How do you get from ones and zeros to a file? Ask Programming |
- How do you get from ones and zeros to a file?
- Recursion: a nightmare
- [VB] Script won't add after 4 iterations
- Noob Question: Is it okay to put the <script> tag within the body?
- Detect variable definitions and occurrences in an embedded C++ code base
- Interpolate the bounding box region with nearest neighbor
- Advice for writing a program for keeping track of social relationships and gatherings
- Arduino NeoPixel help
- Software recommendations for keeping track of social connections visually in graph format?
- Best way to navigate to a website, login, navigate to another page, then pull table data?
- Best (dynamic) way to represent a DFA in Java?
- AngularJS migration
- Why does Quake 3 holds up so well?
- Unit Testing Stored Procedures
- My homework assignment(ANYONE THAT CAN.PLEASE HELP)
- What's the formula for polar coordinate conversion in 3D?
- Main Method not being detected
How do you get from ones and zeros to a file? Posted: 20 Aug 2018 12:19 PM PDT I understand that this is a big question, but hopefully I can specify it down a bit. I have an idea for a fictional story involving an ancient relic with some sort of symbols on it that somehow get translated into computer code and run (the resulting file then releases a monster computer virus that spreads through the internet and becomes an actual biological virus and chaos ensues, etc). My first thought was a QR code, but I feel like that would be too obvious. If I started with binary code, what would it take to make it into a program? From the little I know about computer science, I assume it would require a language and have to go through a compiler to actually run. If a program would be a bit of a stretch, how about just a file like a jpg or an mp3? How would you convert the binary into something like that? If that would be too unrealistic, is there another way you could embed a link or file onto an image that could be understood by a computer? Since it's fictional it doesn't have to be 100% realistic, but I want to base the story in some kind of reality. It has to make sense. [link] [comments] |
Posted: 20 Aug 2018 09:35 AM PDT Hey guys, I don't understand how a recursion call can be stored into a variable! My professor wrote this "code" : ~~~ FastEXP-Rec(x,n) if n = 0 then return 1 else y <- FastEXP-Rec(x, n/2) if n mod 2 = 0 then //it's n%2 == 0 in a real language return y * y else return y * y * x ~~~ That function calculate the xn but i can't understand how I can store into y the result of the recursive call. What am I storing? Please help! [link] [comments] |
[VB] Script won't add after 4 iterations Posted: 20 Aug 2018 09:28 AM PDT I have a very simple script that checks the value of a text box and adds 1. For some reason this works until I get to 4. . When initializing the Form the BoxValue is 1. First Click: Updates to 2 Second Click: Updates to 3 Third Click: Updates to 4 Fourth Click: Stays at 4 Fifth Click: Stays at 4 and so on... Now... If I change the 1 to a 4 (just as an example) after iteration I get the same behavior. So it's not the numeric, it's the iteration. First Click: Updates to 5 Second Click: Updates to 6 Third Click: Updates to 7 Fourth Click: Stays at 7 Fifth Click: Stays at 7 and so on... Is there any logical reason this is happening? I've never come across this behavior. I've stripped the Form down to this text box and the button that hits the script. There are no other events firing. [link] [comments] |
Noob Question: Is it okay to put the <script> tag within the body? Posted: 20 Aug 2018 03:11 PM PDT I know that it's okay because it works, but I'm talking about efficiency here. For instance, it isn't really good to fill in the <head> section of an HTML page because it could leave the browser window to load for a longer period of time, which would end up making users stare at a blank page for a longer time than they'd like, which would eventually kill their interest (at least, according to a tutorial I read somewhere a week ago). So, I just got started learning jQuery, and, from what I've tested, it seems that it only runs when I link to it (and the external JS page) at the end of the body tag. So, to be more precise, my question is more like is it okay to put scripts within the body in the case of jQuery or is there a more efficient way to go about this? I apologize if this question is super noob-y and/or annoying. Thanks in advance! [link] [comments] |
Detect variable definitions and occurrences in an embedded C++ code base Posted: 20 Aug 2018 11:18 AM PDT Hi, As part of my summer job I got to enhance a debugger for embedded systems, namely a Tasking Tricore. The debugger itself is written in C#. My latest task is to show the values and the age of variables in my source code view. A little bit of background information on the age: The Tricore controller works like a classical programmable logic controller based on input-process-output cycles. A cycle starts with the input stage, in which the latest sensor values are retrieved. In the processing stage, the processor executes its program provided by my company to update its state and in the final state, the outputs are set accordingly to the program. Each cycle is 10 milliseconds long. So for example if a variable hasn't been updated in 9 cycles, it's 9 cycles old and thus each occurrence of the variable get displayed in a different colour than a variable that was updated in the previous cycle. I shouldn't only be able to display the value and the age of variables but also members of structs, classes, etc. Hence, I need a method of quickly determining the declaration and all occurrences of a component in my source code. Of course, I need to be able to get scopes, C++ namespaces, etc right. Right now, I'm struggling with finding suitable techniques for quickly navigating a code base. I tried using the language server protocol (LSP) and clangd which I got working for a basic project. However, the issue is that Tasking's compiler is based on gcc and I'm unsure if I can get the compilation database for clangd right. The Tasking IDE is built on an old version of Eclipse CDT and so I can't natively export such a database. Knowing Java, I considered writing my own plugin, but I'm unsure about that. Static analyzers don't really satisfy myself too, as they are too slow, most of them require wrappers for C# and they generally provide too many features which overcomplicates them. I'd be really grateful, if somebody could provide me with a tip which technology to use or if that's doable at all. Just sharing experiences is fine too. [link] [comments] |
Interpolate the bounding box region with nearest neighbor Posted: 20 Aug 2018 02:20 PM PDT I have a rotating bounding box in an image. I want to fill region inside the bounding box with nearest pixel values outside the bounding box. I am thinking of going through the regions of the bounding box iteratively and calculating the left and right neighbour value for each row and fill that row with those values. Before doing that i want to know is there an elegant and better way of doing that in opencv (python) by using some functions [link] [comments] |
Advice for writing a program for keeping track of social relationships and gatherings Posted: 20 Aug 2018 02:03 PM PDT I am extremely inexperienced with programming so please take that into account with this post. I want to make a website and Android and IOS apps (I've been thinking of using html5 wrapped for Android and IOS, based on advice from another person) using this system. I want to have automatic account creation through oauth using a google account. I want to have individual profiles (not created by signing up, signing up claims a profile or generates a new one since this is primarily for recording), the individual profiles will have information on the types of relationships between two individuals, it will also record events step by step with the roles of each individual in the event. I would like for this to be able to do things such as make profiles for contacts, archive text conversations and possibly notifications from other apps, and have a feature to set up in person events between users and say you are at events with other users with some sort of a QR code system or location access system to confirm presence and record where the event is taking place. What kind of a back end should I use? Are my front end ideas good. What should I learn to be able to do this? [link] [comments] |
Posted: 20 Aug 2018 12:26 PM PDT Trying to code a neopixel ring (12 LED's). My goal is to have the ring be able to switch between two colors, and for right now just do that with a delay between them. I found some code that will made the ring go between white and off: include <Adafruit_NeoPixel.h> define PIN 6 define NUM_LIGHTS 60 Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LIGHTS, PIN, NEO_GRB + NEO_KHZ800); void setup() { strip.begin(); strip.show(); // Initialize all pixels to 'off' } void loop() { uint32_t low = strip.Color(125, 75, 0); uint32_t high = strip.Color(0, 0, 125); Turn them off for( int i = 0; i<NUM_LIGHTS; i++){ strip.setPixelColor(i, high); strip.show(); } for( int i = 0; i<NUM_LIGHTS; i++){ strip.setPixelColor(i, low); strip.show(); } delay(1000); } I had to delete some characters at the begging in order for reddit to not think it is some sort of formatting thing (#, // and the like), however, the code is fine, sorry about that. My issue is, whenever I change the values from white and black, the ring does not show the correct color and instead yields a jumbled mess of colors. it ends up switching between a pattern of red,green,blue,white repeated and a pattern of pink,green,light blue,white repeated. Any help is appreciated [link] [comments] |
Software recommendations for keeping track of social connections visually in graph format? Posted: 20 Aug 2018 07:03 AM PDT I am looking for software in which you can plot out people and their connections to you manually and visually in the form of a graph (each node in the graph is a person), and which you can keep notes on each person. I am not looking for a social network like facebook, I don't want to "add" anybody as a connection. This is more for my own personal use on keeping track of the various people in my life and keeping updated notes on them. Any recommendations are appreciated. I thought of building one myself, which should be fairly simple, however if there is an existing solution out there already it wouldn't make sense to build from scratch. [link] [comments] |
Best way to navigate to a website, login, navigate to another page, then pull table data? Posted: 20 Aug 2018 10:19 AM PDT I'm having difficulty finding examples of visual studios C# methods of doing this and there's conflicting information on the internet. Are there any examples or libraries that are good for this? [link] [comments] |
Best (dynamic) way to represent a DFA in Java? Posted: 20 Aug 2018 07:40 AM PDT So I'm struggling with this programming problem where I get, from standard input, information that specifies what the DFA is supposed to look like, i.e number of states, accepted states, start state as well as transitions. The whole parsing part of the program is basically done and the remaining task for me is to write an algorithm that creates the requested DFA and then prints all possible accepted strings. So my question is what would be a smart way to represent the DFA to make it as easy as possible to print all accepted strings (to an upper bound)? So basically I'm trying to print the whole language based on DFA specifications. Thanks in advance! [link] [comments] |
Posted: 20 Aug 2018 06:15 AM PDT Hello, I am working on a Proof-of-concept for migrating a large AngularJs 1.5 (with controllers, $scope, and $rootScope) to Angular's latest version 6.1, I want to migrate a simple isolated page (contact-us page) to Angular 6 while running the rest of the app in AngularJs. The existing app uses Grunt scripts to concatenate Less files and compile them to css since there are no imports between them, uglify and concatenate Js files into a single one, inject bower packages into the index.html page and to run the jboss backend server. I am stuck of where to start since I didn't participate in developping the app. I already tried some tutorials but it doesn't work because I am new to grunt and don't know how to migrate it to webpack or angular cli scripts. Any ideas, insights would be greatly appreciated. [link] [comments] |
Why does Quake 3 holds up so well? Posted: 20 Aug 2018 09:49 AM PDT Recently organized small lan party with my games and i was just amazed at how well quake 3 holds up technologically. I know that probably big part is John Carmack being a genius, but still. First of all that it works without patches on modern operating systems. With a lot of legacy games you need to meddle with compatibility options etc. Do basically those games had hard dependencies on platform specific software, while quake developers made everything from scratch? Other, main thing is working LAN play, iI had such a hard time with multiple games, either games are bot being discovered created using LAN, or some weird problems occur connecting to host's IP adress directly (at least on Garry's Mod, Counter Strike 1.6). With quake it's - host creates a game, everybody see it immediately, join, have a blast. [link] [comments] |
Unit Testing Stored Procedures Posted: 19 Aug 2018 11:38 PM PDT Hey guys, I have a general question about unit testing stored procedures, I have some laravel code in my model that calls a procedure (which contains a decent amount of business logic), how would I go about writing automated tests for this stored procedure, the database that I am using is MySql 5.7, and one I also cannot write the procedures in laravel itself due to certain reasons In other words how would you write test cases for a big query, feel free to ask more questions if you do not understand my question thank you [link] [comments] |
My homework assignment(ANYONE THAT CAN.PLEASE HELP) Posted: 20 Aug 2018 12:31 PM PDT This is my assignment Challenge 1 Write a loop that logs the following triangle to the console: # Challenge 2 Write a function that takes in a number as a parameter. The function must log `"the number is even"` if the given parameter is an even number, and log `"the number is odd"` if it is odd. Refer to the starter code below if you need help getting started. // Challenge 1 for (var i =0; i< 7;i++) { /* your code here */ } /*Your explanation for your code here*/ // Challenge 2 function isEven(number) { /* your code here */} /*Your explanation of your code here*/ This is my friend's code but without the explanation. He is currently on vacation and can't be reached. Can anyone please help and explain the code to me? Challenge #1: <!doctype html> <html> for(j=0;j<=i;j++){ temp=temp+("#") } console.log(temp); temp=' '; } Challenge #2: function IsEven(a){ if(a%2 ===0){ console.log("the number is even"); }else { console.log("the number is odd"); } }else{ console.log("Not a number") } } [link] [comments] |
What's the formula for polar coordinate conversion in 3D? Posted: 20 Aug 2018 04:38 AM PDT |
Main Method not being detected Posted: 20 Aug 2018 12:37 AM PDT I recently managed to get my assignment done but I keep getting the message that the main method can not be found. I have attached the files in the link: https://drive.google.com/open?id=1QIWP-4FD5JAgvG7Ycl-_CUoJrdWyA2ID I am not too sure what I am doing wrong. [link] [comments] |
You are subscribed to email updates from AskProgramming. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment