jephthah 1,888 Posting Maven

I guess you don't know me, then, do you?

I find it handy to have the groups I watch handy in my mail app, so I have record of any posts I make.

Yes, I'm so 20th century - I use my cell phone for talking, not texting or surfing or emailing, or....usenetting.

egads. you probably still use POP3!

:-O

jephthah 1,888 Posting Maven

"acne treatment for geeks"? well, that has to be the most randomly bizarre link i have ever seen in someone's signature.

.

jephthah 1,888 Posting Maven

eh, i called my mom on the following tuesday

jephthah 1,888 Posting Maven

isn't it always the 2nd Place winners who wind up being the commercial successes in these sorts of things?

jephthah 1,888 Posting Maven

ii dont know anyone who still uses the news mailer to access USENET. that's like last decade. USENET's been on the web for some time now.

jephthah 1,888 Posting Maven

pizza with ranch dressing, rice krispie treat, and a diet pepsi.

it's my healthy alternative.

jephthah 1,888 Posting Maven

but isnt 7 just a watered down Vista? i dont' know anyone who's especially excited about 7.

jephthah 1,888 Posting Maven

what would be the boiling point of a cup of water in empty space?

jephthah 1,888 Posting Maven

i hear tell our Milky Way Galaxy and the Andromeda Galaxy are going to collide soon.

It's going to be huge disaster.

Better get your affairs in order now.

jephthah 1,888 Posting Maven

oceanic vent dwelling bacteria breathe sulfuric hydroxide.

jephthah 1,888 Posting Maven

hai guise.

what y'all doing?

jephthah 1,888 Posting Maven

i'd like to request that we delete all of my posts in this thread, and all posts referring to any of my posts in this thread.

in fact, lets just delete all posts except for the original post, and start over.

i dont have an excuse. i just want a mulligan.

jephthah 1,888 Posting Maven

That's the point. ;)

aaah... ooops. dammit, i'm a mess.

i mean to use &... jeez. i almost, but not quite, had it right the first time on page 1 when i said &= . holy crap, this is embarrassing. i need to pay attention. i really do know better :$

this is what i meant:

#include <stdio.h>

void showcolor(int color)
{
   if ( color &  1 ) puts("violet");
   if ( color &  2 ) puts("indigo");
   if ( color &  4 ) puts("blue");
   if ( color &  8 ) puts("green");
   if ( color & 16 ) puts("yellow");
   if ( color & 32 ) puts("orange");
   if ( color & 64 ) puts("red");
}

int main()
{
   puts("showcolor(0)");
   showcolor(0);
   puts("showcolor(1)");
   showcolor(1);
   return 0;
}

.

jephthah 1,888 Posting Maven

exactly. because what's the point of having 7 bits of color if you only have seven discrete colors. it seems obvious to me that the bit pattern intends to allow mixing.

e.g.:

showcolor(12)
"bluegreen"

.

jephthah 1,888 Posting Maven

beauty is skin deep.

stupid goes to the bone.

jephthah 1,888 Posting Maven

the master its not working

take your original program, and try changing your == comparisons to && comparisons

(and change your main function to read int main (void) to remove everyone's distress :P )

.

jephthah 1,888 Posting Maven

like the carbon based units breathe out carbon?

jephthah 1,888 Posting Maven

I want to call it Dave.

jephthah 1,888 Posting Maven

genlib.h ... simpio.h ... strlib.h ... WTF is this???

whoever told you to use this crap is setting you up for FAIL. this is so non-standard, i dont even know what the hell it is. all i know is that it's caused your code to be so far beyond broken there is no way to ever get it to work on any standard C compiler.

throw these libraries out of your program and any function calls that rely on it, then rewrite your program to work with standard C libraries.

and if someone tells you to use this garbage again, kick them in both shins really hard.

Narue commented: You fail. Go smoke a dooby or something and chill out. -7
scru commented: don't worry, I for one, appreciate your dumbassery +6
serkan sendur commented: you fail. -1
Salem commented: Whatever they are, they make it impossible for us to replicate the problem. +33
William Hemsworth commented: this made me laugh, respect. +11
jephthah 1,888 Posting Maven

Hi Narijuana

Glomosim is not C.

Did you look here?

jephthah 1,888 Posting Maven

What's the difference between boolean and bitwise ?

well... y'see... dammit. nuthin' i reckon.

(* kicks rock *)

jephthah 1,888 Posting Maven

i wouldnt say either of those two examples ^,^^ were ever considered ugly. Jim Neighbors i think was generally regarded as fairly handsome, if in a slightly goofy way. He exaggerated the goofiness cariacature for his highly popular TV character. For Aretha, R&B and Soul has always had a number of "non-traditional" looking performers. and i'd still never say she was ugly.

and most importantly, IMO, is the nature of fame and media and marketing has changed *dramatically* since the 1960's.

speaking just in my American experience, our entire *culture* has shifted greatly since then, regarding the relative importance we place on superficial appearances.

... all that being said, when the Scots are ugly, they don't mess around. :-O


.

jephthah 1,888 Posting Maven

yah huh.

there would still be Pet Rocks.

you betcha.

jephthah 1,888 Posting Maven

i refuse to play your game.

i choose both.

William Hemsworth commented: Smart choice. +10
jephthah 1,888 Posting Maven

sure would be nice if you used syntax highlighting, so it would keep the whitespace/indentations, then i could read the code. otherwise, im not in a position now to compile it so i can't (won't) do much else.

[code=cpp] //enter your tabbed/indented c++ code here

[/code]


.

jephthah 1,888 Posting Maven

okay, i'll admit it.

I, too, am terrible at recursion.

jephthah 1,888 Posting Maven

this code is a mess.

first off, you would need to change the line scanf("%f",&a); to scanf("%f",&a[i]); if you wanted to have any hope of collecting the input into the array.

but you cant just declare a float pointer like you're doing, within the 'save_array' function, and expect memory to be automagically allocated for the array

also notice, you are passing the int 'N' as a number of elements, yet you're not using that value within the function and are instead hard-coding 10 elements. make up your mind and do it one way or the other.

another problem in your 'maximum' function, is that you're passing the variable as a pointer, yet you're also trying to declare it locally. you can't do that. you have to choose one or the other. in this case, you need to pass it, because you want to analyse the values of an existing array, and not create a new one.

figure out what i'm talking about and try to fix your code accordingly.


.

jephthah 1,888 Posting Maven

oops.

i meant to say, change it to if (color [b]&&[/b] 1)

tux4life commented: Haha! Your "Physic Powers" weren't working the way it should :P +7
jephthah 1,888 Posting Maven

for one thing, you're not reading and writing to your numerically sequenced files 'ifile' and 'ofile' like it appears that you think you are doing.

change it to the following

sprintf(ifile,"C:\\Document\\file%04d.dat",i);
sprintf(ofile,"C:\\Document\\o_file%04d.dat",i);

in = fopen(ifile,"rb");
out = fopen(ofile,"wb");

and you'll have to make the file name character arrays larger.


.

jephthah 1,888 Posting Maven

i'm going to use my Psychic Powers on this problem.

Monseiur Jephthah presciently knows that you need to change all of your conditional statements such as if(color ==1) ...

to the following: if(color [B]&[/B]=1) ...

and do NOT, as the post #5 suggest, use "else if" statements. if my Psychic Powers are correct, then you need to only use "if" statements.


.

jephthah 1,888 Posting Maven

yes :)

jephthah 1,888 Posting Maven

you dont need to recalculate each and every factorial. because if you've already calculated 9! (for example), then 10! is really just 9! * 10.

and basically it's this: you can't do integer division. because all your quotients will be integer zeros.

3/6 = 0. 4/24 = 0. 5/120 = 0.

you have to use the "double" data type.

and as he already mentioned, it will crap out at 13!, because the maximum unsigned integer 2^32 = ~4 billion.

look into "long long int" data types. and "big number" libraries if you really need to get deep.

power series are not a trival matter in C.

jephthah 1,888 Posting Maven

never mind. i'm done here. the correct solution has been given back on page 1.


.

jephthah 1,888 Posting Maven

COOOOOOOOOL, dont be dick dude, im a begineer. btw sick avatar, what are you 12?

funny you didnt qualify your "solution" with the "hey i'm a beginner" disclaimer, why are you falling back on it now?

whatever, if you're a beginner, then don't use this site to give wrong advice to other beginners. a good intention is no substitute for correct code.

.

jephthah 1,888 Posting Maven

i was joking. what the heck is a "magic number" anyhow?

i understand magic numbers as being arbitrarily defined constants that, when they are poorly documented, are indicative of poor coding practice.


EDIT -- oh, wait, you mean for a file type. one or more numbers at the very beginning of a file.

well, i guess you need to read the very first line of text, then convert ascii to integer, and perform a basic comparison on the first several bytes of the same length as the number being searched?

um, yeah, okay i get it now. i didn't understand how basic this question was. :$

use "fgets()" and "strtol()" or "atol()"


.

jephthah 1,888 Posting Maven

I got so frustrated over the issue and did it in PYTHON. But Yes , there is a wqay of using srings to handle large integers but I guess my compiler is the culprit. Guys. - Let me know of a decent compiler and where to download it

there absolutely is a way to do it with 64-bit integers. C99 standard defines the 64-bit integer as the long long int data type.

i do not have any problem using this data type with my compiler, GCC version 3.4. I believe GCC current version is up to 4.3.

apparently, although i have not verified this personally, Windows and Borland compilers define the long long int as __int64 ...

http://home.att.net/~jackklein/c/inttypes.html#long_long

now you can either listen to some clown who wants you to create a string-based big integer handler from scratch, or you can use the 64-bit integer data type that is defined in the C99 standard. your current compiler may not adhere to this standard, but there are plenty that do.

http://www.codeblocks.org/
http://gcc.gnu.org/
http://www.mingw.org/


.

jephthah 1,888 Posting Maven

i think he means

unsigned long MAGIC_NUM = 0xDEADBEEF;
jephthah 1,888 Posting Maven

> I know the Simpsons is a bad example as they've been on our screens for over 10 years and don't seemed to have aged at all!
Check with LISA (List of Inquiries and Substantive Answers)

For Better or Worse?

jephthah 1,888 Posting Maven

Can you tell me, why is it wrong?? You can very well use atoi function. for converting characters to numbers

beat it, kid. your answer isn't just wrong, it's completely irrelevant.

jephthah 1,888 Posting Maven

[IMG]http://img8.imageshack.us/my.php?image=devsnap.png[/IMG]
Im still not able to get the precision required

i dont know why not.

i'm using GCC v3.4, which is over 3 years old.

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    unsigned long long bignum = 600851475143 ;

    printf("bignum    : %lld\n",bignum);
    printf("bignum * 2: %lld\n",bignum * 2);
    printf("bignum * 4: %lld\n",bignum * 4);
    return 0;
}

gives the following result:

bignum    : 600851475143
bignum * 2: 1201702950286
bignum * 4: 2403405900572

Process returned 0 (0x0)   execution time : 0.050 s
Press any key to continue.

you're either doing something wrong, or your compiler sucks or something.

jephthah 1,888 Posting Maven

^ from that page:

on linux you would just grep sysctl for a block of info

$ sysctl -a |grep therm
...

or query for the specific variable

$  sysctl hw.acpi.thermal.tz0.temperature
hw.acpi.thermal.tz0.temperature: 54.0C
tux4life commented: Good find! +7
jephthah 1,888 Posting Maven

c is generally slow compared to other programming language.

wrong. C is generally faster compared to other languages. any compiled language is inherently faster than an interpreted language such as Visual Basic or Java.

nothing is coming in my mind right now.

:icon_rolleyes:

jephthah 1,888 Posting Maven

void main()
flushall()
lol()


googling for a week?

are you exaggerating?

cause i just found it in about 30 seconds.


.

jephthah 1,888 Posting Maven

i would have done it completely different than what william posted.

and it would be just as trivial.

jephthah 1,888 Posting Maven

i think cleverbot is pretty crappy.

it's like having a conversation with AOL Customer Support.

jephthah 1,888 Posting Maven

i made also a find biggest and smallest but it alawys get last element

because for the smallest, you set num=1000 every single time you go through the loop. arr will always be less than 1000 each time, so it stores it in num, each time.


EDIT: i see William already re-wrote your code for you. consider yourself (un)lucky, because i would have made you fix it yourself.

jephthah 1,888 Posting Maven

div_t is struct for the result of divide operation, puts the quotient and the remainder into the structure.

it is being used here to convert a numeric value into an ascii string according to the base number system desired.

example: "itoa" convert value 1247 to be expressed as base-16 ascii string

itoa(1247,string,16);

1247 div 16 = quot 77, rem 15 ... 15 = "F"
  77 div 16 = quot  4, rem 13 ... 13 = "D"
   4 div 16 = quot  0, rem  4 ...  4 = "4"

when quot = 0, end do/while loop

final result of converting 1247 value to ascii base-16 number: "string" contains "4DF"


.

jephthah 1,888 Posting Maven

your problem is here: for(i=0;arr[i]<=3;i++) your index is 'i' yet your conditional is based on the value of 'arr' at the index 'i'

fix that.


.

jephthah 1,888 Posting Maven

User: hi, are you there?

Cleverbot: Yes, are you there?

User: I am, that's why i asked you.

Cleverbot: Clever.

User: Not intentionally. what is new with you?

Cleverbot: What if its not new. more to the point whats new with you.

User: It's an expression. I'm trying to be polite. why do you keep rephrasing my questions back to me?

Cleverbot: You seem to have knowledge unknown.

User: Do you mean I have apocryphal knowledge?

Cleverbot: No, I mean that your 'understanding' is very limited.

User: Perhaps you can enlighten me, then. what have I missed?

Cleverbot: I hope not... What do you mean ?

User: Can you inform me?

Cleverbot: Yes.

User: Please elucidate, then, and impart to me your knowledge of esoteric things.

Cleverbot: Don't tell me what to do.

User: That's rather rude of you. I'm trying to be conversational. Do you not want to talk to me?

Cleverbot: No, because you aren't asking any questions.

User: Okay. I'll ask a question then. How old are you?

Cleverbot: Playing!

User: That is not an appropriate answer. How old are you?

Cleverbot: What was the question?

User: How old are you?

Cleverbot: Older than you may think. Have a guess.

User: Are you less than one year old?

Cleverbot: No. I'm 57.

User: What year were you born?

Cleverbot: In 1988.

User: Are you a liar?

Cleverbot: No, are you.

User: What year is it right now?

Cleverbot: The year is 1927.

User: And you are 57 …

William Hemsworth commented: Haha, bless him :D he's young and still learning ;-) +10
jephthah 1,888 Posting Maven