Walls and wall following ants

October 20th, 2015

Antfarm class today again; I introduced walls — red pixels can’t be crossed. But the ants struggled to navigate around walls. We used a basic bump-along-the-wall strategy but some of them get stuck. Still, a great class — lots of complex behaviors and ideas, and some successful prototypes. See below. (code here posted on the wiki)

In other news, I left the colony foraging antfarm code running for a week, and it was still running when we started class today. There’s a population limit of 100, though, so this wasn’t “ecological balance” but it’s still interesting to see.

Screenshot 2015-10-20 at 11.16.06 AM

Misconceptions about OSHWA’s Open Source Hardware Certification v1

September 30th, 2015

In my role as an OSHWA board member (up for re-election! ::shameless::), I spent some time over the past year (but not as much as OSHWA board president Michael Weinberg!) reading over and commenting on the evolving drafts of the Open Source Hardware Certification.

I pushed hard for certain lines and clarifications, and I just want to quickly address a few possible misconceptions or even straw men I’ve seen on recent posts about it (mostly in the comments). There are valid reasons both to support or dislike the proposal, but I believe the following three are mostly based on misunderstandings:


Folks seem to be misconstruing the “penalties” mentioned. Just to be clear, the ONLY way you’d have to pay fees is if your work is not actually open source hardware as defined in the OSH Definition. And even then, you could simply remove the logo from your products instead of paying the fees. See Michael’s response in the comments of the Certification announcement.

The idea is that no truly open source hardware project could ever incur fees. Only the bad actors!

Certified projects vs Open Source Hardware projects

Q: If you don’t get your project certified, can it still be open source hardware?

A: YES. If it conforms to the Open Source Hardware Definition. See the end of paragraph 4:

While certification is not a condition for openness, obtaining certification is a way to make it clear to others that a given project is open source hardware.

Certification vs. Licensing

Are they redundant? Are they the same thing? Does OSHWA want me to certify instead of license? No.

Also, I saw a comment on the Cert announcement that commented:

I’m seeing a stark difference between this proposal and a free (libre) software license like the GPL.

Yes! Most definitely! The cert is NOT a license, and works on a different principle. But importantly, the certification relies on compliance with the Open Source Hardware Definition, which requires that designs be licensed!

The Definition uses the word license 34 times. Certification and licensing aren’t the same thing, but certification supports licensing, adds extra clarity, and adds the ability by OSHWA to call out bad actors.

Thanks! And especially thanks to Michael for his hard work on this initiative!

P.S. I’m also in agreement with Windell that to do this well, we’ll need to be really thorough and careful — and to have a really awesome cert logo!

Pawpaws and mushrooms, East and West coasts

September 29th, 2015

I’ve had some great foraging experiences in the past couple weeks — just quickly, below are some pawpaws from the east coast. In some places they are endangered or threatened, although in others they are considered “common” — these were from Maryland, where they are apparently not uncommon.

The PawPaw, aka Asimina triloba:


Best enjoyed on a freshly made waffle (HOW?!?! By the magic of my wonderful hosts, whom I’ll gladly cite if they wish.)


Great trivia about these — they were a fav. dessert of George Washington, the leaves contain a natural pesticide, and they were likely originally propagated by North American megafauna before those were all eaten by humans. Now we eat pawpaws and are likely their primary propagators.

Then, outside Portland Oregon, I (in collaboration with other Public Lab staff) found several large Leccinum Manzanitae (or variants of), which are great when roasted in slices:


…and Boletus Mirabilis, which I did not have an opportunity to actually eat:


All among an array of other interesting discoveries. At bottom are some Bitter Hedgehog mushrooms, which are beautiful if inedible.


Ant death and queen population

September 15th, 2015

We prototyped a lot of ant death scenarios today in AntFarm class. Also — queens creating new queens, and queen death.

More soon — but here’s the partially buggy code for the latter: https://gist.github.com/anonymous/a95bad3aaf6b7f344460

Next class: ant decomposition, trail fading, ant energy and “sight”. https://github.com/jywarren/antfarm/issues/15

Screenshot 2015-09-15 at 11.00.21 AM


Quick antfarm update

September 8th, 2015

First, partial day of Antfarm class at Parts & Crafts today. Much excitement and some bugs found (lol). A queen was quickly suggested and implemented, who spawns new ants, too quickly, then too slowly. New ants won’t change color, unfortunately — https://github.com/jywarren/antfarm/issues/6

Then, overpopulation quickly became a problem, so we opened issue 5, “ant death” https://github.com/jywarren/antfarm/issues/5

Screenshot 2015-09-08 at 11.33.46 AM

Good progress for a first day — the entomologists have agreed to come back next week with more ideas and I’ll get a permanent ant farm installed on the windowsill in the meantime.

Draft queen script saved as queen.ant


August 28th, 2015

In prep for a class I’ll be teaching at Part & Crafts, I made this little simulator for “ants” — just like I used to when I was a kid, learning how to program. I’m hoping to get a bunch of kids into refining and building out the simulation to include things like resources, reproduction, sensing, phermones, etc. This was one thing that really motivated me to learn to code as a kid, and is just lots of fun.

Screenshot 2015-08-28 at 9.57.32 AM

This simulator is pretty darn simple, but does include a base canvas upon which the ants leave trails (nod to StarLogo!) The ants have internal states, including a simple event-based user-modifiable script. To edit one, just double click on an ant, and an editor comes up. Nothing is saved after a page refresh, for now! Trail colors, ant properties, and other things are accessible, documented in the wiki.

Open source, of course: https://github.com/jywarren/antfarm/

Owen, at Parts & Crafts, already got started; see this video where he made them “eat” yellow phermones and grow (a little too big):

Space filling curves cut in paper

August 20th, 2015


Here’s a Gosper curve cut into paper with a Silhouette Cameo desktop paper cutter. Thanks to Owen Maresh for showing me the Gosper curve, which is a space-filling curve formed with a single line, and therefore, here, with a single cut.

Vectorizing sketches and photos with your smartphone/web browser

August 11th, 2015


Yesterday I wrote VectorCam, building on the excellent excellent imagetracerjs library by András Jankovics. Source AGPLv3 at https://github.com/jywarren/vectorcam.

This is a pure JavaScript raster-to-vector converter, which takes images (png, jpg, gif?) and traces them into downloadable SVGs (I haven’t tried a conversion to PDF or DXF, but that’d be useful).

With it, you can snap a photo with your phone, and immediately vectorize it for use in print, laser cutting, or desktop paper cutting. I always thought this should exist as a web service, since it can be a pain to open up Inkscape sometimes, and this is supposed to be a pretty well-solved problem.

It works on Android, fastest in Chrome – and only on Safari on iOS, probably due to Apple’s closed-browser strategy.

Here’s a snap of the output from the above image, opened in Inkscape to show the vector lines:


András’ library does a fantastic job; all I did was connect it to a file upload form and ensure the SVG downloads well, and make a nice interface with a settings dialog. This last could be expanded, as well.

Office: minimal JS drum machine interface

August 6th, 2015

I’ve been doing a lot of small projects for fun, and partially to improve my JavaScript coding practices. I wrote this JS-based drum machine, or almost finished it, although it needs some work on the timers and more samples (only the top row of instruments works at the moment). If you know of some sick free samples, I’d love to use them.

Use it directly (designed for smartphone use): http://jywarren.github.io/office/

On Github here. Try it here in an iframe:

It’s sort of loosely based on the Pocket Operator, which I got a couple months ago:


Parts & Crafts free scholarships, One Lightsaber Per Child

May 22nd, 2015

parts and crafts

Parts and Crafts is a wonderful local Somerville institution, and one which has hosted many Public Lab events! They’re doing a drive to raise money for free scholarships for kids who couldn’t otherwise afford to attend their programs.

DIY culture, and P&C in particular, is such a wonderful thing — PLEASE help to ensure that it reaches those in need. Everyone deserves the opportunity!

Help them out!

I am trying to make them some stickers, too — and since one activity they do SUPER WELL is a “One Lightsaber Per Child” workshop, I wanted to illustrate that: