jephthah 1,888 Posting Maven

I will pray for you.

hey pray for me too.

i got a whole list of stuff i'd like to get by June.

thanks

MosaicFuneral commented: New fly-whisk for the monks? +4
jephthah 1,888 Posting Maven

use the additive property:

(a * m) + (a * n) = a * (m + n)

example:

result = (a << 2) + (a << 4);  
// result now contains the sum,  4a + 16a = 20a

cout << a << " times 20 = " << result << endl;

.

Dave Sinkula commented: http://en.wikipedia.org/wiki/Distributive +19
jephthah 1,888 Posting Maven

I am confused. First you say you want to write the program. Then you say you want somebody to send the code for such a program to you.

those were two different people.

but as to that second guy, welcome to Daniweb. it's pretty much the reason why the long-term users here are often cynical and jaded towards noobs.

jephthah 1,888 Posting Maven

Or do you know the 'ultimate' way?

i know the ultimate way

#include<jephthah.h>

newStr_ptr = removeSpacesAndCondense(myString);

it's non-standard and not very portable, but hey, it works on my machine.

tux4life commented: ROFL :P +7
William Hemsworth commented: :D +10
jephthah 1,888 Posting Maven

We are not here to argue...
We are here, as a member, to help those who have
problems...

speak for yourself.

i'm here for the smackdown.

jephthah 1,888 Posting Maven

what's this non-standard conio.h and clrscr() crap?

why do you refuse to use code tags?

i dont know if your program works in any meaningful way, because it won't even compile

get this weak stuff out of here.

William Hemsworth commented: *clap clap* +10
jephthah 1,888 Posting Maven

suppose there were another planet similar to earth in composition, temperature, and atmosphere.

(and given the bazillions of stars in the universe, the probability is quite high that, somewhere, there must be)

so, considering another earth-like planet with H2O, carbon, and oxygen... over a couple billion years ... what kind of life would evolve? why wouldn't it make sense that many of the life forms that would result, would be similiar to life forms that either once existed on earth in the past, or currently exist on earth today?

you know, mammal-like creatures like cows or mastadons. or reptile-like creatures like dinosaurs or crocodiles. or at least, your basic fish variants and plant life.

and the things that were different, they wouldn't necessarily be radically different from creatures that could conceivably be found on earth. like a pig-dog. or a lizard-bird. or something.

just a thought.

GrimJack commented: Thank you for the topic! What a great way try and see the univers +9
jephthah 1,888 Posting Maven

either a sloppy abbreviation for "numbers" (abbr. "no.")

or he's looking for the LCM and GCF of two noses.

on further review, i prefer the latter.

Salem commented: Well it certainly "smells" like homework, so noses seems a likely bet ;) +30
jephthah 1,888 Posting Maven

it just.

doesn't.

stop.

William Hemsworth commented: Haha :D +9
jephthah 1,888 Posting Maven

or if you use FF and ABP, you dont ever have to worry about any site ads, anywhere, ever.

JugglerDrummer commented: That was sooo helpful! that extension is amazing!! +1
jephthah 1,888 Posting Maven

maybe its a problem with ESL but i dont know WTF the OP is saying.

scru commented: I can never quite figure it out myself either +6
jephthah 1,888 Posting Maven

humanity will be reduced to scavaging and cannibalism. roving bands of blood cults will enslave others as catamites. women will be subjected to birthing babies as a food source.

jephthah 1,888 Posting Maven

PROBLEM:

noobs are continually posting mountains of unhighlighted code, and its just nearly impossible to read such messes without highlighting... i dont even want to try, it hurts my head.

making this worse is the people who need the most help are the same people who are the worst offenders. often times, their errors are something simple syntax or typo error, and could easily be spotted if we could just read it.

It's bad enough getting them to use [code] tags in the first place. But I cant keep bitching at new guys or gals because they dont know to use specific syntax highlighting.


SOLUTION:

by default, unspecificed [code] tags will *always* use the syntax highlighting for whatever the particular forum happens to be. this will be backwards compatible, because all specific code syntax will continue work as normal. if there's not already an option, allow something like to just be plain vanilla text.

[B][U]EXAMPLE[/U][/B]

for the C code forum,

[noparse][code][/noparse] prints C-syntax highlighting [code=c] prints C-syntax highlighting [code=php] prints PHP highlighting [code=plain] prints plain text (no highlighting)

whereas for the PHP forum

[noparse][code][/noparse] prints PHP-syntax highlighting [code=c] prints C-syntax highlighting [code=php] prints PHP highlighting [code=plain] prints plain text (no highlighting)

et cetera...

.[code=plain] to just be plain vanilla text.


EXAMPLE

for the C code forum,

[code] prints C-syntax highlighting
prints C-syntax highlighting [code=php] prints PHP highlighting [code=plain] prints plain text (no highlighting)

Nick Evan commented: You've got my vote! +16
tux4life commented: Mine also :) +3
jephthah 1,888 Posting Maven

any int variable is inherently an *integer* the value is not stored in any particular base .... hex or decimal or binary, it doesnt matter. the only difference is when you print it. printf("hex value %04X = decimal value %d\n",Dec, Dec); but also, what youre asking to do is to concatenate an upper byte to a lower byte. or you could also say you're adding a left-shifted value to another value.

you could do it like this: Dec = (TH1 << 8) + TL1; .

tux4life commented: Yep, an integer is an integer :) +4
jephthah 1,888 Posting Maven

I can't call the function multiple times bc in destroys my maze after one go I'm was trying to think of how to do it without compromising my maze.

all you have to do is store the original maze in memory and recall it each time with the new person's position.

you've been handed 90% of the solution and 99% of the difficulty. all you need to do now is construct a for or while loop to implement it several times.

iamthwee commented: *yup* +19
jephthah 1,888 Posting Maven

why would you ever want to enable safe search? internet without noodz? maaaaan, that's about as fun as a box of ... er as fun as .... well look, that's just not any fun.

were you always picked to be hall monitor in school?

GrimJack commented: Heh,heh - love your sense of humor! +9
jephthah 1,888 Posting Maven

seemingly random

there's your problem: nothing is truly random. some things are just less predictable than others.

the fact is, you're never goign to generate truly random numbers, even if something like that existed. so be happy with the commercially available pseudo-random number generators, like the rest of the world.

if you're doing something that needs more than that, then you're working for the NSA and shouldnt be trolling Daniweb for your answers.

tux4life commented: You're absolutely right :) ! +3
jephthah 1,888 Posting Maven

tell me what is the entire point of the book?

tell me, what is the entire point of this thread?

besides being a means for some random internet guy to air out his creepy obsession for a female user, while simultaneously demonstrating that he doesn't know anything about programming.

because anyone that would either (a) take the 20-year-old Unix Hater's Handbook as being some sort of serious critique in favor of Windows, or (b) use it as evidence that C++ is a "horrible language" .... that person is a gotdam fool.

John A commented: damn straight +20
jephthah 1,888 Posting Maven

i figured how 2 solve q4 now but i tried 2 solve 1,2,3 i cant do anything .

bull crap.

you did not just spontaneously "figure out" how to write the code for Q4, and yet still remain completely helpless to even begin Q1 - Q3. because Q4 combines all the elements of programming that you would need to know for Q1 - Q3

what happened is, someone gave you the answer for Q4, or you found it on another site, and now you're still waiting for someone here to give you the rest of the answers.

until you show some of your work so far -- and ask a meaningful question -- you're just going to be ignored.


.

Salem commented: Damn straight. +29
jephthah 1,888 Posting Maven

LOL WUT? is this a love letter to Narue?

well... damn. I just don't know what else to say.


.

Aia commented: In the cows' word, bullshit is not a swearing word, but a mickey mouse thing is known regardless of who you are. +15
John A commented: LOLWTF +20
jephthah 1,888 Posting Maven

wait, what?

its been three days ... why haven't you guys finished helping this kid write his spyware program, yet?

who do i give neg rep to?

Salem commented: Anyone you like, I keep running up my daily limit, but it does no good. Reporting the thread didn't work either. Suckssssssss +29
jephthah 1,888 Posting Maven

i get no love :(

William Hemsworth commented: Awwh *hug* +8
jephthah 1,888 Posting Maven

well, then maybe one of you Win32 API gurus can post something remotely resembling an answer to the OP's question??

jephthah 1,888 Posting Maven

W00T!!!!1

i got my star!!!!

now i can finally go to bed.

:P

jephthah 1,888 Posting Maven

const means the program can not modify the value volatile means the value may be arbitrarily modified outside the program.

the two are separate and not mutually exclusive.

use them together, for instance, in the case of reading a hardware status register. const prevents the value from being stomped on, while volatile tells the compiler that this value can be changed at any time external to the program.

this const volatile <type> <variablename> will thus satisfy both requirements and prevent an optimizing compiler from incorrectly optimizing the code, that it would do if only "const" were used.

Dave Sinkula commented: I sometimes like to add something like, "interpret 'const' as 'read-only'." But you've got all bases covered here already. +18
jephthah 1,888 Posting Maven

... someone else's account?

there's some new guy who signed up last week, using a Calvin avatar.

i want him taken out.

John A commented: Troll in his threads until he gets angry and leaves. +19
jephthah 1,888 Posting Maven

hi everyone.. i have to build a satellite navigation and control system in any language.. i have no clues on how to begin this.. can anyone plz send me an algorithm on controlling liquid propellant boosters using neural networks?? thanks

Sky Diploma commented: LOL +3
jephthah 1,888 Posting Maven

on further review, I believe I have falsely accused Trav580 of being the culprit.

i see now, that multiple posts have been copied, not just TRAV's, and that they all the posts seem to appear on the other site, about 30-60 minutes after they are posted on here.

TRAV580, I'm sorry for jumping to accuse you.

some of the surface details seemed coincidental, but now I see that you were just bringing this to Daniweb's attention.

GrimJack commented: Way to go Jeph! +9
jephthah 1,888 Posting Maven

ahah. he doesn't know C at all and barely knows C++, and yet he just performed the impossible -- with proof! call the ACM journals! prepare the honorary PhDs!

seriously though, where DO these people come from?

tux4life commented: This makes me laugh, good post ! +2
jephthah 1,888 Posting Maven

oh, are those questions?

or demands?

or merely the instructor's notes to the students on how to fill in the framework of this assignment that was provided to them?

Salem commented: Door number 3 please Bob - It's a winner! +29
jephthah 1,888 Posting Maven

do you have a reading/comprehension disability or something? i'm not saying your code is wrong. i have no idea if its wrong or right because I cant read the garbled formatting that includes 3 lines of junk for every line of code.

and have neither the time nor inclination to reformat your convoluted mess.. if you cant be coherent, then dont bother

jephthah 1,888 Posting Maven

i'm sorry, what the hell do i what?

i don't know, i was just reading what you wrote.

You probably don't need lots of IR sensors.

Colin Mac commented: youre the one picking the fight dickhead +3
jephthah 1,888 Posting Maven

ahh. i feel better already :)

Nick Evan commented: This thread made me laugh :) +16
jephthah 1,888 Posting Maven

you know how some threads seem like a good idea late at night

... then later on in the light of day, they just seem kind of fail?

do ya?

or are you just smiling and nodding?

Dave Sinkula commented: /me smiles and nods. +18
jephthah 1,888 Posting Maven

i would, but i have to go wash my dog.

Salem commented: LOL +0
jephthah 1,888 Posting Maven

It doesn't seem like a topic of opinion though

well, apparently this one is.

hey, that reminds me, which is better: big endian or little endian? i seem to have forgotten...

John A commented: Big Endian. +18
jephthah 1,888 Posting Maven

as omnivores, humans are adapted to eating both meat and vegetables. our digestive track has enzymes evolved specifically for breaking down animal fat and protiens.

that said, we don't have to eat meat. so if you don't, good for you. but without a doubt it is more difficult and expensive to maintain a healthy diet that is lacking in animal protein.

in short, to each their own. if you don't want to eat animal meat, then don't. but I do, so if you don't like that.... too bad.

jephthah 1,888 Posting Maven

hmm. i thought my post was calm and to the point. the inappropriate use of and reliance on globals is a habit that is reinforced by laziness and/or a 'get-r-dun' attitude.

i understand your position: you think that at this point it's not worth the time to undo what he's already done. presumably, he'll learn to not learn globals some future point.

but what i'm saying is that I think it IS worth the time, right now -- otherwise, the time never gets taken. and the habit steadily becomes more firmly entrenched.

i'm just expressing my opinion based on my experience. i wasnt attacking you; don't take everything so personal.


.

Salem commented: "Who has time? But then if we never *take* time, how can we have time?" - Merovingian +29
jephthah 1,888 Posting Maven

And you can write a termios.h solution that will be broken on every non-POSIX system. What's your point?

that my indignant self-righteousness only flows in one direction: from GNU/GPL and against MSFT.

it ain't right, but i can still sleep most nights.

Aia commented: Hahaha! +14
jephthah 1,888 Posting Maven

sorry, folks, i didn't mean to come off sounding like such a dick.

truth is: i still have issues, and i'm exceedingly frustrated by this subject

especially by the paradoxical fact that i live in the most technologically-advanced country, which seems to be always on the verge of being taken over by a bunch of superstitions chicken bone shakers.

it probably didnt help that i grew up and spent a large part of my adult life in the U.S. South. or that I've got a bunch of fundamentalist anti-intellectuals in my family.

:(

ddanbe commented: superstitious chicken bone shackers, could be the title of the next great song! +4
jephthah 1,888 Posting Maven

yeah, i know.... this account came free with a lvl 70 orc mage i bought on EBay.

:(

Ezzaral commented: You win this thread. +19
Nick Evan commented: Best reply ever. +15
jephthah 1,888 Posting Maven

my point is that STRSTR function will do what the OP wants

i thought it would be readily apparent to anyone who takes a moment to look it up. sorry, if i don't type out a fully commented and validated solution.

Essentially the solution is this:

get one line at a time with FGETS, then use STRSTR to see if a certain string (such as the particular "id_no") is found within the line. if not, then read the next line. if it is, well, there's your line.

i'll leave typing out the code as an exercise for the reader.

Aia commented: I am stupendous man and I approve of this message. ;) +9
jephthah 1,888 Posting Maven

i see nothing much has changed since ive been gone.

Salem commented: In a world of change, it's nice to have constants :) +20
jephthah 1,888 Posting Maven

This isn't the place for "can you tell me about some feature of C". This is *not* a lecture hall, and we don't have the time to be unpaid tutors.

You have to remember, there are a *lot* of students who post here.

Post your code, and tell us your problem with it - we'll try to help. That's what we do, and that's about all that we have the time to do.

I'm sure you can google just about any subject or question to find tutorial material on the features of C.

damn, dude. lighten up already. this place isnt for you to vent your frustrations on some hapless student for asking legitimate questions. Yeah, perhaps he framed his question a little oddly (it did seem like he wanted code) but there is nothing wrong with asking questions on how C functions work.

because that's the purpose of this place: for students (and professionals) to ask C programming questions. Now if you dont have time to answer these questions, that's your business. don't answer them, okay?

but maybe you should spend more than a month here before you decide who this place is and isn't for.

.

Ancient Dragon commented: nicly put :) +34
jephthah 1,888 Posting Maven

When you declare a "char" array as char *abc="alpha" , the string is not editable i.e. readonly, You need to declare it as char abc[]="alpha"; , if you wish to edit by using the abc[index]=''; method,

Why this difference exists however I am not aware of !!

well, y'see... hmmm... okay, i guess i don't really know WTF you're talking about

because to declare an array of chars as either char * myString or a char myString[] is the same effect. in either case, "myString" is a pointer to the address containing the first character of that array of chars.


.

ssharish2005 commented: Well said!! - ssharish +2
jephthah 1,888 Posting Maven

I'd suggest to you that STRTOK might not be the best choice here. because the delimiters in STRTOK are treated equally. STRTOK takes a string and divides it up into any number of equivalent "tokens" based on the blind application of one or more "delimiters" that are used to mark the boundaries of the tokens.

For your problem, you want to differentiate between opening bracket < and closing bracket >, so you can treat the text found within the brackets differently than the text found without.

So I would instead use a couple of char * pointers to keep track of relative positions within the search string, in conjunction with STRSTR to find the next bracket location, along with a variable that keeps track of whether you are "inside" a tag (because the last bracket found was '<') or "outside" a tag (because the last bracket found was '>')


.

jephthah 1,888 Posting Maven

i wish threads that have had no activity for 90 days or more, would be automatically locked.

Aia commented: I vote for that. +8
jephthah 1,888 Posting Maven

lets stare deeply into each others eyes for long moonlit walks on the beach!

MM PJM ND NS HWP ISO BI or G C or LDS BBW LD LS OK DDF a plus GSOH and SI for FTA send photo YMMV RTFM PEBCAK OMG LOL TTYL


.

twomers commented: NaCl H2O... you're just making chemical symbols and you know it! +6
jephthah 1,888 Posting Maven

im kind of a moderate, so i guess i dress down the center.

scru commented: ... +3
jephthah 1,888 Posting Maven

I'd like to state for the record, that I agree with Ed, Nick, Dragon, and Jishnu the Second.


.

Nick Evan commented: Nice to know that you sometimes actually agree with someone ;) +6