The Big Programming Thread - Page 72
Forum Index > General Forum |
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. | ||
Archmage
United States169 Posts
| ||
Craton
United States17233 Posts
On July 29 2011 09:07 SaYyId wrote: I'm trying to learn VB but it's so confusing x_X VB or VB.NET? The idea of VB.NET is that you should be able to read the code aloud and understand what it is doing. | ||
rabidch
United States20288 Posts
On July 29 2011 11:36 tec27 wrote: Ruby or Python are good choices. In the case of either, all you really need is a text editor. I like gVim, but it can be a bit daunting, so (assuming you're on Windows) you may want to check out notepad++. Since you have no experience, I think you meet the main audience target of Learn Python the Hard Way, so you'll probably want to check that out if you decide to learn python. Haven't actually read it myself, but heard a lot of good things about it (and its free if you do the HTML version, so its not like you have a lot to lose). theres emacs too :D (im a vim user though) | ||
icystorage
Jollibee19343 Posts
ive been suggesting using linux because in the near future when we take up our Operating Systems subject we would be more focused on linux since our school highly supports open source. But it think it would really help in being "multidimensional" in learning linux too aside from windows. | ||
Frigo
Hungary1023 Posts
On July 29 2011 11:10 Alexl wrote: Hi everyone. I've been looking into starting programming for a while and now that I've got lots of time with the holidays I want to start. Could anyone suggest a good language to start with? I'm looking for something relatively easy to learn so that I can do stuff without getting blocked too much on vocabulary/syntax but still be able to program interesting things. As I have no experience, I can't really compare the features of each language so I'm a bit lost :/ If anyone could suggest a good text editor/IDE to code I'd appreciate a lot too! Thanks. I recommend starting with either Java or C++. Java is easier, less frustrating, has better features and standard library support (threads, GUI, sockets, serialization, reflection, whatever), but I see too many Java programmers who have a few misconceptions and lack of insight, especially when they are trying to learn C++. C++ programmers who learn Java however have much clearer coding style in both. C++ supports operator overloading, custom value types, is more customizable and flexible and better suited for mathematical stuff and real-time applications, has more libraries and programs written in it, but you basically need to reinvent a lot of stuff when you are writing something serious in it. I seriously recommend against touching any kind of scripting, functional, procedural or esoteric language without having a proper knowledge of Java or C++. You will learn nothing useful. I started with C64 Basic when I was about 8, then learned Pascal and x86 assembly when I had my 286. These were all pretty useless, helped next to nothing to understand programming, it wasn't until uni when I learned C++ then Java, those two helped tremendously. As for editor, I use Notepad++. | ||
Osmoses
Sweden5302 Posts
On July 29 2011 11:10 Alexl wrote: Hi everyone. I've been looking into starting programming for a while and now that I've got lots of time with the holidays I want to start. Could anyone suggest a good language to start with? I'm looking for something relatively easy to learn so that I can do stuff without getting blocked too much on vocabulary/syntax but still be able to program interesting things. As I have no experience, I can't really compare the features of each language so I'm a bit lost :/ If anyone could suggest a good text editor/IDE to code I'd appreciate a lot too! Thanks. I see people recommending Java and C++ because they're "real" programming languages, but believe me you'll get blocked again and again by C++ and probably Java as well. If you just want to get into programming, get a feel for it and see some results, I'd recommend the Flash scripting language, Actionscript 3. Most people, I imagine, don't get into programming so that they can make document-handling applications or calculate their taxes. Correct me if I'm wrong, but how many of you didn't start out because you wanted to make games? I don't enjoy keeping track of pointers and having to write a thousand lines of code just to see a 3 second animation onscreen, and in that respect, flash is perfect, it requires a minimum of overhead and you get immediate results, which in turn is going to keep you interested and learning more. | ||
KaiserJohan
Sweden1808 Posts
On July 31 2011 19:29 Frigo wrote: I recommend starting with either Java or C++. Java is easier, less frustrating, has better features and standard library support (threads, GUI, sockets, serialization, reflection, whatever), but I see too many Java programmers who have a few misconceptions and lack of insight, especially when they are trying to learn C++. C++ programmers who learn Java however have much clearer coding style in both. C++ supports operator overloading, custom value types, is more customizable and flexible and better suited for mathematical stuff and real-time applications, has more libraries and programs written in it, but you basically need to reinvent a lot of stuff when you are writing something serious in it. I seriously recommend against touching any kind of scripting, functional, procedural or esoteric language without having a proper knowledge of Java or C++. You will learn nothing useful. I started with C64 Basic when I was about 8, then learned Pascal and x86 assembly when I had my 286. These were all pretty useless, helped next to nothing to understand programming, it wasn't until uni when I learned C++ then Java, those two helped tremendously. As for editor, I use Notepad++. If you are doing it on your own, I agree. However in university we first learned a functional language called SML. It was a simple language which made it a very good introductionary language to the basic concepts of programming, such as data types, functions, coding styles and so forth - you could skip the unnecessary parts like Java programs have, that are only confusing to a complete beginner. SML is very straightforward and easy to understand. I would do either that or C. C is also less complex than C++, there is less chance of getting lost early. Its easier to find C++ resources though, and you can just reuse C code in C++... | ||
EvanED
United States111 Posts
On July 31 2011 19:29 Frigo wrote: I seriously recommend against touching any kind of scripting, functional, procedural or esoteric language without having a proper knowledge of Java or C++. You will learn nothing useful. I vehemently disagree with this, for reasons I've stated above. (Just the negative part -- that you won't learn anything useful. Depending on your interest, Java or C++ might be a reasonable starting language.) I've got a substantial portion of the "best" CS schools on my side too. US News gives the top 10 as MIT (#1), CMU (#2), Stanford and UIUC (#3-tie), Cal Berkeley (#5), Georgia Tech (#6), UT Austin (#7), Michigan (#8), Cal Tech (#9) and Cornell (#10). Of those: MIT used to use Scheme and now uses Python in their intro class, CMU uses SML, Stanford uses Java, UIUC uses Java for what seems to be the primary first in-major class (there's another intro class that uses Python, but I'm not sure how it fits in), Cal Berkeley seems to emphasize Scheme though it's not at the complete exclusion of everything else, Georgia Tech uses Python, UT Austin uses Java, Michigan uses ??? (I actually can't find a course webpage, and the description doesn't say; there's a chance it uses C++. If you have better luck than me, the course is EECS 280), Caltech uses Python, Cornell uses Java. Discounting Michigan, counting UIUC as Java, and counting Berkeley as Scheme, the counts are 4 schools for Java, 3 schools for Python, 1 school for Scheme, and one school for SML. Even if Michigan came into the picture with Java, that's still half of the US News top 10 schools which teach a language you accuse of teaching "nothing useful." Now, the pressures are very different for a university deciding how to set its curriculum and an individual deciding what to learn, but I think that "you won't learn anything from a high-level language" is complete bogus. On July 31 2011 19:50 KaiserJohan wrote: I would do either that or C. C is also less complex than C++, there is less chance of getting lost early. Its easier to find C++ resources though, and you can just reuse C code in C++... Well, that's sort of true, but at the same time IMO a good C programmer does not necessarily make a good C++ programmer (though it is likely). You'll have to unlearn a fair bit of stuff for that. | ||
DeathByMonkeys
United States742 Posts
| ||
japro
172 Posts
Saying one should start with C++ because it makes it easy to transition to other languages is like saying everyone should first learn latin since a lot of languages derive from it. | ||
SilverSkyLark
Philippines8437 Posts
| ||
Deleted User 101379
4849 Posts
On August 01 2011 17:06 SilverSkyLark wrote: Assembly Question here (using DOS Debug), how do I display a character byte as hexadecimal? We were asked to create a program that displays as hexadecimal the byte in DL (Low byte of D). I know that I have to use "mov dl,1" to read a character onto dl, but I'm not sure how to proceed after. A character is just another number, so you have to write a program that converts a byte into it's hexadecimal text representation. For example assuming DL is the character B, which is 0x42 or 66 decimal: You get the first character of the hexadecimal representation by dividing the number by 16, resulting in 4. Then check if the number is > 9, if it is, then the character code is
otherwise the character is
The second character is DL mod 16 (remainder of division), so in this case 2. For other characters you need to do the same check for > 9 as for the first number. Store each result into memory, add line ending and call the output function and you should be done. It's been ages (well, 6 years) since i've done any assembly programming, so i cannot give you a code example, but this is the basic logic behind it so you should be able to start from this. | ||
ibutoss
Australia341 Posts
On July 29 2011 13:54 Archmage wrote: Hello everybody! I have been interested in getting started with iOS development. I have had some prior programming experience (mostly Java) and am looking for a guide that will allow me to teach myself iOS development using Xcode 4. I'd normally go to Google for this, but the newest version of Xcode has only just come out fairly recently, and most of the suggested guides are for Xcode 3.2. I'd assume most of the principals are the same and that a good 3.2 guide will still teach me what I need to know, but if anyone has had any experience with a guide that teaches Xcode 4, I'd love to hear your thoughts about it. I would suggest a e-book called iOS 4 Programming Cookbook, it's a O'Reilly book. I found it quite useful while creating my first iphone game. Xcode4 is so much better than 3.2, don't even bother downloading it for free. | ||
SilverSkyLark
Philippines8437 Posts
On August 01 2011 17:22 Morfildur wrote: A character is just another number, so you have to write a program that converts a byte into it's hexadecimal text representation. For example assuming DL is the character B, which is 0x42 or 66 decimal: You get the first character of the hexadecimal representation by dividing the number by 16, resulting in 4. Then check if the number is > 9, if it is, then the character code is
otherwise the character is
The second character is DL mod 16 (remainder of division), so in this case 2. For other characters you need to do the same check for > 9 as for the first number. Store each result into memory, add line ending and call the output function and you should be done. It's been ages (well, 6 years) since i've done any assembly programming, so i cannot give you a code example, but this is the basic logic behind it so you should be able to start from this. What number? The Decimal equivalent of the character? I think the only input we have is the character only, then we have to show the hex equivalent of that code. | ||
Deleted User 101379
4849 Posts
On August 01 2011 17:42 SilverSkyLark wrote: What number? The Decimal equivalent of the character? I think the only input we have is the character only, then we have to show the hex equivalent of that code. The character is the number. They are one and the same. 'A' is 0x41, they are identical - no conversion neccessary. If you write the character 'A' to DL, DL will have the value 0x41. | ||
SilverSkyLark
Philippines8437 Posts
On August 01 2011 17:55 Morfildur wrote: The character is the number. They are one and the same. 'A' is 0x41, they are identical - no conversion neccessary. If you write the character 'A' to DL, DL will have the value 0x41. Oh right, you input characters in DOS Debug via its hex equivalent...*facepalm* | ||
Rhyze
Belgium10 Posts
the example: WHERE signature=\"".$_GET['signature']."\" hope it's not too stupid :p EDIT: student job, me having very little exp :/ | ||
Craton
United States17233 Posts
If you want to use a single-quote within the string you have to escape the single-quote with a backslash \ . Like this: \' ! Just google simple questions like that. | ||
Deleted User 101379
4849 Posts
On August 02 2011 19:09 Rhyze wrote: kay, so i'm at this new job and i'm supposed to fix a php script that uses SQL. In one of the queries, =\ is used. What does that mean? the example: WHERE signature=\"".$_GET['signature']."\" hope it's not too stupid :p EDIT: student job, me having very little exp :/ That looks really, really evil. What you have there is basically an invite for SQL Injection. $_GET anywhere in a query string is... well, "bad" doesn't really cut it. I just hope for the company that you use some sort of escaping of request parameters. Such code always makes me shudder. Anyways, the \ is an escape modifier for the following character, in this case the ". It basically tells PHP that this " is just a character and not meant to be PHP code, which allows you to use " characters in strings with the same type of quotes. Without the \, the " would end the string at that point and the next " would start a new string, which - apart from being invalid syntax - would not be what is intended here. | ||
Rhyze
Belgium10 Posts
| ||
| ||