AOA Forums AOA Forums AOA Forums Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA Forums > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!


Reply
 
LinkBack Thread Tools Rate Thread
  #41 (permalink)  
Old 25th August, 2005, 01:30 PM
Chesso's Avatar
Banned
 
Join Date: January 2005
Location: Sydney - Australia
Posts: 877
Send a message via MSN to Chesso

How big a number? integer's range from -2mil something to 2mil something or more, That's atleast 6 digits.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #42 (permalink)  
Old 25th August, 2005, 01:35 PM
hoinar's Avatar
Member
 
Join Date: February 2005
Location: Iasi, Romania
Posts: 945
Send a message via Skype™ to hoinar

lol, try 100 years for example and look at the seconds number
__________________
I'd cry...but I can't stop laughing.
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #43 (permalink)  
Old 25th August, 2005, 01:37 PM
Chesso's Avatar
Banned
 
Join Date: January 2005
Location: Sydney - Australia
Posts: 877
Send a message via MSN to Chesso

Oh you mean how many seconds in 100 years? why on earth would you want to know that lol and there are ways around it which is what you meant i guess.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #44 (permalink)  
Old 25th August, 2005, 01:53 PM
hoinar's Avatar
Member
 
Join Date: February 2005
Location: Iasi, Romania
Posts: 945
Send a message via Skype™ to hoinar

Thumbs up

Quote:
Originally Posted by Chesso
Oh you mean how many seconds in 100 years? why on earth would you want to know that lol and there are ways around it which is what you meant i guess.
Yep, it's what I meant. Not to criticize his program.
__________________
I'd cry...but I can't stop laughing.
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #45 (permalink)  
Old 25th August, 2005, 02:04 PM
Rondog's Avatar
Member
 
Join Date: January 2005
Location: Victoria, Australia
Posts: 3,298
Send a message via MSN to Rondog

Quote:
Originally Posted by hoinar
Lol mate, you're such a kid with such an affirmation but I forgive you, cause I like you :P C# and the .Net Framework are made by some very strong programmers, one of wich worked before to develop Delphi to be like it is today And Gates didn't touch that language as I know
If you know some OOP programming you could learn C# much quicker than C++.
Perhaps. But it requires .NET Framework 1.1. Which I am refusing to install on principle.
__________________
AOA Team fah

Rig 1: Intel Core i5 750,4gb,HD6870,500gb,W7 Ult x64
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #46 (permalink)  
Old 25th August, 2005, 02:19 PM
skool h8r's Avatar
Member
 
Join Date: January 2005
Location: Rotherham, UK
Posts: 3,157
Send a message via MSN to skool h8r

Is this the 'Gates has had something to do with it' principal? Do you use Windows (not the holes in the wall type either)? Well gates made some of that. Even if you play games not made by MS, they are likely to have made the compiler that the game was compiled with, or the operating system it was compiled on. Almost everything to do with computers today has been made using something the MS made, even the programs used to make programs are 'affected'. A bit over the top but there we have it. If i based everything on principal, i wouldn't have made Re-volt or wouldn't want to be a programmer.
__________________
i7 2600K (4.3Ghz 1.34v) | GTX580 | 16GB (4x4GB) Patriot Viper Sec. 5 Ser. 2 (1866 - 9-11-9-27) | P67A-UD4-B3
Corsair AX1200 | Vertex II 240GB SSD | 4TB RAID0 (Samsung HD204UI) | Logitech G930 Wireless Headset

YouTube - Benchmark Results (Coming Soon!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #47 (permalink)  
Old 25th August, 2005, 02:21 PM
hoinar's Avatar
Member
 
Join Date: February 2005
Location: Iasi, Romania
Posts: 945
Send a message via Skype™ to hoinar

Lol, the same you could say about Java's runtime. Ehh...I'll stop here I don't want to start a debate.
__________________
I'd cry...but I can't stop laughing.
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #48 (permalink)  
Old 25th August, 2005, 02:24 PM
Rondog's Avatar
Member
 
Join Date: January 2005
Location: Victoria, Australia
Posts: 3,298
Send a message via MSN to Rondog

Quote:
Originally Posted by skool h8r
Is this the 'Gates has had something to do with it' principal? Do you use Windows (not the holes in the wall type either)? Well gates made some of that. Even if you play games not made by MS, they are likely to have made the compiler that the game was compiled with, or the operating system it was compiled on. Almost everything to do with computers today has been made using something the MS made, even the programs used to make programs are 'affected'. A bit over the top but there we have it. If i based everything on principal, i wouldn't have made Re-volt or wouldn't want to be a programmer.
I use Windows under duress for gaming only. I go against my principles, because my counscious mind gets bored.

Quote:
Originally Posted by hionar
Yep, it's what I meant. Not to criticize his program.
I generally take criticsm in a constructive way. How would I fix this problem? It works at 68 years. but at 69 it buggers up, why?
__________________
AOA Team fah

Rig 1: Intel Core i5 750,4gb,HD6870,500gb,W7 Ult x64
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #49 (permalink)  
Old 25th August, 2005, 02:27 PM
skool h8r's Avatar
Member
 
Join Date: January 2005
Location: Rotherham, UK
Posts: 3,157
Send a message via MSN to skool h8r

'i know, let's talk about hoinar's 5kg piece of noisy ***** then'

I don't know much about programming, i admit that, but the more you know, the better. As for Java, i won't even touch that as the applications you can make with it, i just don't even like the look of them. Unless you are decent at graphics, then usually, it looks crap. As 'jailbait or mmm' says, that is just wrong.
Edit: it buggers up at 69 you say? Well, it just doesn't like your relationship with your girlfriend then
__________________
i7 2600K (4.3Ghz 1.34v) | GTX580 | 16GB (4x4GB) Patriot Viper Sec. 5 Ser. 2 (1866 - 9-11-9-27) | P67A-UD4-B3
Corsair AX1200 | Vertex II 240GB SSD | 4TB RAID0 (Samsung HD204UI) | Logitech G930 Wireless Headset

YouTube - Benchmark Results (Coming Soon!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #50 (permalink)  
Old 25th August, 2005, 02:29 PM
Rondog's Avatar
Member
 
Join Date: January 2005
Location: Victoria, Australia
Posts: 3,298
Send a message via MSN to Rondog

Quote:
Originally Posted by skool h8r
'i know, let's talk about hoinar's 5kg piece of noisy ***** then'

I don't know much about programming, i admit that, but the more you know, the better. As for Java, i won't even touch that as the applications you can make with it, i just don't even like the look of them. Unless you are decent at graphics, then usually, it looks crap. As 'jailbait or mmm' says, that is just wrong.

Edit: it buggers up at 69 you say? Well, it just doesn't like your relationship with your girlfriend then
LOL. I set myself up for that ay?

Nah, im single and have been for ages. It bites.
__________________
AOA Team fah

Rig 1: Intel Core i5 750,4gb,HD6870,500gb,W7 Ult x64
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #51 (permalink)  
Old 25th August, 2005, 02:33 PM
hoinar's Avatar
Member
 
Join Date: February 2005
Location: Iasi, Romania
Posts: 945
Send a message via Skype™ to hoinar

Quote:
Originally Posted by Rondog
I use Windows under duress for gaming only. I go against my principles, because my counscious mind gets bored.

I generally take criticsm in a constructive way. How would I fix this problem? It works at 68 years. but at 69 it buggers up, why?
Because Int datatype is not enough for such a big number. Use a larger datatype. This is just an idea, there are better solutions I guess.
__________________
I'd cry...but I can't stop laughing.
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #52 (permalink)  
Old 25th August, 2005, 02:35 PM
hoinar's Avatar
Member
 
Join Date: February 2005
Location: Iasi, Romania
Posts: 945
Send a message via Skype™ to hoinar

Talking

Quote:
Originally Posted by skool h8r
'i know, let's talk about hoinar's 5kg piece of noisy ***** then'

I don't know much about programming, i admit that, but the more you know, the better. As for Java, i won't even touch that as the applications you can make with it, i just don't even like the look of them. Unless you are decent at graphics, then usually, it looks crap. As 'jailbait or mmm' says, that is just wrong.
Edit: it buggers up at 69 you say? Well, it just doesn't like your relationship with your girlfriend then


Quote:
Originally Posted by Rondog
LOL. I set myself up for that ay?

Nah, im single and have been for ages. It bites.
You have time to repair that situation
__________________
I'd cry...but I can't stop laughing.
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #53 (permalink)  
Old 25th August, 2005, 02:35 PM
skool h8r's Avatar
Member
 
Join Date: January 2005
Location: Rotherham, UK
Posts: 3,157
Send a message via MSN to skool h8r

Have you checked the include files. Maybe something is in there. There doesn't seem to be anything in your source code as far as i can see.
__________________
i7 2600K (4.3Ghz 1.34v) | GTX580 | 16GB (4x4GB) Patriot Viper Sec. 5 Ser. 2 (1866 - 9-11-9-27) | P67A-UD4-B3
Corsair AX1200 | Vertex II 240GB SSD | 4TB RAID0 (Samsung HD204UI) | Logitech G930 Wireless Headset

YouTube - Benchmark Results (Coming Soon!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #54 (permalink)  
Old 25th August, 2005, 02:57 PM
Chesso's Avatar
Banned
 
Join Date: January 2005
Location: Sydney - Australia
Posts: 877
Send a message via MSN to Chesso

Search google for c++ data types. Also if you really despise char arrays you could always get somethign fo rit and include it so you can have string capability from the get go.

Though once you get good i would recommend making something of your own to handle string's so you know exactly what is in it. There might already be something you can include for using string's i can' remember.

skool hr8 if you want a mildly simple language that isn't over the top and isn't going to majorly bust performance i would recommend a pascal language preferabbly the object pascal language delphi or even visual basic.

Even i started with visual basic
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #55 (permalink)  
Old 25th August, 2005, 02:58 PM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, Unicycle Challenge Champion, YetiSports 9: Final Spit Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 16,178
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

Quote:
Originally Posted by skool h8r
I tried a buffer overrun with the numbers version i created, it output a weird minus number when the user is asked to confirm them. Gizmo, could you post the corrected code so it can use characters as when i tried to change it and compile, i just got errors, my fault obviously. I'd rather not say what language my browser was written in as it would make it really obvious how i got all the features in.
The integer version won't suffer from a buffer overrun. The string version will.

Code:
int main()
{
    char this_is_a_string[128];
    printf( "Welcome to AuthentiLog.\nTo initiate the login procedure, please press the enter key.", this_is_a_number );
    getchar();
    printf( "User number: " );
    scanf( "%s", this_is_a_string );
    printf( "welcome user number %s.", this_is_a_string );
    getchar();
    char magic_string[128];
    scanf( "%s", &magic_number );
    printf( "PassString: ", magic_string );
    scanf( "%s", &magic_string );
    getchar();
    printf( "Thankyou. ", magic_string );
    getchar();
    char sir_madam[128];
    printf( "Please enter verification string: " );
    scanf( "%s", sir_madam );
    getchar();
    printf( "Thankyou.", sir_madam );
    getchar();
    char number_list_confirm[128];
    printf( "Please confirm the entries below are correct. " );
    getchar();
    printf( "UserNumber: %s. ", this_is_a_string );
    getchar();
    printf( "PassNumber: %s. ", magic_string );
    getchar();
    printf( "Verification Number: %s. ", sir_madam );
    getchar();
    /*---
    scanf( "%s", magic_string );
    printf( "PassNumber: %s", magic_string );
    getchar();
    scanf( "%s", sir_madam );
    printf( "Verification Number: %s", sir_madam );
    getchar();
    ---*/
    char string_final[128];
    //this code is wrong------->printf( "\n", this_is_a_number );
    printf("%s\n", this_is_a_string);
    printf( "Thankyou for using AuthentiLog user number %s.", this_is_a_string );
    printf( "\nGoodbye user number %s.", this_is_a_number );
    getchar();
}
The code above should compile and run with the expected results.

The line I have marked with

//this code is wrong---------->

contains a syntax error that will allow the application to compile and run, but could result in stack corruption. You are passing an argument to printf, but not actually using it in your format string. This is a common error when using printf, and is one of the reasons that C++ uses the << metaphore instead.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #56 (permalink)  
Old 25th August, 2005, 03:22 PM
Chesso's Avatar
Banned
 
Join Date: January 2005
Location: Sydney - Australia
Posts: 877
Send a message via MSN to Chesso

Gizmo do you mean to say that because of the size of his char array it could cause problems? if more char's then the length of the array was input for example.

To solve that either increase the length of the char array or check the length of the input first if possible.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #57 (permalink)  
Old 25th August, 2005, 03:27 PM
skool h8r's Avatar
Member
 
Join Date: January 2005
Location: Rotherham, UK
Posts: 3,157
Send a message via MSN to skool h8r

Well, is it possible to put in a very high number, e.g. 999999999 to try and prevent it? Or would that cause errors?
__________________
i7 2600K (4.3Ghz 1.34v) | GTX580 | 16GB (4x4GB) Patriot Viper Sec. 5 Ser. 2 (1866 - 9-11-9-27) | P67A-UD4-B3
Corsair AX1200 | Vertex II 240GB SSD | 4TB RAID0 (Samsung HD204UI) | Logitech G930 Wireless Headset

YouTube - Benchmark Results (Coming Soon!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #58 (permalink)  
Old 25th August, 2005, 03:35 PM
Chesso's Avatar
Banned
 
Join Date: January 2005
Location: Sydney - Australia
Posts: 877
Send a message via MSN to Chesso

It's been awhile since i have written any c++ but if their is a function for checking the length of string's/char arrays and hopefully integer values then use it to determine whether it can be stored or not.

Basically: If (Length(SomeText) > 15) Then //allow the user to re-input valid data. Otherwise store it and do w/e.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #59 (permalink)  
Old 25th August, 2005, 04:05 PM
Kaitain's Avatar
Member
Mars Rover Champion, Joust Champion
 
Join Date: September 2001
Location: MK10, UK.
Posts: 4,372
Send a message via MSN to Kaitain Send a message via Skype™ to Kaitain

Quote:
Originally Posted by skool h8r
Well, is it possible to put in a very high number, e.g. 999999999 to try and prevent it? Or would that cause errors?
It's possible, within some limits, and doesn't cause errors, but neither does it fix the problem. There are some geeks around that will spend a long time with their finger on one or two keys to ensure that enough characters are generated to overflow any char array.

You have to develop a routine to throw away invalid inputs before they get to the array, or use a different input method.
__________________
It is by coffee alone I set my mind in motion...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #60 (permalink)  
Old 25th August, 2005, 04:06 PM
skool h8r's Avatar
Member
 
Join Date: January 2005
Location: Rotherham, UK
Posts: 3,157
Send a message via MSN to skool h8r

what about:

Code:
if("%s", this_is_a_string > 30)goto "printf", this_is_a_string;
I tried it, and got errors. Anyone care to correct me on it?
__________________
i7 2600K (4.3Ghz 1.34v) | GTX580 | 16GB (4x4GB) Patriot Viper Sec. 5 Ser. 2 (1866 - 9-11-9-27) | P67A-UD4-B3
Corsair AX1200 | Vertex II 240GB SSD | 4TB RAID0 (Samsung HD204UI) | Logitech G930 Wireless Headset

YouTube - Benchmark Results (Coming Soon!)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
linux help required skool h8r OS, Software, Firmware, and BIOS 5 31st July, 2006 05:10 AM
New Athlon Cpu Required surgeon AMD Motherboards & CPUs 15 18th November, 2005 05:29 PM
More mentions required dod ThunderRd's AOA FOLDING@HOME Team 4 8th October, 2004 08:47 PM


All times are GMT +1. The time now is 08:37 PM.


Copyright ©2001 - 2010, AOA Forums
Don't Click Here Don't Click Here Either

Search Engine Friendly URLs by vBSEO 3.3.0