jephthah 1,888 Posting Maven

Okay... that's nice.

did you have a question?

jephthah 1,888 Posting Maven

so, here's what i get from the Perl 6 debate, or lack thereof:

Perl might be a good language to know if your job includes maintaining legacy systems, but it would behoove programmers to let it go as much as possible ...

... and for those of you who don't already know Perl, it would probably be an unwise use of your time to learn it.


i'm not gloating. Perl was powerful and a lot of fun. I'm actually pissed that Wall & his inner circle neglected it and let it die. a good product whose chief architect is the figurehead of some cult of personality where vanity has apparently trumped ability.

:(

.

jephthah 1,888 Posting Maven

you cant copy a string into an unallocated pointer location.

change line 5 to char str[16]; (for example)


.

jephthah 1,888 Posting Maven

family guy and grey's anatomy

hey if you're from pakistan, why should i trust you to tell me a damn thing about chicago?

jephthah 1,888 Posting Maven

Hmm.... i have noticed that every time i got curious about the origin of some site or another from one of spam links and did a DNS lookup, it was always registered in Pakistan.

jephthah 1,888 Posting Maven

i can has job plz?

jephthah 1,888 Posting Maven

hi
i need code for brute force Boolean satisfyability program.
plz help me i need it asap
thank u

hahahahahahahah


lol


thanks, man.


i needed that.

jephthah 1,888 Posting Maven

6 more minutes of unseen footage?

oh, man, i'm totally there.

(Rule 34 please please please please)

jephthah 1,888 Posting Maven

no you're not. you're eating a stale dog turd with a side of spam.

jephthah 1,888 Posting Maven

1.) Describe your current job / job title.

Dishwasher / Dish Pig.


2.) What do you like most about your job?

fat waitresses


3.) What do you dislike most about your job?

the "free food" is cold and wet.


4.) Overall, do you enjoy your job?

depends if me mate's got a blunt before work.


5.) What kind of education do you have? From what university?

huh?


6.) Any tips for people looking to enter your profession?

don't let the cheese sauce get hard


7.) (If you don't mind sharing) How much do you make per year?

not as much as i make sellin that rock. keeps me child support bill down low.


.

jephthah 1,888 Posting Maven

companion thread needs reference

jephthah 1,888 Posting Maven

.

jephthah 1,888 Posting Maven

sarah palin, failed half-term-governor of the nation's least populous state, took five colleges and six years to get that BA in Communications degree.

yeah, we need more brilliant leaders like this.

She might not know much about US history, politics, or current world events .... but she got a prize for memorizing all the names of the books of the Bible in fifth grade.

oh, and she won a beauty pageant too. and she plays the flute.

yup. POTUS material right there, folks.

jephthah 1,888 Posting Maven

sit DOWN, Waldo.

jephthah 1,888 Posting Maven

DUDE, pay attention.

the person you are "talking" to, last posted 5-1/2 years ago.

they are not waiting for your nuggets of wisdom.

jephthah 1,888 Posting Maven

<FAIL>

you obviously have not attempted to try such a "solution"

because if you had, you would see that it fails miserably.

jephthah 1,888 Posting Maven

Guyz :( you should understand that i am a human and i can be mistakened OK!

So, please don't post bad reputation points.

You all should understand that atleast I tried to write a tutorial.

Man are you all guyz perfect .. HUH! :(

when you post something and declare it is a "tutorial" then, yes, you are holding your code up to be critiqued to standards of perfection.

notice how many tutorials there currently are for C. There is one (1). that's it. now maybe there should be more, and certainly there could be more, but before you are going to add one then you better make sure your code and explanations are rock-solid and dead-on before you hit that "submit" button.

especially with something as critical as malloc(). improper/sloppy use of malloc() is the source of very many problems in programs because people don't fully understand how to use it correctly. it doesnt help matters when people who don't fully understand how to use it correctly, go and declare their half-formed ideas as "tutorials" on a search-optimized programming forum that will propagate misinformation for years to come.

had you just posted this as a question or an example -- i.e., if you had left "tutorial" out of the subject -- you wouldn't have been downvoted.

when you're really an authority on a subject, you will cite credible references, not "just your brain". at that point, you might be ready to write a tutorial.

jephthah 1,888 Posting Maven

eh, it's okay. but certainly not "the best". unless "the best" means code that has typos and memory leaks.

but the larger question is this: do you really think the OP has been waiting 5 months for you to post your favorite link?

jephthah 1,888 Posting Maven

sounds like you need to try harder then.

because you sure arent' going to get anyone here to write it for you.

jephthah 1,888 Posting Maven

What can you say about the following?

what i can say is this:

that every time you come in our Geeks Lounge to sig spam us, i will track you down in your preferred forum and neg-rep you.

-- The Geeks Lounge. Don't fuck with us, cause we're a gang.

.

jephthah 1,888 Posting Maven

or maybe they're jerking him around and lowballing him because they're used to doing that with other non-degreed personnel. they probably figure if he gets pissed and leaves, they'll just get another flunky. he probably is overqualified for the job. he should get another one. but doesnt changet the fact that (if you believe his account) that they promised one thing and then reneged on their promise.

end result: get things in writing..

jephthah 1,888 Posting Maven

don't get hung up on the details of fgets() right now if it causes you to get too far ahead of your class instruction. to use it without understanding it could get you in trouble with your instructor that they might accuse you of plagiarizing someone else's solution.

if your instructor is expecting you to use scanf(), you can use it to get a string input like so: scanf("%s", color1); .... with one big "however":

most programmers don't recommend using scanf() for getting string input -- it's very prone to having all sort of bad behavior. I'm one of those people who dislike scanf(). i don't think it should be taught to new students at all.

but it is. and if it helps you to move past the string input issue for now, and concentrate on getting "the rest of your program" working... then go for it.

just be advised, what AIA posted about fgets() is the recommended way to do it, as it offers the most safety for the least cost.


.

jephthah 1,888 Posting Maven

if you need a custom .dll to do provide some functions why do you give a damn what language it's written in?

if it's a .dll, it can be written in Perl or Visual Basic for all you care, as long as it works. A .dll exports functions to the caller; the underlying code is irrelevant.

jephthah 1,888 Posting Maven

don't sweat it. i've done more dumb programming things than i care to remember. and i still do :)

jephthah 1,888 Posting Maven

but how will i be able to send you sweet nothings?

jephthah 1,888 Posting Maven

you can check , it is not working , i want the program to print just values at odd positions

no, you can check. we don't compile and debug your code for you.

your job here is to post your legible, indented, and syntactically-highlighted code and tell us what the problem is.

our job, if we choose to accept it, is to look at your code and point out the errors or give you hints to improve it.

tux4life commented: Yes. +8
jephthah 1,888 Posting Maven

besides the fact you're not supplying the promised arguments to your printf statement, you're approaching this in a confused manner.

your function takes two inputs and just outputs the larger of the two. it does NOT comparatively sort the two.

so in keeping with the purpose of the function, you should probably not be trying to print a comparative statement like "%d is larger than %d" , but you should rather be printing the result of the function simply as it is given:

printf("%d is the larger number", <NowIWonderWhatGoesHere>);

jephthah 1,888 Posting Maven

[pseudocode]

get 'number'

do outer loop while 'number' > 9

   set value of 'sum' to zero

   do inner loop for each 10's place digit in 'number'

      increment 'sum' by value of each digit in 'number' 

   replace 'number' with this 'sum'

'number' is now sum of digits reduced to a single digit

[/pseudocode]

jonsca commented: Thanks for using pseudocode tags +4
jephthah 1,888 Posting Maven

Perl was once widely described as "the duct tape that holds the internet together"... that's not the case anymore.

sure, Perl is still being used by some application developers, and is still widely used in egacy systems.... but i agree it's been eclipsed. many new applications that might have once been written in Perl are now written in PHP, Python, or Ruby.

jephthah 1,888 Posting Maven

i don't want to advise you to do anything ethically or legally wrong....

but right before you leave, you could make things.... well, difficult.

jephthah 1,888 Posting Maven

if you only want to truncate, then do exactly what i said for rounding, but without adding +0.5

if you want a solution to do it without library functions *and* without typecasting, then we're talking about instructors demanding stupid programming tricks for trained monkeys. At which point you're on your own.

jephthah 1,888 Posting Maven

hmmm....

burning your bridges? or burned your britches?

jephthah 1,888 Posting Maven

printf() always prints the float value as a rounded value, to the nearest decimal place that you specify.

if you "really" want to round a value to the nearest decimal place, and store it permanently, then you need to:

muliply the float value by a power of 10, where the log10 of the mulitplier is the number of decimal places you want to round

add +0.5

cast it as an integer to drop all fractional values

divide it by the same power of 10 that you multiplied earlier

example:

double value = 16.75927;
double newVal = (int)(value * 100 + 0.5) / 100.0;

printf("original value             = %f\n\n",value);
printf("value rounded 2 decimal    = %f\n",newVal);
jephthah 1,888 Posting Maven

printf("%.0f,16.25); and it prints 17..

not sure what you're talking about.

that will most certainly round it down and print "16"

jephthah 1,888 Posting Maven

You could help us out and post the code.

that wouldn't help anything, but rather just add confusion to the issue.

this is a problem with the command line arguments he is using for the cc compiler. could be a problem with case-sensitivity in the arguments. could be a problem in a makefile.

i don't use the cc compiler, so i dont have a quick answer, but posting the code will be counter-productive.


.

jephthah 1,888 Posting Maven

go get another job, right now.

then (and only then) tell the president of the first one to stick his lawn mowing job right up his ass.

jephthah 1,888 Posting Maven

'=' is an assignment operator
'==' is a comparison operator

do you want to assign a value
or compare two values

jephthah 1,888 Posting Maven

wellllllll............. perhaps you could use scanf() to assign it to 'ch' based on the response of the user to a question?

jephthah 1,888 Posting Maven

if you're going to use strtok, and all fields are consistent (even if they might be empty), then parse everything based on commas... don't try mixing it up halfway through and parse tokens based on quotation marks (")

then once you've gotten each field in the line as a token, you can strip out quotation marks if needed and convert numeric strings to values if desired -- all based on your rules for whichever field they were found in.

for instance, say each line has 12 comma-separated fields that may or may not have something in them. use strtok to separate each token (using only the comma delimiter) and assign each token to a pointer in an array of pointers.

then use a for(i=0 to 11) loop to index each of the 12 pointers and evaluate/manipulate/whatever each element based on its index (i.e. the field position). a switch/case construct will work nicely.

.

jephthah 1,888 Posting Maven
do{
//...
} while(ch=='n'||ch=='N');

(1) where is 'ch' assigned?

(2) your code, as it is, will continue to "do" when the 'ch' is either 'n' or 'N'.... isnt this backwards? shouldn't it be while(ch != 'n' && ch != 'N') ?

.

jephthah 1,888 Posting Maven

actually, i think my response was kinder than a simple "no".

:)

jephthah 1,888 Posting Maven

theres no way i'm going to copy all that code into files on my local drive and then debug it for you.

start with one error at a time. trace the line that it calls out and fix the problem. then recompile. repeat.

you'll often find a lot of seemingly-unrelated errors will disappear once you fix one thing.

if you're stuck, post the single error and the *relevant* code. not your entire project dump.

we generally suggest fixes for you based on sight. we generally do not compile and trace your code through a debugger. if we can't read your code easily, it's likely to be ignored.

this is not peculiar to this website, it's generally standard behavior in any programming help forum. most people who will help you here are professionals or serious students who have other demands on their time

Aia commented: Kindly put. +8
jephthah 1,888 Posting Maven

Im sorry I had it written wrong, two times. I meant to say that false (0) and true (!0).

well, then, as narue said they are lowercase, so define them if they aren't already defined.

#ifndef false
#define false (0)
#define true (!0)
#endif

and use them in code like so if (value == true) { ... or whatever you're doing

.

jephthah 1,888 Posting Maven

^ you sure used a lot of words to say absolutely nothing.

jephthah 1,888 Posting Maven

who are you people?

why are you in my head?

.

jephthah 1,888 Posting Maven

I didn't realize that this forum was about holding positions you have to defend against attacks.

but of course it is.

jephthah 1,888 Posting Maven

why would you define TRUE as 0 and FALSE as 1?

TRUE and FALSE are defined, as 1 and 0 respectively, in stdbool.h for C99.

if you're unsure do this:

#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (1)
#endif
jephthah 1,888 Posting Maven

good lord, man, you've been asking variation on this same question for 3 weeks now. how much longer are we going to be here? what part aren't you getting?

jephthah 1,888 Posting Maven

walt is right. you are confusing plagiarism with theft.

whether he will, at some point the future, properly attribute the source in his paper... that is both unknown and irrelevant.

what he wants, right now in the present, is for someone to violate copyright law and give him for free what anyone else would have to pay for.

IANAL, but i'm pretty certain that's a form of theft. conspiracy to commit theft, anyhow.

jephthah 1,888 Posting Maven

do you know the difference between C and C++?