Fantastically Plastic

Arduino + Python

Here’s a talk I did at the Chicago Python Users’ Group (ChiPy) back in February. It starts a little ways in, and there’s a section where the video hangs, but it’s mostly there:

Special thanks to Carl for doing captures and posting the ChiPy talks on blip.tv.

Here are also some notes that got sent out after the talk to the ChiPy list:

Main Arduino Project Page:
http://www.arduino.cc/

Arduino Playground (lots of hardware/software examples):
http://www.arduino.cc/playground/

Firmata:
http://www.firmata.org/wiki/Main_Page
http://arduino.cc/en/Reference/Firmata

Pyduino:
http://code.google.com/p/pyduino/

Places to Get Kits and Hardware:
http://www.adafruit.com/
http://www.sparkfun.com/
http://liquidware.com/ (I’ve not bought anything from them personally, but they have some interesting Arduino compatible boards)

Also if you’re interested in some of the code used during the talk, I’ve posted some of the demos I did at the end up on github:
http://github.com/jsnyder/jbsnyder_tools/tree/master

You’ll probably need to install a few modules to make them work including wx, multiprocessing, matplotlib and numpy (in addition to pyduino from above).

The mouse demo also uses a little Objective C program to move the mouse around, compile instructions for that are in the movemouse.m file.

Windows on VirtualBox 2.1.2

Having just grabbed the latest version of VirtualBox as well as the Windows 7 beta, I thought I’d run a benchmark or two of Windows running on top of VirtualBox 2.1.2 with GeekBench.  Overall the performance isn’t too shabby, with numbers similar for Windows 7 and XP:

Windows 7 Beta: 2697

Windows XP: 2628

Linux Host (Ubuntu 8.10 64-bit): 3306

Host Specs:

Intel Core 2 Duo 2.33 GHz, 4 GB RAM

The multithreaded LU decomp values seem to be rather suspect, as they well exceed native performance.  Perhaps there’s some sort of bug related to timing under virtualized situations?

US Government Not Based in Christianity?

I’ll not wander too far into this territory, since this topic invokes both religion and politics.  More than once in the past couple of months, I’ve heard claims from members of the religious right that the United States or its laws were based on Christianity.  I’ve also both read and for some time believed that many of those who laid the foundation of the US Government were more deistic in their beliefs.  This is certainly supported if one reads the constitution, which makes no mention of a deity.  In fact, the only major point where religion is discussed is in Article VI, Section 3, which states that “no religious test shall ever be required as a qualification to any office or public trust under the United States.”

All of this aside, I’d not seen any specific statement that the US Government isn’t based on Christianity, until now.  If one looks at “Treaty of Peace and Friendship, signed at Tripoli November 4, 1796 (3 Ramada I, A. H. 1211), and at Algiers January 3, 1797 (4 Rajab, A. H. 1211)” (yeah, awkward title), the 11th article states:

As the government of the United States of America is not in any sense founded on the Christian religion as it has in itself no character of enmity against the laws, religion or tranquility of Musselmen [Muslims] and as the said States have never entered into any war or act of hostility against any Mahometan nation, it is declared by the parties that no pretext arising from religious opinions shall ever produce an interruption of the harmony existing between the two countries.

I think that’s fairly clear, having been signed by George Washington President John Adams (sorry about the error).

Now, this certainly says nothing about the current state of affairs, and whether there is separation between church and state.  That said, I think this might do a fair job of settling this one debate.

This thought, in part, sparked by the following MetaFilter post.

Nitpick

While I certainly cannot claim perfection in my own use of the English language, I have learned that first impressions are important.  Why does this page ask for a form of information (age) that one cannot provide with the form (date of birth).

Modifying Properties in Address Book with AppleScript

I’ve been syncing my contacts and calendars with a Zimbra server as of late so that I can get synchronization with my iPhone.  While things have generally gone quite well, and most of the process has been easy, I have hit a hurdle or two, and I thought I’d write about one of them.

I’ve got one machine where I’m using Thunderbird and the Zindus extension for syncing contacts with that software.  This works pretty well, but from some contacts I had synced from GMail a while back, many entries in my Address Book application had labeled email addresses as “other” rather than “work” or “home.”  Zimbra doesn’t seem to have quite the same distinction system for email addresses, and by the time things got to Thunderbird these “other” email addresses were simply getting excluded, while ones labeled “home” or “work” were still included.  Since this somewhat obviated the purpose of syncing contacts with an email client, I set about changing categories for email addresses in my address book where I only had one email address, which I was able to do with AppleScript.

It’s a little rough around the edges, and if someone else where in this situation and wanted a similar fix, they might want to further restrict the set of addresses being changed to only those with an “other” email address, but this worked just fine for me.  The script follows:

tell application "Address Book"
	repeat with this_person in every person
		if exists (email of this_person) then
			if (count of emails of this_person) = 1 then
				set label of email of this_person to "Home"
			end if
		end if
	end repeat
end tell

A Little Old But Neat: Processing in Javascript

John Reisg has ported the Processing visualization language to JavaScript: Processing.js

DTrace Scripts

It doesn’t look like new scripts have been added lately, but I just ran across this nice little collection of dtrace scripts and one-liners.  There’s a special section for Mac OS X 10.5 compatible scripts.

Nice Response to the Beer == Worse Science Paper

I’ve still not gotten around to reading the actual paper, but slashdot today mentioned some additional analysis of the paper correlating increase beer drinking with reduced scientific success (measured in terms of publications and citations). My initial thought after reading the first of many posts about this that appeared around the internet was as follows:

correlation != causation

This blog post points out some additional issues with the paper, which I’ll now have to check out, given that it is both short, and to evaluate the other scientist’s analysis.

Beyond the correlation != causation, the author of the blog post points out that there are really only 34 data points, and without 5 of them the correlation falls apart.  Additionally, the R-squared for correlation is 0.5.  In addition to the comment made pointing out that an equally probable explanation for the data was that low-output scientists were drinking more, there’s also that statistic itself.  An R-squared of 0.5 suggests that 50 percent of the variation in output can be attributed to beer drinking level.  That still leaves a large percentage of potential other influences on top of alternate causal relationships.

Ah well, I suppose the original article may have aimed more at headlines or amusement, but it’s still fun to try and justify beer.  I think the common sense on this item is likely close to the mark: heavy drinking certainly doesn’t help with your output, but reasonable social drinking probably doesn’t correlate well with output levels.

Safari Performance Jump w/ 3.1

Wow.  The new Safari build has significantly improved JavaScript performance in Apple’s SunSpider benchmark.

Older Safari 3: 8537.4ms ± 0.3%
Safari 3.1: 3152.6ms ± 0.2%

The new Firefox beta is no slouch either:
Firefox 3 beta 4: 5080.4ms ± 5.7%
Firefox 2.0.0.12: 15463.6ms ± 5.7%

Full results after the jump. Read more »

Solaris – What is the Appeal, Outside the Server Room?

So, I’ve recently been experimenting with and loving ZFS on FreeBSD and OS X.  Some of the initial instability (kernel panics) issues I was having with ZFS and OS X seem to have calmed down for the moment, and I’ve had zero problems on 64-bit FreeBSD.  32-bit FreeBSD has been mostly problem free after doing a little tuning to make sure that there was enough space for ZFS to grow during times of need.

Recently I ran across this old thread about ZFS being ported to OS X, and it reminded me of how I feel about Solaris and related technologies that have been ported to other operating systems.

I love ZFS, and I’ve liked DTrace in my recent experiments with it on OS X, which has lead me to play a bit with Solaris from whence these technologies come.  After all it has not only those technologies, but a bunch of other neat solutions like zones (including branded zones to run native Linux applications and the like), but I don’t see how I could love this operating system without more easily installable & buildable software available for it.  Sure there’s Blastwave and a few other repositories out there that have Solaris binaries, and Project Indiana is working on linux-izing Solaris to provide a nice command-line package manager and whatnot, but I don’t see how one could already love the operating system as an experimenting “power user.”  Sun, I’ve heard, does an excellent job on engineering solid server products (both software and hardware), but I can’t imagine going back to compiling everything from makefiles to get decent pieces of software on it.  It’s OK if everything you want to build doesn’t have terrible dependency trees and, say, has been tested on Solaris, but trying to figure out how to get something to compile that requires some modification to make it through this process is a waste of time, unless I’m going to be using a particular piece of software a lot, and already know that it’s essential from use on other platforms.

Perhaps Indiana will change much of this, but I’m also wondering why it hasn’t happened already?  FreeBSD and the variety of other BSD operating systems out there are also somewhat acquired tastes in an operating system, but working with it is so much easier with the ports collection.  I can build and install pretty much whatever I want on it, and have a working desktop machine or a server box up and running without too much pain.  If I went over to Solaris, however, I know that I would end up spending time trying to get things like netatalk to compile, and figuring out how to get and compile relevant libraries because I don’t see it at any of the standard repositories.  If I were on linux or BSD, even if I ended up compiling from source, the package system would allow me to get the right compiler and libraries without any trouble.  I could also trust that what’s in ports or on an rpm or deb repository will be fairly recent.  When I sifted around looking for things on blastwave, not only was I unsure about whether things would run happily on something other than the somewhat long released Solaris 10 (the current OpenSolaris builds are called Nevada and I believe will be Solaris 11) , but quite a few things were more than a few versions old.

I’m not blaming the Solaris community, or Blastwave or anyone for this, I think they’ve all done quite a bit of work to make available what is there, but I don’t think I’ll end up playing with it much until there’s at least a healthy set of packages or ports that don’t require too much messing around with to get running.  When that’s there, I’ll give it a go again.

Contact

Ads