Search found 15 matches

by shawncplus
Tue Jan 15, 2008 12:59 am UTC
Forum: Coding
Topic: Urgent PHP and MySQL help...
Replies: 5
Views: 1485

Re: Urgent PHP and MySQL help...

PHP has smart variables, you don't need to precede them with the type. just

Code: Select all

for ($x=0; $x < mysql_num_rows($query); $x++) {
by shawncplus
Wed Nov 07, 2007 5:45 pm UTC
Forum: Coding
Topic: Funniest/Most Annoying Code Comments
Replies: 662
Views: 146347

Re: Funniest/Most Annoying Code Comments

:mrgreen:

Code: Select all

//I bet the original programmer that did this is getting a lot of bad karma right now
by shawncplus
Wed Oct 10, 2007 4:25 am UTC
Forum: Individual XKCD Comic Threads
Topic: 0327: "Exploits of a Mom"
Replies: 210
Views: 110195

Re: "Exploits of a Mom"

For Example: INSERT INTO students (address, phone, name) VALUES ($_POST['address'], $_POST['phone'], $_POST['name']); If the name was input as Robert'); DROP TABLE students;-- the query would end up looking like this INSERT INTO students(address, phone, name) VALUES ('123 example', 555-555-5555', 'R...
by shawncplus
Wed Oct 10, 2007 2:37 am UTC
Forum: Coding
Topic: How to learn java for cs ab test?
Replies: 11
Views: 2887

Re: How to learn java for cs ab test?

Little note, Java doesn't have pointers since it's a virtual environment and you don't have direct access to memory I second what's been said before, and add this one small pointer: they're quite fond of asking nitpick questions, like the difference between String s1 = "apple"; String s2 =...
by shawncplus
Wed Sep 19, 2007 2:38 am UTC
Forum: Coding
Topic: Funniest/Most Annoying Code Comments
Replies: 662
Views: 146347

Code: Select all

/* Horrible, ugly hack that I will fix later (god help me) */


It was a hack to stitch together an element affinity system in a game. At the time I was ashamed at the code, perhaps if I commented better I would understand why it is so bad now. *shrug*
by shawncplus
Fri Aug 24, 2007 8:09 pm UTC
Forum: Coding
Topic: mwahahaha my first major coding langauge. what shall it be.
Replies: 16
Views: 4433

The only thing that is different is that it should use stdio.h instead of cstdio and the using namespace I forgot to take out since Dev-C++ automatically puts the include and that when I make a new file. Other than that there is no standardization issues, as to the void main it is completely incorre...
by shawncplus
Thu Aug 23, 2007 1:09 pm UTC
Forum: Coding
Topic: mwahahaha my first major coding langauge. what shall it be.
Replies: 16
Views: 4433

If you are writing in C++ you really shouldn't mix C with C++ (mixing puts with cout) also the yes no maybe you have could be simplified to an unnamed enum enum { YES, NO, MAYBE }; Yes is automatically initialized as 0, No would then be 1, and Maybe 2. Since you are using iostream system(&...
by shawncplus
Sun Aug 19, 2007 4:20 am UTC
Forum: Coding
Topic: Keyboard tomfoolery
Replies: 6
Views: 2136

Wow, I'd never seen AutoHotKey before. Thanks for the link I just added some nice hot-keys/hot-strings to Dev-C++ and had a lot of fun doing it. (Dreamweaver style Shift+Enter shortcut for endl) and auto bracketing.

Thanks again, awesome program
by shawncplus
Sat Aug 18, 2007 6:07 pm UTC
Forum: Coding
Topic: Keyboard tomfoolery
Replies: 6
Views: 2136

Do some research on ANSI Bombs (malicious programs that remap keys on the keyboard), that should get you a good distance.

ANSI.SYS isn't really used anymore as the main method of keyboard input but it will give you an idea atleast.
by shawncplus
Sat Aug 11, 2007 10:36 pm UTC
Forum: Coding
Topic: C++ question
Replies: 44
Views: 6616

Number wrote:I always used getch() to wait for the user to press a key, as I was taught. Is that non-standard? Or is it less preferred?


getch() comes from the conio header which is non-standard
by shawncplus
Sat Aug 11, 2007 4:49 pm UTC
Forum: Coding
Topic: C++ question
Replies: 44
Views: 6616

I highly advise against system("pause"); Compared to cin.get() this is what system("pause") has to do: Send call to cstdlib library for the system function Look up the "pause" system command Transfer program control to the system to execute the command Return control ba...
by shawncplus
Tue Aug 07, 2007 7:54 pm UTC
Forum: Coding
Topic: Couple Java programs.
Replies: 23
Views: 3518

Code: Select all

boolean [] used = {false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false};


I'm used to C++ but can't you just do

Code: Select all

boolean used[26] = {false};
by shawncplus
Thu Aug 02, 2007 12:11 pm UTC
Forum: Coding
Topic: Java Books
Replies: 34
Views: 10721

No, the cplus comes from cplusplus but that was too long so I just shortened it. A little googlage popped up this link: Top Must-Read Java Programming Books I haven't learned Java yet since I've focused on C++ for about 4-5 years and I've dabbled in a few other languages like VB.NET, Python, Lua, an...
by shawncplus
Thu Aug 02, 2007 3:27 am UTC
Forum: Coding
Topic: Java Books
Replies: 34
Views: 10721

Firstly, HTML and CSS aren't really programming languages. HTML is a markup language.

Secondly, what is your reason for learning Java? Learning a new language is a pretty big endeavor and there might be a better language for what you need.
by shawncplus
Wed Aug 01, 2007 3:21 am UTC
Forum: Coding
Topic: Alternatives to the dreaded goto
Replies: 114
Views: 19440

Well, as a general rule of thumb in almost every language, if you get yourself into a situation where you have to repeat a block of code(not a loop) just make it a function. Though this can be a bit unnecessary if it only needs to be repeated once. Pseudocode (evil): label get_input Display welcome ...

Go to advanced search