#robotics Logs

Sep 14 2012

#robotics Calendar


00:09 rue_house er
00:46 sherlock rue_house: int main(void) {
00:48 rue_house return 0;
00:48 rue_house }
00:48 sherlock nahh, EXIT_SUCCESS
00:49 sherlock too many people use 0 and 1 as exits codes and assume itl be cross platform
00:49 rue_house sily people
00:49 rue_house 0 is the only success
00:49 rue_house failures are many
00:50 sherlock in POSIX land, sure
00:50 rue_house I'm having a hard time finding new $1/buynow/free shipping items off ebay
00:50 rue_house running out of keywords
00:51 rue_house I like 0 success, 1+ as warnings, and -1 - as fatal errors
00:52 sherlock Idk, I do not usually need process exit codes other than fail and success
00:53 sherlock I think diff3 has 3 codes
00:53 sherlock for failed to merge, general error, and success
00:54 sherlock rue_house: I dont like 0 being success most of the time because then I need to write stupid statements like if(!dosomething()) { // success }
00:55 sherlock in general I mean
00:55 sherlock which ends up looking silly in code
00:55 rue_house hehe, yea
00:57 rue_house in my code I standardized all the reutrn types
00:58 rue_house typedef enum Status_e { OK = 0, ErrMalloc, Full, BadArg, CantOpen, BadData, EarlyEOF, Overflow, NoMatch, Forbidden, ExecFail, NotReady} Status_t;
00:58 sherlock yeah, enums are where it is at
00:58 rue_house in all my code, those are all the return types I have come up with
00:59 sherlock Do you need to specify that the first one is 0?
00:59 sherlock I usually do it for clarity
00:59 sherlock but I have never actually checked if its defined as 0
00:59 rue_house there are a few fn's I'v made that just return numbers, but the general policy is that EVERY function return Status_t and any numbers to be modified are passed in by pointer
01:00 rue_house default is first one to zero, but I specify it cause you can do if(!myfunction()) {
01:00 rue_house for sure
01:05 MrTrick rue_house: easiest way to deal with the cognitive dissonance of 0 success codes: "error = doSomething(); \n if (!error) { //success }"
01:06 rue_house I can also do if (myfunction() != OK) {
01:07 MrTrick yup
01:07 rue_house which is how I'm supposed to do it
01:14 rue_bed I
01:15 rue_bed v decided to use tiny26's so sequence the steppers
01:15 rue_bed I will pick over making a state machine for too long
10:42 Tom_itx http://www2.electronicproducts.com/Video_Robot_cheetah_outruns_Olympic_sprinter_Usain_Bolt-article-fajb_robot_cheetah_record_sep2012-html.aspx
20:04 ace4016 time to build a flying yacht kats: http://www.theflyingyacht.com/index.php/the-yachts/
20:11 katsmeow-afk i was mentioning flying boats to some one yesterday
20:13 ace4016 i wonder how efficient it is
20:14 katsmeow-afk theflyingyacht.com? horrible
20:14 rue_house I dont think I can maintain awakefullness
20:15 katsmeow-afk the wig speedboats? horrible too, but you can fly over barriers, not waste fuel going around them, so it averages out better
20:17 katsmeow-afk https://www.google.com/search?q=flying+boat&hl=en&client=firefox-a&hs=8PN&rls=org.mozilla:en-US:official&prmd=imvns&tbm=isch&tbo=u&source=univ&sa=X&ei=UdRTUNrMMI289gTmmIBA&ved=0CCsQsAQ&biw=958&bih=492&sei=VNRTUJnQFYnm8gSu1YCgAw
20:19 ace4016 well, i meant a flying boat in general using the same/similar concept
20:19 rue_house hydrofoil
20:19 ace4016 this looks cool: http://www.aviationexplorer.com/Flying%20Car%20Pictures/flarecraft.jpg
20:19 ace4016 :P
20:19 katsmeow-afk http://www.switched.com/2010/09/30/iran-introduces-flying-boats-with-machine-guns-scares-nobody/
20:24 rue_house it would be great for taking down pirates and smugglers
20:25 Tom_itx why do we want what is just out of reach?
20:25 rue_house there is prolly a policy against defeating your own government tho
20:25 katsmeow-afk the fish are always bigger on the other side of "can't go there", Tom
20:25 rue_house because we already have everything in reach and everything else is just tooo far away
22:43 katsmeow-afk wow, i found a channel that neither ace or orlok is in!
22:43 ace4016 :D
22:44 ace4016 only ones i'm in you would go to would be this, ##electronics, and #lisp
22:44 ace4016 i use to be in math and physics...but those were lame :/
22:44 ace4016 and i doubt you do 3d game programming or cg art >_>
22:44 ace4016 could be wrong though :P
22:45 katsmeow-afk i like some cg art, but i don't do it
22:46 katsmeow-afk i joined ##philosophy to ask about when a cow isn't a cow any more, and to stop referring to it as a cow, stop feeding it, stop milking it, and it's not feeling pain, but it's still a cow(?) so it's hide is "cow leather" even if what i am not taking it off of is "not-a-cow" now(?)
22:48 ace4016 interesting
22:50 katsmeow-afk they aren't answering
22:50 katsmeow-afk i think it's a valid point to explaiing the situation to an Ai, but they don't answer in ##AGI either
23:35 TELunus Rue, I think I might need to change new to have a different name since my compiler is for C++.
23:36 rue_shop3 ah
23:36 rue_shop3 that might do it
23:37 rue_shop3 I think they used more of the windows stuff than they should have
23:40 rue_shop3 TELunus,
23:42 TELunus Rue, I renamed new to newc in the function you got me to copy. It is now complaining about strnlen.
23:43 TELunus shouldn't strnlen just be the smaller of strlen and n?
23:58 rue_shop3 no
23:58 rue_shop3 strlen IS C99 so it shoudl be there
23:58 rue_shop3 oh yes
23:59 rue_shop3 you can do
23:59 rue_shop3 (n<strlen(-)?n:strlen(-))
23:59 rue_shop3 or the like