|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
On February 25 2014 10:39 darkness wrote:Show nested quote +On February 25 2014 06:55 tofucake wrote: I write sloppy and quick code to get a feature done and then I never refactor it because I've got far too many things to do. Do you feel confident that your quick code is good or do you just rely on compiler's optimisation? Also a follow-up question to everyone: which book do you recommend for learning how to write good code? I've come across these 2 "Code Complete" and "Clean Code: A Handbook of Agile Software Craftsmanship". My level is neither beginner nor veteran, so something in between should be preferable. Two years into computer engineering "Clean Code" taught me so much that I felt had been missing from my classes. After two years of learning about patterns, data structures, algorithms, etc. it felt incredible good to finally learn about how to actually write clean maintainable code. It's by far the book that has helped me the most, but of course that doesn't mean it will do the same to you. In any case, I'd say it's easily worth the money.
By the way, in this context clean code isn't necessarily the same as efficient code. It's about conveying your intention and making it easily understandable to others (including future you), as well as making the code flexible to future updates.
|
Code Complete is also awesome. It teaches you good design and talks a lot about stuff you have to consider before you even begin to write your code. Highly recommended.
|
Hey guys. I have a friend studying for his Masters in Economics, and he is trying to build a small simple program that shows the distance between two places like from Miami to Houston. My question is, what is the best way to build a small program that can expand to many cities (3,000 - 5,000). The thing is, we don't have any original data, so we don't want to put in anything manually. What is the best way to go about this? I know I need a loop of some sort, I was thinking of using PHP and looping through one of the google distance formula sheets that they provide for free. Any suggestions would help, thank you!
|
Hey awesome people. I'm applying for an apprenticeship at a company called Capgemini: http://www.uk.capgemini.com/careers/your-career-path/higher-apprenticeships
Does anyone have any experience with this company or apprenticeship? More importantly, I have little bits of knowledge with Javascript, Python and HTML, but it is very limited, completing some CodeAcademy courses and whatnot. Will this knowledge be enough for any interview or potential apprenticeship, considering that I will hopefully be learning on the job?
|
On February 25 2014 23:56 Days wrote: Hey guys. I have a friend studying for his Masters in Economics, and he is trying to build a small simple program that shows the distance between two places like from Miami to Houston. My question is, what is the best way to build a small program that can expand to many cities (3,000 - 5,000). The thing is, we don't have any original data, so we don't want to put in anything manually. What is the best way to go about this? I know I need a loop of some sort, I was thinking of using PHP and looping through one of the google distance formula sheets that they provide for free. Any suggestions would help, thank you!
Assuming you have the locations, this is in Objective-C:
CLLocationDistance distance = [secondLocation distanceFromLocation:firstLocation];
Locations are of type CLLocation (you need longitude and latitude of your place).
Alternatively: http://stackoverflow.com/a/929781/1091781
Question to others: is an NSMutableDictionary (HashMap in Java) appropriate as a data structure in this case? Maybe even AVL Tree if retrieval is a key?
|
On February 26 2014 00:30 darkness wrote:Show nested quote +On February 25 2014 23:56 Days wrote: Hey guys. I have a friend studying for his Masters in Economics, and he is trying to build a small simple program that shows the distance between two places like from Miami to Houston. My question is, what is the best way to build a small program that can expand to many cities (3,000 - 5,000). The thing is, we don't have any original data, so we don't want to put in anything manually. What is the best way to go about this? I know I need a loop of some sort, I was thinking of using PHP and looping through one of the google distance formula sheets that they provide for free. Any suggestions would help, thank you! Assuming you have the locations, this is in Objective-C: CLLocationDistance distance = [secondLocation distanceFromLocation:firstLocation]; Locations are of type CLLocation (you need longitude and latitude of your place). Alternatively: http://stackoverflow.com/a/929781/1091781Question to others: is an NSMutableDictionary (HashMap in Java) appropriate as a data structure in this case? Maybe even AVL Tree if retrieval is a key?
We don't have the locations either, but what I was thinking is downloading a simple .txt file with a list of city names that we can use to loop through, so I don't think the name of locations should be a problem. I heard there is a way to integrate the Google Maps API with PHP, I was wondering if that was a possibility? I've never used Objective-C, I'm only familiar with C# and Visual Basic, not sure how similar they are to objective-c
|
On February 26 2014 01:12 Days wrote:Show nested quote +On February 26 2014 00:30 darkness wrote:On February 25 2014 23:56 Days wrote: Hey guys. I have a friend studying for his Masters in Economics, and he is trying to build a small simple program that shows the distance between two places like from Miami to Houston. My question is, what is the best way to build a small program that can expand to many cities (3,000 - 5,000). The thing is, we don't have any original data, so we don't want to put in anything manually. What is the best way to go about this? I know I need a loop of some sort, I was thinking of using PHP and looping through one of the google distance formula sheets that they provide for free. Any suggestions would help, thank you! Assuming you have the locations, this is in Objective-C: CLLocationDistance distance = [secondLocation distanceFromLocation:firstLocation]; Locations are of type CLLocation (you need longitude and latitude of your place). Alternatively: http://stackoverflow.com/a/929781/1091781Question to others: is an NSMutableDictionary (HashMap in Java) appropriate as a data structure in this case? Maybe even AVL Tree if retrieval is a key? We don't have the locations either, but what I was thinking is downloading a simple .txt file with a list of city names that we can use to loop through, so I don't think the name of locations should be a problem. I heard there is a way to integrate the Google Maps API with PHP, I was wondering if that was a possibility? I've never used Objective-C, I'm only familiar with C# and Visual Basic, not sure how similar they are to objective-c
I made a similar program for a client early last year when I was just getting into PHP, (made a whopping $80!). I used this PHP Class https://github.com/Quixotix/PHP-ZipCode-Class. It requires a database that has city/zipcode/lat/long data, which can be downloaded off the internet.
I don't have much experience with Google Maps API so I don't know if that is better.
|
On February 26 2014 00:26 Zealos wrote:Hey awesome people. I'm applying for an apprenticeship at a company called Capgemini: http://www.uk.capgemini.com/careers/your-career-path/higher-apprenticeshipsDoes anyone have any experience with this company or apprenticeship? More importantly, I have little bits of knowledge with Javascript, Python and HTML, but it is very limited, completing some CodeAcademy courses and whatnot. Will this knowledge be enough for any interview or potential apprenticeship, considering that I will hopefully be learning on the job?
one of their requirements is "demonstrable passion and capability in software development (e.g. you might have designed a website or a game)"
have you done that? because i believe that is important.
|
|
|
If you're not completely set on Google, I'd say to take a look at the OpenStreetMap project.
http://www.openstreetmap.org
I haven't used it personally in a project, but I think I'd probably see how viable it was if I was doing anything with mapping. It seems pretty cool from what I've seen of it.
|
Hey guys, I need some help finding matching words in a specific column of a sql table.
I have 3 columns,
1. The UserID(int) 2. The Word(string) 3. tinyInt(1) 0 if word has no match, 1 if word has a match.
How can can I make my query count the amount of matches that the word column has for each different user.
|
On February 27 2014 17:39 dapierow wrote: Hey guys, I need some help finding matching words in a specific column of a sql table.
I have 3 columns,
1. The UserID(int) 2. The Word(string) 3. tinyInt(1) 0 if word has no match, 1 if word has a match.
How can can I make my query count the amount of matches that the word column has for each different user. How about this?
SELECT UserId, Word, SUM(tinyInt) FROM tableName GROUP BY UserId, Word
This is assuming the same word and userid can show up several times and each time with 1 in tinyInt is a match, otherwise I don't really understand what kind of matches you're looking to count.
|
On February 26 2014 01:12 Days wrote:Show nested quote +On February 26 2014 00:30 darkness wrote:On February 25 2014 23:56 Days wrote: Hey guys. I have a friend studying for his Masters in Economics, and he is trying to build a small simple program that shows the distance between two places like from Miami to Houston. My question is, what is the best way to build a small program that can expand to many cities (3,000 - 5,000). The thing is, we don't have any original data, so we don't want to put in anything manually. What is the best way to go about this? I know I need a loop of some sort, I was thinking of using PHP and looping through one of the google distance formula sheets that they provide for free. Any suggestions would help, thank you! Assuming you have the locations, this is in Objective-C: CLLocationDistance distance = [secondLocation distanceFromLocation:firstLocation]; Locations are of type CLLocation (you need longitude and latitude of your place). Alternatively: http://stackoverflow.com/a/929781/1091781Question to others: is an NSMutableDictionary (HashMap in Java) appropriate as a data structure in this case? Maybe even AVL Tree if retrieval is a key? We don't have the locations either, but what I was thinking is downloading a simple .txt file with a list of city names that we can use to loop through, so I don't think the name of locations should be a problem. I heard there is a way to integrate the Google Maps API with PHP, I was wondering if that was a possibility? I've never used Objective-C, I'm only familiar with C# and Visual Basic, not sure how similar they are to objective-c
Put your city names in a database, and use a langage of your choice to do a geocodeing call on the google geocoding api (doc https://developers.google.com/maps/documentation/geocoding/). Store the retrieved latitude and longitude and repeat till you got all cities (be aware that there is a 2500 request limit / ip / 24h )
Once you got all the coordinates in a database the distance calculation is simple math and you don't need a maps service for that anymore.
Edit: Unless you want actual road distance. which again would requeire a map service
|
On February 27 2014 17:39 dapierow wrote: Hey guys, I need some help finding matching words in a specific column of a sql table.
I have 3 columns,
1. The UserID(int) 2. The Word(string) 3. tinyInt(1) 0 if word has no match, 1 if word has a match.
How can can I make my query count the amount of matches that the word column has for each different user. In addition to Tobberoth's answer, you can also do this:
SELECT UserID, Count(tinyInt) FROM Table WHERE tinyInt = 1 GROUP BY UserID
|
On February 28 2014 01:34 enigmaticcam wrote:Show nested quote +On February 27 2014 17:39 dapierow wrote: Hey guys, I need some help finding matching words in a specific column of a sql table.
I have 3 columns,
1. The UserID(int) 2. The Word(string) 3. tinyInt(1) 0 if word has no match, 1 if word has a match.
How can can I make my query count the amount of matches that the word column has for each different user. In addition to Tobberoth's answer, you can also do this: SELECT UserID, Count(tinyInt) FROM Table WHERE tinyInt = 1 GROUP BY UserID Yeah, this will give you a list of all matches for a user (without the words). Makes sense if the userId and Word combination is unique.
|
|
|
i'll stick to my vim... :>
|
On February 28 2014 08:32 nunez wrote: i'll stick to my vim... :> First answer, best answer.
|
Hyrule19167 Posts
|
Hello I have a problem with a simple Calculator app and I cannot pinpoint the problem. It works great with int numbers, but whenever i try decimals the results are all over the place.
The calculator works on prinicple that it reads numbers in textbox and converts them to double. And in the end it converts the total back into the string so it can be displaye in textbox.
private void btnPlus_Click(object sender, EventArgs e) {
total1 = total1 + double.Parse(textBox1.Text); textBox1.Clear(); }
private void btnResult_Click(object sender, EventArgs e) { total2 = total1 + double.Parse(textBox1.Text); textBox1.Text = total2.ToString(); total1 = 0; }
Also apart from results beeing wrong when using decmials it never shows any decimals in result no matter what. SO i recon i messed up in converting somewhere?
|
|
|
|
|
|