The Life Unwired

with Ben Combee

I was happy to see a green box waiting for me at home today, my first indiebox, the game Freedom Planet. From watching the subscriber video, it looks like they've moved to a new format. The box has a "Challenge" flap in it holding info on an in-game challenge to compete for a special trophy.

Unlike previous boxes, the Steam code is now on a sticker at the bottom of the outer box, leaving the shrink-wrapped game box undisturbed.

In the Freedom Planet box, I found some nice trinkets. First was a leather pouch embossed with the FP logo and labeled "Kingdom Stone". Inside was a heavy polished metal sphere. Having not yet played the game, I'm unsure of the significance.

There was also a shiny coin featuring the character Mayor Zao on one side and a +5 on the other, encased in a plastic holder.

The final big feelie is a vinyl trifold wallet with velcro enclosure featuring ID holder and several zippers. I might actually use it, as I'm a fan of non-leather wallets.

The game was on their standard USB "cartridge". I didn't see any weirdness on this drive, just the game files. I only saw files for Windows there, but the instruction manual mentions Mac OS X and Linux files.

The game soundtrack was supplied on three CDs! Unfortunately, the plastic case for my CDs was cracked at the hinge, but it didn't look like the CDs had any scratches.

Printed material included issue thirteen of the indiebox newsletter, a 24-page full color instruction manual, a Freedom Planet sticker, and an indiebox sticker.

All in all, a pretty nice box. No game controller this time, but the items seemed good and the game looks to be quite fun. My only concern is the soundtrack CDs needed some better method of protection when shipped loose with a heavy metal ball.

I've become enamored with the recently-released Zachtronics game TIS-100, a game very much oriented at low-level programmers. The conceit is that you've discovered this weird computer from your uncle's estate that comes with a few instructions and a wiped memory where different programs need to be implemented. However, it's not a straightforward CPU, but instead a grid of micro-CPUs that communicate with each other. As you develop your programs, you get feedback based on your friend's efforts, often showing you that it's possible to build the same app with fewer instructions or that runs quicker or takes fewer nodes. At the same time, you're finding corrupted notes from your uncle linking to some sort of conspiracy.

I'm about 1/3rd through with it, but already have hit some very creative challenges. I like the achievement system, as it pushes you to try alternative ways to build things.

Here's some techniques I wanted to write down:( Read more...Collapse )Saturating math: the registers on the TIS-100 are limited to the range -999 to 999. Unlike most modern CPUs, if you overflow, it will stay at the maximum or minimun value. For example, -900 - 200 = -999. You can use this to identify positive or negative values without using the IF instructions... to make the ACC register 1 when it's current value is positive means you'd write:

ADD 998 # any positive number will now be 999
SUB 998 # positive numbers will now be 1, zero or negative will be less
SUB 999 # zero or negative numbers will be -999, positive numbers will be -998
ADD 999 # transform into 0 or 1

The negative-finding form is similar.

Pushing extra copies: Sometimes you need to compare a value and then use it again, but the original comparison destroyed it's value in your ACC register. Doing a SAV and SWP takes two instructions, but having the value pushed to you twice means you only need one instruction. The main pitfall is sometimes this means doing a MOV to NIL because you've got to use up that node's push to unblock it.

Using a node as an extra register: since a node only has one register, ACC. There's a saved version of it that you access with the SAV and SWP instructions, but there's no way to say something like "ADD SAV". When you need some storage, push the value to an adjacent node, then have that node push it back one or more times. A variation on this is a make a smart register where you push a control value that then will cause it to either accept your next push to save into it's value pool or push it's stored value back to you.

Splitting up computation: In order to reduce runtime, look for ways to split up complex tasks across nodes. Since they all run in parallel, this will often reduce the overall runtime of your program. It also is a good way to avoid needing to use the backup register to save state.

Set up a back channel: the natural way for you to write nodes means values go in only one direction. However, sometimes it's useful to pause an upstream node for it might also be pushing values to a neighbor. In that case, have the upstream node wait on a push from you and signal it with a value when your done. This technique seems to be mode useful when you start working with stack nodes, as you don't want to be pushing into a stack from one spot while you're reading from the stack in another.

I've been building a Pebble watch app, Phantom Camera, and I published it earlier today on the Pebble store. A few minutes later, a fellow developer said that the configuration page wasn't working on iOS.

This led to an afternoon-long exploration.

My searching led to a WebKit bug - https://bugs.webkit.org/show_bug.cgi?id=24175 - which indicated that Safari didn't preserve URL fragments across a redirect. So, if you navigate to foo/a.html#42 and foo's server redirects you to foo/b.html, you'll not have that #42 applied when the browser loads the b.html page. However, this didn't seem to apply, as Instagram was putting the hash in the URL it sent.

My authentication with Instagram uses redirection. I send the user to a URL on the Instagram site, they handle having the user log in and allow my app, and the server then uses a HTTP 302 redirection to return them to my page with the token in the fragment.

On Android and in Firefox and Chrome, I was seeing this working fine. I'd get the token, JavaScript in the page would read it from the window.location, and all would be fine. On iOS Safari, the user would see the "authorize" button again. When I tested manually, I'd see the page load with no token in the URL.

After lots of testing various things, I found myself looking in the network monitor tab in Firefox again, and I noticed an extra 302 redirect. It turns out that my page was hosted at www.combee.net, but I'd specified combee.net in the URLs for Instagram. My web host did a 302 redirect to www.combee.net, and that second redirect was losing the hash with the authentication token.

Chaning my redirect URL to use www.combee.net directly fixed it, and now its working on all the platforms.

(This is from a talk I gave to the Trinity Social Justice class in May)

Austin's Solar Policy

- Austin Energy has committment to buying solar energy- aiming for 35% renewable by 2020, 55% by 2025- City of Austin wants to move to renewables- Latitude means solar is fairly effective here in central Texas

How Does Solar Power Work

- solar cells are made of silicon with dopants that make them semiconductors- photos from sunlight push electrons out of the cell, making a constant pressure or voltage- this power is direct current -- it flows in one direction, and the current flow is dependent on how much sunlight hits the cells and the angle of the sunlight, and the temperature of the cells (hotter is worse) - the power grid is alternating current with a constant voltage- to adapt the energy, you use a device called an inverter that connects to the grid and the solar system, and transforms the solar power into grid power- you often see the opposite form of these (in small) with power adapters that convert AC to DC for running digital devices like computers and cell phones- Tesla just announced an inexpensive home-battery system that would let a homeowner save the solar power in DC form instead of feeding it into the grid

Cost of Solar

- Equipment and Installation- Need sufficient unshaded roof or yard space to make it viable- On my house, I have 14 200W panels, for a total system size of 2.8kW- in practice, I never generate 2.8kW of power. I've seen the system hit 2.6kW on really perfect days.- On an awesome day, I'll generate around 18kWH of electricity. For April, this generation really starts around 10am and goes through 6:30pm. So, that's 8 1/2 hours of generation

- System cost about $15K to install- 30% of those costs were returned in the form of Federal tax credits- They estimate system costs as being 2.2K to 4.5K per kW- I used geostellar.com to do my initial estimates

Austin Energy has two incentive programs for homeowners- solar PV - Austin Energy rebates $1100/kW installed - they pay $0.113 / kWh, so I get a credit of about $2/day for my system at peak performance - max credit of $700ish year, but I've actually gotten more like $350 of credit a year - residental customers tend to pay $0.087 per kWH for first 500, then $0.134 for next 500 - you still pay AE for the energy you use -- - on a good month, it covers half to 2/3rds of our usage

I had my second one-on-one session with TechShop's ShopBot Alpha tonight, and I hit a few obstacles. My first time was using 3/4" MDF and it worked out very well. This time, I was using 3/4" pine, and I had a bit of unevenness with the depth of cutting.

My first problem was setting the wrong Z dimension in my original file. I had Z=0 at the bottom of the part, not the top. This caused a lot of confusion with setting the zero point on the table, and I ended up using an offset to get things right. However, I was guessing at it, and may have been off in my calculations a little.

My second problem was not tightening my collet enough to hold my endmill. I thought it was adequate, but my depth kept changing during my second cut, and when I stopped the tool and checked the tightness, it had loosened a lot.

My third problem was holding the wood to the table. I'd used the composite nails to good effect, but with a couple of false starts, my final work was far enough down on the wood to be beyond my last nail. I think this was responsible for the exterior cut gouging the surface a little. Fortunately, it was a small cut and the TechShop DC gave me a pass, but I really want to avoid this problem in the future.

My last problem was using too high of a plunge depth. I had to adjust VCarve Pro's tooling database to add the 1/8" endmill I was using, and while I correctly updated the diameter, I forgot to update the depth, and I think that let to too deep of an initial cut which then led to having the uneven bottom surface.

My final part was OK, but it will need a bit of manual work to clean up parts, and I already had some chipping from the pine in part of a relatively thin interior wall.

Lessons learned:

1) remember to run VCarve with Z=0 set to the top of the part.2) when adjusting your endmill settings, make sure you adjust all of the parameters3) when using natural boards, it's probably a good idea to plane them first to ensure a uniform thickness4) when affixing the board to the surface, go a little overboard with the composite nails. Why use four when six or eight would work?

Friday was my last day with LG Electronics; I've left to pursue a new opportunity with Roku working on new product development here in Austin, TX.

I consider Enyo to be a great product, a result of excellent architecture work by the original developers and a very thoughtful and innovative evolution of features. I'm really proud of what we did in the last year under LG, and I'm looking forward to the Enyo and webOS-powered LG SmartTVs hitting the US market soon.

The good news is that LG is still fielding a great Enyo team with a bunch of great developers that are keeping the work going, including Gray Norton, Kevin Schaaf, Cole Davis, Blake Stephens, Aaron Tam, Jim Tang, and Lex Podgorny, as well as the LG teams from TV Lab in Korea. Look for their input here as part of our public Enyo conversation; I expect great things to come.

I'd also like to recognize all the wonderful input from the community; your pull requests and questions have made Enyo development much more enjoyable, and I'll miss working with you.

I'm still going to follow this email list and check up on things from time to time, but I'm no longer speaking in my role as project lead, just as team member emeritus. My day-to-day work is going to involve firmware development for embedded hardware, so I won't be spending too much time in the web development world.

One good way to get horizontal symmetry is to set your document width to match the exact size of the material you're using, then select all of your objects, group, and center horizontally in the document.

If you're doing a double sided design where symmetry is important, be sure to do a horizontal flip before printing in Corel Draw to make sure things line up. I learned this the hard way working on the Enyo ornaments.

When you do your test run, look for overdraws and edit those out using the Corel object editor. Auto-trace can often leave these in, and they just end up causing longer jobs and scorching.

When you're mixing engraving and cutting, make the engraved bitmap the black color. For some reason, Trotec's software just wasn't seeing non-grayscale as something that could be etched, even though Job Control allows setting that up. It's OK to use lots of colors for all your cutting layers.

When possible, use multiple colors for your vectors to order cuts. This is important if you're cutting small features out of larger shapes and using plywood that has a tendency to be uneven, so if you cut the larger features first, you may be out of focus for the interior ones if the work material has dropped.

Always use the job estimation feature in Job Control. Not only does it show about how long the laser will take, but it lets you know quickly if the software isn't understanding your layers.

I've been spending more time at Austin's TechShop lately working on projects... my creativity has been desperately needing some outlets. One project involves making molds out of plywood for vacuum forming, and I'm using layers of laser-cut plywood for this, since I need some pretty precise heights.

The standard TechShop laser here in Austin is the AWESOME Trotec Speedy 300, far more powerful than the Epilog 40W laser that we had at Resistor. However, that's meant having to adjust my settings for various materials with a lot of trial and error.

1/4" MDF board: this took a lot of tries, as it's very dense with lots of layers to cut through and also tends to smoke and flare up. I would end up having to do run after run which would scorch the material. No fun. What ultimately worked for cutting was 100% power at 2.0 velocity for five passes, each one adjusting the Z-axis offset 0.05". That was fast enough to not flare up as badly, and adjusting the height kept the laser cutting the bottom layers of material instead of just burning the sides.