I’ve been contributing to the eLua project since early this year, and have really enjoyed digging into some low-level details for implementing drivers and higher level functionality for an embedded dynamic language. While many people would toss out the possibility of running a full distribution of a dynamic language (especially one typically used on desktops) on a microcontroller, Lua fits quite well. You won’t be writing any extensive applications in an environment like this, but many small and medium-sized projects should fit pretty well within the resource limitations imposed by these devices, even with the overhead of a dynamic language.One thing that I’ve started working on recently is a resurrection of Lua-RPC, which is a simple client-server RPC library for Lua. In general it seems to provide two main services:
- Calling remotely defined functions, and serializing the input and output values of these functions.
- Calling remote functions in a protected environment that allows errors to be returned to the client that made the call in the first place.
With a set of minor adjustments in place to account for changes between the Lua 4.x and 5.1.x API, it now seems to work fairly well as a module in a current version of Lua, handling remote procedure calls over sockets. It also now works as a loadable module, so one can use it within scripts or at the Lua REPL.Now that a basic port has been made, the next step I’m working on is getting it up and running over not just sockets but other link types, like serial. The concept of socket use is pretty well embedded in the design of Lua-RPC, but there’s enough abstraction that it isn’t necessary to rewrite much of the Lua-facing side of the code (those C functions that are registered with Lua), mostly what is needed is establishment of some sort of common interface that will work for not just socket communications, but much less feature-laden link types like RS-232. I think I have a general path laid out for this, and will likely make some comments as this process goes along.For those interested in the code, you can check out the GitHub project here (no guarantees about any particular commit working well until a release is made, which will be after the link-layer abstraction is working).
Tagged with: Lua
Posted in Uncategorized
Instructions on how to use Soundflower & esound to pipe all the audio output on your Mac to a Linux box (and the other direction if you want): http://rolf.haynberg.de/?p=14Latency is about 500ms, which could be better, but it’s an improvement over what I’ve gotten with Airfoil.
Tagged with: apple
Posted in Uncategorized
I’ve put up some instructions on how to build an ARM EABI toolchain on Mac OS X machines using CodeSourcery’s versions of GCC, GDB, Newlib & binutils.Hope they’re helpful to someone who hasn’t been able to get a toolchain going on their Mac.
“Massimo Banzi is the co-founder of Arduino with partners David Cuartielles, Gianluca Martino, Tom Igoe, and David Mellis. Banzi is the CTO of Tinker.it!. He has worked in Milan and London on projects for companies such as Prada, Artemide, and Adidas. For four years he functioned as an associate professor at the Interaction Design Institute Ivera. Beyond his private endeavors, he has been a guest speaker and teacher of workshops throughout Europe.”FLOSS Weekly No. 61
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.
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?
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.
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).
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