Ionrock Dot Org

by Eric Larson

My Weblog

Holy Cow, I Fixed Our Four Track!


We have gone through two four tracks throughout the years. They both broke in the same way. The jack for the power adaptor always seems to break. Deep in my heart I knew it probably was an easy fix, but my avoidance working on physical technology seemed to always keep me away. That is until now!

Seeing as I’m pretty weak in the tool department, some family members took the steps necessary to get my interest in technology off the computer and into the garage. The result was a table saw and a most excellent soldering iron. With a 10 year anniversary wrapped up, the New Year begun, and a new tube stereo amplifier kit on the table, it seemed like a good time to start learning how to solder. One of our broken four tracks was destined to be my first attempt at mastering the art of melting metal.

Before getting too far along in my quest to actually understand the real world implications of Ohm’s law, I needed a place to work. As luck would have it, I discovered an old sign up in our garage attic from the previous owners. It was about the perfect size for a work table, so I grabbed the last few boards from my van customizations and went at it. The table saw made the whole thing so easy. I had actual straight cuts that didn’t involve balancing boards on saw horses and setting up dumb jigs just to cut one board. In record time my work table was done and I started populating it with my newly acquired electronic goods.

Cracking open the four track, I felt much more confident about the whole thing. It is pretty addicting to work with your hands. It also didn’t hurt that I had nothing to lose with this extra, broken four track. Once I got to the actual connection in question it didn’t take much to see the problem. Sure enough, the soldered connection had come apart. I lucked out in that removing the old solder was pretty simple. A little prying from a screwdriver and with some help from the iron, it popped right off. The next step was to try and resolder the connection.

When you solder something the first thing you do is “tin” the tip. That means putting a thin layer of solder on it. I honestly couldn’t tell you what this does, but everyone says to do it, so I did the best I could. It was during this time I played around with the temperature to see how hot I really needed my iron. In the long run, if I were to do it again, I might start at the hottest and work my way down instead of slowly warming up. If for no other reason than to get your iron behaving in a similar way as those fine folks who make helpful howto solder videos on youtube. In the videos, the whole process seems insanely fast, but I suspect that is partly because they have rather powerful irons and have learned to solder efficiently. In any case, it feels like you’re doing things right when it is hotter.

After the tinning, I tried making a new connection. I had been reading up on how to actually solder something for a while now, but it really didn’t work like you expect. In all the tutorials they mention touching the iron to the thing you want connected and not on the solder itself. This seems like a good idea, except when you see how fast things go with the youtube videos and you can’t get the solder to melt for anything, it makes it seem like you’re missing something. After soldering the connection a few times for practice, I still didn’t feel too terribly confident. But, seeing as I had a nice glob of solder stuck on there I went ahead and tried turning it on. Sure enough it worked! The jack seemed stable and everything was working. Pretty crazy.

I’m not quite ready to start up my tube stereo amplifier kit I got for Christmas just yet. I’d like to head up to Fry’s and look for a practice board or something to get a few more resistors done first. That said, I’m pretty excited to try to do something a little more in depth. Soldering is far from simple, but it also isn’t nearly as scary as I would have thought. All in all, it was a nice initial forray into the physical world of tech.

Posted Mon Jan 4 07:49:21 2010 by Eric Larson

My First Electronics Project

These totally out of focus pictures are from my very first electronics project. I got a kit that dims some LEDs based on the amount of sound coming from a mic.

Posted Tue Jan 5 19:38:19 2010 by Eric Larson

Crash and Burn


Last night I tried to wrap up my tube stereo amplifier kit. I mounted the board, connected all the transformers, added a power cord, a switch, a fuse and put some banana plugs on some speakers. Things were looking good and I felt reasonably confident it would power up and I could boast about my extreme warm tones.

Unfortunately things didn’t work out that way. When I flipped the switch there was a nice hum. It sounded like a real tube amp, which seemed like a positive development. No sparks seemed like a good sign. I watched the tubes waiting to see a nice glow, but then noticed a little smoke coming from the power transformer. I turned things off and saw one of the coils started to melt a plastic shield around it. Somewhat dismayed, I took it back into the garage and checked for obvious errors on my part, clipped a few leads and tried it again. The same thing happened.

I’ve started looking up the best way to debug the problem on different forums. While I had hoped I could avoid getting too involved in the actual science of resistors, transistors, capacitors and the like, it seems I might need to get a little more serious about it all. This is far from a bad thing, but it does mean I probably won’t have my sweet tube stereo playing our EP on vinyl anytime soon. Worst case scenario, my wife found a good vintage stereo repair guy in town that I can probably talk to about how to fix things up.

Posted Thu Jan 7 19:32:07 2010 by Eric Larson

Keeping Track of Translations


At work we have a rather globally focused set of applications thanks to our very international company. The requirement for i18n is an absolutely critical one. The problem is that we haven’t yet taken the steps to handle the issue more elegantly. We’ve been using GNU gettext with some success, but it is becoming apparent that our usage could be better.

The biggest question in my mind is where and when translations get built. The way gettext works in a nutshell is you have a .po file that gets updated with the different translations. That .po file ends up being used to generate a .mo file. The .mo file is a binary representation of the translation that gets used when calling gettext functions. Right now we have a folder in our python module that has a template .po file for updating the different language .po files. When we have a new string, we add it to the global .po and run a script to add it to the language specific ones. The translators then translate the strings in the file and we generate the .mo files. Both the .po and .mo files end up in the python module so that it is simpler in deployment. There are some problems with this system.

First the translators often edit the file more liberally than strictly adding in the strings. Small things like changing line endings and adding extra spaces makes for minimal changes, but ruins merges. Second, patching the files is difficult since things like line number comments change. This is easy to rectify manually, but using mercurial it ends up becoming more difficult because the patch is slightly off. Finally, the generation of the .mo files is anything but automatic. It takes about 5 steps to add a new translation and 3 for updating a translation, all of which involve manual running of scripts. While it is a pretty minimal set of steps, it is still something that feels like it’s in the wrong place.

Personally, I’d like to extract the translations from the module. This would help break the reliance on a specific version of the code and instead provide a more decoupled way for dealing with the translations. I’d also like to only keep external .po files in version control and instead rely on a build or deployment to handle constructing the .mo files. Doing this means there is no question regarding changes in .mo files as they don’t exist in a repository. Currently, when the .mo file changes it is unclear whether that was from a merge or compilation. If you merge the files and see the .mo files as changed, it can be difficult to know whether that change came from the merge or if you still need to compile them again against any possible .po file changes. Forcing the .mo to be something that must always be built reduces the chance for confusion and issues involving .mo files that aren’t actually in sync with their respective .po files.

While my ideas on the matter seem pretty reasonable, I’d love to see what others do. Hopefully the lazyweb can help me out in finding some of the pros/cons with my ideas as well as systems others have used.

Posted Fri Jan 8 20:37:32 2010 by Eric Larson

Man Made Floods


Over the weekend we had something of an issue. Behind our refrigerator is a water connection socket for things like ice makers and builtin water dispensers. As we have neither in our fridge, it effectively sat unused all this time. When we bought our house it had leaked a little. We got it fixed and that was that I thought.

Saturday morning when we got up, we noticed the sound of water running. I figured a faucet had been left on or possibly the toilet downstairs might have been running through the night. As soon as I get to the stairs I realize that the water running is quite a bit louder. It didn’t sound good. When I get downstairs I find the floor flooded coming out of the kitchen. I waded through water to find that socket turned on full blast and firing water into the air. I grabbed some plumbing pliers and turned it off. It was a huge mess.

The water had filled the kitchen with around a inch and half of water. The carpet downstairs was also fully soaked throughout most of the downstairs. We bought a wet/dry vac and starting the process of getting all the water up. A friend brought his vac over as well. After working all day we had pretty much gotten things at a semi-reasonable state. We kept the windows open and fans blowing overnight as well to help continue to dry things. The house is in the low 50s, which makes things rather difficult.

Today we’ll be calling the insurance company to see if there is more we need to do as well as if we can get some help doing it. It is all pretty frustrating because it really shouldn’t have happened. We had a professional plumber come to plug up that socket originally and he obviously just put some putty in it. I realize this might be totally fine, but obviously, in practice is was anything buy. We found a nice solid metal cap and rubber washer worked much better plugging up the hole, so it surprises me that a pro wouldn’t have done something similar. After a couple days of fans blowing and the house being exceptionally cold, I think the worse is definitely behind us. The carpet is pretty dry and while the mat is most likly still pretty wet, I think it might be drying out as well. The whole thing made for a pretty bad weekend. Thanks to all our friends that came over to stomp on towels and hang out in the cold.

Posted Mon Jan 11 07:37:26 2010 by Eric Larson

Desktop Linux


As a programmer, I’ve found using Linux on my desktop rather rewarding. So rewarding I might consider stating Linux is ready for desktop use. But, when I do consider claiming that Linux is finally ready for relatives it dawns on me that I’m far from a good use case.

First off I use Emacs. This is not a mild usage of the one true editor, but in fact Emacs has become a daily tool that I’d say I can’t live without. Second up, I use StumpWM. This is a tiling window manager that is anything but user friendly. For instance, over the holidays, family members would consistently become frustrated trying to open a new window or web browser. Lastly, I’m a programmer! The vast majority of things I do on my computer deals with basic text and not much else. I’ve even started doing more basic web browsing in Emacs to save a little time.

While using myself as use case is not the best measurement of usability, it doesn’t really end there when ranking the desktop friendliness of Linux. One huge frustration of mine is sound. On the one hand, there are a ton cool programs for Linux having to do with sound. There are music players, drum machines, samplers and rather full featured recording applications. Unfortunately, rarely do they work. In fact, sound often stops working in Flash and doesn’t start working again unless I restart my browser. Say what you will of Windows and OS X, but sound works pretty darn well.

Personally, I’m totally fine with Linux not being ready for the desktop. It is only a matter of time really. The desktop is quickly becoming nothing more than a web browser and a series of web service clients. Linux will still need to seriously find a way to stop sucking at sound and improve video, but I suspect that it will. The only question then is whether it will even matter at that point.

Posted Mon Jan 11 23:39:48 2010 by Eric Larson

Hopefully Posting With Twitter


Today I took a minute to add automatically tweeting when I write a blog. For whatever reason, I’ve been blogging more lately. The result is that in my (totally biased) opinion, my writing might actually be helpful. What better way to help promote my writing than through the 80+ people who follow me on Twitter!

It only took a few minutes before things seemed to be working including using bit.ly for shortening URLs. The nice thing about this is that I will be finally pointing my posts back to my own blog instead of relying on whatever service it is I’m using (Posterous and WordPress). Personally, I’d like to consider it a testament moreso to the wealth of great libraries available in Python than any real programming feat of my own. That said, after not looking at my blog code for probably a year or more, I’m happy to report things were really easy to follow.

Posted Wed Jan 13 04:17:27 2010 by Eric Larson

My New Pedal and Some Soldering Tips


Over the weekend I managed to finish up my pedal kit! I did have one cold joint on the actual switch that needed to be re-soldered, but other than that, it went off without a hitch. When I was in high school and listened to a lot of guitar dude bands (this was before listening to guitar dude bands was “cool”), I was always impressed when I heard some member of the band could work on equipment. I think it was either Journey or Yes whose guitarist designed his own distortion pedal and Brian May (Queen) built his guitar. The idea that you could go and change your sound beyond turning a knob was always enthralling.

While my actual role in getting the pedal working was pretty much just soldering joints, it is obvious I’m just starting out. Still, I’m really proud that I was able to do it right the first time around and now have a pretty respectable pedal for it. It also makes me really excited to start on another one! As my biggest accomplishment was soldering, it became clear there were some techniques that help to make nice clean joints.

I found when soldering onto the board, the goal is to get the solder to drop onto the joint. When you see a joint on a commercial product, there is perfect little dab of solder on the joint that looks like a tiny concave cone. This cone is what I’m describing when I say “dropping” the solder. This is not some term I picked up anywhere else, so don’t go walking into your amp repair shop saying you think some joint was bad because the solder on the joint never dropped. When it happens, you see the tiny ball of hot molten solder disperse onto the board. It disconnects from the iron and flows down to the connection on the board and wraps perfectly around the lead you’re soldering.

One of the best things to help make this happen is keeping you tip well tinned. This is something everyone says to do without really describing why. Tinning, in my limited experience, acts like a lubricant of sorts that lets the solder fall off the tip of the iron easily. It also makes heating up the solder much faster. Both of these characteristics help a great deal to make a good joint. The solder naturally will make a nice joint when it drops onto the board, but getting it to do it is where the challenge comes in. A well tinned tip is a great place to start.

Once you’re actually starting to solder, there are couple things that help to get the solder to disperse on the board. You can make the angle of the iron more vertical. This makes any solder on the iron tend to go towards gravity, which will get the solder to flow on the connection. Sometimes, I would even tap it slightly to get the solder moving down the tip. One thing I should point out is that I’m not adding solder to the tip first and then putting it on the board. When you go to solder the joint, you usually have to end up touching the solder to the tip slightly and the solder tends to naturally end up on the iron. The quest then is to get it from the iron to the joint. You can also do thing like twisting the iron slightly and moving it around the joint. Sometimes this gets the solder to latch onto the lead, which will provide enough momentum to get it down on the board.

When you spill a liquid on carpet, sometimes it just sits on the surface and doesn’t actually sink in. This sinking in is what you want with the solder. If you’ve ever touched liquid that hasn’t sunk into carpet, you saw very quickly that once that seal was broken, it quickly soaked into the fibers. Again, things like moving the iron, tapping and getting the solder to slide off the iron all help break that seal and let the solder drop on the board.

In addition to trying to get solder off the iron, you can avoid getting it on the tip of the iron in the first place. When you place the solder on the joint, try to touch the solder to the iron while touching the solder to the joint as well. This can let the solder immediately flow on the joint, at which point you’re golden. You can push a hair more solder on and brag to your friends how your hands are better than machines. I think the guys that are really good have learned to do this aspect really well, so it is something that will becomes easier with practice.

I’m no expert but I did manage to do a decent job on my joints. I could still do better and next time I’m definitely going to try. But overall, using the above techniques and understanding of how the solder worked made a huge difference getting decent connections when soldering pieces to the board.

Posted Tue Jan 19 17:55:01 2010 by Eric Larson

A RESTful Gettext


At work I’ve been thinking a lot about how we work with different languages. One area that has been something of a pain has been translations. There is a disconnect between what phrases are live and those that live in the source. It seems like a better system would be a lazy one that creates and updates translation catalogs as the different phrases are used. For example, when a translated string comes from a database or variable.

My idea is to create a really simple service to act as a lazy gettext. In terms of features, the basic idea is that if the string hasn’t been translated, you get a 404. Otherwise, you get the translated string. The URLs are really simple. The language catalog and English percent encoded phrase identifies the resource (/es/very%20well). Any special context can be added via query string arguments that allow similar phrases to be translated differently.

I’ve started working on a simple implementation using MongoDB that I’m calling Dragoman, which is a synonym for translator. There will also be a HTML interface for adding translated phrases. As new phrases show up missing (404s), they will be made available to translators to translate. The idea is to move the application translation out of the source and into the hands of those users that create the actual content.

Update

I wrapped up some basic functionality/tests and added it to my BitBucket account. It uses a library called Fab which is our internal web framework built on CherryPy. I’m working getting the necessary aspects available (a nice threadsafe connection pool), so others can use that aspect easily. It also uses Eggmonster.

Posted Sat Jan 23 08:11:57 2010 by Eric Larson

Project Ideas for PyCon


This year my company is sending some folks to PyCon! For those that don’t know, PyCon is a conference that focuses on the Python programming language. When PyCon was in Dallas I was able to go both years and it was a lot of fun. It is an opportunity to totally immerse yourself in programming and the community in a way that is pretty unique. There are literally hundreds of people constantly discussing programming with Python. It is almost impossible to avoid getting sucked into the conversations and learning something new.

It is a good idea to head to a conference like this with some ideas on things you can work on. Sometimes these sorts of projects get some attention from others and you have the rare opportunity to “sprint” on the code and get something working others can use. Other times it simply gives you something to do when considering all the different techniques and libraries you’re learning about. Last year I worked on writing a simple CouchDB-ish database to get better acquainted with some different libraries and learn more about threaded programming. Needless to say nothing came of it in the end, but I did learn a few things, which was the entire point of the excercise.

This year, I don’t really have a focus or specific technique I’d like to learn about. Last year was all about parallel computing, but this year, I’m thinking a bit more practically. This past year in fact has been more about making practical attempts at creating helpful tools more than anything else. In other words, I’d like to finish something this year. This means small ideas or small parts of larger ideas. I’d also like to stick to something that would be relatively helpful to someone other than myself. Really, that last requirement is rather difficult, but it seems reasonable to try.

My first, and most likely what I’ll end up with, is my gettext replacement. I’ve got some real work done on it and coming up with a simple deadline for what needs to be done with it seems reasonable. Another idea is a feed reader of sorts. My blog already works kind of like Planet in that it pulls in feeds and adds posts to my blog. I’ve been getting worried about my “googly” view of the world, so a slightly smarter planet-like interface sure seems helpful. Likewise, I wouldn’t mind being able to have a feed reader in emacs that actually works. Even though that wouldn’t really do much with Python, it is an itch of mine. I started writing a little code to make a twitter bot. This is like an IRC bot that you can ask questions and it will interact with different services. Specifically, I’d like to be able to send tweets that end up in delicious, so that would mean working out tags, a URL that is not minified and any other bits that need to happen. This is definitely a tool that seems like it could be helpful to others, which is a definite plus. Another tool is one that submits blog posts to the different social news sites automatically. I’m not sure if that is even possible, but it sure would be helpful.

I’m actually pretty short on ideas this year, so any suggestions people have are welcome.

Posted Tue Jan 26 17:09:34 2010 by Eric Larson

The Dollar Value of Music


I read this short article on the damages for pirating music. One thing that struck me is the minimum damages for copyright violation is $750 per track. Call me crazy but that seems really high, especially when everyone seems to be suggesting that the current state of the music industry is actually correcting itself. If Brian Eno is correct and the music industry really similar to that of whale blubber, I can’t help but think that the RIAA’s quest to get money via lawsuits should be extinct.

The point is not so much that music isn’t worth anything. But, if the labels are obviously suffering and the recent trends really are an indicator of scarcity more so than an unintended consequence of new technology, then the ability to expect huge damages should also be greatly reduced. If I steal a pack of gum from the grocery store, it is not the same thing as if manage to embezzle money from a bank or steal a few hundred cars. If I get caught stealing from the store, there is a good chance I’ll just have to give the gum back or pay for it along with a fine. Worst case scenario I might spend a night in jail, but no judge is going to send me to jail for a few years since the actual cost on society is so little. Likewise, if the value of a song has clearly become devalued, why then can someone have the ability to sue for huge damages. This is especially true when the track record of record labels is horrible when it comes to consistent profits. Venture capital funds can’t sue the random users when a tech startup fails, so why can record labels sue listeners when a song is pirated? While it is true the pirate is stealing, that doesn’t mean the record label lost money. Just because someone pirates a song or even an album doesn’t mean that person would have paid for it had they not been able to download it. With iTunes and Amazon making music so readily available, it is tough to argue that pirating a song means a loss in revenue.

This doesn’t take into account the aspect of file sharing such as torrents where you not only download, but upload files at the same time. Again, unless you make your entire music library available 24/7, I can’t see how it is possible to be a huge source of free music. Likewise, if you consider the same circumstances where you downloaded the track illegally, the case for huge damages continues to not make sense. You didn’t want to pay because you wanted to hear the album a couple times on your ipod. If you make a similar assumption about those downloading it from you, then it is clear that the presumed damages the record companies are assuming don’t hold water.

All that said, if labels can figure out a way really prove how much they lose from pirating, then I think the lawsuit damages would make sense. Personally, I seriously doubt they can, but if they get smart it might be possible. Bandcamp has a great new model for this sort of thing with their BCWax label. It is so simple it hurts. They look at the statistics of what is selling, see if they like it, and if they do, they offer to put out extremely high quality physical versions of the music. This is how a label should work! Bands should keep excellent records for this very reason. We’ve sold out of our EP, which is pretty good. We have decent sales from the digital retailers and have a good track record selling at shows. From a potential sales standpoint, we are a pretty decent risk in that we have a good track record of selling recorded music. Yet, not one label has asked for any information regarding our history selling music. This is what makes me wonder if we really are seeing an industry correct itself more so than a technology destroy a business. In the end, it really doesn’t matter either way. It has become harder to make money making music, so you should either accept it and move on or try something else.

Posted Wed Jan 27 22:10:18 2010 by Eric Larson

An Interesting iPad Observation


With the release of the iPad, there have been an almost non-stop barrage of blogs and articles suggesting the both the triumph and failure of the machine. My take is that it looks like it would be fun to play with. How’s that for a review. One observation I’ve seen a few times if the lack of Flash. This has been an annoyance on the iPhone since much of the web depends on the pervasiveness of Flash to deliver content. On the one hand, much of the Flash content on the web is advertising. While it seems like shooting the web in the foot preventing ads with Flash, not many folks miss seeing big flashing advertisements.

The connection many of these blogs make is that if this platform continues to grow (the iPod, iPad, and iPhone), it will eventually have an impact on the propagation of HTML 5. This is an interesting logical conclusion to make, especially since Apple does have its own Flash player that it has been shipping with OS X for quite a while. Yet, the I hope that it is true. While I haven’t been following HTML 5, the reverberations of its features have become rather loud lately. There are quite a few aspects that go beyond HTML as markup and set the stage for a larger platform built on the DOM and Javascript. While it has appeared the spec is rather prescriptive in what it specifies, there have been some positive connections to things like Google Gears and jQuery that make me think some of the features that are out of scope, actually make a lot of sense. In end it really doesn’t matter if the HTML 5 spec defines things like background processes in Javascript as long as something pushes the issue in a way browser vendors can implement it.

I have to agree that the big win with the success of a Flash-less iPad platform is the continued openness of the web. The Flash/Flex RIA world is enticing, but it’s still extremely proprietary. It has obviously been a huge challenge to find technology that meets the needs of the web while still keeping the openness. Changes in Javascript have been excellent and it seem HTML 5 is where that evolution continues and opens yet another door for opening up the web as platform. Flash has been the one proprietary platform with the web that has continued to keep a stranglehold on rich content. HTML 5 allows a real choice when considering rich media in the browser. Hopefully this observation the iPad reviews have presented can become a reality and the web can have another renaissance with rich media and interactivity.

Posted Thu Jan 28 19:45:49 2010 by Eric Larson
Created using Python, jQuery and Emacs