50 Lines of Code – day 2: more LWP
More Paint LWP work... See gist at bottom. Anyway, all I've been doing is just letting my hands type out the general idea of what I want. I have yet to test it in any emulator or device, to make sure it's doing what I think it is. I just want to make sure I'm writing things correctly; the first write is to learn it, the second to create, and the following to master. Once I've got the idea solid (and I think I'm getting there), I'm going to write one of these more simply: instead of four colors, only one moving paint dot. And that way, I can really start testing what I'm looking for. I'll get some more time tomorrow, so expect a new copy of this, a little simpler and more testable. Maybe I'll even have a package to distribute - wouldn't that be nice. ![]()
50 Lines of Code, Day 1: Live Wallpaper
My first 50 Lines of Code entry, is the beginnings to an Android 2.1+ Live Wallpaper.
Called Paint, the idea is to have four main colors at the edge of the screens. By the phone's tilt, those colors will bleed into the screen itself, causing the animation, and interactivity with the phone regardless of whether or not you're actually accessing an app. The LWP actually becomes as fun to use as anything else on the phone.
The basic setup is contained in this Gist. There's more to add, but I made my quota for the day, and I want something to work on tomorrow.
50 lines of code
I haven't written much code, for being a Comp Sci major. I feel like sometimes, I get further and further behind my peers because they have the opportunity to write the code that I don't.
I'm giving myself a challenge, and having my blog (Corner of Seven, for those of you reading this via Facebook) become the record of my success or failure of this challenge.
Starting today, my goal is to write *at least* 50 (fifty) lines of code per day.
This idea came about through the previously mentioned "Don't Break the Chain" post on this blog (which worked oh so very well...), and a recent experience that I had at work.
Most of my work duties are currently system configuration and setup, and less actual development on said systems. With that, my ability to get code written has diminished. I was asked recently to create a component in our software that renamed a file going out, based off of metadata contained within that file. After sitting blankly at the computer screen, with my brain screaming, "I know what to do!!!!" and my hands frozen, unable to regain the muscle memory of the common actions of Java, I looked inside, and realized this had to change.
In a sense of betterment, I want to complete at least a small project daily. Maybe it's a coding kata. Maybe I work on stuff in Android. Maybe I continue work on RBEQ. Maybe I add new things to Corner of Seven. Maybe it's something I haven't even thought of yet. All I know is that new code needs to come out of me, before I can't do it any more.
Fortunately, I have tools at my disposal. The afforementioned projects can keep me busy for a while, but what do I have to show the work that I've put in? Enter the Gist system at GitHub. This allows you to put small snippets of code out, configurable by language; it gets your code available on the internet, and embedded into a blog or webpage.
So there you have it. Look to see some Gists from me shortly.
Cheers!
RBEQ 1.4 – GStreamer Presets
Just when you thought it was safe...
1.4 of the RBEQ, the Rhythmbox Equalizer, is out and ready for download. The big change here is a switch from storing presets in a flat file to using the GStreamer Preset system. As always, downloads are at RBEQ Google Code.
A big thanks to Stefan Kost, who left this gem of a comment on the 1.3 release posting:
Any reason, you are not using the presets shipped with the gstreamer plugin?
Look at /usr/share/gstreamer-0.10/presets/GstIirEqualizer10Bands.prs and the GstPreset interface.
Users can install own presets to $HOME/.gstreamer-0.10/presets/
Since I didn't know anything about them, after looking at the aforementioned docs, I've gotten things so that they use the GStreamer Preset interface, and it is more well-behaved.
Also a big thanks to Hicham HAOUARI, whose awesome work has gotten RBEQ into Fedora! That's awesome; I was nearly flabbergasted when I saw that. Thank you for the support!
Comments and bug issues are always welcome; please let me know what you find while using it.
Look at /usr/share/gstreamer-0.10/presets/GstIirEqualizer10Bands.prs and the GstPreset interface.
Users can install own presets to $HOME/.gstreamer-0.10/presets/
Exploring the Droid
Recently I've been having a lot of fun playing with my new phone.
The previous statement isn't much of a surprise in this day in age, but I think I should qualify what I mean.
I've been having a lot of fun playing with the software internals of my new phone.
RBEQ 1.3 – Now With Presets!
Hello all -
A new version of RBEQ, the Rhythmbox Equalizer plugin that I've been hacking away at, is out for public availability. Of course, this means that I have to go update all of my previous links to point to the new download. For ease of accessibility, you can find it at http://rbeq.googlecode.com, as the featured download. Installation instructions are the same: download the file, open a terminal, and type:
tar -xvzf rbeq-1.3.tar.gz -C ~/.gnome2
New in this release:
- The ability to save and load presets. This has been a big request, and I finally found a decent way of handling it.
- Layout cleanup and arranging to add in the new preset functions.
- Backend code cleanup, so that it behaves more python-y. I'm not a python programmer, so this has been a neat experiment in trying it out.
Thanks to all out there who have used and enjoy the past versions of this plugin. Hope that the new one is to your liking.
Pinewood Derby
I received a phone call from my Mom earlier this week, posing what would seem to be a simple question: "Could you help come up with something to manage the pinewood derby at the beginning of March?"
Little did I know that it was going to become a rather taxing endeavor.
The first step has been figuring out the best way to generate heats. Given m entrants and n lanes, there must be m/n, rounded up, 'heats' in order to make sure everyone has raced the same number of times. Some of these heats would be less than the number of lanes, but should be set up to be not only most fair to racers, but keep the scoring as even as possible.
I started out to see if, given m entrants and n lanes, if it was possible to have a true round-robin tournament; that is, make every racer have a race against every other entrant, and have each racer have the same number of races. That would make the calculations for the winner the simplest. Unfortunately, while easy on paper, it becomes impractical in real life.
For example, say we had 8 racers on 4 lanes. In order to achieve a true round-robin state, we need to have 8C4 races, or 70 heats, in order to satisfy the above conditions. Now, in practicality, do you think it's possible to have 8 elementary school students sit patiently enough through seventy races? I didn't think so either.
My current goal is to make a heat generator out of some form of predictive system. Using a map of entrants to see how many times one has competed against another, the generator picks the least raced candidates, in order to keep fairness at a maximum. There are some other things to take into account for the day, like damage, re-races, and run-offs for ties, but those become part of the operation logic. The true core of this is creating the heats for each level, and keep track of the points received for those races.
Why Apple Chose iPad
As everyone is quite aware, Apple's release of their tablet, now known as the iPad, was announced yesterday. With their own System-on-a-chip processor, near-10" screen, and storage sizes ranging from 16-64 GiB, these pieces of technology are impressive at their price point, even for a non-macHead.
However, the overwhelming response to the announcement yesterday was that of its name: "iPad." Throughout the afternoon, the 2nd-highest trending topic on twitter was 'iTampon,' a not-so-subtle play on the name. Many jokes set in along the same lines:
http://www.fastcompany.com/blog/alissa-walker/designerati/apple-ipad-name-not-winning-women
http://bits.blogs.nytimes.com/2010/01/27/the-ipads-name-makes-some-women-cringe/
http://online.wsj.com/article/SB10001424052748704094304575029603030082186.html?mod=WSJ_Small+Business_sections_management
This led people to question: "Who in their right mind would use this name? Especially considering this MADtv Clip?"
Others: "Were there NO women on Apple's naming board?"
Personally, I think Apple knew EXACTLY what they were doing. It thrives off of the idea that "any publicity is good publicity." Everyone now has the name iPad stuck in their mind, even if it was because they heard it in a joke somewhere. They know what the device is, and they knew about the MADtv sketch. As these things get passed around more and more, it will create more interest in the actual device.
On top of that, Apple's fans are the some of the most extreme technology followers, even worse than Stallman, et. al. in the GNU/Linux world. These people, who would buy the device anyway, coupled with the tech world, who is actually impressed with the functionality, makes me think that even with the interesting choice of name, they've still got a hit on their hands.
Resume Available
Hello All -
I put my resume up for availability as I'm not quite certain how much longer I can stay at my current job. I'll be looking around for things to work on in the Dubuque area, so if anyone knows of any open positions, please let me know.
The resume itself can be found here, or just use the link at the top of the page.
