jephthah 1,888 Posting Maven

aww.... now that's just precious: you think armies are for "helping people".

Well, I'm sorry to have to be the one to inform you, but the army, in whatever country, has the primary purpose of breaking shit and killing people. I'm afraid you're going to be in for a rude awakening. if you want to "help people," join the Peace Corps.

anyhow, as far as Buddhism goes, i think Lin Ji got it right:

If you meet Buddha on the road, kill him

.

scru commented: Now now, behave. -1
jephthah 1,888 Posting Maven

s'cool. thanks :)

jephthah 1,888 Posting Maven

okay, so i wasn't really trying to talk about advanced civilisations or human-like intelligent creatures, or any sort of SETI contact.

just merely in a general sense, why wouldn't life on an "earth-like" planet naturally evolve into creatures more or less "similar to" the life forms that have evolved here?

i vaguely understand the complexities of DNA, but there are so many potential combinations that just wouldnt work out on earth for a variety of reasons, evolution would guide the developing forms (in most part) to be suited for life on land or in water.

and yes i know that there are some bizarre lifeforms around oceanic vents sucking up sulfuric acid and whatnot, but we can just ignore the outliers -- like balloony-floating energy packets, or vibrating silicon crystals, or even giant fungi living under minnesota -- and think about the vast majority of land and ocean dwelling creatures.

because if the atmosphere was ~20% oxygen, and the surface contained 70% water with an average temperature around 20C give or take... then creatures that thrive on oxygen would exist, and most likely wander around the land masses drinking water and either laying eggs or weaning pups or whatever.

i still imagine that it wouldnt be all that radically different from what we have on earth. perhaps they would have "relatively" different thing, like maybe "manbearpigs" or "snuffaluffaguses" or bizarre flying insect/reptile combinations with skill saw blades on their heads maybe... but in a zoological …

jephthah 1,888 Posting Maven

no, i dont want a length of some arbitrary string, that may or may not be null-terminated

Narue was right: i wanted the size of the entire array.

jephthah 1,888 Posting Maven

er. i was hoping that wasnt the only answer.

oh, well, it's not a big deal. i just thoguht there was some clever trick that i had forgotten.

jephthah 1,888 Posting Maven

im going to risk getting a beating, because this is something i should (used to?) know...

anyhoo, given a function, how do you tell the size of the array that is passed? obviously trying to find the sizeof the pointer doesn't work (it returns the size of the pointer, duh)

but im having a brainfart trying to remember how to find the size of the passed array...

void myFunction (char * myString) 
{
    size_t len = sizeof(myString) 
    // gives size of pointer, not string

}

assume the string being pointed to is properly declared and of a significant length.

.

jephthah 1,888 Posting Maven

ORG (or sometimes, ".ORG" ) is an assembler directive.

assembler directives do not get translated into an instruction.

directives tell assembler *how* to assemble the source code into machine code. ORG sets the memory address at which the next instruction will be stored.

jephthah 1,888 Posting Maven

:P

jephthah 1,888 Posting Maven

ORG declares the starting address where the code will be located in memory.

jephthah 1,888 Posting Maven

hmmm. well, the OP is perfect example of why engineers don't make good biology students.

jephthah 1,888 Posting Maven

Is it mandatory to make fun of his religion

eh, lighten up. i make fun of every religion. christianity and scientology and mormons are my favorites to mock.

i like buddhism, personally, but that doesnt mean their particular brand of superstitions gets a free pass

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

um, you sure have some sort of romantic notion of the military "showing everything to make stronger"

having been in the military, i don't really understand what that's about. I'm afraid you're going to find that doing a bunch of push ups and sit ups is not really all that extraordinary :icon_rolleyes:

i mean, unless you're going into special forces, and learn how to rip a mans throat out with your bare hands, while living in the jungle surviving on a diet of worms and bugs.

hey wait a minute... aren't you the buddhist monk who gets all teary-eyed when someone talks about eating steak?

nav33n commented: Buddhist monk ? I don't think so. -2
William Hemsworth commented: Couldn't help but find it funny :P +10
jephthah 1,888 Posting Maven

but BASIC is just glorified pseudocode, isn't it? :P

jephthah 1,888 Posting Maven

hmm... you're serious aren't you?

okay, no: there is no "simple c code" for developing a binary phase shift key modem.

if there were, then people wouldn't get paid salary to develop solutions to relatively complex engineering projects.

jephthah 1,888 Posting Maven

did you try this?

jephthah 1,888 Posting Maven

maybe i'm missing something, but UDP doesn't care what IP address is in the pseudo-header. it's a multicast protocol. anyone on the network can see and process the datagrams if they desire to do so.

jephthah 1,888 Posting Maven

most of my experience is in manufacturing. i second AD's comment about being the "most interesting". we get to write programs that directly control hardware and physical equipment such as automation and robotics.... sometimes very heavy duty stuff like cranes and motor drives, sometimes very precise measurement and assembly equipment.

i am quite sure that working somewhere purely data/number crunching like a bank would bore the living crap out of me.

game programming might be fun for a moment, but even then i really think i would miss the hardware/equipment interfacing.

.

jephthah 1,888 Posting Maven

perl is (or at least was) a very good language to know. some people would say that it's a dying language and is being replaced by Python. one of those two would be worth your time.

i'd say to hell with PHP, though. everyone and their brother knows PHP. anyone can build a webpage. you can learn it online if you need to so dont waste your time on it while in school.

at least a basic understanding of networking (TCP/IP) is necessary.

jephthah 1,888 Posting Maven

what about marriages in Belgium, Canada, Netherlands, Norway, South Africa, Spain, Sweden, Aruba, Antilles, Israel, and the U.S. states of Iowa, Massachusetts, Connecticut, Maine, Vermont, and New York?

I believe your algorithm fails.


.

jephthah 1,888 Posting Maven

oh dear... i've made a fatal mistake. the number of permutations is not "26*26", but is actually "26!"

which is a ridiculously huge number.

my apologies to NeoKyrgyz.. i think he is more capable than I am to speak on this subject.

and maybe if i shut up for a moment, i might learn something.

jephthah 1,888 Posting Maven

glad to hear it... seriously tho, consider removing 'scanf()' from your bag of tricks. that's generally a bad function to use.

'fgets()' is much, much better.

jephthah 1,888 Posting Maven

I saw the trailer for it at the theaters a couple months ago, looks like a piece of crap.

my wife thought the trailer looked pretty uninteresting too, and she enjoyed the movie immensely.

by any standard, this movie is a huge success with movie critics around the globe.

mainly because it's well-acted, with a solid plot, great effects that don't overwhelm, and is completely accessible to even non-fans.

and the last part may explain why the only people who seem to dislike it are the most obsessive Star Trek fanatics, the so-called "Trekkies" who like to dress up and go to geek conventions.

jephthah 1,888 Posting Maven

of course its solvable.

it's a trivial matter to "brute force" 676 total permutations, and only slightly more complicated to do a few dictionary matches on each potential solution.

anyhow, if it's as you say "not solvable" the why the hell bother to suggest using Knuth-Morris-Pratt algorithm ... an algorithm which is completely inappropriate to the problem, in the first place?

.

jephthah 1,888 Posting Maven

you havent given much for us to go on here, as far as trying to help you debug your code.

i suspect you need to review the fundamentals of socket programming.

review Beej's Guide, review your code, and try again.

jephthah 1,888 Posting Maven

holy ESL, Batman. :icon_rolleyes:

seriously, though... this is like some sort of advanced undergrad or first-year grad school project. if you've made it this far to be assigned this sort of problem, you damn sure better be prepared and able to do the majority of the work yourself.

post some meaningful, compilable code along with a close-ended question if you expect any assistance.


.

jephthah 1,888 Posting Maven

well, i took my kid to see Star Wars III: Revenge of the Sith, when he was 6 months old. he seemed to do alright. he's been watching Bruce Willis movies since age 2.

i like to think i'm giving him a well-rounded cultural education.

jephthah 1,888 Posting Maven

EDIT: never mind, this has been moved to a new thread.

.

jephthah 1,888 Posting Maven

sorry, it doesn't work like that here.... espeically considering you're using a non-standard library.

you're going to have to post your code so we can replicate your failure, then maybe someone can diagnose why you're having a fault.

jephthah 1,888 Posting Maven

rocked.

but, as a relatively-new parent, i realize they give these movies a PG-13 rating for a reason.... the reason being that it's not really appropriate viewing material for four-year-olds.

oh, well, he shouldn't suffer permanent scars.

much.

jephthah 1,888 Posting Maven

... are you stalking me?

:eek:

jephthah 1,888 Posting Maven

your first problem is that you're not getting the values entered by the user. this is becasue you're using the horrible function 'scanf()'

you could try to implement scanf in this manner:

printf( "Complex 1: Please enter two floating point values: " );
  scanf( "%lf %lf", &r, &i);
  printf(" you entered: %f and %f\n",r,i);

or, better yet, you would use 'fgets()' in conjunction with 'sprintf()' to perform some minimal error checkign on the input.

jephthah 1,888 Posting Maven

there are 26*26=676 permutations. that's easy to "brute force" the trickier part will be getting the computer to recognize when the solution has been found.

a possible intermediate stage to this program could be to allow the user to choose which letters are substituted, updating the output each time. this would not be so much of a "solver" as more of a "helper" program to allow a user the ability to quickly find solutions by examining which substitutions work and which don't

the whole theory of how to solve these "cryptoquotes" is to start with the small words, 1 and 2 and 3 letter words such as "A", "I", "IF", "OF", "OR", "AND", "THE"... then the larger words start to fall into place.

jephthah 1,888 Posting Maven

so if i got an infraction from Narue, do i get to claim my academic pedigree back to Dani?

jephthah 1,888 Posting Maven

this thread is relevant to my interests

jephthah 1,888 Posting Maven

oh, that.... i guess i forgot about this particular epic battle :P

well i was just emphasizing the fact that it's a null character, ant that he needs to terminate the string

but okay. i concede the point. because several libraries define capital NULL, i should be more precise, and refer to the terminating character as '\0'

.

jephthah 1,888 Posting Maven

can you possibly be more vague?

jephthah 1,888 Posting Maven

theres no way to tell whats going on by the sparse amount of code you've posted.

the problem, i'll wager, is likely in your "load complex" function, whatever that is...

jephthah 1,888 Posting Maven

I'm glad it worked for you. I'm even more glad you worked it out on your own. that's the best way to learn.

you'll figure out the "glitches" and "best practices" in time. I still am, myself.

jephthah 1,888 Posting Maven

um... i'm not sure get it. is this some kind of semantic trickery? are we fixating on my use of capital letters or something?

because C-strings are most certainly terminated by null characters. and if it's not done by a standard library, then WE will be responsible for terminating it ourselves.

http://en.wikipedia.org/wiki/Null_character

jephthah 1,888 Posting Maven

i think strchr is what you're looking for

it will point to the character in question. everything up to that character can be assumed* to be the characters of the first number, everything after can be assumed* to be the characters of the second number.

atol or strtol will accept the first one or more numeric characters and ignore non-numerics following thereafter.

*Definition: ass-u-me: the behavior often preceding an event where someone gets shot in the foot.

jephthah 1,888 Posting Maven

the fact that it doesnt terminate the string with a NULL is the error.

a string must have a NULL termination, or else it's just a character array.

jephthah 1,888 Posting Maven

the prototype for itoa is: char * itoa ( int value, char * str, int base ); but it's really a bad function to use as it's not portable.

use sprintf, instead: sprintf(buf,"%d",sum); another problem you may be having is, how is "buf" terminated? what do you expect is at the buf[3] position?

jephthah 1,888 Posting Maven

i'm sorry, but why would anyone WANT to use floats as a boolean type?

that's like taking the most basic thing in the world, and purposely making it complicated and unreliable.

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

use sockets.

Beej's Guide is probably one of the best general-purpose reference guides available.

jephthah 1,888 Posting Maven

yes.

yes you can.

jephthah 1,888 Posting Maven

i dont think any robot can have feelings or ego or identity ... is not aware of what it is doing and will never be.

yeah, what do you know anyhow? the human brain is just a soggy bag of electrochemical switches. voltage-gated ion channels, to be precise, a bio computer composed of hydrocarbons.

besides, don't you have someone to stalk or a stripper bar to go to? I'll take opinions on future trends in AI from someone with a little more credibility, if you dont mind.


.

jephthah 1,888 Posting Maven

The world will end in 2038 when the "real" millenium-bug hits.

eh, i doubt it's going to be a big deal. there might be a few more glitches than there were at the Y2K.... but truly mission critical stuff will be upgraded before this happens.

jephthah 1,888 Posting Maven

right after the strip club my english sounds like native.

what are you saying, you can order a beer and a lap dance just like a good ol' boy?

your reputation as "creepy internet stalker dude", just keeps getting more and more entrenched.

seriously. do you know what "creepy" means? do you know why everyone describes you this way? you should look up synonyms, too. it's not a good thing to be.

you want some advice? quit hanging around losers at strip clubs. go take an english class at a community college. quit acting like a creep. maybe you'll even find a girlfriend or something.


.