<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4828565973650069607</id><updated>2012-02-16T14:13:51.245-08:00</updated><title type='text'>Rickology</title><subtitle type='html'>Alien postings and musings of the Ricklon.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-1828196833742035004</id><published>2010-09-27T15:07:00.000-07:00</published><updated>2010-09-27T15:08:32.094-07:00</updated><title type='text'>Moving to http://rickology.tumblr.com</title><content type='html'>Hi All, It's been fun here at Blogspot, but there is way more fun&amp;nbsp;occurring&amp;nbsp;at http://rickology.tumblr.com. My AVR Tool chain and all other project updates will be at over there.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://rickology.tumblr.com/"&gt;http://rickology.tumblr.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-1828196833742035004?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/1828196833742035004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=1828196833742035004' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1828196833742035004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1828196833742035004'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/09/moving-to-httprickologytumblrcom.html' title='Moving to http://rickology.tumblr.com'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-3517121938133370496</id><published>2010-08-24T19:04:00.000-07:00</published><updated>2010-08-24T19:06:31.939-07:00</updated><title type='text'>AVR GCC Makefile build project</title><content type='html'>I thought this wouldn't be too bad, and it was easy to get started, but to really know what combination works is really tricky. I started with gcc-4.5.1 and it compiled great with mpfr, and gmp simlinked into the source directory. But when I started working gcc 4.3.2, 4.3.5, 4.4.4 each of these got the relative pathing wrong. &amp;nbsp;Basiclly, instead of ../ configure generated ./ so the code was unreachable. Then I tried using --with-gmp, and --with-mpfr. I got the gmp version recognized, but mpfr was still not findable.&lt;br /&gt;&lt;br /&gt;Anyway, the code is on Github, and I will be updating it with whatever positive improvements I find.&lt;br /&gt;&lt;a href="http://github.com/ricklon/avrgcc-macosx-makefile"&gt;http://github.com/ricklon/avrgcc-macosx-makefile&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-3517121938133370496?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/3517121938133370496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=3517121938133370496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/3517121938133370496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/3517121938133370496'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/08/avr-gcc-makefile-build-project.html' title='AVR GCC Makefile build project'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-2605659442649421178</id><published>2010-07-02T16:09:00.001-07:00</published><updated>2010-08-24T18:57:35.594-07:00</updated><title type='text'>Makerbot Heated Platform 2.0</title><content type='html'>&lt;a href="http://www.flickr.com/photos/rickanderson/4755681864/" title="photo sharing"&gt;&lt;img alt="" src="http://farm5.static.flickr.com/4115/4755681864_6454e2f9c4_m.jpg" style="border: 2px solid rgb(0, 0, 0);" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size: 0.9em; margin-top: 0px;"&gt;&lt;a href="http://www.flickr.com/photos/rickanderson/4755681864/"&gt;img_5591.jpg&lt;/a&gt; &lt;br /&gt;Originally uploaded by &lt;a href="http://www.flickr.com/people/rickanderson/"&gt;flirianders&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;Just some quick notes on the experience. Overall not difficult, and straightforward. However:&lt;br /&gt;&lt;br /&gt;1. Remember to get Kapton tape.&lt;br /&gt;2. Remember to obtain solder paste.&lt;br /&gt;3. Think about the color of led you would like. It comes with red, but you can always substitute your favorite color.&lt;br /&gt;4. Wasted time on soldering 3 wires onto an adapter. Could have just used a servo cable instead.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://thingiverse-production.s3.amazonaws.com/renders/4a/7a/0d/59/f5/SDC10746_preview_small.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://thingiverse-production.s3.amazonaws.com/renders/4a/7a/0d/59/f5/SDC10746_preview_small.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. The thermistor solders to the PCB in an annoying way.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://thingiverse-production.s3.amazonaws.com/renders/39/68/da/d4/ed/SDC10765_preview_medium.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://thingiverse-production.s3.amazonaws.com/renders/39/68/da/d4/ed/SDC10765_preview_medium.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;So you have to solder one wire then put Kapton tape over it and the solder the other wire. More room could be made for this in the design.&lt;br /&gt;&lt;br /&gt;I'm planning to work with Matt from Fubar Labs to re work the aluminum so that it screws together flush. I'm worried the extruder head will crash into the exposed bolts.&lt;br /&gt;&lt;br /&gt;That's all for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-2605659442649421178?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/2605659442649421178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=2605659442649421178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2605659442649421178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2605659442649421178'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/07/makerbit-heated-platform-20.html' title='Makerbot Heated Platform 2.0'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm5.static.flickr.com/4115/4755681864_6454e2f9c4_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-8937749908245253091</id><published>2010-04-12T20:14:00.000-07:00</published><updated>2010-04-12T20:14:44.989-07:00</updated><title type='text'>Thoughts on the Adafruit protoshield</title><content type='html'>I built another &lt;a href="http://www.adafruit.com/index.php?main_page=product_info&amp;cPath=17_21&amp;products_id=51"&gt;Adafruit proto shield tonight&lt;/a&gt;. Good design and fun to do, but there some things to think about. The first thing is do you want them to be stackable? If you want the to be the top shield, or the only shield in your experimental sandwich then they are great as is. But, if you want to make the stackable what do you do? Well, you need to get some stackable headers. Then you need to figure out where those headers should go. Not so complicated, they need to match the pins on the Arduino board you've got. With stackable headers you can keep going and going. Following the Adafruit directions you alternate inside and outside, which doesn't stack. So think about what you want from you proto shield, and order extra parts as needed.&lt;br /&gt;&lt;br /&gt;So why would you stack a proto shield? Well, in my case I have a nice Serial Display and an awesome Serial shield from Mark Sproul. So that has to go on top, doesn't make sense to stack things on top of your output display anyway. I've got a nice GPS shield from Adafruit. Oops, that not got stackale headers either. Anyway a decent accelerometer from Adafruit on a break out board. I'd like to combine all that info together, and equipment together. The theory goes, stack on an Arduino the GPS shield, add the accelerometer on a proto shield, and finally the serial shield with a 2x16 read out of the serial data.&lt;br /&gt;&lt;br /&gt;I'll get this done, once I've got my stackable headers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-8937749908245253091?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/8937749908245253091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=8937749908245253091' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8937749908245253091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8937749908245253091'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/04/thoughts-on-adafruit-protoshield.html' title='Thoughts on the Adafruit protoshield'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-8532015727171334208</id><published>2010-04-06T21:35:00.001-07:00</published><updated>2010-07-02T16:15:15.152-07:00</updated><title type='text'>Adafruit Wave Shield Kit 1.1</title><content type='html'>&lt;a href="http://farm4.static.flickr.com/3287/4610971372_dbe4598720_m.jpg" title="photo sharing"&gt;&lt;img src="http://farm4.static.flickr.com/3287/4610971372_dbe4598720_m.jpg" alt="" style="border: solid 2px #000000;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size: 0.9em; margin-top: 0px;"&gt;&lt;br /&gt;Originally uploaded by &lt;a href="http://www.flickr.com/people/rickanderson/"&gt;flirianders&lt;/a&gt;.&lt;/span&gt;&lt;br clear="all" /&gt;&lt;p&gt;Yea! Another kit assembled, and just shy of being ready to try out. It's bed time, and I'll have to check it out in detail tomorrow.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-8532015727171334208?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/8532015727171334208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=8532015727171334208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8532015727171334208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8532015727171334208'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/04/adafruit-wave-shield-kit-11.html' title='Adafruit Wave Shield Kit 1.1'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3287/4610971372_dbe4598720_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-6055895299927173091</id><published>2010-04-05T19:37:00.001-07:00</published><updated>2010-04-05T19:37:35.575-07:00</updated><title type='text'>Completed GPS Logger</title><content type='html'>&lt;a href="http://www.flickr.com/photos/rickanderson/4495135107/" title="photo sharing"&gt;&lt;img src="http://farm3.static.flickr.com/2748/4495135107_40758740aa_m.jpg" alt="" style="border: solid 2px #000000;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size: 0.9em; margin-top: 0px;"&gt;&lt;a href="http://www.flickr.com/photos/rickanderson/4495135107/"&gt;Completed GPS Logger&lt;/a&gt; &lt;br /&gt;Originally uploaded by &lt;a href="http://www.flickr.com/people/rickanderson/"&gt;flirianders&lt;/a&gt;.&lt;/span&gt;&lt;br clear="all" /&gt;&lt;p&gt;Yea. it's done and works. Now I'm looking forward to playing with it and and see about incorporating it into some new projects.&lt;br /&gt;&lt;br /&gt;In general the "make it" section of the Adafruit site was great. Easy to follow and solder. It was a lot tougher following the steps in the "use it section." Being on netbook and going through section was somewhat confusing. There steps where the wires need be configured one way to test the GPS unit, and another for testing the SD card, and then plugging it all back together. For some reason it wasn't as clear.&lt;br /&gt;&lt;br /&gt;So I soldered in an extra row of header pins and just jumped the wires over to reconfigure easily. Made it easy to try the different configurations.&lt;br /&gt;&lt;br /&gt;I found that it was critical that the SD Cards be formatted in fat16.  Reading through the forums, that seemed to really trip people up. GParted on Ubuntu made formatting for fat16 very easy. &lt;br /&gt;&lt;br /&gt;The last issue was that there was multiple versions of the code to upload to test with and it wasn't clear which worked with the 328 chip. Also, it wasn't clear if the memory hack for serial by bring the buffer down to 32 was necessary for the 328 chip. I don't think it was but I'm not sure, I'll have to check that out.&lt;br /&gt;&lt;br /&gt;I was thinking with the one kind of hack I'd like to do is have timestamp of when the position were recorded and then sync to a photo set for gathering geolocation data.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-6055895299927173091?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/6055895299927173091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=6055895299927173091' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/6055895299927173091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/6055895299927173091'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/04/completed-gps-logger.html' title='Completed GPS Logger'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2748/4495135107_40758740aa_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-3277413693867726644</id><published>2010-04-01T20:06:00.001-07:00</published><updated>2010-04-01T20:08:11.618-07:00</updated><title type='text'>Not March Madness: Adafruit GPS Log Shield</title><content type='html'>&lt;a href="http://www.flickr.com/photos/rickanderson/4482655805/" title="photo sharing"&gt;&lt;img src="http://farm3.static.flickr.com/2797/4482655805_03e61217fc_m.jpg" alt="" style="border: solid 2px #000000;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size: 0.9em; margin-top: 0px;"&gt;&lt;a href="http://www.flickr.com/photos/rickanderson/4482655805/"&gt;Adafruit GPS Shield&lt;/a&gt; &lt;br /&gt;Originally uploaded by &lt;a href="http://www.flickr.com/people/rickanderson/"&gt;flirianders&lt;/a&gt;.&lt;/span&gt;&lt;br clear="all" /&gt;&lt;p&gt;Yea, I get to do something nice and physical tonight. I soldered up the Adafruit GPS log shield and didn't have to write a program to see if it worked. So satisfying. I'm going to got o bed around 11pm. &lt;br /&gt;&lt;br /&gt;No longer do I have to program from 10pm to midnight, and then debug until satisfied. I can do it tomorrow. Yea! Another thought about March madness is some projects had physical components, then the Arduino sketch, and then some program that listened to the serial port. That program would have to talk to some web server, and ... so on. Tough to get all that done in one day.&lt;br /&gt;&lt;br /&gt;Here's a Flickr set of the fun I had:&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/rickanderson/sets/72157623626704103/"&gt;http://www.flickr.com/photos/rickanderson/sets/72157623626704103/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next time I promise no iPhone documentation.I'll get my real camera.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-3277413693867726644?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/3277413693867726644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=3277413693867726644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/3277413693867726644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/3277413693867726644'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/04/not-march-madness-adafruit-gps-log.html' title='Not March Madness: Adafruit GPS Log Shield'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2797/4482655805_03e61217fc_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-1719521028863677593</id><published>2010-03-31T21:10:00.000-07:00</published><updated>2010-03-31T21:18:35.539-07:00</updated><title type='text'>March Madness Challenge - Day 31</title><content type='html'>Whew, made it. Tonights project adds three potentiometers to might brightness calibration technique. Turns out it's important to examine ones assumptions. I discovered that I had to map values in distinct steps to keep the numbers within the range of my minimum maximum. If I hadn't hooked up the potentiometers and then outputted the values to see what my eyes were experience it would have taken much longer to realize this issue. So now I can go back and fix some older code.&lt;br /&gt;&lt;br /&gt;I'd like to do a manual calibration for brightness and compare it to the automatic version. Since the analogRead function yields a 10 bit value at 4.9mV per unit it's possible to calculate what resistor needs to be place on each color in order to calibrate them with physical resistors and then not need the Arduino to calculate the relative values.&lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=QmNnJd9drYs&lt;br /&gt;&lt;br /&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/QmNnJd9drYs&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/QmNnJd9drYs&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;int redPin = 9;    // LED connected to digital pin 9&lt;br /&gt;int greenPin = 11;&lt;br /&gt;int bluePin = 10;&lt;br /&gt;int pins[] = &lt;br /&gt;{&lt;br /&gt;    redPin, greenPin, bluePin&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int photoPin = 0;&lt;br /&gt;int redPot = 1;&lt;br /&gt;int greenPot = 2;&lt;br /&gt;int bluePot = 3;&lt;br /&gt;&lt;br /&gt;int photoVal = -1;&lt;br /&gt;int rr, gg, bb = -1;&lt;br /&gt;int minmax, rmax, gmax, bmax = 0;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;  Serial.begin(9600);&lt;br /&gt;  Serial.println("Start");&lt;br /&gt;  &lt;br /&gt;  pinMode(redPin, OUTPUT);     &lt;br /&gt;  pinMode(greenPin, OUTPUT);     &lt;br /&gt;  pinMode(bluePin, OUTPUT);  &lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;  digitalWrite(bluePin, HIGH); &lt;br /&gt;&lt;br /&gt;  digitalWrite(redPin, LOW);&lt;br /&gt;  delay(500);&lt;br /&gt;  rmax = analogRead(photoPin);&lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(greenPin, LOW);&lt;br /&gt;  delay(500);&lt;br /&gt;  gmax = analogRead(photoPin);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(bluePin, LOW);&lt;br /&gt;  delay(500);&lt;br /&gt;  bmax = analogRead(photoPin);&lt;br /&gt;  digitalWrite(bluePin, HIGH);&lt;br /&gt;  &lt;br /&gt;   sendMax();&lt;br /&gt;   minmax = min(rmax, min(gmax, bmax));&lt;br /&gt;   setRGB(255, 255, 255);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void setRGB(int red, int green, int blue) &lt;br /&gt;{&lt;br /&gt;  //These values are the 10 bit values, they need to be mapped to minmax&lt;br /&gt;    //For some reason some values were mapping negative&lt;br /&gt;  red = map(red, 0, 1023, 0, minmax);&lt;br /&gt;  green = map(green, 0, 1023, 0, minmax);&lt;br /&gt;  blue = map(blue, 0, 1023, 0, minmax);&lt;br /&gt;  sendRGB(red, green, blue); &lt;br /&gt;  &lt;br /&gt;  red = map(red, 0, minmax, 255, 0);&lt;br /&gt;  green = map(green, 0, minmax,  255, 0);&lt;br /&gt;  blue = map(blue, 0, minmax,  255, 0);&lt;br /&gt;&lt;br /&gt;  analogWrite(redPin, red);&lt;br /&gt;  analogWrite(greenPin, green);&lt;br /&gt;  analogWrite(bluePin, blue);&lt;br /&gt;  sendRGB(red, green, blue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void sendRGB(int red, int green, int blue) &lt;br /&gt;{&lt;br /&gt;      Serial.print(" { \"red\" : ");&lt;br /&gt;      Serial.print(red);&lt;br /&gt;      Serial.print(", \"green\" : ");&lt;br /&gt;      Serial.print(green);&lt;br /&gt;      Serial.print(", \"blue\" : ");&lt;br /&gt;      Serial.print(blue);&lt;br /&gt;      Serial.print("}");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void sendMax()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    Serial.print(" { \"rmax\" : ");&lt;br /&gt;    Serial.print(rmax);&lt;br /&gt;    Serial.print(", \"gmax\" : ");&lt;br /&gt;    Serial.print(gmax);&lt;br /&gt;    Serial.print(", \"bmax\" : ");&lt;br /&gt;    Serial.print(bmax);&lt;br /&gt;    Serial.println("}");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void loop() &lt;br /&gt;{&lt;br /&gt;  rr = analogRead(redPot);&lt;br /&gt;  gg = analogRead(greenPot);&lt;br /&gt;  bb = analogRead(bluePot);&lt;br /&gt;  setRGB(rr, gg, bb);&lt;br /&gt;  sendRGB(rr, gg, bb);&lt;br /&gt;  Serial.print(" { \"minmax\" : ");&lt;br /&gt;  Serial.print(minmax);&lt;br /&gt;  Serial.println("}");&lt;br /&gt;  &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-1719521028863677593?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/1719521028863677593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=1719521028863677593' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1719521028863677593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1719521028863677593'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-31.html' title='March Madness Challenge - Day 31'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-6924500437755513069</id><published>2010-03-30T22:41:00.000-07:00</published><updated>2010-03-30T22:49:02.575-07:00</updated><title type='text'>March Madness Challenge - Day 30</title><content type='html'>Example of a sha1 signed query string from a form. This is useful if you are calling a REST method from a web service. Next time I do this I'm going to look at the code posted here: http://code.google.com/p/crypto-js/&lt;br /&gt;&lt;br /&gt;Here's the important part:&lt;br /&gt;&lt;br /&gt;str = $("form").serialize().split("&amp;").sort().join("&amp;");&lt;br /&gt;hex_str = hex_sha1(str);&lt;br /&gt;console.log(str + "&amp;sig=" + hex_str);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Full code:&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=U3hqaSTR"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-6924500437755513069?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/6924500437755513069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=6924500437755513069' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/6924500437755513069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/6924500437755513069'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-30.html' title='March Madness Challenge - Day 30'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-2972578431903215024</id><published>2010-03-29T20:47:00.000-07:00</published><updated>2010-03-29T20:54:32.233-07:00</updated><title type='text'>March Madness Challenge - Day 29</title><content type='html'>A little more experimenting with Second Life. Decided to work with LLSetPrimtive. It allows for the changing of many of the prim options. This code tests scale, rotation, and changing the location of the prim. For fun my avatar was being harassed by a Dalek, and I sat on the test object and took a ride. The machine wasn't powerful enough to take a nice smooth video so this will have to do.&lt;br /&gt;&lt;br /&gt;This code could be crossed with the httpserver mechanism and it could be controlled from outside of Second Life. &lt;br /&gt;&lt;br /&gt;http://www.youtube.com/watch?v=eZWtsDzr0Qw&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/eZWtsDzr0Qw&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/eZWtsDzr0Qw&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;// touch to trigger binary actions involving llSetPrimitiveParams&lt;br /&gt;&lt;br /&gt;integer trigger=FALSE;&lt;br /&gt;&lt;br /&gt;default&lt;br /&gt;{&lt;br /&gt;    touch_start(integer nn)&lt;br /&gt;    {&lt;br /&gt;        if (trigger==FALSE)&lt;br /&gt;        { &lt;br /&gt;            llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, &lt;1, 1, 1&gt;, 1.0, 10.0, 0.75] ); &lt;br /&gt;            llSetPrimitiveParams([PRIM_SIZE, &lt;0.5, 0.5, 0.5&gt;]);&lt;br /&gt;            llSetPrimitiveParams( [PRIM_ROTATION, ZERO_ROTATION] );&lt;br /&gt;            rotation  yrot =  llEuler2Rot( &lt; 0, 15 * DEG_TO_RAD, 0 &gt; );&lt;br /&gt;            integer ii;&lt;br /&gt;            for (ii = 0; ii &lt; 59; ii++)&lt;br /&gt;            {&lt;br /&gt;                llSetPrimitiveParams( [PRIM_ROTATION, llGetRot() * yrot] );&lt;br /&gt;            }&lt;br /&gt;            llSetPrimitiveParams([PRIM_POSITION, llGetPos() + &lt;0,0,1&gt;]); &lt;br /&gt;            trigger=TRUE; &lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        { &lt;br /&gt;            llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, &lt;1, 1, 1&gt;, 1.0, 10.0, 0.75] );&lt;br /&gt;            llSetPrimitiveParams([PRIM_SIZE, &lt;2, 2, 2&gt;]);&lt;br /&gt;            integer ii;&lt;br /&gt;            integer increase;&lt;br /&gt;            for (ii = 0; ii &lt; 50; ii++)&lt;br /&gt;            {&lt;br /&gt;                llSetPrimitiveParams([PRIM_POSITION, llGetPos() + &lt;0,0,1&gt;]); &lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            for (ii = 0; ii &lt; 50; ii++)&lt;br /&gt;            {&lt;br /&gt;                llSetPrimitiveParams([PRIM_POSITION, llGetPos() + &lt;0,0,-1&gt;]); &lt;br /&gt;            }&lt;br /&gt;            trigger=FALSE;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-2972578431903215024?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/2972578431903215024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=2972578431903215024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2972578431903215024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2972578431903215024'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-29.html' title='March Madness Challenge - Day 29'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-804299995855664510</id><published>2010-03-28T21:05:00.000-07:00</published><updated>2010-03-28T21:05:24.747-07:00</updated><title type='text'>March Madness Challenge - Day 28</title><content type='html'>I got two prims to talk to to each other in Second Life over the httprequest and httpserver mechanism. Lot's of uses for this. This is the mechanism I use to get data in and out of Second Life, also it can be used to pass information between objects in Second Life, however, there are more effective mechanism for intra/inter prim communication in Second Life. Would be neat to see some scripting that was capable with shared media. Hopefully, I get to explore it more later. For now here's the code to get it working.&lt;br /&gt;&lt;br /&gt;httpserver.lsl&lt;br /&gt;&lt;pre&gt;key requestURL;&lt;br /&gt;string gURI;&lt;br /&gt;integer CHANNEL = 43;&lt;br /&gt;integer LINK_TARGET = -1;&lt;br /&gt;integer gPosterPrim = 1;&lt;br /&gt;&lt;br /&gt;default&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt;    state_entry() {&lt;br /&gt;        requestURL = llRequestURL();     // Request that an URL be assigned to me.&lt;br /&gt;        llOwnerSay((string) llGetLinkNumber());&lt;br /&gt;        llOwnerSay((string) llGetNumberOfPrims());&lt;br /&gt;        llMessageLinked(gPosterPrim,0,gURI,gURI);&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    on_rez(integer param)&lt;br /&gt;    {   // Triggered when the object is rezzed, like after the object has been sold from a vendor&lt;br /&gt;        llResetScript();//By resetting the script on rez forces the listen to re-register.&lt;br /&gt;    }&lt;br /&gt;    touch_start(integer number)&lt;br /&gt;    {&lt;br /&gt;        &lt;br /&gt;        llOwnerSay("My URI: " + gURI);&lt;br /&gt;        llSay(0,"linknum: " + (string)llGetLinkNumber());&lt;br /&gt;        llSay(0, gURI);&lt;br /&gt;        llMessageLinked(gPosterPrim,0,gURI,gURI);&lt;br /&gt;            &lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    link_message(integer sender_num, integer num, string msg, key id) {&lt;br /&gt;        llOwnerSay(msg);&lt;br /&gt;        llMessageLinked(gPosterPrim,0,gURI,gURI);&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    changed (integer change) {&lt;br /&gt;        if (change &amp;&amp; CHANGED_REGION ) {&lt;br /&gt;            requestURL = llRequestURL();     // Request that an URL be assigned to me.&lt;br /&gt;        }&lt;br /&gt;        else {&lt;br /&gt;            llOwnerSay("No need to update URL.");   &lt;br /&gt;        }    &lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;     http_request(key id, string method, string body) {&lt;br /&gt; &lt;br /&gt;        if ((method == URL_REQUEST_GRANTED) &amp;&amp; (id == requestURL) ){&lt;br /&gt;            // An URL has been assigned to me.&lt;br /&gt;            llOwnerSay("LSL server obj: " + (string)llGetKey());&lt;br /&gt;            llOwnerSay("URI: " + body);&lt;br /&gt;            llSay(CHANNEL, body);&lt;br /&gt;            gURI = body;&lt;br /&gt;            requestURL = NULL_KEY;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;        else if ((method == URL_REQUEST_DENIED) &amp;&amp; (id == requestURL)) {&lt;br /&gt;            // I could not obtain a URL&lt;br /&gt;            llOwnerSay("There was a problem, and an URL was not assigned: " + body);&lt;br /&gt;            requestURL = NULL_KEY;&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        else if (method == "POST") {&lt;br /&gt;&lt;br /&gt;            list headers = [ "x-script-url", &lt;br /&gt;                                "x-path-info", &lt;br /&gt;                                "x-query-string", &lt;br /&gt;                                "x-remote-ip", &lt;br /&gt;                                "user-agent", &lt;br /&gt;                                "x-secondlife-shard",           &lt;br /&gt;                                "x-secondlife-object-name",     &lt;br /&gt;                                "x-secondlife-object-key",      &lt;br /&gt;                                "x-secondlife-region",          &lt;br /&gt;                                "x-secondlife-local-position",  &lt;br /&gt;                                "x-secondlife-local-rotation",  &lt;br /&gt;                                "x-secondlife-local-velocity",  &lt;br /&gt;                                "x-secondlife-owner-name",      &lt;br /&gt;                                "x-secondlife-owner-key"    &lt;br /&gt;                                ];&lt;br /&gt;                integer pos = ~llGetListLength(headers);&lt;br /&gt;                while( ++pos )&lt;br /&gt;                    {&lt;br /&gt;                        string header = llList2String(headers, pos);&lt;br /&gt;                        llOwnerSay(header + ": " + llGetHTTPHeader(id, header));&lt;br /&gt;                    }            &lt;br /&gt;            &lt;br /&gt;            // Anincoming message was received.&lt;br /&gt;            string time =  llGetTimestamp();&lt;br /&gt;            llOwnerSay("lslhttpserver (" + time + ") Received information from the outside: " + body);&lt;br /&gt;            &lt;br /&gt;            llHTTPResponse(id,200,"Thank you for calling. All of our operators are busy.");&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;    &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;        else {&lt;br /&gt;            // An incoming message has come in using a method that has not been anticipated.&lt;br /&gt;            llHTTPResponse(id,405,"Unsupported Method");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;post.lsl&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;key requestid; // just to check if we're getting the result we've asked for; all scripts in the same object get the same replies&lt;br /&gt;string uri;&lt;br /&gt;integer listen_handle;&lt;br /&gt;string gURI;&lt;br /&gt;key gServerPrimKey;&lt;br /&gt;integer gPrimServer = 2;&lt;br /&gt;&lt;br /&gt;default&lt;br /&gt;{&lt;br /&gt;    state_entry()&lt;br /&gt;    {   &lt;br /&gt;     &lt;br /&gt;        llMessageLinked(gPrimServer,0,"Send gPrimURI","Send gPrimURI");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    on_rez(integer param)&lt;br /&gt;    {   // Triggered when the object is rezzed, like after the object has been sold from a vendor&lt;br /&gt;        llResetScript();//By resetting the script on rez forces the listen to re-register.&lt;br /&gt;    }&lt;br /&gt;  &lt;br /&gt;      link_message(integer sender_num, integer num, string msg, key id) {&lt;br /&gt;        llOwnerSay(msg);&lt;br /&gt;        gURI = msg;&lt;br /&gt;      &lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    touch_start(integer number)&lt;br /&gt;    {&lt;br /&gt;       &lt;br /&gt;         llOwnerSay("My URI: " + gURI);&lt;br /&gt;        llSay(0,"linknum: " + (string)llGetLinkNumber());&lt;br /&gt;        llSay(0, gURI);&lt;br /&gt;        llMessageLinked(gPrimServer,0,"Send gPrimURI","Send gPrimURI");&lt;br /&gt;        &lt;br /&gt;    &lt;br /&gt;        requestid = llHTTPRequest(gURI, &lt;br /&gt;            [HTTP_METHOD, "POST",&lt;br /&gt;             HTTP_MIMETYPE, "application/x-www-form-urlencoded"],&lt;br /&gt;            "time=" +  llGetTimestamp()  +"&amp;parameter2=world");&lt;br /&gt;    &lt;br /&gt;        &lt;br /&gt;            &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    http_response(key request_id, integer status, list metadata, string body)&lt;br /&gt;    {&lt;br /&gt;        string time =  llGetTimestamp();&lt;br /&gt;        &lt;br /&gt;        &lt;br /&gt;        if (request_id == requestid)&lt;br /&gt;             llOwnerSay( "http resp(" + time + ") key: " + (string)request_id);&lt;br /&gt;             llOwnerSay( "http resp(" + time + ") status: " + (string)status);&lt;br /&gt;             llOwnerSay( "http resp(" + time + ") metadata: " + (string)metadata);&lt;br /&gt;             llOwnerSay( "http resp(" + time + ") body: " + body);&lt;br /&gt;             llWhisper(10, " Whisper to test box");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-804299995855664510?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/804299995855664510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=804299995855664510' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/804299995855664510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/804299995855664510'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-28.html' title='March Madness Challenge - Day 28'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-8223362613516669067</id><published>2010-03-27T20:49:00.000-07:00</published><updated>2010-03-27T20:50:56.624-07:00</updated><title type='text'>March Madness Challenge - Day 27</title><content type='html'>&lt;b&gt;A little more work with Seriality API&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I wrote a quick serial console for the Seriality API using jQuery, also, I have the RGB slider control project written. However, the serial.write() function seems to not do anything today. I went back to my original on/off code from Day 23 and it failed to work too, even though it had worked fine originally. So I'm going to post the code for the Serial Console and call it a night, and use some fresh eyes tomorrow to figure out why the one way communication is happening.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=cBCfAEge"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-8223362613516669067?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/8223362613516669067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=8223362613516669067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8223362613516669067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8223362613516669067'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/little-more-work-with-seriality-api.html' title='March Madness Challenge - Day 27'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-1067938605618866118</id><published>2010-03-26T22:17:00.000-07:00</published><updated>2010-03-26T22:32:13.780-07:00</updated><title type='text'>March Madness Challenge - Day 26</title><content type='html'>Took me a bit to get a strategy that passed most tests. I'll have to look at this one again in the morning. It has some nice features, and some mystery features. Using seriality API I could use QUnit to test the string parsing. Ok, so what this thing does is take a string of 3 numbers separated by commas, and feed it over the serial port to the Arduino. The code looks for commas and then asks is this the first, or second comma. There is no third comma so it simply checks nn value to say is this the third value. If so it sets it.&lt;br /&gt;&lt;br /&gt;It only set's the values if it understands and leaves the values with the previous value. This should be a nice feature if used with sliders because there would be no off and on flickering it just stays on at the last combination it had.&lt;br /&gt;&lt;br /&gt;This program also just echoes back the setting sent to it. Nice thing to look for for debugging. This is also a tool to be used for testing since, I know what went in should match what come out.&lt;br /&gt;&lt;br /&gt;Finally, I added a map function that reverses HIGH, LOW and makes to analog numbers feel more natural. Also, I need to find a way to test that using the map function the way I'm using it really results in balance colors.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt;* Day 26 RGB calibrated fading code with serial controls&lt;br /&gt;*/&lt;br /&gt;char str[11]; &lt;br /&gt;&lt;br /&gt;int redPin = 9;    // LED connected to digital pin 9&lt;br /&gt;int greenPin = 11;&lt;br /&gt;int bluePin = 10;&lt;br /&gt;int pins[] = &lt;br /&gt;{&lt;br /&gt;    redPin, greenPin, bluePin&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;int photoPin = 0;&lt;br /&gt;int photoVal = -1;&lt;br /&gt;int rr, gg, bb = -1;&lt;br /&gt;int minmax, rmax, gmax, bmax = 0;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;  Serial.begin(9600);&lt;br /&gt;  Serial.println("Start");&lt;br /&gt;  &lt;br /&gt;  pinMode(redPin, OUTPUT);     &lt;br /&gt;  pinMode(greenPin, OUTPUT);     &lt;br /&gt;  pinMode(bluePin, OUTPUT);  &lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;  digitalWrite(bluePin, HIGH); &lt;br /&gt;&lt;br /&gt;  digitalWrite(redPin, LOW);&lt;br /&gt;  delay(500);&lt;br /&gt;  rmax = analogRead(photoPin);&lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(greenPin, LOW);&lt;br /&gt;  delay(500);&lt;br /&gt;  gmax = analogRead(photoPin);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(bluePin, LOW);&lt;br /&gt;  delay(500);&lt;br /&gt;  bmax = analogRead(photoPin);&lt;br /&gt;  digitalWrite(bluePin, HIGH);&lt;br /&gt;  &lt;br /&gt;   sendMax();&lt;br /&gt;   minmax = min(rmax, min(gmax, bmax));&lt;br /&gt;   setRGB(255, 255, 255);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void setRGB(int red, int green, int blue) &lt;br /&gt;{&lt;br /&gt;  red = map(red, 0, minmax, 255, 0);&lt;br /&gt;  green = map(green, 0, minmax,  255, 0);&lt;br /&gt;  blue = map(blue, 0, minmax,  255, 0);&lt;br /&gt;  analogWrite(redPin, red);&lt;br /&gt;  analogWrite(greenPin, green);&lt;br /&gt;  analogWrite(bluePin, blue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void sendRGB(int red, int green, int blue) &lt;br /&gt;{&lt;br /&gt;      Serial.print(" { \"red\" : ");&lt;br /&gt;      Serial.print(red);&lt;br /&gt;      Serial.print(", \"green\" : ");&lt;br /&gt;      Serial.print(green);&lt;br /&gt;      Serial.print(", \"blue\" : ");&lt;br /&gt;      Serial.print(blue);&lt;br /&gt;      Serial.println("}");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void sendMax()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    Serial.print(" { \"rmax\" : ");&lt;br /&gt;    Serial.print(rmax);&lt;br /&gt;    Serial.print(", \"gmax\" : ");&lt;br /&gt;    Serial.print(gmax);&lt;br /&gt;    Serial.print(", \"bmax\" : ");&lt;br /&gt;    Serial.print(bmax);&lt;br /&gt;    Serial.println("}");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void loop() &lt;br /&gt;{&lt;br /&gt;int ii = 0;&lt;br /&gt;int nn = 0;&lt;br /&gt;char num[2];&lt;br /&gt;int rgb = 0;&lt;br /&gt;boolean keepgoing = true;&lt;br /&gt;&lt;br /&gt;while (keepgoing) &lt;br /&gt;{&lt;br /&gt;  while (Serial.available() ) &lt;br /&gt;    {&lt;br /&gt;     {&lt;br /&gt;      str[ii] = Serial.read();&lt;br /&gt;      num[nn] = str[ii];&lt;br /&gt;      //Echo the character as you type&lt;br /&gt;      //Serial.write(str[ii]);&lt;br /&gt;&lt;br /&gt;      if (str[ii] == 44)&lt;br /&gt;      {&lt;br /&gt;          if (rgb == 0) &lt;br /&gt;         {&lt;br /&gt;           rr = atoi(num);&lt;br /&gt;           nn = -1;&lt;br /&gt;           rgb++;&lt;br /&gt;         } &lt;br /&gt;         else if (rgb == 1)&lt;br /&gt;         {&lt;br /&gt;          gg = atoi(num);&lt;br /&gt;          nn = -1;&lt;br /&gt;          rgb++;&lt;br /&gt;         }&lt;br /&gt;      }&lt;br /&gt;      if (str[ii] == 0x0d )&lt;br /&gt;      {&lt;br /&gt;      keepgoing = false;&lt;br /&gt;       if (rgb == 2)&lt;br /&gt;         {&lt;br /&gt;          bb = atoi(num); &lt;br /&gt;          nn = -1;&lt;br /&gt;          rgb = 0;&lt;br /&gt;         }      &lt;br /&gt;        sendRGB(rr,gg, bb);&lt;br /&gt;        setRGB(rr, gg, bb);&lt;br /&gt;      }&lt;br /&gt;      ii++;&lt;br /&gt;      nn++;&lt;br /&gt;      }&lt;br /&gt;    } &lt;br /&gt;} &lt;br /&gt;  str[ii] = 0;&lt;br /&gt;  Serial.println();&lt;br /&gt;  Serial.println(str);&lt;br /&gt;  setRGB(rr, gg, bb);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-1067938605618866118?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/1067938605618866118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=1067938605618866118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1067938605618866118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1067938605618866118'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-26.html' title='March Madness Challenge - Day 26'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-2436573829533015400</id><published>2010-03-25T17:23:00.000-07:00</published><updated>2010-03-25T20:25:43.768-07:00</updated><title type='text'>March Madness Challenge - Day 24</title><content type='html'>Yea, tonight some serial programming. With advice from Mark and John I got a nice Serial Echo program for the Arduino. I need to learn some basics about serial communication and have a tool to debug the communication from web page over Seriality to the Arduino.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt;* Echo Serial on the Arduino&lt;br /&gt;* with advice from Mark Sproul&lt;br /&gt;*/&lt;br /&gt;char str[10]; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;  Serial.begin(9600);&lt;br /&gt;  Serial.println("Start");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop() &lt;br /&gt;{&lt;br /&gt;int ii = 0;&lt;br /&gt;boolean keepgoing = true;&lt;br /&gt;while (keepgoing) &lt;br /&gt;{&lt;br /&gt;  while (Serial.available() ) &lt;br /&gt;    {&lt;br /&gt;     {&lt;br /&gt;      str[ii] = Serial.read();&lt;br /&gt;      //Echo the character as you type&lt;br /&gt;      //Serial.write(str[ii]);&lt;br /&gt;      if (str[ii] == 0x0d )&lt;br /&gt;      {&lt;br /&gt;        keepgoing = false;&lt;br /&gt;      }&lt;br /&gt;      ii++;&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;  str[ii] = 0;&lt;br /&gt;  Serial.println();&lt;br /&gt;  Serial.println(str);&lt;br /&gt;  delay(200);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-2436573829533015400?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/2436573829533015400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=2436573829533015400' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2436573829533015400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2436573829533015400'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-24_25.html' title='March Madness Challenge - Day 24'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-2800747884077346413</id><published>2010-03-24T20:13:00.000-07:00</published><updated>2010-03-24T20:26:36.143-07:00</updated><title type='text'>March Madness Challenge - Day 24</title><content type='html'>Tonight's project is modifying the example RGB slider mixer example from jQuery and crossing it with the Seriality API. I now have an HTML. JQuery, and JQuery UI structure to be connected to an RGB Led, Photoresistor, and Arduino. Tomorrow I'll do the Arduino portion. So I promise tomorrow night will be much more interesting.&lt;br /&gt;&lt;br /&gt;Also, I need to figure out how to use the BitBucket embed. Would be much nicer.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=B0D4VZy2"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-2800747884077346413?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/2800747884077346413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=2800747884077346413' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2800747884077346413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2800747884077346413'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-24.html' title='March Madness Challenge - Day 24'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-4149754072421388755</id><published>2010-03-24T09:40:00.000-07:00</published><updated>2010-03-24T09:42:58.839-07:00</updated><title type='text'>Screen is awesome</title><content type='html'>I was looking for a quick and easy way to look in on a serail port for Mac OS X and came across a tip to use "screen." I really like screen in general, but this really is nice.&lt;br /&gt;&lt;br /&gt;Look for your serial port:&lt;br /&gt;ls /dev/tty.*&lt;br /&gt;&lt;br /&gt;screen /dev/tty.usbserial-ADxxx&lt;br /&gt;&lt;br /&gt;and you are goog to go!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-4149754072421388755?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/4149754072421388755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=4149754072421388755' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4149754072421388755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4149754072421388755'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/screen-is-awesome.html' title='Screen is awesome'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-1926378196529493567</id><published>2010-03-23T20:32:00.000-07:00</published><updated>2010-03-24T18:20:14.138-07:00</updated><title type='text'>March Madness Challenge - Day 23</title><content type='html'>Today's March Madness will be done in less than 30 minutes. Tick, Tick, Tick, .... Erg, bugs, took 2 hours, and still bugs&lt;br /&gt;&lt;br /&gt;I was thinking how neat it would be to be able to reach out to a serial device through the browser. Did some quick searching and found the &lt;a href="http://code.google.com/p/seriality/"&gt;Seriality API browser plugin&lt;/a&gt;. Tested it out and it works well on Mac OS X, and in Firefox. So for tonight I will take my JSON RGB Calibration project and hook it to a web page hosted locally in a web browser.&lt;br /&gt;&lt;br /&gt;Started to move my code over to Bit Bucket. The project code can be found here: &lt;a href="http://bitbucket.org/ricklon/march-madness-fubar-coding-challenge/overview/"&gt;March Madness&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I've got a nifty on off switch. It's a pause on color and other weird things, thing.&lt;br /&gt;&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=XxHjV2A8"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;//*&lt;br /&gt;* The RGB Calibrator&lt;br /&gt;* &lt;br /&gt;* Find, and monitor max brightness of red, green, and blue in an RGB led&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int redPin = 9;    // LED connected to digital pin 9&lt;br /&gt;int greenPin = 11;&lt;br /&gt;int bluePin = 10;&lt;br /&gt;int pins[] = &lt;br /&gt;{&lt;br /&gt;    redPin, greenPin, bluePin&lt;br /&gt;};&lt;br /&gt;int i =0;&lt;br /&gt;&lt;br /&gt;int photoPin = 0;&lt;br /&gt;int potPin = 1;&lt;br /&gt;&lt;br /&gt;int photoVal = -1;&lt;br /&gt;int r,g,b = -1;&lt;br /&gt;int rmax, gmax, bmax = 0;&lt;br /&gt;int rmin, gmin, bmin = 1024;&lt;br /&gt;char on = '-';&lt;br /&gt;long interval = 500; &lt;br /&gt;long previousMillis = 0;&lt;br /&gt;&lt;br /&gt;void setup()  &lt;br /&gt;{ &lt;br /&gt;  Serial.begin(9600);&lt;br /&gt; // Serial.println("Setup done");&lt;br /&gt;  &lt;br /&gt;  pinMode(redPin, OUTPUT);     &lt;br /&gt;  pinMode(greenPin, OUTPUT);     &lt;br /&gt;  pinMode(bluePin, OUTPUT);  &lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;  digitalWrite(bluePin, HIGH); &lt;br /&gt;&lt;br /&gt;  digitalWrite(redPin, LOW);&lt;br /&gt;  delay(1000);&lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(greenPin, LOW);&lt;br /&gt;  delay(1000);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(bluePin, LOW);&lt;br /&gt;  delay(1000);&lt;br /&gt;  digitalWrite(bluePin, HIGH);&lt;br /&gt;  &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void loop()  &lt;br /&gt;{&lt;br /&gt;  if (i &gt; 2) //The number of LEDS being measured&lt;br /&gt;  {&lt;br /&gt;     i = 0; &lt;br /&gt;  }&lt;br /&gt;  if (Serial.available()) {&lt;br /&gt;    on = Serial.read();&lt;br /&gt;  } &lt;br /&gt;  &lt;br /&gt;  if (on == '!' ) {&lt;br /&gt;    digitalWrite(pins[i], LOW);     &lt;br /&gt;    photoVal = analogRead(photoPin);&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;    switch (i)&lt;br /&gt;    {&lt;br /&gt;     case 0: //red led&lt;br /&gt;       r = photoVal;&lt;br /&gt;       rmin = min(rmin, r);&lt;br /&gt;       rmax = max(rmax, r);&lt;br /&gt;       break;&lt;br /&gt;     case 1: //green led&lt;br /&gt;       g = photoVal;&lt;br /&gt;       gmin = min(gmin, g);&lt;br /&gt;       gmax = max(gmax, g);&lt;br /&gt;       break;&lt;br /&gt;     case 2: //blue led&lt;br /&gt;       b = photoVal;&lt;br /&gt;       bmin = min(bmin, b);&lt;br /&gt;       bmax = max(bmax, b);&lt;br /&gt;      break;&lt;br /&gt;     default: //should not happen&lt;br /&gt;       break;&lt;br /&gt;      &lt;br /&gt;    }&lt;br /&gt;    Serial.print ("{ \"entry\" :");&lt;br /&gt;    Serial.print(" { \"photoVal\" : ");&lt;br /&gt;    Serial.print(photoVal);&lt;br /&gt;    &lt;br /&gt;    Serial.print(", \"rmax\" : ");&lt;br /&gt;    Serial.print(rmax);&lt;br /&gt;    Serial.print(", \"gmax\" : ");&lt;br /&gt;    Serial.print(gmax);&lt;br /&gt;    Serial.print(", \"bmax\" : ");&lt;br /&gt;    Serial.print(bmax);&lt;br /&gt;    &lt;br /&gt;    Serial.print(", \"rmin\" : ");&lt;br /&gt;    Serial.print(rmin);&lt;br /&gt;    Serial.print(", \"gmin\" : ");&lt;br /&gt;    Serial.print(gmin);&lt;br /&gt;    Serial.print(", \"bmin\" : ");&lt;br /&gt;    Serial.print(bmin);&lt;br /&gt;    &lt;br /&gt;    Serial.print(", \"r\" : ");&lt;br /&gt;    Serial.print(r);&lt;br /&gt;    Serial.print(", \"g\" : ");&lt;br /&gt;    Serial.print(g);&lt;br /&gt;    Serial.print(", \"b\" : ");&lt;br /&gt;    Serial.print(b);&lt;br /&gt;    Serial.println("}}");&lt;br /&gt;    &lt;br /&gt;    if (millis() - previousMillis &gt; interval) {&lt;br /&gt;      previousMillis = millis();   &lt;br /&gt;      digitalWrite(pins[i], HIGH);&lt;br /&gt;      i++;    &lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;  else &lt;br /&gt;  { &lt;br /&gt;    digitalWrite(pins[i], HIGH);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-1926378196529493567?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/1926378196529493567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=1926378196529493567' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1926378196529493567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1926378196529493567'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-23.html' title='March Madness Challenge - Day 23'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-5815648055822796032</id><published>2010-03-22T20:13:00.000-07:00</published><updated>2010-03-22T20:20:28.806-07:00</updated><title type='text'>March Madness Challenge - Day 22</title><content type='html'>Thought about what I was going to do, figured it would be some twist yesterday, and lo it was. Based on some sample code, and mixing it with simplejson I'm loading json data from the Arduino over serail and transforming it into a Python dictionary. This is neat for few things. One is that is formatted to be Python friendly or anything that reads JSON. it can easily be hooked up to something like a web framework like Django, Pylons, etc.  I'll show the test Python code and then the updated Arduino code.&lt;br /&gt;&lt;br /&gt;Python&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import serial&lt;br /&gt;import simplejson as json&lt;br /&gt;&lt;br /&gt;ser = serial.Serial('/dev/tty.usbserial-A7004qpc',19200)&lt;br /&gt;while 1:&lt;br /&gt; try:&lt;br /&gt;  entry = json.loads(ser.readline())&lt;br /&gt;  print entry&lt;br /&gt;  print entry[u'entry'].keys()&lt;br /&gt; except KeyboardInterrupt:&lt;br /&gt;         raise&lt;br /&gt; except:&lt;br /&gt;  print "value not json"&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Arduino RGB Calibration JSON code&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt;* The RGB Calibrator&lt;br /&gt;* &lt;br /&gt;* Find, and monitor max brightness of red, green, and blue in an RGB led&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int redPin = 9;    // LED connected to digital pin 9&lt;br /&gt;int greenPin = 11;&lt;br /&gt;int bluePin = 10;&lt;br /&gt;int pins[] = &lt;br /&gt;{&lt;br /&gt;    redPin, greenPin, bluePin&lt;br /&gt;};&lt;br /&gt;int i =0;&lt;br /&gt;&lt;br /&gt;int photoPin = 0;&lt;br /&gt;int potPin = 1;&lt;br /&gt;&lt;br /&gt;int photoVal = -1;&lt;br /&gt;int r,g,b = -1;&lt;br /&gt;int rmax, gmax, bmax = 0;&lt;br /&gt;int rmin, gmin, bmin = 1024;&lt;br /&gt;&lt;br /&gt;long interval = 500; &lt;br /&gt;long previousMillis = 0;&lt;br /&gt;&lt;br /&gt;void setup()  &lt;br /&gt;{ &lt;br /&gt;  Serial.begin(19200);&lt;br /&gt; // Serial.println("Setup done");&lt;br /&gt;  &lt;br /&gt;  pinMode(redPin, OUTPUT);     &lt;br /&gt;  pinMode(greenPin, OUTPUT);     &lt;br /&gt;  pinMode(bluePin, OUTPUT);  &lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;  digitalWrite(bluePin, HIGH); &lt;br /&gt;&lt;br /&gt;  digitalWrite(redPin, LOW);&lt;br /&gt;  delay(1000);&lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(greenPin, LOW);&lt;br /&gt;  delay(1000);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(bluePin, LOW);&lt;br /&gt;  delay(1000);&lt;br /&gt;  digitalWrite(bluePin, HIGH);&lt;br /&gt;  &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void loop()  &lt;br /&gt;{&lt;br /&gt;  if (i &gt; 2) //The number of LEDS being measured&lt;br /&gt;  {&lt;br /&gt;     i = 0; &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  digitalWrite(pins[i], LOW);     &lt;br /&gt;  photoVal = analogRead(photoPin);&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  switch (i)&lt;br /&gt;  {&lt;br /&gt;   case 0: //red led&lt;br /&gt;     r = photoVal;&lt;br /&gt;     rmin = min(rmin, r);&lt;br /&gt;     rmax = max(rmax, r);&lt;br /&gt;     break;&lt;br /&gt;   case 1: //green led&lt;br /&gt;     g = photoVal;&lt;br /&gt;     gmin = min(gmin, g);&lt;br /&gt;     gmax = max(gmax, g);&lt;br /&gt;     break;&lt;br /&gt;   case 2: //blue led&lt;br /&gt;     b = photoVal;&lt;br /&gt;     bmin = min(bmin, b);&lt;br /&gt;     bmax = max(bmax, b);&lt;br /&gt;    break;&lt;br /&gt;   default: //should not happen&lt;br /&gt;     break;&lt;br /&gt;    &lt;br /&gt;  }&lt;br /&gt;  Serial.print ("{ \"entry\" :");&lt;br /&gt;  Serial.print(" { \"photoVal\" : ");&lt;br /&gt;  Serial.print(photoVal);&lt;br /&gt;  &lt;br /&gt;  Serial.print(", \"rmax\" : ");&lt;br /&gt;  Serial.print(rmax);&lt;br /&gt;  Serial.print(", \"gmax\" : ");&lt;br /&gt;  Serial.print(gmax);&lt;br /&gt;  Serial.print(", \"bmax\" : ");&lt;br /&gt;  Serial.print(bmax);&lt;br /&gt;  &lt;br /&gt;  Serial.print(", \"rmin\" : ");&lt;br /&gt;  Serial.print(rmin);&lt;br /&gt;  Serial.print(", \"gmin\" : ");&lt;br /&gt;  Serial.print(gmin);&lt;br /&gt;  Serial.print(", \"bmin\" : ");&lt;br /&gt;  Serial.print(bmin);&lt;br /&gt;  &lt;br /&gt;  Serial.print(", \"r\" : ");&lt;br /&gt;  Serial.print(r);&lt;br /&gt;  Serial.print(", \"g\" : ");&lt;br /&gt;  Serial.print(g);&lt;br /&gt;  Serial.print(", \"b\" : ");&lt;br /&gt;  Serial.print(b);&lt;br /&gt;  Serial.println("}}");&lt;br /&gt;  &lt;br /&gt;  if (millis() - previousMillis &gt; interval) {&lt;br /&gt;    previousMillis = millis();   &lt;br /&gt;    digitalWrite(pins[i], HIGH);&lt;br /&gt;    i++;    &lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-5815648055822796032?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/5815648055822796032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=5815648055822796032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/5815648055822796032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/5815648055822796032'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-22.html' title='March Madness Challenge - Day 22'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-8073516718157409933</id><published>2010-03-21T11:17:00.000-07:00</published><updated>2010-03-21T21:03:32.139-07:00</updated><title type='text'>March Madness Challenge - Day 21</title><content type='html'>Worked on the AnnoyAltron 2000 yesterday, the RGB didn't really have good color calibration. So I'm planning to hook a Potentiometer to the RGB LED, next to a Photoresistor on an analog port for the Arduino, and measure the brightness. Then find the correct resistance needed for mixing the RGB colors.&lt;br /&gt;&lt;br /&gt;Hmmm.... interesting maybe this could be made automatic and not need a manual override. If it appears one is brighter than another after calibration a manual setting should be possible.&lt;br /&gt;&lt;br /&gt;Well. After a bit of work I got the basics of this running. I ran to a very interesting set of issues. The RGB led I used is common anode vs common cathode. So after a while of confusion it was resolved that LOW is on, and HIGH is off for that configuration for the Arduino. That brought up the question of why does the AnnoyLatron work at all then. Turns, out I was writing analog values to RGB led. What that did was show values from dark to bright, as opposed to on and off values. So the larger the number the dimmer it got. Smaller the number the brighter it got. It worked in inverse. So for this kind of project it didn't matter too much. I'll go look at the code a little later and see if there were any other "interesting"  things in there.&lt;br /&gt;&lt;br /&gt;Anyway, once that was resolved the rest was pretty simple, but testing it out and making sure the basics were right took a lot of time. I also ended up with a few questions like how do the analog pins sample and return the values detected. I want to confirm that it's strictly a voltage reading. Then I started worrying about noise, and calibrating the calibrator. I had a potentiometer hooked to the pin 1 next the photoresistor pin 0. I pulled that off the bread board, and the values changed to be more consistent. Also, there was light in the room. I was treating that as a constant. &lt;br /&gt;&lt;br /&gt;Things did stabilize. So I was getting decent readings, and I got some decent data on max brightness. However, there was a real problem with the detecting minimum brightness. I figured out a few obvious issues, but some where the min is being assigned a 0, and I can't tell if that is a real reading or not. Also, once maxs and mins are found I didn't provide a way to have maxs and mins readjust overtime and experimentation. THe program needs a reset to adjust as things change. So if I do add some potentiometers to calibrate the brightness, I would need to be able to find those new values without restarting.&lt;br /&gt;&lt;br /&gt;Not perfect but way fun.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt;* The RGB Calibrator&lt;br /&gt;* &lt;br /&gt;* Find, and monitor max brightness of red, green, and blue in an RGB led&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int redPin = 9;    // LED connected to digital pin 9&lt;br /&gt;int greenPin = 11;&lt;br /&gt;int bluePin = 10;&lt;br /&gt;int pins[] = &lt;br /&gt;{&lt;br /&gt;    redPin, greenPin, bluePin&lt;br /&gt;};&lt;br /&gt;int i =0;&lt;br /&gt;&lt;br /&gt;int photoPin = 0;&lt;br /&gt;int potPin = 1;&lt;br /&gt;&lt;br /&gt;int photoVal = -1;&lt;br /&gt;int r,g,b = -1;&lt;br /&gt;int rmax, gmax, bmax = 0;&lt;br /&gt;int rmin, gmin, bmin = 1024;&lt;br /&gt;&lt;br /&gt;long interval = 500; &lt;br /&gt;long previousMillis = 0;&lt;br /&gt;&lt;br /&gt;void setup()  &lt;br /&gt;{ &lt;br /&gt;  Serial.begin(19200);&lt;br /&gt;  Serial.println("Setup done");&lt;br /&gt;  &lt;br /&gt;  pinMode(redPin, OUTPUT);     &lt;br /&gt;  pinMode(greenPin, OUTPUT);     &lt;br /&gt;  pinMode(bluePin, OUTPUT);  &lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;  digitalWrite(bluePin, HIGH); &lt;br /&gt;&lt;br /&gt;  digitalWrite(redPin, LOW);&lt;br /&gt;  delay(1000);&lt;br /&gt;  digitalWrite(redPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(greenPin, LOW);&lt;br /&gt;  delay(1000);&lt;br /&gt;  digitalWrite(greenPin, HIGH);&lt;br /&gt;&lt;br /&gt;  digitalWrite(bluePin, LOW);&lt;br /&gt;  delay(1000);&lt;br /&gt;  digitalWrite(bluePin, HIGH);&lt;br /&gt;  &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void loop()  &lt;br /&gt;{&lt;br /&gt;  if (i &gt; 2) //The number of LEDS being measured&lt;br /&gt;  {&lt;br /&gt;     i = 0; &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  digitalWrite(pins[i], LOW);     &lt;br /&gt;  photoVal = analogRead(photoPin);&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  switch (i)&lt;br /&gt;  {&lt;br /&gt;   case 0: //red led&lt;br /&gt;     r = photoVal;&lt;br /&gt;     rmin = min(rmin, r);&lt;br /&gt;     rmax = max(rmax, r);&lt;br /&gt;     break;&lt;br /&gt;   case 1: //green led&lt;br /&gt;     g = photoVal;&lt;br /&gt;     gmin = min(gmin, g);&lt;br /&gt;     gmax = max(gmax, g);&lt;br /&gt;     break;&lt;br /&gt;   case 2: //blue led&lt;br /&gt;     b = photoVal;&lt;br /&gt;     bmin = min(bmin, b);&lt;br /&gt;     bmax = max(bmax, b);&lt;br /&gt;    break;&lt;br /&gt;   default: //should not happen&lt;br /&gt;     break;&lt;br /&gt;    &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  Serial.print(" photoVal: ");&lt;br /&gt;  Serial.print(photoVal);&lt;br /&gt;  &lt;br /&gt;  Serial.print(" rmax: ");&lt;br /&gt;  Serial.print(rmax);&lt;br /&gt;  Serial.print(" gmax: ");&lt;br /&gt;  Serial.print(gmax);&lt;br /&gt;  Serial.print(" bmax: ");&lt;br /&gt;  Serial.print(bmax);&lt;br /&gt;  &lt;br /&gt;  Serial.print(" rmin: ");&lt;br /&gt;  Serial.print(rmin);&lt;br /&gt;  Serial.print(" gmin: ");&lt;br /&gt;  Serial.print(gmin);&lt;br /&gt;  Serial.print(" bmin: ");&lt;br /&gt;  Serial.print(bmin);&lt;br /&gt;  &lt;br /&gt;  Serial.print(" r: ");&lt;br /&gt;  Serial.print(r);&lt;br /&gt;  Serial.print(" g: ");&lt;br /&gt;  Serial.print(g);&lt;br /&gt;  Serial.print(" b: ");&lt;br /&gt;  Serial.println(b);&lt;br /&gt;  &lt;br /&gt;  if (millis() - previousMillis &gt; interval) {&lt;br /&gt;    previousMillis = millis();   &lt;br /&gt;    digitalWrite(pins[i], HIGH);&lt;br /&gt;    i++;    &lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-8073516718157409933?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/8073516718157409933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=8073516718157409933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8073516718157409933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8073516718157409933'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-21.html' title='March Madness Challenge - Day 21'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-5220010682429375796</id><published>2010-03-20T20:14:00.000-07:00</published><updated>2010-03-21T06:32:21.838-07:00</updated><title type='text'>March Madness Challenge - Day 20</title><content type='html'>Allright. Something interesting for the night. Updated the accelerated LED project, and added a piezo buzzer. So now I offer you the AnnoyALatron 2000. All the RGB goodness brought to you with sound. It's a shaky device that changes pitch as you shake it. Who knew vigorous shaking could do so much for so few. :-P &lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/qobngrJLDNw&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/qobngrJLDNw&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;a href="http://www.youtube.com/watch?v=qobngrJLDNw"&gt;http://www.youtube.com/watch?v=qobngrJLDNw&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt;* The AnnoyAlatron 2000&lt;br /&gt;* &lt;br /&gt;* Accelorometer  controled red, green, blue leds, and piezo buzzer&lt;br /&gt;* ADXL335&lt;br /&gt;*/&lt;br /&gt;#define NOTE_C6  1047&lt;br /&gt;#define NOTE_E6  1319&lt;br /&gt;#define NOTE_G6  1568&lt;br /&gt;&lt;br /&gt;int notes[] = {&lt;br /&gt;  NOTE_C6, NOTE_E6,NOTE_G6 };&lt;br /&gt;&lt;br /&gt;int piezoPin = 8;&lt;br /&gt;int greenPin = 9;    // LED connected to digital pin 9&lt;br /&gt;int redPin = 10;&lt;br /&gt;int bluePin = 11;&lt;br /&gt;int Z = 0;&lt;br /&gt;int Y = 1;&lt;br /&gt;int X = 2;&lt;br /&gt;int r,g,b = 0;&lt;br /&gt;int xmax, ymax, zmax = 0;&lt;br /&gt;int xmin, ymin, zmin = 1024;&lt;br /&gt;float xg, yg, zg;&lt;br /&gt;&lt;br /&gt;void rgb (int r, int g, int b) &lt;br /&gt;{&lt;br /&gt;     analogWrite(redPin, r);&lt;br /&gt;     analogWrite(greenPin, g);&lt;br /&gt;     analogWrite(bluePin, b);&lt;br /&gt;     &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//From the Adafruit forums&lt;br /&gt;float to_g(const int axis_value) &lt;br /&gt;{&lt;br /&gt;  const float arduino_power_supply = 5;&lt;br /&gt;  const float sensor_power_supply = 3.3;&lt;br /&gt;  const float zero_g_bias = sensor_power_supply / 2;&lt;br /&gt;  float voltage = axis_value * arduino_power_supply / 1024;&lt;br /&gt;  return (voltage - zero_g_bias) * 1000 / 330;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void setup()  &lt;br /&gt;{ &lt;br /&gt;  Serial.begin(19200);&lt;br /&gt;  Serial.println("Setup done");&lt;br /&gt;  tone(piezoPin, notes[0], 200);&lt;br /&gt;  tone(piezoPin, notes[1], 200);&lt;br /&gt;  tone(piezoPin, notes[2], 200);&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void loop()  &lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  r = analogRead(Z);&lt;br /&gt;  g = analogRead(Y);&lt;br /&gt;  b = analogRead(X);&lt;br /&gt;  &lt;br /&gt;  xg = to_g(b);&lt;br /&gt;  yg = to_g(g);&lt;br /&gt;  zg = to_g(r);  &lt;br /&gt;  &lt;br /&gt;  Serial.print(" X: ");&lt;br /&gt;  Serial.print(b);&lt;br /&gt;  Serial.print(" xg: ");&lt;br /&gt;  Serial.print(xg);&lt;br /&gt;  Serial.print(" Y: ");&lt;br /&gt;  Serial.print(g);&lt;br /&gt;  Serial.print(" yg: ");&lt;br /&gt;  Serial.print(yg);&lt;br /&gt;  Serial.print(" Z: ");&lt;br /&gt;  Serial.print(r);&lt;br /&gt;  Serial.print(" zg: ");&lt;br /&gt;  Serial.println(zg);&lt;br /&gt; &lt;br /&gt;  xmin = min(xmin, b);&lt;br /&gt;  ymin = min(ymin, g);&lt;br /&gt;  zmin = min(zmin, r);&lt;br /&gt;  &lt;br /&gt;  xmax = max(xmax, b);&lt;br /&gt;  ymax = max(ymax, g);&lt;br /&gt;  zmax = max(zmax, r);&lt;br /&gt;  &lt;br /&gt;  tone(piezoPin, (r + notes[0]), 10);&lt;br /&gt;  tone(piezoPin, (g + notes[1]), 10); &lt;br /&gt;  tone(piezoPin, (b + notes[2]), 10);&lt;br /&gt;&lt;br /&gt;  r = map(r, zmin, zmax, 0, 255);&lt;br /&gt;  g = map(g, ymin, ymax, 0, 255);&lt;br /&gt;  b = map(b, xmin, xmax, 0, 255);&lt;br /&gt;      &lt;br /&gt;  rgb(r, g, b);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-5220010682429375796?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/5220010682429375796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=5220010682429375796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/5220010682429375796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/5220010682429375796'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-20.html' title='March Madness Challenge - Day 20'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-1653699458011119479</id><published>2010-03-19T19:29:00.000-07:00</published><updated>2010-03-20T12:06:01.624-07:00</updated><title type='text'>March Madness Challenge - Day 19</title><content type='html'>Ok Google, why does your Google Apps Script not have any decent search features. Let's look at the API for contacts. If your grep for search nope nothing, nada. There is findByEmailAddress, but I have to know what I'm looking for not a substring. This goes with events, I can search the calendar application and search for words related to my events, but the API doesn't contain a search feature. You have to select an event by date. Not so useful. Anyway onto tonight's March madness.&lt;br /&gt;&lt;br /&gt;Non working code, sorry.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function getAllContacts() {&lt;br /&gt;  var contacts = ContactsApp.getAllContacts();&lt;br /&gt;  for (var i = 0; i &lt; contacts.lengh; i++) &lt;br /&gt;  {&lt;br /&gt;    var contact = [];&lt;br /&gt;    contact.push(contacts[i].getFullName());&lt;br /&gt;    contact.push(contacts[i].getPrimaryEmail());&lt;br /&gt;    contact.push(contacts[i].getEmailAddresses());&lt;br /&gt;    contact.push(contacts[i].getHomeAddress());&lt;br /&gt;    contact.push(contacts[i].getWorkAddress());&lt;br /&gt;    contact.push(contacts[i].getPager());&lt;br /&gt;    contact.push(contacts[i].getHomeFax());&lt;br /&gt;    contact.push(contacts[i].getWorkFax());&lt;br /&gt;    contact.push(contacts[i].getHomePhone());&lt;br /&gt;    contact.push(contacts[i].getWorkPhone());&lt;br /&gt;    contact.push(contacts[i].getMobilePhone());&lt;br /&gt;    contact.push(contacts[i].getNotes());&lt;br /&gt;    contact.push(contacts[i].getUserDefinedField());&lt;br /&gt;    contact.push(contacts[i].getUserDefinedFields());&lt;br /&gt;    range = SpreadsheetApp.getActiveSheet().getRange((3+i),1,1,contact.length);&lt;br /&gt;    range.setValues([contact]);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-1653699458011119479?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/1653699458011119479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=1653699458011119479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1653699458011119479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1653699458011119479'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-19.html' title='March Madness Challenge - Day 19'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-8853858772375793414</id><published>2010-03-18T21:58:00.000-07:00</published><updated>2010-03-18T21:59:45.221-07:00</updated><title type='text'>March Madness Challenge - Day 18</title><content type='html'>&lt;pre&gt;&lt;br /&gt;//Apply force and torque to  large sphere in Second LIfe&lt;br /&gt;default&lt;br /&gt;{&lt;br /&gt;    touch(integer i)&lt;br /&gt;    {&lt;br /&gt;        llSetStatus(STATUS_PHYSICS, TRUE);&lt;br /&gt;        llSetForceAndTorque(&lt;0x7FFFFFFF,0x7FFFFFFF,0x7FFFFFFF&gt;, &lt;10,0x7FFFFFFF,10&gt;,0);&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-8853858772375793414?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/8853858772375793414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=8853858772375793414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8853858772375793414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8853858772375793414'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-18.html' title='March Madness Challenge - Day 18'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-7083691349830608660</id><published>2010-03-17T20:50:00.000-07:00</published><updated>2010-03-17T20:55:14.267-07:00</updated><title type='text'>March Madness Day 17</title><content type='html'>Experimentation with representations of JSON in Python. This program takes some test data in a file of formatted JSON data from stdio and loads it into memory and then prints out the version in memory.&lt;br /&gt;&lt;br /&gt;testdata.json&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;{"foo":"bar", "baz":1, "a":2}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;jsonstdio.py&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import sys&lt;br /&gt;import json&lt;br /&gt;&lt;br /&gt;def getjson(jd):&lt;br /&gt;        jsondata = json.loads(jd)&lt;br /&gt;        print "JSON Data: "&lt;br /&gt;        print repr(jsondata)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;def main():&lt;br /&gt; stdin = sys.stdin.read()&lt;br /&gt; getjson(stdin)&lt;br /&gt; &lt;br /&gt;if __name__=="__main__":&lt;br /&gt;    main()&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to run:&lt;br /&gt;python jsonstdio.py &lt; testdata.json&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-7083691349830608660?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/7083691349830608660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=7083691349830608660' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/7083691349830608660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/7083691349830608660'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-day-17.html' title='March Madness Day 17'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-7270826208513349958</id><published>2010-03-16T20:55:00.000-07:00</published><updated>2010-03-16T21:00:33.173-07:00</updated><title type='text'>March Madness Challenge - Day 16</title><content type='html'>Wired and ADXL335 accelerometer to RGB leds. Thought neat I've got a simple program. Oops, the only difference between the Joystick controlled RGB LED was that I was measuring X, Y, and Z axis. Three variable between two programs. Yikes, that sounds a lot like a rule violation. So in the last few minutes I've added self calibration to the device. I didn't have time to work out the math and turn the numbers into something meaning so I did something to make it more meaningful to an LED. x, y, and z max and min values are now checked and set so depending on the most recent max and mins the widest led action occurs.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt;* Accelerometer  controlled red, green, blue leds&lt;br /&gt;* ADXL35&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int redPin = 9;    // LED connected to digital pin 9&lt;br /&gt;int greenPin = 10;&lt;br /&gt;int bluePin = 11;&lt;br /&gt;int Z = 0;&lt;br /&gt;int Y = 1;&lt;br /&gt;int X = 2;&lt;br /&gt;int r,g,b = 0;&lt;br /&gt;int xmax, ymax, zmax = 0;&lt;br /&gt;int xmin, ymin, zmin = 1024;&lt;br /&gt;&lt;br /&gt;void rgb (int r, int g, int b) &lt;br /&gt;{&lt;br /&gt;     analogWrite(redPin, r);&lt;br /&gt;     analogWrite(greenPin, g);&lt;br /&gt;     analogWrite(bluePin, b);&lt;br /&gt;     &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void setup()  { &lt;br /&gt;  Serial.begin(9600);&lt;br /&gt;  Serial.println("Setup done");&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void loop()  {&lt;br /&gt;&lt;br /&gt;  r = analogRead(Z);&lt;br /&gt;  g = analogRead(Y);&lt;br /&gt;  b = analogRead(X);&lt;br /&gt; &lt;br /&gt;  xmin = min(xmin, b);&lt;br /&gt;  ymin = min(ymin, g);&lt;br /&gt;  zmin = min(zmin, r);&lt;br /&gt;  &lt;br /&gt;  xmax = max(xmax, b);&lt;br /&gt;  ymax = max(ymax, g);&lt;br /&gt;  zmax = max(zmax, r);&lt;br /&gt;  /*&lt;br /&gt;  Serial.print("xmin: ");&lt;br /&gt;  Serial.print(xmin);&lt;br /&gt;  Serial.print(", xmax: ");&lt;br /&gt;  Serial.print(xmax);&lt;br /&gt;  Serial.print(" ymin: ");&lt;br /&gt;  Serial.print(ymin);&lt;br /&gt;  Serial.print(", zmax: ");&lt;br /&gt;  Serial.println(zmax);&lt;br /&gt;  */  &lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  r = map(r, zmin, zmax, 0, 255);&lt;br /&gt;  g = map(g, ymin, ymax, 0, 255);&lt;br /&gt;  b = map(b, xmin, xmax, 0, 255);&lt;br /&gt;      &lt;br /&gt;  rgb(r, g, b);&lt;br /&gt;  /*&lt;br /&gt;  Serial.print(r);&lt;br /&gt;  Serial.print(", ");&lt;br /&gt;  Serial.print(g);&lt;br /&gt;  Serial.print(", ");&lt;br /&gt;  Serial.println(b);&lt;br /&gt; */&lt;br /&gt;        &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-7270826208513349958?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/7270826208513349958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=7270826208513349958' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/7270826208513349958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/7270826208513349958'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-16.html' title='March Madness Challenge - Day 16'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-8432736640551081534</id><published>2010-03-15T20:59:00.000-07:00</published><updated>2010-03-15T21:25:41.657-07:00</updated><title type='text'>March Madness Challenge - Day 15</title><content type='html'>This time tried to create Events from a Google Spreadsheet. Came close but ran out of time. The time parsing was messed up. I could not find clear docs about the format of the Spreadsheet date that would be compatible with the Javascript Date function. None of the options looked to be a visual match. Adding a menu item called "makeEvent" worked. Selecting info from the active row seemed to work well. Even though I really wanted getDataRange inside of a range. I new the number of columns so I could just grab what I needed. Lastly, the "options" part of createEvent(title, starttime, endtime, options) was a Javascript Object. This always ended up blank, probably an error on my part. But no multi value examples were available. &lt;br /&gt;&lt;br /&gt;I did find this useful set of examples when I was flailing around &lt;a href="http://ouseful.wordpress.com/2010/03/07/maintaining-a-google-calendar-from-a-goole-spreadsheet-reprise/"&gt;Maintaing a Google Calendar from a Spreadsheet, Reprise.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function onOpen() {&lt;br /&gt;  var sheet = SpreadsheetApp.getActiveSpreadsheet();&lt;br /&gt;  var menuEntries = [ {name: "MakeEvent", functionName: "getEventFromSpreadSheet"} ];&lt;br /&gt;  sheet.addMenu("Events", menuEntries);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function getEventFromSpreadSheet () {&lt;br /&gt;  &lt;br /&gt;  var range = SpreadsheetApp.getActiveRange();  &lt;br /&gt;&lt;br /&gt;  var vals = range.getValues();&lt;br /&gt;  var Title = vals[0];&lt;br /&gt;  var Description = vals[1];&lt;br /&gt;  var Summary = vals[2];&lt;br /&gt;  var StartTime = vals[3];&lt;br /&gt;  var EndTime = vals[4];&lt;br /&gt;  var Location = vals[5];&lt;br /&gt;  var Guests = vals[6];&lt;br /&gt;  var GuestsStatus = vals[7];&lt;br /&gt;  var Invites = vals[8];&lt;br /&gt;  var Options = {description: Description,&lt;br /&gt;      guests: Guests,&lt;br /&gt;      location: Location,&lt;br /&gt;      sendInvites: Invites&lt;br /&gt;      };&lt;br /&gt;  makeEvent(Title, StartTime, EndTime, Options);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function makeEvent(Title, StartTime, EndTime, Options) {&lt;br /&gt;  var cal = CalendarApp.getDefaultCalendar();&lt;br /&gt;  cal.createEvent(Title, new Date(StartTime), new Date(EndTime), {location:'blah loc'}, {description: 'blah desc'});  &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;W00t the fixes just clicked. Given my comments below here is the fixed code:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function onOpen() {&lt;br /&gt;  var sheet = SpreadsheetApp.getActiveSpreadsheet();&lt;br /&gt;  var menuEntries = [ {name: "MakeEvent", functionName: "getEventFromSpreadSheet"} ];&lt;br /&gt;  sheet.addMenu("Events", menuEntries);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function getEventFromSpreadSheet () {&lt;br /&gt;  &lt;br /&gt;  var range = SpreadsheetApp.getActiveRange();  &lt;br /&gt;&lt;br /&gt;  var vals = range.getValues();&lt;br /&gt;  var Title = vals[0][0];&lt;br /&gt;  var Description = vals[0][1];&lt;br /&gt;  var Summary = vals[0][2];&lt;br /&gt;  var StartTime = vals[0][3];&lt;br /&gt;  var EndTime = vals[0][4];&lt;br /&gt;  var Location = vals[0][5];&lt;br /&gt;  var Guests = vals[0][6];&lt;br /&gt;  var GuestsStatus = vals[0][7];&lt;br /&gt;  var Invites = vals[0][8];&lt;br /&gt;  var Options = {description: Description,&lt;br /&gt;      guests: Guests,&lt;br /&gt;      location: Location,&lt;br /&gt;      sendInvites: Invites&lt;br /&gt;      };&lt;br /&gt;&lt;br /&gt;  makeEvent(Title, StartTime, EndTime, Options);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function makeEvent(Title, StartTime, EndTime, Options) {&lt;br /&gt;  var cal = CalendarApp.getDefaultCalendar();&lt;br /&gt;  cal.createEvent(Title, new Date(StartTime), new Date(EndTime), Options); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And here is the CSV of the spreadsheet I tested with:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Title,Description,Summary,StartTime,EndTime,Location,Guests,GuestsStatus&lt;br /&gt;MyTest,MyTest Description,MyTest Summary,9/22/2010 10:00:00,9/22/2010 11:00:00,Home Test,0000@noemail.gmail.com,yes&lt;br /&gt;MyTest1,MyTest Description,MyTest Summary,10/22/2010 0:00:00,10/22/2010 0:00:00,Home Test,0000@noemail.gmail.com,yes&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-8432736640551081534?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/8432736640551081534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=8432736640551081534' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8432736640551081534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8432736640551081534'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-15.html' title='March Madness Challenge - Day 15'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-6603329031911695488</id><published>2010-03-14T08:29:00.000-07:00</published><updated>2010-03-14T19:43:41.487-07:00</updated><title type='text'>March Madness Challenge - Day 14</title><content type='html'>I wrote some code earlier that scraped the guest from an event in the Google Calendar the hard way. With a little bit of searching around it looks &lt;a href="http://googleappsscript.blogspot.com/"&gt; Google Apps Scripting&lt;/a&gt; is the right solution. So in keeping with the spirit of March Madness I will need to do something more than rewrite that entry. These functions dump the entire Default Calendar events into a Google Spreadsheet. I would have liked to have  write a script that get's the guests from one event, creates a new event and invites them to it, but I got side tracked.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I really liked the Logger object, but it started causing errors so I removed that code. I put it back and everything seemed good so I moved on.&lt;br /&gt;&lt;br /&gt;Hint to get oriented for selecting range values:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var range = SpreadsheetApp.getActiveSheet().getRange(1,1,1,8);&lt;br /&gt;  Browser.msgBox("row: " + range.getRowIndex() + " rows: " + range.getNumRows() + " col: " + range.getColumnIndex() + " cols: " + range.getNumColumns() + " Vals: " + range.getValues());&lt;br /&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The code for tonight. Make a Google Apps Script and paste the code in. However, I use the&lt;a href="http://www.json.org/json2.js"&gt; JSON.stringify library&lt;/a&gt; for the full dump of the event Object. It has to be pasted in at the bottom of the file. You can get that code here:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This code dumps the entire object including the functions. So if you need analyze what Google is doing this approach get's every piece of data and method for the object. Some times it's nice to get all the detail. As a short cut I use JSON.stringify to dump the data held in some of the fields. If you can read the JSON this is nice because it directly translates into the object, and you can keep drilling down.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function dumpEventObject() {&lt;br /&gt;  // The code below will retrieve all the events for the user's default calendar and&lt;br /&gt;  // display the description of the first event&lt;br /&gt;  var cal = CalendarApp.getDefaultCalendar();&lt;br /&gt;  var events = cal.getEvents(new Date("July 21, 2009 EST"), new Date());&lt;br /&gt;  var text = "";&lt;br /&gt;  var range;&lt;br /&gt;  &lt;br /&gt;  event = [];&lt;br /&gt; &lt;br /&gt;  Logger.log(JSON.stringify(events[0]));&lt;br /&gt;&lt;br /&gt;  //set the headers&lt;br /&gt;  var key;&lt;br /&gt;  for (key in events[0]){&lt;br /&gt;         event.push(key);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  range = SpreadsheetApp.getActiveSheet().getRange(2,1,1,event.length);&lt;br /&gt;  range.setValues([event]);&lt;br /&gt;&lt;br /&gt;  //add the dat into appropriate rows/columns&lt;br /&gt;  var i;&lt;br /&gt;  for (i = 0; i &lt; events.length; i++)&lt;br /&gt;  {&lt;br /&gt;    event = [];&lt;br /&gt;     for (ev in events[i] )&lt;br /&gt;    {&lt;br /&gt;     if (typeof events[i][ev] != 'function') {&lt;br /&gt;        event.push(JSON.stringify(events[i][ev]));&lt;br /&gt;      } else {&lt;br /&gt;              event.push(events[i][ev]);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    range = SpreadsheetApp.getActiveSheet().getRange((3+i),1,1,event.length);&lt;br /&gt;    range.setValues([event]);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Dumps only the data. This is useful to get information you need and work with. I can see cleaning this up more and really make a nice library. This doesn't use JSON.stringify. It iterates through any arrays and separates them on a new line. So all the email address for guests of an event are clearly listed.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function dumpEventData () {&lt;br /&gt;  // The code  below will retrieve all the events for the user's default calendar and&lt;br /&gt;  // display the  description of the first event&lt;br /&gt;  var cal = CalendarApp.getDefaultCalendar();&lt;br /&gt;  var events = cal.getEvents(new Date("July 21, 2009 EST"), new Date());&lt;br /&gt;  var event = [];&lt;br /&gt;&lt;br /&gt;  //set the headers&lt;br /&gt;  for (var key in events[0]){&lt;br /&gt;       if ((typeof events[0][key] != 'function'  ) &amp;&amp; ( typeof  events[0][key] != 'undefined' ) ){&lt;br /&gt;         event.push(key);&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;  var range = SpreadsheetApp.getActiveSheet().getRange(2,1,1,event.length);&lt;br /&gt;  range.setValues([event]);&lt;br /&gt;  &lt;br /&gt;  for (var i = 0; i &lt; events.length; i++)&lt;br /&gt;  {&lt;br /&gt;     event =  [];&lt;br /&gt;    for (key in events[i] )&lt;br /&gt;     {&lt;br /&gt;       if ((typeof events[i][key] != 'function'  ) &amp;&amp; ( typeof  events[i][key] != 'undefined' ) ){&lt;br /&gt;         if ((typeof  events[i][key] == 'object') &amp;&amp; (events[i][key].length))&lt;br /&gt;         {&lt;br /&gt;           var txt = "";&lt;br /&gt;           for (var k in events[i][key])&lt;br /&gt;           {&lt;br /&gt;             txt = txt + events[i][key][k] + "\n";&lt;br /&gt;           }&lt;br /&gt;           event.push(txt);&lt;br /&gt;         }&lt;br /&gt;         else&lt;br /&gt;         {&lt;br /&gt;           event.push(events[i][key]);&lt;br /&gt;         }&lt;br /&gt;       }      &lt;br /&gt;     }&lt;br /&gt;    range = SpreadsheetApp.getActiveSheet().getRange((3+i),1,1,event.length);&lt;br /&gt;    range.setValues([event]);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I'm pretty excited about this new capability. If anyone has feedback I'd appreciate it. This is my first rough crack at Google Apps Scripting. I think there is some amazing potential here.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-6603329031911695488?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/6603329031911695488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=6603329031911695488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/6603329031911695488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/6603329031911695488'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-14.html' title='March Madness Challenge - Day 14'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-4303408919010394226</id><published>2010-03-13T20:25:00.000-08:00</published><updated>2010-03-13T20:30:38.492-08:00</updated><title type='text'>March Madness Challenge - Day 13</title><content type='html'>Exploration of the zip, izip functions in Python. The code doesn't really get to the meaning and best use of the zip, and izip functions. Another piece of code I'm going to have to revisit later. I'll be exploring Python test frameworks soon, hopefully, I can revisit the testing and bench marking using one of the official Python frameworks.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;from itertools import izip&lt;br /&gt;&lt;br /&gt;c1 = ["ft","fu","fs","fv"]&lt;br /&gt;c2 = ["gt","gu","gs","gv"]&lt;br /&gt;c3 = ["ht","hu","hs","hv"]&lt;br /&gt;c4 = ["it","iu","is","iv"]&lt;br /&gt;&lt;br /&gt;c  = [c1,c2,c3,c4]&lt;br /&gt;ind = ["r1","r2","r3","r4"]&lt;br /&gt;&lt;br /&gt;def showit(c):&lt;br /&gt;        for i in c:&lt;br /&gt;                for k in i:&lt;br /&gt;                        print k&lt;br /&gt;def izipit(c):&lt;br /&gt;        for (i,k) in izip(ind, c):&lt;br /&gt;                print i&lt;br /&gt;                print k&lt;br /&gt;&lt;br /&gt;def zipit(ind, c):&lt;br /&gt;        d = dict(zip(ind, c))&lt;br /&gt;        return d&lt;br /&gt;&lt;br /&gt;print "showit(c)"&lt;br /&gt;showit(c)&lt;br /&gt;print "izipit(c)"&lt;br /&gt;izipit(c)&lt;br /&gt;print "zipit(c)"&lt;br /&gt;print zipit(ind, c)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-4303408919010394226?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/4303408919010394226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=4303408919010394226' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4303408919010394226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4303408919010394226'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-13.html' title='March Madness Challenge - Day 13'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-3303935328550401483</id><published>2010-03-12T18:21:00.000-08:00</published><updated>2010-03-12T19:47:04.160-08:00</updated><title type='text'>March Madness Challenge - Day 12</title><content type='html'>I've been at the Virtual Worlds Best Practices in Education Conference all day. I've learning all kinds of neat stuff about mixed reality, real reality, virtual reality, and lots of stuff in between. The 3D world in this case is Second Life from the Linden Lab people. They came out with a beta browser and there's lot's of neat potential. The shared media component is really nice. I can create a panel and post to my blog on it now. What I'm really waiting for is the  ability to export/import 3D objects to standard 3D tools like Blender. So it would be great to build stuff in or out of Second Life, and then be able to send it to a Makerbot or Mendel for printing.&lt;br /&gt;&lt;br /&gt;In the meantime I wrote this script which sends messages from the sender prim to the receiver prim and tells it to fade away the more it is clicked.&lt;br /&gt;&lt;br /&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/DcAty05lclQ&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/DcAty05lclQ&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;The Red Message Sending Box/Prim:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;integer chan = -12878;  &lt;br /&gt;&lt;br /&gt;default&lt;br /&gt;{&lt;br /&gt;    state_entry()&lt;br /&gt;    {&lt;br /&gt;        llOwnerSay( "Sending prim ready");&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    touch_start(integer total_number)&lt;br /&gt;    {&lt;br /&gt;         llSay(chan, "Hello, this is from RK");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The Blue Spinny Thing that receives messages from Red Message Box.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;float spin_rate = 0.1;&lt;br /&gt;integer chan = -12878;   &lt;br /&gt;float alpha = 1.0;   &lt;br /&gt;&lt;br /&gt;default&lt;br /&gt;{&lt;br /&gt;    state_entry()&lt;br /&gt;    {&lt;br /&gt;        llSay(0, "Hello, Avatar!");&lt;br /&gt;        llListen(chan, "", "", "");&lt;br /&gt;        llTargetOmega(&lt;1.0,0.0,0.0&gt;,spin_rate,0.2);&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    listen(integer channel, string name, key id,  string message)&lt;br /&gt;    { &lt;br /&gt;        llSay(0,"I heard:"+message);&lt;br /&gt;        alpha = alpha - 0.1;                     &lt;br /&gt;        llSetAlpha(alpha,ALL_SIDES);&lt;br /&gt;        if (alpha &lt; 0.0)&lt;br /&gt;          {&lt;br /&gt;             alpha = 1.0;&lt;br /&gt;          }  &lt;br /&gt;    }   &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-3303935328550401483?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/3303935328550401483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=3303935328550401483' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/3303935328550401483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/3303935328550401483'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-12.html' title='March Madness Challenge - Day 12'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-322145293478071737</id><published>2010-03-11T20:17:00.000-08:00</published><updated>2010-03-12T11:25:10.082-08:00</updated><title type='text'>March Madness Challenge - Day 11</title><content type='html'>Hello kwargs&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#test the default args&lt;br /&gt;&lt;br /&gt;def test2args(arg1="default1", arg2="default2"):&lt;br /&gt; print "arg1: " + arg1&lt;br /&gt; print "arg2: " + arg2&lt;br /&gt;&lt;br /&gt;def test2argskwargs(arg1="default1", arg2="default2", **kwargs):&lt;br /&gt;        print "arg1: " + arg1&lt;br /&gt;        print "arg2: " + arg2&lt;br /&gt;        for k, v in kwargs:&lt;br /&gt;  print "%s=%s" % (k, v)&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;test2args()&lt;br /&gt;test2args("1","2")&lt;br /&gt;args = ("3","4")&lt;br /&gt;&lt;br /&gt;test2args(*args)&lt;br /&gt;#test2args(a="5", b="6")&lt;br /&gt;test2argskwargs("3","4", a="5", b="6")&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-322145293478071737?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/322145293478071737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=322145293478071737' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/322145293478071737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/322145293478071737'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-11.html' title='March Madness Challenge - Day 11'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-8802647830720662080</id><published>2010-03-10T20:35:00.000-08:00</published><updated>2010-03-10T20:53:01.037-08:00</updated><title type='text'>March Madness Challenge - Day 10</title><content type='html'>Ok. Fighting back from last minute code, and then trying to fix it the next day. My little fixes managed to break barely working code. So, let's look at a a testing framework for Javascript called &lt;a href="http://docs.jquery.com/QUnit"&gt;Qunit&lt;/a&gt;. QUnit is a jQuery based testing framework. Once you've got the basic html in place just include the necessary css and Javascript and you are up and running. Since my previous code had some issues with cookies I figured I would use QUnit to do a couple of test of how cookies work. I'll probably do more variations on this theme, but until then. Here's the code need to quickly test if cookies exist, cookies are created, etc.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://butterflysmack.com/rianders/mapapi/qunitcookie.html"&gt;Live Page&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;QUnit Cookie test&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;initial-scale=1.0, user-scalable=no&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://www.google.com/jsapi?key=ABQIAAAAyOcYQmrUZiRTkZD33sBhThSYG2nKbTfLUqOyuY0R-KaU9CNsSxQHWg8je-XfTEMamlZKbXxG4Z752A&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://maps.google.com/maps/api/js?sensor=true&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;          google.load(&amp;quot;jquery&amp;quot;, &amp;quot;1.4.2&amp;quot;);&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;  &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;http://github.com/jquery/qunit/raw/master/qunit/qunit.css&amp;quot; type=&amp;quot;text/css&amp;quot; media=&amp;quot;screen&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://github.com/jquery/qunit/raw/master/qunit/qunit.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;jquery.cookies.2.2.0.min.js&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt; $(document).ready(function() {&lt;br /&gt;&lt;br /&gt;  test(&amp;quot;a basic test example&amp;quot;, function() {&lt;br /&gt;    ok( true, &amp;quot;this test is fine&amp;quot; );&lt;br /&gt;    var value = &amp;quot;hello&amp;quot;;&lt;br /&gt;          equals( &amp;quot;hello&amp;quot;, value, &amp;quot;We expect value to be hello&amp;quot; );&lt;br /&gt;         });&lt;br /&gt;&lt;br /&gt;  test(&amp;quot;Are cookies available?&amp;quot;, function() {&lt;br /&gt;   ok(true, $.cookies.test());&lt;br /&gt;   });&lt;br /&gt;&lt;br /&gt;  //Are there existing cookies&lt;br /&gt;  test(&amp;quot;Is there an existing cookie?&amp;quot;, function() {&lt;br /&gt;   equals(true, $.cookies.get(&amp;#039;newcookie&amp;#039;)[0].test, &amp;quot;Cookie exists from last time.&amp;quot;);&lt;br /&gt;   });&lt;br /&gt;&lt;br /&gt;  //Load cookie values nd check&lt;br /&gt;&lt;br /&gt;  //Create a new cookie test&lt;br /&gt;  test(&amp;quot;Created new cookie.&amp;quot;, function () {&lt;br /&gt;   var markers = [];&lt;br /&gt;   var marker = {test: true, date: new Date() } ;&lt;br /&gt;   markers.push(marker);&lt;br /&gt;   $.cookies.set(&amp;#039;newcookie&amp;#039;, markers);      &lt;br /&gt;   var cookiedata = $.cookies.get(&amp;#039;newcookie&amp;#039;);&lt;br /&gt;   equals(true, cookiedata[0].test, &amp;quot;Cookie data is true&amp;quot;);&lt;br /&gt;  });&lt;br /&gt;                //if not created create cookie data&lt;br /&gt;&lt;br /&gt;                //find and display existing markers&lt;br /&gt;        });&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt; div.c1 {width:100%; height:100%}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;   &amp;lt;h1 id=&amp;quot;qunit-header&amp;quot;&amp;gt;QUnit Cookie Tests&amp;lt;/h1&amp;gt;&lt;br /&gt;    &amp;lt;h2 id=&amp;quot;qunit-banner&amp;quot;&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;     &amp;lt;h2 id=&amp;quot;qunit-userAgent&amp;quot;&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;      &amp;lt;ol id=&amp;quot;qunit-tests&amp;quot;&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-8802647830720662080?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/8802647830720662080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=8802647830720662080' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8802647830720662080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/8802647830720662080'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-10.html' title='March Madness Challenge - Day 10'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-4970497585306728635</id><published>2010-03-09T20:29:00.000-08:00</published><updated>2010-03-09T21:25:27.066-08:00</updated><title type='text'>March Madness Challenge - Day 9</title><content type='html'>Another last minute post. Attempting to save marker data as JSON array in a Cookie in a jQuery friendly way. I ran out of time to test the code. In theory it should work. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://butterflysmack.com/rianders/mapapi/dogpooin.html?quality=3&amp;setcenter="&gt;Preview URL&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;    &amp;lt;meta http-equiv=&amp;quot;content-type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;Where in the world is my dog pooin!&amp;lt;/title&amp;gt;&lt;br /&gt;    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;initial-scale=1.0, user-scalable=no&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://www.google.com/jsapi?key=ABQIAAAAyOcYQmrUZiRTkZD33sBhThSYG2nKbTfLUqOyuY0R-KaU9CNsSxQHWg8je-XfTEMamlZKbXxG4Z752A&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://maps.google.com/maps/api/js?sensor=true&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;   &lt;br /&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;          google.load(&amp;quot;jquery&amp;quot;, &amp;quot;1.4.2&amp;quot;);&lt;br /&gt;  &amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;jquery.cookies.2.2.0.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;   &lt;br /&gt;&lt;br /&gt;      &amp;lt;script type=&amp;quot;text/javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;       $(document).ready(function() {&lt;br /&gt;         var markers = [];&lt;br /&gt;  function setPosition(position) {&lt;br /&gt;   console.log(&amp;quot;setPosition: lat: &amp;quot; + position.coords.latitude + &amp;quot; lng: &amp;quot; + position.coords.longitude   );&lt;br /&gt;   var location = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);&lt;br /&gt;   console.log(&amp;quot;Map: &amp;quot; + map);&lt;br /&gt;   map.setCenter(location, 13);&lt;br /&gt;   addMarker(location, &amp;quot;Quality: &amp;quot; +  $(&amp;quot;input[name=&amp;#039;quality&amp;#039;]:checked&amp;quot;).val()  + &amp;quot;Date: &amp;quot; + new Date());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function addMarker(location, msg) {&lt;br /&gt;    var marker = new google.maps.Marker({&lt;br /&gt;    position: location, &lt;br /&gt;    map: map, &lt;br /&gt;    title: msg&lt;br /&gt;    });&lt;br /&gt;   markers.push(marker);&lt;br /&gt;        $.cookies.set(&amp;#039;dogdata&amp;#039;, markers);  &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;  function detectBrowser() {&lt;br /&gt;   var useragent = navigator.userAgent;&lt;br /&gt;   var mapdiv = document.getElementById(&amp;quot;map_canvas&amp;quot;);&lt;br /&gt;           &lt;br /&gt;   if (useragent.indexOf(&amp;#039;iPhone&amp;#039;) != -1 || useragent.indexOf(&amp;#039;Android&amp;#039;) != -1 ) {&lt;br /&gt;       mapdiv.style.width = &amp;#039;100%&amp;#039;;&lt;br /&gt;       mapdiv.style.height = &amp;#039;100%&amp;#039;;&lt;br /&gt;     } else {&lt;br /&gt;   mapdiv.style.width = &amp;#039;600px&amp;#039;;&lt;br /&gt;          mapdiv.style.height = &amp;#039;800px&amp;#039;;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  if( !$.cookies.test() )&lt;br /&gt;  {&lt;br /&gt;   alert(&amp;quot;Please enable cookies for this program to track very important information&amp;quot;);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  //if not created create cookie data&lt;br /&gt;&lt;br /&gt;  //find and display existing markers&lt;br /&gt;&lt;br /&gt;  var latlng = new google.maps.LatLng(-34.397, 150.644);&lt;br /&gt;  var myOptions = {&lt;br /&gt;          zoom: 14,&lt;br /&gt;   center: latlng,&lt;br /&gt;       mapTypeId: google.maps.MapTypeId.ROADMAP,&lt;br /&gt;    };&lt;br /&gt;  var map = new google.maps.Map(document.getElementById(&amp;quot;map_canvas&amp;quot;), myOptions); &lt;br /&gt;&lt;br /&gt;  $(&amp;quot;#setcenter&amp;quot;).bind(&amp;quot;click&amp;quot;, function(e){&lt;br /&gt;   console.log(&amp;quot;bind click&amp;quot;);&lt;br /&gt;   navigator.geolocation.getCurrentPosition(setPosition);&lt;br /&gt;  });&lt;br /&gt;&lt;br /&gt;  if (navigator.geolocation) {&lt;br /&gt;   navigator.geolocation.getCurrentPosition(setPosition);&lt;br /&gt;  } else {&lt;br /&gt;   alert(&amp;quot;navigator.geolocation not available.&amp;quot;);&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;//  detectBrowser();&lt;br /&gt; navigator.geolocation.getCurrentPosition(setPosition);&lt;br /&gt; });&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt;  &amp;lt;/head&amp;gt;&lt;br /&gt;  &amp;lt;body &amp;gt;&lt;br /&gt;   &amp;lt;h1&amp;gt;Warning the SQLite poo storage db is not installed yet.&amp;lt;/h1&amp;gt;&lt;br /&gt;   &amp;lt;h2&amp;gt;This means you have to never reload the page to record all the necessary poo data.&amp;lt;/h2&amp;gt;&lt;br /&gt;   &amp;lt;div&amp;gt;Where in the world does my dog poo?&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;div&amp;gt;Use the geolocation information to mark the spots your dog marks, with optional quality indicator.&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;form name=&amp;quot;controls&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;div&amp;gt;Quality: &amp;lt;/div&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;1&amp;lt;/input&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;2&amp;quot;&amp;gt;2&amp;lt;/input&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;3&amp;quot; checked=&amp;quot;checked&amp;quot;&amp;gt;3&amp;lt;/input&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;4&amp;quot;&amp;gt;4&amp;lt;/input&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;5&amp;quot;&amp;gt;5&amp;lt;/input&amp;gt;&lt;br /&gt; &amp;lt;button name=&amp;quot;setcenter&amp;quot; id=&amp;quot;setcenter&amp;quot;&amp;gt;Mark!&amp;lt;/button&amp;gt;&lt;br /&gt; &amp;lt;/form&amp;gt;&lt;br /&gt; &amp;lt;div id=&amp;quot;map_canvas&amp;quot;  style=&amp;quot;width:100%; height:100%&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;  &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-4970497585306728635?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/4970497585306728635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=4970497585306728635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4970497585306728635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4970497585306728635'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-9.html' title='March Madness Challenge - Day 9'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-3165915753227763304</id><published>2010-03-08T20:00:00.000-08:00</published><updated>2010-03-08T20:09:15.497-08:00</updated><title type='text'>March Madness Challenge - Day 8</title><content type='html'>This is the beginning of something special for all the dog lovers in the world. Using Google Maps API version 3, and jQuery you can now mark on a map where and the quality of your dogs poo. Unfortunately, this program is a two parter. Today's portion allows you to mark the location of the poo, and track it as long as you never reload the web page. The next update will use the SQLite option in HTML to store and retrieve poo data. &lt;br /&gt;&lt;br /&gt;Compatibiltiy note: Marking poo locations works in Firefox 3.5 and higher, iPhone, and maybe Droid. When SQLite is added it will end up being only iPhone or Droid.&lt;br /&gt;&lt;br /&gt;One thing that took way too much time to debug was how get the code recognized as HTML5. One way is to strip out all the things indicating that it's not HTML 5 and include only an html tag by itself. This let's the browser choose.&lt;br /&gt;&lt;br /&gt;And here's the code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;    &amp;lt;meta http-equiv=&amp;quot;content-type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;Where in the world is my dog pooin!&amp;lt;/title&amp;gt;&lt;br /&gt;    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;initial-scale=1.0, user-scalable=no&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://www.google.com/jsapi?key=ABQIAAAAyOcYQmrUZiRTkZD33sBhThSYG2nKbTfLUqOyuY0R-KaU9CNsSxQHWg8je-XfTEMamlZKbXxG4Z752A&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://maps.google.com/maps/api/js?sensor=true&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;   &lt;br /&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;          google.load(&amp;quot;jquery&amp;quot;, &amp;quot;1.4.2&amp;quot;);&lt;br /&gt;      &amp;lt;/script&amp;gt;&lt;br /&gt;      &amp;lt;script type=&amp;quot;text/javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt;&lt;br /&gt;       $(document).ready(function() {&lt;br /&gt;  function setPosition(position) {&lt;br /&gt;   console.log(&amp;quot;setPosition: lat: &amp;quot; + position.coords.latitude + &amp;quot; lng: &amp;quot; + position.coords.longitude   );&lt;br /&gt;   var location = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);&lt;br /&gt;   console.log(&amp;quot;Map: &amp;quot; + map);&lt;br /&gt;   map.setCenter(location, 13);&lt;br /&gt;   addMarker(location, &amp;quot;msg&amp;quot;);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function addMarker(location, msg) {&lt;br /&gt;    var marker = new google.maps.Marker({&lt;br /&gt;    position: location, &lt;br /&gt;    map: map, &lt;br /&gt;    title: msg&lt;br /&gt;   });   &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;  function detectBrowser() {&lt;br /&gt;   var useragent = navigator.userAgent;&lt;br /&gt;   var mapdiv = document.getElementById(&amp;quot;map_canvas&amp;quot;);&lt;br /&gt;           &lt;br /&gt;   if (useragent.indexOf('iPhone') != -1 || useragent.indexOf('Android') != -1 ) {&lt;br /&gt;       mapdiv.style.width = '100%';&lt;br /&gt;       mapdiv.style.height = '100%';&lt;br /&gt;     } else {&lt;br /&gt;   mapdiv.style.width = '600px';&lt;br /&gt;          mapdiv.style.height = '800px';&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;        var latlng = new google.maps.LatLng(-34.397, 150.644);&lt;br /&gt;  var myOptions = {&lt;br /&gt;          zoom: 14,&lt;br /&gt;   center: latlng,&lt;br /&gt;       mapTypeId: google.maps.MapTypeId.ROADMAP,&lt;br /&gt;    };&lt;br /&gt;  var map = new google.maps.Map(document.getElementById(&amp;quot;map_canvas&amp;quot;), myOptions); &lt;br /&gt;&lt;br /&gt;  $(&amp;quot;#setcenter&amp;quot;).bind(&amp;quot;click&amp;quot;, function(e){&lt;br /&gt;   console.log(&amp;quot;bind click&amp;quot;);&lt;br /&gt;   navigator.geolocation.getCurrentPosition(setPosition);&lt;br /&gt;  });&lt;br /&gt;&lt;br /&gt;  if (navigator.geolocation) {&lt;br /&gt;   navigator.geolocation.getCurrentPosition(setPosition);&lt;br /&gt;  } else {&lt;br /&gt;   alert(&amp;quot;navigator.geolocation not available.&amp;quot;);&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;//  detectBrowser();&lt;br /&gt; navigator.geolocation.getCurrentPosition(setPosition);&lt;br /&gt; });&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;br /&gt;  &amp;lt;/head&amp;gt;&lt;br /&gt;  &amp;lt;body &amp;gt;&lt;br /&gt;   &amp;lt;h1&amp;gt;Warning the SQLite poo storage db is not installed yet.&amp;lt;/h1&amp;gt;&lt;br /&gt;   &amp;lt;h2&amp;gt;This means you have to never reload the page to record all the necessary poo data.&amp;lt;/h2&amp;gt;&lt;br /&gt;   &amp;lt;div&amp;gt;Where in the world does my dog poo?&amp;lt;/div&amp;gt;&lt;br /&gt;   &amp;lt;div&amp;gt;Use the geolocation information to mark the spots your dog marks, with optional quality indicator.&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;form name=&amp;quot;controls&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;div&amp;gt;Quality: &amp;lt;/div&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;1&amp;quot;&amp;gt;1&amp;lt;/input&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;2&amp;quot;&amp;gt;2&amp;lt;/input&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;3&amp;quot;&amp;gt;3&amp;lt;/input&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;4&amp;quot;&amp;gt;4&amp;lt;/input&amp;gt;&lt;br /&gt; &amp;lt;input type=&amp;quot;radio&amp;quot; name=&amp;quot;quality&amp;quot; value=&amp;quot;5&amp;quot;&amp;gt;5&amp;lt;/input&amp;gt;&lt;br /&gt; &amp;lt;button name=&amp;quot;setcenter&amp;quot; id=&amp;quot;setcenter&amp;quot;&amp;gt;Mark!&amp;lt;/button&amp;gt;&lt;br /&gt; &amp;lt;/form&amp;gt;&lt;br /&gt; &amp;lt;div id=&amp;quot;map_canvas&amp;quot;  style=&amp;quot;width:100%; height:100%&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;  &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-3165915753227763304?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/3165915753227763304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=3165915753227763304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/3165915753227763304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/3165915753227763304'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-8.html' title='March Madness Challenge - Day 8'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-4393237280156295430</id><published>2010-03-07T19:40:00.000-08:00</published><updated>2010-03-07T21:23:55.363-08:00</updated><title type='text'>March Madness Challenge - Day 7</title><content type='html'>Thumb joystick controlled RGB LED!!!&lt;br /&gt;&lt;br /&gt;Yesterdays entry was way unsatisfying. I wanted to enumerate all the possible RGB combinations, but was impatient, and made errors. Today's project took on the issue of determining what exact PWM values were set on this RGB led, and getting a starting point to calibrate the brightness between leds so get a decent color mix. Well, I didn't get to the issue of calibration, but I did get connect 2 thumb joysticks to the  led and adjust the brightness values by reading the joystick data. Hook up 3 potentiometers and you can dial the exact combination RGB values you want.&lt;br /&gt;&lt;br /&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/4rEiMe-3kzI&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/4rEiMe-3kzI&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt;* 3 Potentiometers or Joystick  controled rgb led&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int redPin = 9;    // LED connected to digital pin 9&lt;br /&gt;int greenPin = 10;&lt;br /&gt;int bluePin = 11;&lt;br /&gt;int potR = 0;&lt;br /&gt;int potG = 1;&lt;br /&gt;int potB = 2;&lt;br /&gt;int r,g,b = 0;&lt;br /&gt;&lt;br /&gt;void rgb (int r, int g, int b) &lt;br /&gt;{&lt;br /&gt;     analogWrite(redPin, r);&lt;br /&gt;     analogWrite(greenPin, g);&lt;br /&gt;     analogWrite(bluePin, b);&lt;br /&gt;     &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void setup()  { &lt;br /&gt;  Serial.begin(9600);&lt;br /&gt;  Serial.println("Setup done");&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void loop()  {&lt;br /&gt;&lt;br /&gt;  r = analogRead(potR);&lt;br /&gt;  g = analogRead(potG);&lt;br /&gt;  b = analogRead(potB);&lt;br /&gt;  &lt;br /&gt;  r = map(r, 0, 1023, 0, 255);&lt;br /&gt;  g = map(g, 0, 1023, 0, 255);&lt;br /&gt;  b = map(b, 0, 1023, 0, 255);&lt;br /&gt;      &lt;br /&gt;  rgb(r, g, b);&lt;br /&gt;  Serial.print(r);&lt;br /&gt;  Serial.print(", ");&lt;br /&gt;  Serial.print(g);&lt;br /&gt;  Serial.print(", ");&lt;br /&gt;  Serial.println(b);&lt;br /&gt; &lt;br /&gt;        &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-4393237280156295430?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/4393237280156295430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=4393237280156295430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4393237280156295430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4393237280156295430'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-7.html' title='March Madness Challenge - Day 7'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-5856196269579756874</id><published>2010-03-06T20:03:00.000-08:00</published><updated>2010-03-07T20:44:16.481-08:00</updated><title type='text'>March Madness Challenge - Day 6</title><content type='html'>Loss of brain power leads to coding RGB LED enumeration for Arduino. Tired going to bed soon.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;int redPin = 9;    // LED connected to digital pin 9&lt;br /&gt;int greenPin = 10;&lt;br /&gt;int bluePin = 11;&lt;br /&gt;&lt;br /&gt;void fadeIn(int pin, int fadeInc, int delayValue)&lt;br /&gt;{&lt;br /&gt;  for (int fadeValue = 0; fadeValue&lt;= 255; fadeValue += fadeInc)&lt;br /&gt;  {&lt;br /&gt;    analogWrite(pin, fadeValue);&lt;br /&gt;    delay(delayValue); &lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// fade out from max to min in increments&lt;br /&gt;void fadeOut(int pin, int fadeInc, int delayValue)&lt;br /&gt;{&lt;br /&gt;  for (int fadeValue = 255; fadeValue &gt;= 0; fadeValue -= fadeInc)&lt;br /&gt;  {&lt;br /&gt;    analogWrite(pin, fadeValue);&lt;br /&gt;    delay(delayValue); &lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void rgb (int r, int g, int b) &lt;br /&gt;{&lt;br /&gt;     analogWrite(redPin, r);&lt;br /&gt;     analogWrite(greenPin, g);&lt;br /&gt;     analogWrite(bluePin, b);&lt;br /&gt;     delay(30);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void setup()  { &lt;br /&gt;  Serial.begin(9600);&lt;br /&gt;  &lt;br /&gt;  // diagnostic lights on&lt;br /&gt;  fadeIn(redPin, 5, 60);&lt;br /&gt;  fadeOut(redPin, 5, 60);&lt;br /&gt;  analogWrite(redPin, 0);&lt;br /&gt;  delay(30);&lt;br /&gt;  fadeIn(greenPin, 5, 60);&lt;br /&gt;  fadeOut(greenPin, 5, 60);&lt;br /&gt;  analogWrite(greenPin, 0);&lt;br /&gt;  delay(30);&lt;br /&gt;  fadeIn(bluePin, 5, 60);&lt;br /&gt;  fadeOut(bluePin, 5, 60);&lt;br /&gt;  analogWrite(bluePin, 0);&lt;br /&gt;  delay(30);&lt;br /&gt;  Serial.print(redPin);&lt;br /&gt;  Serial.print(", ");&lt;br /&gt;  Serial.print(greenPin);&lt;br /&gt;  Serial.print(", ");&lt;br /&gt;  Serial.println(bluePin);&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void loop()  {&lt;br /&gt;  for (int r = 0; r &lt;= 255; r++)&lt;br /&gt;  {&lt;br /&gt;    for (int g = 0; g &lt;= 255; g++)&lt;br /&gt;    {&lt;br /&gt;      for (int b = 0; b &lt;= 255; b++)&lt;br /&gt;      {&lt;br /&gt;        rgb(r, g, b);&lt;br /&gt;        Serial.print(r);&lt;br /&gt;        Serial.print(", ");&lt;br /&gt;        Serial.print(g);&lt;br /&gt;        Serial.print(", ");&lt;br /&gt;        Serial.println(b);&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }    &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-5856196269579756874?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/5856196269579756874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=5856196269579756874' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/5856196269579756874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/5856196269579756874'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-6.html' title='March Madness Challenge - Day 6'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-4481076391957469868</id><published>2010-03-05T17:10:00.001-08:00</published><updated>2010-03-05T20:44:01.099-08:00</updated><title type='text'>March Madness Challenge - Day 5</title><content type='html'>For tonight's March madness I will be demonstrating a variation on the theme of storing your private key locally. This program will up the ante and store your username and password as a QRCode. This way only a few machines can compromise your accounts when you take a picture of your username/password for decryption. Inspired by the following super high security tech technology: &lt;a href="https://www.safeberg.com/en/video/encryptie_en"&gt;SafeBerg Technology&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; A bit of preparation is required. I'm using the python library &lt;a href="http://github.com/hudora/huBarcode#readme"&gt;huBarcode&lt;/a&gt;. You will need to run some flavor of "git clone git://github.com/hudora/huBarcode.git" followed by python setup.py install. Last option: sudo easy_install huBarcode&lt;br /&gt;&lt;br /&gt;This code would have worked brilliantly if not for this error:&lt;br /&gt;IOError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/huBarcode-0.56p5-py2.4.egg/qrcode/qrcode_data/qrv1_0.dat'&lt;br /&gt;&lt;br /&gt;And here is the code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#&lt;br /&gt;# Turn a username/password into a QRCode &lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;import getopt&lt;br /&gt;import sys&lt;br /&gt;import getpass&lt;br /&gt;import qrcode&lt;br /&gt;&lt;br /&gt;#Describe usage&lt;br /&gt;def usage():&lt;br /&gt; print "-h, --help\n -v, --verbose\n -u, --username\n -p, --password\n -f, --filename\n"&lt;br /&gt;&lt;br /&gt;def main():&lt;br /&gt; try:&lt;br /&gt;  opts, args = getopt.getopt(sys.argv[1:], "h:u:pvf:", ["help", "username=", "password", "filename"])&lt;br /&gt; except getopt.GetoptError, err:&lt;br /&gt;  #print help information and exit:&lt;br /&gt;  print str(err) # will print something like "option -a not recognized"&lt;br /&gt;  usage()&lt;br /&gt;  sys.exit(2)&lt;br /&gt; username = None&lt;br /&gt; password = None&lt;br /&gt; verbose = False&lt;br /&gt; filename = "default.png"&lt;br /&gt;&lt;br /&gt; for o, a in opts:&lt;br /&gt;  if o == "-v":&lt;br /&gt;   verbose = True&lt;br /&gt;  elif o in ("-h", "--help"):&lt;br /&gt;   usage()&lt;br /&gt;   sys.exit()&lt;br /&gt;  elif o in ("-u", "--username"):&lt;br /&gt;   username = a&lt;br /&gt;   if verbose:&lt;br /&gt;    print "username: " + username &lt;br /&gt;                elif o in ("-p", "--password"):&lt;br /&gt;   password = getpass.getpass("Enter password: ") &lt;br /&gt;   if verbose:&lt;br /&gt;    print "password: " + password &lt;br /&gt;  elif o in ("-f", "--filename"):&lt;br /&gt;          filename  = a;&lt;br /&gt;   if verbose:&lt;br /&gt;    print "filename: " + filename &lt;br /&gt;  else:&lt;br /&gt;   assert False, "unhandled option"&lt;br /&gt; if username is None:&lt;br /&gt;  print "-u, --username  was not given"&lt;br /&gt;  usage() &lt;br /&gt;  sys.exit(2)&lt;br /&gt; if password is None:&lt;br /&gt;  print "-p, --password  was not given"&lt;br /&gt;  usage()&lt;br /&gt;  sys.exit(2)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; encoder = qrcode.QRCodeEncoder( username + "\n" + password)&lt;br /&gt; print encoder.get_ascii()&lt;br /&gt; encoder.save(filename, 3)&lt;br /&gt;&lt;br /&gt;if __name__ == "__main__":&lt;br /&gt; main()&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-4481076391957469868?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/4481076391957469868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=4481076391957469868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4481076391957469868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/4481076391957469868'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-5.html' title='March Madness Challenge - Day 5'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-5464835756133315071</id><published>2010-03-04T06:41:00.001-08:00</published><updated>2010-03-05T06:55:31.254-08:00</updated><title type='text'>March Madness Challenge - Day 4</title><content type='html'>Kept thinking about yesterday's setTimeout and how to chain it into a a color show. Inspired the by the &lt;a href="http://www.tvbgone.com/cfe_trippyRGB_instructions.php"&gt;Trippy RGB Waves kit&lt;/a&gt;. I wanted to create a Javascript simulation of the rgb color show. The Trippy RGB Waves kit uses an array called lightTab to hold information about the hold time, fade time, and the rgb color values. So I took that array an implemented in Javascript. In order to display values I built a test page, test css, test Javascript. I ran out of time to write the fader. So I have a color show based on the lightTab array. setTimeout is used in a recursive fashion. The issues run into were needing to make sure the lightTab was global, and that an anonymous function was used to call the function in the site time out. Here's the example:&lt;br /&gt;&lt;br /&gt;  setTimeout("runShow(" + (i + 1) + ")", holdTime);&lt;br /&gt;  setTimeout(function () {runShow(i + 1);}, holdTime);&lt;br /&gt;&lt;br /&gt;If I was executing more code or had more values in my function then anonymous function route is much easier to type, and less error prone. Other thing, I love jQuery, but none of my Javascript entries have used it. Sort of just checking out the plain old DOM and seeing what can be done. &lt;br /&gt;&lt;br /&gt;Without further ado here is the html, css, and js.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://pastebin.com/raw.php?i=2VxwE8MG"&gt;test.html&lt;/a&gt;&lt;br /&gt;====&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=2VxwE8MG"&gt;&lt;/script&gt;&lt;br /&gt;====&lt;br /&gt;&lt;br /&gt;&lt;a href="http://pastebin.com/raw.php?i=SyvtZpMz"&gt;rgb.css&lt;/a&gt;&lt;br /&gt;====&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=SyvtZpMz"&gt;&lt;/script&gt;&lt;br /&gt;====&lt;br /&gt;&lt;br /&gt;&lt;a href="http://pastebin.com/raw.php?i=tFPq2Q2q"&gt;rgb.js&lt;/a&gt;&lt;br /&gt;====&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=tFPq2Q2q"&gt;&lt;/script&gt;&lt;br /&gt;====&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-5464835756133315071?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/5464835756133315071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=5464835756133315071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/5464835756133315071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/5464835756133315071'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-4.html' title='March Madness Challenge - Day 4'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-2740764502813453868</id><published>2010-03-03T15:01:00.000-08:00</published><updated>2010-03-03T21:44:59.607-08:00</updated><title type='text'>March Madness Challenge - Day 3</title><content type='html'>Another long day, but I did come. up with something that I needed for another project. It turns out the closest thing Javascript has to sleep(ms) or delay(ms) is setTimeout.  Which is nice but is tricky to use in a synchronous environment. So in terms of matching what happens on an AVR chip or an Arduino. It's time for a delay(ms) script.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;setTimeout("showColor(red,green,blue)",holdTime);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;function showColor(red, green, blue) &lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;document.getElementById("leddisplay").style.backgroundColor="rgb(" + red + "," + green + "," + blue + ")";&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Well not really. I wrote the delay function, but it's not the recommended technique. Why block all actions on a page waiting for one thing to happen. The above code is closer. But doesn't solve the key issues. The setTimeout needs to have values assigned for red, green, and blue for the showColor function. Additionally, this code requires a web page. I needed to upload that. I needed to assign an event listener, and lastly  had to resolve an issue about setTimeout being inside a loop. The issue being the loop sets all the "setTimeout"s as quickly as possible, so all time outs occur almost in parallel. I could be wrong about that, but I did have some kind of issue. I needed to examine Javascript fader examples more closely, and I would have figured it out, but ran out of time.&lt;br /&gt;&lt;br /&gt;Ok. I wrote a super quick brute force demonstration of the problem. This requires &lt;a href="http://getfirebug.com"&gt;Firebug&lt;/a&gt; in order to run.  Paste the following code into the Firebug console. Warning whatever web page you are viewing in firebug will go through some awful color contortions.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function showColor(red, green, blue)&lt;br /&gt;{ document.body.style.backgroundColor="rgb(" + red + "," + green + "," + blue + ")"; &lt;br /&gt;console.log("Color set"); &lt;br /&gt;}&lt;br /&gt;console.log("Start");&lt;br /&gt;console.log('setTimeout("showColor(0,0,0)",10000);');&lt;br /&gt;setTimeout("showColor(0,0,0)",10000);&lt;br /&gt;console.log('setTimeout("showColor(10,10,10)",9000);');&lt;br /&gt;setTimeout("showColor(10,10,10)",9000);&lt;br /&gt;console.log('setTimeout("showColor(100,100,100)",8000);');&lt;br /&gt;setTimeout("showColor(100,100,100)",8000);&lt;br /&gt;console.log('setTimeout("showColor(200,200,200)",7000);');&lt;br /&gt;setTimeout("showColor(200,200,200)",7000);&lt;br /&gt;console.log('setTimeout("showColor(200,0,0)",6000);');&lt;br /&gt;setTimeout("showColor(200,0,0)",6000);&lt;br /&gt;console.log('setTimeout("showColor(100,0,0)",5000);');&lt;br /&gt;setTimeout("showColor(100,0,0)",5000);&lt;br /&gt;console.log('setTimeout("showColor(0,100,0)",4000);');&lt;br /&gt;setTimeout("showColor(0,100,0)",4000);&lt;br /&gt;console.log('setTimeout("showColor(0,100,100)",3000);');&lt;br /&gt;setTimeout("showColor(0,100,100)",3000);&lt;br /&gt;console.log("Done")&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So nesting the setTimeout inside SetTimeout should be interesting. Onto the next challenge.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-2740764502813453868?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/2740764502813453868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=2740764502813453868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2740764502813453868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2740764502813453868'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-3.html' title='March Madness Challenge - Day 3'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-1088562422812489849</id><published>2010-03-02T18:20:00.000-08:00</published><updated>2010-03-02T18:36:27.884-08:00</updated><title type='text'>March Madness Challenge - Day 2</title><content type='html'>Ok. Time was a bit of challenge today. I wanted to learn more about getopt, and figure out how it differed from optparse. I definitely learned about some of those differences. So tonights program uses getpass to collect a username, password combination. This is pretty unoriginal, but it did help me learn about getopt. I would like to try variation on determining mandatory fields, optional fields, and fields in combination. &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#&lt;br /&gt;# Hello World Get Opt for Python&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;import getopt&lt;br /&gt;import sys&lt;br /&gt;import getpass&lt;br /&gt;&lt;br /&gt;#Describe usage&lt;br /&gt;def usage():&lt;br /&gt; print "-h, --help\n -v, --verbose\n -u, --username\n -p, --password\n"&lt;br /&gt;&lt;br /&gt;def main():&lt;br /&gt; try:&lt;br /&gt;  opts, args = getopt.getopt(sys.argv[1:], "h:u:pv", ["help", "username=", "password"])&lt;br /&gt; except getopt.GetoptError, err:&lt;br /&gt;  #print help information and exit:&lt;br /&gt;  print str(err) # will print something like "option -a not recognized"&lt;br /&gt;  usage()&lt;br /&gt;  sys.exit(2)&lt;br /&gt; username = None&lt;br /&gt; password = None&lt;br /&gt; verbose = False&lt;br /&gt;&lt;br /&gt; for o, a in opts:&lt;br /&gt;  if o == "-v":&lt;br /&gt;   verbose = True&lt;br /&gt;  elif o in ("-h", "--help"):&lt;br /&gt;   usage()&lt;br /&gt;   sys.exit()&lt;br /&gt;  elif o in ("-u", "--username"):&lt;br /&gt;   username = a&lt;br /&gt;   print "username: " + username &lt;br /&gt;                elif o in ("-p", "--password"):&lt;br /&gt;   password = getpass.getpass("Enter password: ") &lt;br /&gt;   print "password: " + password &lt;br /&gt;  else:&lt;br /&gt;   assert False, "unhandled option"&lt;br /&gt;&lt;br /&gt;if __name__ == "__main__":&lt;br /&gt; main()&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-1088562422812489849?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/1088562422812489849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=1088562422812489849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1088562422812489849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/1088562422812489849'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-2.html' title='March Madness Challenge - Day 2'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-6851243919068398721</id><published>2010-03-01T19:51:00.000-08:00</published><updated>2010-03-02T20:48:10.466-08:00</updated><title type='text'>March Madness Challenge - Day 1</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;Several of my partners in craziness at &lt;/span&gt;&lt;a href="http://fubarlabs.com/"&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;FUBAR Labs&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;, the local New Jersey Hackerpsace. Have taken on March Madness. Write a program a day for a month. Well I'm jumping in on day one with a piece of code that solves one of PIAs I experience when trying to get the emails off of Google Calendar Events. Wish there was a feature that allowed you to make a group based off of an event. Anyway, the following code is how to get a list of guests from a Google Calendar event. Pop the list into an alert box, then cut and paste for your own use.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;---&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: rgb(105, 105, 105); white-space: pre;font-family:monospace;font-size:13px;"  &gt;/*&lt;/span&gt;&lt;br /&gt;&lt;pre style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(105, 105, 105);"&gt;* Get list of emails address from the guests invited to a Google event&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(105, 105, 105);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;function&lt;/span&gt; &lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(128, 0, 128);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;var&lt;/span&gt; guests&lt;span style="color: rgb(128, 128, 48);"&gt;,&lt;/span&gt; emails&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(105, 105, 105);"&gt;//Handily there is class associated to each guest&lt;/span&gt;&lt;br /&gt;guests &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; document&lt;span style="color: rgb(128, 128, 48);"&gt;.&lt;/span&gt;getElementsByClassName&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 230);"&gt;"guest"&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;emails &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 0, 230);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(105, 105, 105);"&gt;//iterate the guests&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;for&lt;/span&gt; &lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;var&lt;/span&gt; i  &lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;in&lt;/span&gt; guests&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;if&lt;/span&gt; &lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;guests&lt;span style="color: rgb(128, 128, 48);"&gt;.&lt;/span&gt;hasOwnProperty&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;i&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(128, 0, 128);"&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: rgb(105, 105, 105);"&gt;//each guest name/email is the first child textContent of guest element&lt;/span&gt;&lt;br /&gt;      emails &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; emails &lt;span style="color: rgb(128, 128, 48);"&gt;+&lt;/span&gt; guests&lt;span style="color: rgb(128, 128, 48);"&gt;[&lt;/span&gt;i&lt;span style="color: rgb(128, 128, 48);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;.&lt;/span&gt;childNodes&lt;span style="color: rgb(128, 128, 48);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 140, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;.&lt;/span&gt;textContent &lt;span style="color: rgb(128, 128, 48);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(0, 0, 230);"&gt;",&lt;/span&gt;&lt;span style="color: rgb(15, 105, 255);"&gt;\n&lt;/span&gt;&lt;span style="color: rgb(0, 0, 230);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(128, 0, 128);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;}&lt;/span&gt;&lt;br /&gt;alert&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;emails&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;}&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0);"&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;---&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;In order to run this you need to can run it in the Firebug console. Testing this, you need to create a Google Calendar Event add a few people to it. Find an old event with people in the guest list.&lt;br /&gt;&lt;br /&gt;Another way to run this would be as a Greasemonkey script. Hey, that might be a good project for tomorrow.&lt;br /&gt;&lt;br /&gt;I did discover the source code for Google Hosted applications is not quite the same as it's standard gmail offerings. To run this in a hosted environment you would need to use the following to select the guests:&lt;div&gt;&lt;span class="Apple-style-span" style=";font-family:Times;font-size:medium;"  &gt;&lt;pre style="background-color: rgb(255, 255, 255);"&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre style="background: none repeat scroll 0% 0% rgb(255, 255, 255); color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;function&lt;/span&gt; &lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(128, 0, 128);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;var&lt;/span&gt; guests&lt;span style="color: rgb(128, 128, 48);"&gt;,&lt;/span&gt; emails&lt;span style="color: rgb(128, 128, 48);"&gt;,&lt;/span&gt; guest&lt;span style="color: rgb(128, 128, 48);"&gt;,&lt;/span&gt; tmp&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;guests &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; document&lt;span style="color: rgb(128, 128, 48);"&gt;.&lt;/span&gt;getElementsByClassName&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 230);"&gt;"ep-gl-guest"&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;emails &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 0, 230);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;guest &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 0, 230);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;tmp &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 0, 230);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;for&lt;/span&gt; &lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;var&lt;/span&gt; i  &lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;in&lt;/span&gt; guests&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;if&lt;/span&gt; &lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;guests&lt;span style="color: rgb(128, 128, 48);"&gt;.&lt;/span&gt;hasOwnProperty&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;i&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;{&lt;/span&gt;&lt;br /&gt;guest &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; guests&lt;span style="color: rgb(128, 128, 48);"&gt;[&lt;/span&gt;i&lt;span style="color: rgb(128, 128, 48);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;.&lt;/span&gt;id&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;tmp &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; guest&lt;span style="color: rgb(128, 128, 48);"&gt;.&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(128, 0, 0);"&gt;split&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 230);"&gt;":i"&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;emails &lt;span style="color: rgb(128, 128, 48);"&gt;=&lt;/span&gt; emails &lt;span style="color: rgb(128, 128, 48);"&gt;+&lt;/span&gt; tmp&lt;span style="color: rgb(128, 128, 48);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 140, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;]&lt;/span&gt; &lt;span style="color: rgb(128, 128, 48);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(0, 0, 230);"&gt;",&lt;/span&gt;&lt;span style="color: rgb(15, 105, 255);"&gt;\n&lt;/span&gt;&lt;span style="color: rgb(0, 0, 230);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;}&lt;/span&gt;&lt;br /&gt;alert&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;emails&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;}&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 128, 48);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;//Final Note: Not Happy with editor at Blogger.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-6851243919068398721?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/6851243919068398721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=6851243919068398721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/6851243919068398721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/6851243919068398721'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2010/03/march-madness-challenge-day-1.html' title='March Madness Challenge - Day 1'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-693358311755106724</id><published>2009-12-20T07:45:00.001-08:00</published><updated>2009-12-20T10:13:08.300-08:00</updated><title type='text'>Bug in the fire</title><content type='html'>&lt;a href="http://www.flickr.com/photos/rickanderson/4199691505/" title="photo sharing"&gt;&lt;img src="http://farm3.static.flickr.com/2798/4199691505_468707afa6_m.jpg" alt="" style="border: 2px solid rgb(0, 0, 0);" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="margin-top: 0px;font-size:0.9em;" &gt;&lt;a href="http://www.flickr.com/photos/rickanderson/4199691505/"&gt;Bug in the fire&lt;/a&gt;&lt;br /&gt;Originally uploaded by &lt;a href="http://www.flickr.com/people/rickanderson/"&gt;flirianders&lt;/a&gt;.&lt;/span&gt; &lt;p&gt;Played around with a glue gun, and an led at the &lt;a href="http://fubarlabs.com/"&gt;Fubarlabs&lt;/a&gt; &lt;a href="http://hackerspaces.org/wiki/Synchronous_Hackathon/2009-11-20"&gt;Hackathon&lt;/a&gt;. Ended up with atmega168 powered LED that lit up chilled hot glue, and formed a fire breathing bug.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-693358311755106724?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/693358311755106724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=693358311755106724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/693358311755106724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/693358311755106724'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2009/12/bug-in-fire.html' title='Bug in the fire'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2798/4199691505_468707afa6_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-7617866675168955424</id><published>2007-06-04T20:54:00.001-07:00</published><updated>2007-06-04T20:54:35.635-07:00</updated><title type='text'>Iron Man Kills Dr. Lucky's dog</title><content type='html'>&lt;a href="http://www.flickr.com/photos/rickanderson/375990525/" title="photo sharing"&gt;&lt;img src="http://farm1.static.flickr.com/34/375990525_70ba3a4fa4_m.jpg" alt="" style="border: solid 2px #000000;" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size: 0.9em; margin-top: 0px;"&gt;&lt;a href="http://www.flickr.com/photos/rickanderson/375990525/"&gt;Iron Man Kills Dr. Lucky's dog&lt;/a&gt; &lt;br /&gt;Originally uploaded by &lt;a href="http://www.flickr.com/people/rickanderson/"&gt;flirianders&lt;/a&gt;.&lt;/span&gt;&lt;br clear="all" /&gt;&lt;p&gt;Kill Dr. Lucky is a great Cheapass game. We scavenged both the Marvel Monopoly and the classic Monopoly pieces for this game. The variation we played was Kill Dr. Lucky and his dog. I as Iron man finally killed Dr. Lucky's dog. I was so satisfied with the moment, it had to have a photo. I no longer remember the final outcome, but that pesky dog was finally eliminated.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-7617866675168955424?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/7617866675168955424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=7617866675168955424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/7617866675168955424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/7617866675168955424'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2007/06/iron-man-kills-dr-lucky-dog.html' title='Iron Man Kills Dr. Lucky&amp;#39;s dog'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm1.static.flickr.com/34/375990525_70ba3a4fa4_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-2947314792001385855</id><published>2007-04-14T19:43:00.000-07:00</published><updated>2007-04-22T20:14:21.612-07:00</updated><title type='text'>Thoughts on Django</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;I've just started really looking into &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.djangoproject.com/"&gt;Django&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt; and so far I've been impressed. I've bee pleasantly surprised that things were easier than I thought and nicely organized. I really like the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.djangoproject.com/documentation/model-api/"&gt;Models&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;, &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.djangoproject.com/documentation/templates/"&gt;Templates&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;, and &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.djangoproject.com/documentation/tutorial02/"&gt;Admin interface&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;. The model concept provides a nice database independent data structure. For simple test projects it's really simple to use SQLite. The key feature I like about the Templates is the ability to create base templates and extend them for specific task. Allows for efficient coding of pages. The automatically generated Admin interface has received a lot of deserved attention it's a great concept.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Areas that I'm looking into more. If the Admin interface is based off a template structure can it be extended for basic user/member of the site. So a regular user could change their profile without me having to duplicate the coding that would be auto generated in the Admin interface. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Also, as a new user it looks like I need to build a base set of templates that can be used and reused through out all my Django projects. Once that basic set is created I could stamp out a lot of variations on a theme for projects I'd like to build in django. It would be nice to have an application theme that could be modded. It might make Django more cookie cutter but it would awesome to not have test projects look junky while the admin interface is clean and usable.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;As for test projects I've been enamored with creating a list of lists project. I have simple prototype that was fun. Now I want to revise it and make it have user registration, RSS, atom,  and list sharing. As this goes I'd like to examine how the Model resolves recursion. Lists of lists of lists, etc. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Another project that I've been terribly interested in is using an interpreted environment to dynamically build applications and interact with applications from interpreted shell type environment. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Figured I get these thoughts written down before I forgot.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-2947314792001385855?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/2947314792001385855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=2947314792001385855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2947314792001385855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/2947314792001385855'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2007/04/thoughts-on-django.html' title='Thoughts on Django'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-141633473146599492</id><published>2007-02-09T05:47:00.000-08:00</published><updated>2007-02-09T05:47:57.777-08:00</updated><title type='text'>Thoughts for a Documentary Movie Series</title><content type='html'>When I was I kid I loved TV. Once when my parents decided to limit access, I argued that it was an important learning tool. We learned about relationships, technology, what to do in a disaster, what was happening in the world, and how to tell time by the plot. I believed I put together a pretty compelling argument. However, that stiil was the end of the all night Friday night TV. I looked at TV as the source of knowledge about the world I lived in. Looking at TV, Movies, and fiction as documentary and learning is a common strategic approach to understanding the world. The series I'm envisioning would take the documentary which is supposed to be a representation of the real, show reality is shaped by some very familiar dramatic arcs and emotional themes. Documentaries like a photograph show more context than the main subject. Documentaries tell a story that pulls from a specific moment the recordings, images, documents, people, and film, that can be found that are not created with the POV of the now. These objects, however, are wedged into the frame of documentary. The documentary and the objects of the past locked in a battle for context.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-141633473146599492?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/141633473146599492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=141633473146599492' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/141633473146599492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/141633473146599492'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2007/02/thoughts-for-documentary-movie-series.html' title='Thoughts for a Documentary Movie Series'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-691732292546761948</id><published>2007-02-09T05:31:00.000-08:00</published><updated>2006-08-15T08:32:47.723-07:00</updated><title type='text'>The Mechaton Lego Madness</title><content type='html'>Getting the Mechs to the field battle is a difficult, but important task. I had assembled my bricks into a mighty prescribed army according to the manuals provide in the boxes they came in, but as the battle approached, and I started customizing the army they have devolved back into a pile of bricks no longer contained in neat ready to assemble little containers. They are now contained in the one plastic box that forms the miasma of creation, which I will call "The Sea of Corruption," for all freshly hatched lego Mecha. Much like the "God Warriors" from Nausicaa, they will rise, and unleash destruction upon the world. But not to soon. I don't want any of them to melt.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-691732292546761948?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/691732292546761948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=691732292546761948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/691732292546761948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/691732292546761948'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2007/02/mechaton-lego-madness.html' title='The Mechaton Lego Madness'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4828565973650069607.post-7262895204904672202</id><published>2006-08-15T07:23:00.000-07:00</published><updated>2006-08-15T08:32:47.675-07:00</updated><title type='text'>The Rickology begins</title><content type='html'>Take your luggage on this journey. Also, bring your baggage. Remember, it's nice when they travel together.&lt;br /&gt;&lt;br /&gt;Let's see how this goes...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4828565973650069607-7262895204904672202?l=rickology.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rickology.blogspot.com/feeds/7262895204904672202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4828565973650069607&amp;postID=7262895204904672202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/7262895204904672202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4828565973650069607/posts/default/7262895204904672202'/><link rel='alternate' type='text/html' href='http://rickology.blogspot.com/2006/08/rickology-begins.html' title='The Rickology begins'/><author><name>Rick</name><uri>http://www.blogger.com/profile/04730771763137801253</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
