Author Topic: XKCD was interesting today  (Read 15949 times)

0 Members and 1 Guest are viewing this topic.

Offline DJPhilTopic starter

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: 00
XKCD was interesting today
« on: April 22, 2010, 12:39:52 am »
I'm sure some of you have heard of the webcomic XKCD. Today's was a good one for electronics, and I thought you guys might enjoy it.

http://www.xkcd.com/730/#

I think my favorite bit was the arena. :)
 

Offline GeoffS

  • Supporter
  • ****
  • Posts: 1272
  • Country: au
Re: XKCD was interesting today
« Reply #1 on: April 22, 2010, 01:01:09 am »
I was going to make it but my local supplier is all out of flux capacitors  >:(
 

Offline David

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: gb
Re: XKCD was interesting today
« Reply #2 on: April 22, 2010, 12:50:38 pm »
That would make a nice t-shirt!
David
(United Kingdom)
 

Offline JoeB83

  • Regular Contributor
  • *
  • Posts: 152
  • Country: us
  • Longmont, CO
Re: XKCD was interesting today
« Reply #3 on: November 16, 2015, 06:25:36 am »
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2187
  • Country: au
Re: XKCD was interesting today
« Reply #4 on: November 16, 2015, 02:25:58 pm »
hit random a few times and came across this... would been handy in that thread we had about using goto :)


 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8550
  • Country: us
    • SiliconValleyGarage
Re: XKCD was interesting today
« Reply #5 on: November 16, 2015, 03:11:47 pm »
I don't understand the fuss about the usage of 'goto'.
even the most 'properly' constructed code will compile down to using JMP instructions. which is nothing more than a goto.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: XKCD was interesting today
« Reply #6 on: November 16, 2015, 03:20:29 pm »
Not necessarily true -- although I don't know of any languages which compile semantic constructs into e.g. function calls.  That is, putting the inner braces of each execution path into their own functions.  And by function, I mean, using CALLs instead of JMPs.

But the higher level semantics are much more valuable than the machine code that implements it, at least for average development.  In this post-computational-abundance world, the programmers' bandwidth is the limiting factor.  (Well, almost.  One would hope.  Of course, more computing power always means bigger and slower high level libraries, or scripting languages.  So...)

And, that said, I would enjoy if assembler were designed with indentation in mind.  Many (older?) assemblers won't even accept it -- they expect strict whitespacing.  That makes it very hard to read and write structured code.  Usually, big comment blocks are used.

Tim
« Last Edit: November 16, 2015, 03:25:04 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4284
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: XKCD was interesting today
« Reply #7 on: November 16, 2015, 03:24:52 pm »
goto xkcd

Offline ECEdesign

  • Regular Contributor
  • *
  • Posts: 173
  • Country: us
Re: XKCD was interesting today
« Reply #8 on: November 16, 2015, 07:08:40 pm »




If you hover over the image on the website it says:

"The last band of color indicates the snake's tolerance for being held before biting."  ;D
 

Offline rolycat

  • Super Contributor
  • ***
  • Posts: 1103
  • Country: gb
Re: XKCD was interesting today
« Reply #9 on: November 16, 2015, 07:59:13 pm »
Yesterday's strip was good, and (somewhat) electronics related:



The most powerful hand-held torch (flashlight) I could find is the X-LED XHP DualBeam, which the manufacturers reckon is 50,000 lumens.
They are apparently working on a 1 million lumen LED light, but since this will consume 5 kW you probably won't be able to slip it in your pocket.
 

Offline AF6LJ

  • Supporter
  • ****
  • Posts: 2903
  • Country: us
Re: XKCD was interesting today
« Reply #10 on: November 16, 2015, 08:58:27 pm »
I'm sure some of you have heard of the webcomic XKCD. Today's was a good one for electronics, and I thought you guys might enjoy it.

http://www.xkcd.com/730/#

I think my favorite bit was the arena. :)

Been around for a long time but still funny as hell. :D
Sue AF6LJ
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 12406
  • Country: us
Re: XKCD was interesting today
« Reply #11 on: November 16, 2015, 09:00:03 pm »
The most powerful hand-held torch (flashlight) I could find is the X-LED XHP DualBeam, which the manufacturers reckon is 50,000 lumens.
They are apparently working on a 1 million lumen LED light, but since this will consume 5 kW you probably won't be able to slip it in your pocket.

Well, put two 28 V power tool batteries in series and that will give you 56 V. Such batteries can comfortably supply 100 A, so there's 5 kW. More lantern sized than pocket sized perhaps, and it won't run for very long, but it would be cool on a dark night.
 

Offline kfitch42

  • Frequent Contributor
  • **
  • Posts: 300
  • Country: us
Re: XKCD was interesting today
« Reply #12 on: November 16, 2015, 09:20:37 pm »
Well, put two 28 V power tool batteries in series and that will give you 56 V. Such batteries can comfortably supply 100 A, so there's 5 kW. More lantern sized than pocket sized perhaps, and it won't run for very long, but it would be cool on a dark night.

A quick google told me that the Makita 28V battery is 3.0Ah. So, we are talking less than 2 minutes at 100 Amp. I am guessing these things aren't designed for continuous operation at 100A. So, hopefully they won't last long enough to heat up to thermal runaway...

But, at least you will be able to see what you are doing while jump starting a big diesel truck:
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7987
  • Country: nl
  • Current job: ATEX product design
Re: XKCD was interesting today
« Reply #13 on: November 16, 2015, 10:39:39 pm »
I don't understand the fuss about the usage of 'goto'.
even the most 'properly' constructed code will compile down to using JMP instructions. which is nothing more than a goto.
Because memory leak, and dinosaurs.

BTW if you want bright flashlights, try them with Maxwell supercapacitor banks. 75V 1800A from something that fit into a backpack.
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2035
  • Country: au
Re: XKCD was interesting today
« Reply #14 on: November 16, 2015, 11:30:21 pm »


Had this one on the fridge. My son was fascinated by it even though he was young and didn't know what SQL was.




https://xkcd.com/1133/
Is currently on the fridge:
« Last Edit: November 16, 2015, 11:36:09 pm by HackedFridgeMagnet »
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: XKCD was interesting today
« Reply #15 on: November 16, 2015, 11:45:53 pm »
In addition to the above, I like these ones:


and

 

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: gb
Re: XKCD was interesting today
« Reply #16 on: November 17, 2015, 12:03:38 am »
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: XKCD was interesting today
« Reply #17 on: November 17, 2015, 12:21:06 am »
I don't understand the fuss about the usage of 'goto'.
even the most 'properly' constructed code will compile down to using JMP instructions. which is nothing more than a goto.
Because memory leak, and dinosaurs.

Ironically, I have a soft spot for goto in one particular usecase: preventing memory leaks on error conditions (athough I don't use it in this situation professionally, and I generally abhor goto in every other case). Example:

Code: [Select]
void main() {
  FILE* f1 = fopen( ... );
  if (f1 == NULL) {
    printf("Failed to open f1\r\n");
    return;
  }

  Object a = makeObject();
  if (a == NULL) {
    printf("Failed to make a\r\n");
    goto finalize_f1;   
  }

  ...

  if (nasty.error()) {
    printf("Ouch\r\n");
    goto finalize_a;
  }

  ...

finalize_a:
  a.finish();
  delete a;
finalize_f1:
  fclose(f1);
}

Obviously in this case the Object could have been allocated on the stack; but it's more the problem of issuing cleanup method calls like close() -- which may well delete objects internally. Of course more featured languages have things like the defer block, which is one of many ways to avoid this pattern.
 

Online IanB

  • Super Contributor
  • ***
  • Posts: 12406
  • Country: us
Re: XKCD was interesting today
« Reply #18 on: November 17, 2015, 12:43:15 am »
Ironically, I have a soft spot for goto in one particular usecase: preventing memory leaks on error conditions (athough I don't use it in this situation professionally, and I generally abhor goto in every other case). Example: ...

In C++ the RAII pattern can be used to good effect where resource cleanup should happen for all exit paths including errors and exceptions.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: XKCD was interesting today
« Reply #19 on: November 17, 2015, 12:45:33 am »
Ironically, I have a soft spot for goto in one particular usecase: preventing memory leaks on error conditions (athough I don't use it in this situation professionally, and I generally abhor goto in every other case). Example: ...

In C++ the RAII pattern can be used to good effect where resource cleanup should happen for all exit paths including errors and exceptions.

Indeed, I really like RAII, although it's not available in pure C of course. I've been meaning for a while to see what the overhead for using C++ on AVR is...
 

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: gb
Re: XKCD was interesting today
« Reply #20 on: November 17, 2015, 01:22:48 am »
I'm just learning C, so don't have a clue, but...

I fully understand that abusing goto can result in awful spaghetti code, but the "thou shalt not us goto under any circumstances" mantra seems almost cult-like!
 

Offline JoeO

  • Frequent Contributor
  • **
  • Posts: 527
  • Country: us
  • I admit to being deplorable
Re: XKCD was interesting today
« Reply #21 on: November 17, 2015, 01:27:09 am »
I'm just learning C, so don't have a clue, but...

I fully understand that abusing goto can result in awful spaghetti code, but the "thou shalt not us goto under any circumstances" mantra seems almost cult-like!

C code can be written without using GOTOs. 
The day Al Gore was born there were 7,000 polar bears on Earth.
Today, only 26,000 remain.
 

Offline Maxlor

  • Frequent Contributor
  • **
  • Posts: 565
  • Country: ch
Re: XKCD was interesting today
« Reply #22 on: November 17, 2015, 02:31:52 am »
I'm just learning C, so don't have a clue, but...

I fully understand that abusing goto can result in awful spaghetti code, but the "thou shalt not us goto under any circumstances" mantra seems almost cult-like!
You can break the rules once you've mastered them, but not before. It's neither a mantra nor cult-like, it's just something meant to preserve as much global sanity as possible.
 

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: gb
Re: XKCD was interesting today
« Reply #23 on: November 17, 2015, 02:53:10 am »
I'm just learning C, so don't have a clue, but...

I fully understand that abusing goto can result in awful spaghetti code, but the "thou shalt not us goto under any circumstances" mantra seems almost cult-like!

C code can be written without using GOTOs.

I'm sure it can be written without using a lot of things!  So surely that's not a reason by default. 

I have read a fair bit about this on stackexchange and other sites, and it seems that people will go to (pun not intended, sorry) extreme lengths, writing convoluted code, just to avoid a goto!  That's when it seems to me like more dogma than engineering!
 

Offline Delta

  • Super Contributor
  • ***
  • Posts: 1221
  • Country: gb
Re: XKCD was interesting today
« Reply #24 on: November 17, 2015, 02:54:27 am »
I'm just learning C, so don't have a clue, but...

I fully understand that abusing goto can result in awful spaghetti code, but the "thou shalt not us goto under any circumstances" mantra seems almost cult-like!
You can break the rules once you've mastered them, but not before. It's neither a mantra nor cult-like, it's just something meant to preserve as much global sanity as possible.

I am looking forward to that day!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf