The Way to Programming
The Way to Programming
If you want to ‘gain an edge’, you need to prove that you put 110% effort in and that you’re dedicated. Learn a programming language that will best enable you to what you want to do. For example, don’t go into C# if you’re more interested in website design… Then, start making things and don’t stop until you are happy with them. Show people your work. Try and get jobs from people (freelance) to prove your skills and build up a portfolio. When you leave college, show people that you’ve actually taken things in and that you can apply what you’ve learned.
Really, just think about what you would be looking for as an employer. If two candidates had identical qualifications, how would you make a decision?
OOP can be confusing at first. The best way to understand it is to try it. Make sure you do the examples in the book and then do some of your own examples using OOP. There will be a lightbulb moment when you get it.
Try to get a simple program up and running that can send messages over TCP or UDP (depending on what you want to do) and if you don’t know what TCP/UDP is, then go read up on networking…
I’m on a technical university now, doing the study called, Software Science.
They just started with Java, I think there is a good reason to that…
If you have any questions, or want to know the stuff we learned in the first 6 weeks, let me know!
Java isn’t that hard to code btw and is pretty straight forward. You can code everything in once or make methods.
Your code is alright except it didn’t have the addition operation (since that’s what you want to do). Firstly, you must declare a variable (lets call it sum and set it to 0).
Then you will want to iterate the lines inside the text file, you can use for function to iterate it, and at the same time you will add the number line by line into variable sum. Don’t forget to change the number in the text file into integer since python will treat it as string instead of integer and you can’t perform addition.
Lastly you need to return the variable so you can call the result later.
#This program calculates the total in numbers contained in the file #numbers.txt def main(): n = open(r'C:\numbers.txt', 'r') sum = 0 for line in n: sum += int(line) return sum n.close() #close the file #call main function total = main() print total
What you could try is to add an alert in the displayContents method, alerting the readystate. Something like alert(reader.readyState); If the pop-up doesn’t show, the function doesn’t get called. If the readystate is not 4, something else is the matter, and the file can’t be loaded.
Have a look at boost::function
and boost::bind
, they may be helpful.
Checked out this site? Looks like it solves the problem pretty well.
http://perishablepress.com/permanently-redirect-a-specific-ip-request-for-a-single-page-via-htaccess
Did you try his example? Check the following line:
$uploads_path = './myuploadpath/' . $category . $_FILES['file']['name'];
In your case, change ‘myuploadpath’ to ‘uploads. Category is then appended, but he did forget the trailing slash. Then the file name is appended. So just change the line to this:
$uploads_path = './uploads/' . $category . '/' . $_FILES['file']['name'];
A few things to note: you need to make sure that the folder for the category exists before you upload to that folder or you’ll get errors. Also, you may want to ensure that the category is valid before just uploading it. Maybe create an array of valid categories and confirm that the chosen one exists. The reason is that some people may send false data and cause issues.
Finally, I’d suggest going about this with a database rather than simply uploading to different folders.
The question behind is, “Do you really need the new features of the new software?” Sometimes you have no choice, e.g. if you need Directx 11 and only have win xp. On the other hand ‘my Word for DOS is working close to lightspeed’ with the feature set I need for writing.
Making cross-domain calls via a proxy is a simple solution, assuming you do it right. Basically, you need 3 things: the target URL, and parameters and the “verb” (GET, POST, etc.). Your code is fine, except you’re passing all this stuff as var url = ‘proxy.php?url=’ + path, yet you’re trying to access it in your PHP as $_POST[‘yws_path’]. The fix is simple – either change your JS to ‘proxy.php?yws_path=’ or change your PHP to $_POST[‘url’] and $_GET[‘url’].
Download a C/C++ compiler, type C/C++ code, compile, view result.
Use realloc. Example:
http://www.tutorialspoint.com/c_standard_library/c_function_realloc.htm
#include#include int main() { char *str; /* Initial memory allocation */ str = (char *) malloc(15); strcpy(str, "tutorialspoint"); printf("String = %s, Address = %u\n", str, str); /* Reallocating memory */ str = (char *) realloc(str, 25); strcat(str, ".com"); printf("String = %s, Address = %u\n", str, str); free(str); return(0); }
When you run it, it returns:
String = tutorialspoint, Address = 355090448 String = tutorialspoint.com, Address = 355090448
2) Instead of malloc and memset you can use calloc. It sets all the allocated values to zero, aka clear-alloc (calloc).
Asking which of two jobs is ‘better’ is completely relative and personal. If you enjoy the job and it meets your needs, that’s the preferable option. A DBA is better if you have a number of large databases to manage, but he’s not going to be the most helpful if you want to build a website. Likewise, a php programmer is needed when building a complicated website and can typically perform needed SQL tasks, but they aren’t normally skilled in managing databases to be as efficient as reliable as possible.
At line 19, just call prime1(myArray).
Also, you program at its current form does not work.
Sign in to your account