hints in C

Any other programming language that is not covered in the Web Scripting category.

Postby al_tyranny on Sun Jul 10, 2005 12:25 am

Strafe wrote:It's so like romanians to be stupid.


Hey Strafe, can you guess what's going in my signature the next time I update it? Laughing
mm_freak wrote:Slackware users are dreamers. Sorry to say.
al_tyranny
Phoenix Veteran
Phoenix Veteran
 
Posts: 294
Joined: Tue May 17, 2005 3:18 am
Location: Greater Boston Area

Postby Strafe on Sun Jul 10, 2005 7:05 am

"I love romanians" ? Razz
And yes, i consider my people stupid. I'm the exception though Very Happy
Strafe
Valued Member
Valued Member
 
Posts: 195
Joined: Fri Jun 17, 2005 8:19 am

this is about c...

Postby whitehat101 on Mon Jul 11, 2005 4:15 pm

//This is a C thread...
/*I code like this!*/
#include <stdio.h>

/*vars, sub declarations... comments... acsii art doodles... all go here*/

void main(){
printf("
I didn't mean learning/knowing pascal was a bad thing, kudos for taking the time to learn it!

Very Happy I know what you mean by 12-year-old hackers! It's great that someone thinks they are a hacker and oober 1337 just because they can google a program that will make someone's cd drive open, or better yet a link to something that exploits something in IE6!
I have a friend like that, lol! It makes me laugh sometimes. (not saying that all 12-year-old hackers don't know anything. Myself and a friend of mine foe example, but we weoudn't clasify ourselves as hackers, except maybe under the origional definition Smile)

That stuff interested me for a short short time. Once I learned about sql injection I put that info to use by filtering the input. As a joke, I have the ThinkGeek hacker hat (the white one) (there is the root of my username if you haven't already caught it). Those little kiddies who think they are all that just because they think they know what an IP address is and know how to find out what theirs is.

lol, about that site. I had it looking rather nice in firefox and then I started testing in IE and it looked like crap!(CSS mainly) But rumor has it that IE7 is going to support more standards... Then again, they're only releasing it for XP and I'm one of the people who isn't going to bite the eye candy of xp, expecally with a older machiene that is running win2k just fine. (old news on /. you read it?)

well, I'm off to attempt to make a quicktime panarama of my bedroom (more to say I can than to show peeps what my bedroom looks like Cool)
");
}

//subs... yeah!
If it hurts, rub it.
whitehat101
Contributer
Contributer
 
Posts: 41
Joined: Fri Jun 24, 2005 5:18 am
Location: Orangevale, CA

Postby Strafe on Mon Jul 11, 2005 5:17 pm

Haha Smile
I see we have different "ub3r hack3rz" in our "lives". Yours are the ones that exploit bugs in Windows, mines are the ones that talk about *nix like they're some kind of guru.
All they do is beg somebody to give them a shell so they can scan for exploits like a brute-force ssh password breaker (scans within a given ip range for weak sshd logins/passwords such as root:12345, root:root, guest:guest etc). I've seen them talk like they've done coding on linux - although the only thing they did was replacing a string in some other guy's program/bash script so that it would look like they've done it.
Good "hackers" never do something stupid like revealing their identity, hanging around public chat networks... they live "in the shadows" and nobody's ever heard of them, even though they're into some heavy stuff Smile
Strafe
Valued Member
Valued Member
 
Posts: 195
Joined: Fri Jun 17, 2005 8:19 am

Oh wow!

Postby whitehat101 on Mon Jul 11, 2005 5:58 pm

Looks like the average 1337 romanian hacker is on a whole other level compared to california haxorz!

I can't say I've even met a ha3qxz9zo5rzzzz that knows what *nix is. Then again, I've olny met one person who knows what *nix is and uses it. He is such a smart cookie! We need more people like him...

Can't say I've even met a windows guru (real or pretend). I took a C class last year... and it wasn't the best... it was with Borland and Win2k and everyone was amazed with batch files...(although, I quickly discovered SciTE making the *.bat files obsolete) I probably have more thumbs than there were people in that class that had ever used ANY kind of terminal for anything useful. I knew more than the teacher sadly... but still I learned something and I got on the good side of the super respected Clac. teacher (; so, it's all good!

The hacker test: Ask them if they are a hacker. If they say yes, they aren't. If they say no, they could be.
If it hurts, rub it.
whitehat101
Contributer
Contributer
 
Posts: 41
Joined: Fri Jun 24, 2005 5:18 am
Location: Orangevale, CA

Postby Strafe on Mon Jul 11, 2005 6:08 pm

Follow the white rabbit Smile
Sadly, you don't learn anything useful in schools. That's why we're better than our teachers - they got along with the idea just fine, but we don't. We're explorers, researchers, whatever you can call us. I remember my teacher being amazed the first time i opened a computer case in front of her... and our "local network administrator" (even though he's a good friend of mine) begs me to teach him some basic linux stuff. How did he become one in the first place if he doesn't know BASIC linux commands ?

Oh well.. I did the test on myself and i cheated because i already knew the answers Very Happy
Strafe
Valued Member
Valued Member
 
Posts: 195
Joined: Fri Jun 17, 2005 8:19 am

Postby pugrit on Mon Jul 11, 2005 7:58 pm

schools are more on theories...boring part of learning.. hehehehehe
pugrit
Phoenix Veteran
Phoenix Veteran
 
Posts: 293
Joined: Thu Mar 10, 2005 1:06 pm
Location: /home/pugrit

Postby al_tyranny on Tue Jul 12, 2005 12:47 am

Strafe: does your school have a Linux network, or a Windows one? If it's Windows, why would he need any commands for a "Spawn of Satan" OS? So many damned lazy people out there nowadays ... whoops, have to go finish my PERL homework ... Wink
mm_freak wrote:Slackware users are dreamers. Sorry to say.
al_tyranny
Phoenix Veteran
Phoenix Veteran
 
Posts: 294
Joined: Tue May 17, 2005 3:18 am
Location: Greater Boston Area

Postby mm_freak on Tue Sep 13, 2005 12:26 am

I guess it's too late, but still a good advice for others, I hope. And this doesn't only apply to exams. =)

Write your code backwards. Let's say, you needed to write a prime number generator. So what does it need? Firstly it needs a main(). main() will need a random number generator and a primality check. The random number generator doesn't have any other dependencies, so write it first. Just leave a bit space for #includes and in the case of an exam, leave one or two lines for variables (that's enough, trust me - see below).

Next, what does the primality check need? It needs modular exponentiation, which by itself doesn't have further dependencies, so write it. Depending on the primality check, it may also need the Jacobi or Legendre symbol, which again by itself doesn't have further dependencies, so write it. After that all dependencies have been resolved, so you can write the actual primality check.

After that, you can already write the main() function, since you have everything you need already done.

Now about global variables: you shouldn't need them. However, if you do, you can define them after your main function at the bottom of the source code. The one or two lines you have reserved for variables can now be used for declaring them extern. But this only applies to exams.
I'm x^10 + x^8 + x^5 + x^4 + x^3 + 1, so don't mess with me!
mm_freak
Moderator
Moderator
 
Posts: 635
Joined: Sun Sep 11, 2005 12:29 pm
Location: Baden-Wuerttemberg (Germany)

Postby bockman on Mon Nov 28, 2005 8:58 pm

I never thought writing programs on paper was too much different. Usually the grader is lenient on race conditions though, but what do I know, I've only taking one qbasic class once. :p
bockman
Newbie
Newbie
 
Posts: 17
Joined: Mon Nov 28, 2005 8:42 pm

Re: hints in C

Postby wrd on Tue Nov 29, 2005 1:12 pm

I believe trial and error is a good method since most programmer I met use it, cause there is no such things as buggfree programs, unless they got lines under something you really can control.

How I do is to work with classes. When the apps get really big its alot easier to have instances of classes doing job for you than writhing everyting into same place. If something is complicated alone, it get it own class.
wrd
Contributer
Contributer
 
Posts: 26
Joined: Tue Nov 29, 2005 7:11 am

Re: hints in C

Postby mm_freak on Wed Nov 30, 2005 1:25 am

wrd wrote:I believe trial and error is a good method since most programmer I met use it, cause there is no such things as buggfree programs, unless they got lines under something you really can control.


You can't do trial and error on paper.

wrd wrote:How I do is to work with classes. When the apps get really big its alot easier to have instances of classes doing job for you than writhing everyting into same place. If something is complicated alone, it get it own class.


I think, you're missing the context. Read the original post.
I'm x^10 + x^8 + x^5 + x^4 + x^3 + 1, so don't mess with me!
mm_freak
Moderator
Moderator
 
Posts: 635
Joined: Sun Sep 11, 2005 12:29 pm
Location: Baden-Wuerttemberg (Germany)

Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron