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_Pagehttp://arduino.cc/en/Reference/FirmataPyduino: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/masterYou’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.

Advertisements
Tagged with: , ,
Posted in Uncategorized

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: 2697Windows XP: 2628Linux Host (Ubuntu 8.10 64-bit): 3306Host Specs:Intel Core 2 Duo 2.33 GHz, 4 GB RAMThe 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?

Posted in Uncategorized

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.

Tagged with: ,
Posted in Uncategorized

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).

Media_httpediacaranme_nndej
Posted in Uncategorized

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 repeatend tell
Posted in Uncategorized

A Little Old But Neat: Processing in Javascript

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

Posted in Uncategorized

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.

Posted in Uncategorized