I probably wont get a real post out this week. No, it isn't blogapathy, life and work is a little hectic right now.
Next up will be my game announcement though. Then maybe I can get back to hacking :)
-P
Friday, May 27, 2011
Monday, May 23, 2011
Lot's todo
All developers are familiar with the infamous "//TODO" comment in code. It means "I know this code is not finished and will need work", or "I have deadlines and Fred's code is broken so this is the best that can be done until he fixes his library". The problem is that these thing can linger forever. I know, I'm guilty of it myself.
Who hasn't seen things like:
//TODO fix after June
(But that comment was checked in 2 years ago)
//TODO see Fred for a fix.
(Fred doesn't work there anymore, by the way).
Amongst the many code quality techniciques and policies, such as unit testing, treating warnings as errors, and using static analysis tools, I propose a system for dealing with a "TODO" - something that has been identified as needing rework eventually.
In my Android Game, I have recently started using a class to denote such beasts. Behold:
Who hasn't seen things like:
//TODO fix after June
(But that comment was checked in 2 years ago)
//TODO see Fred for a fix.
(Fred doesn't work there anymore, by the way).
Amongst the many code quality techniciques and policies, such as unit testing, treating warnings as errors, and using static analysis tools, I propose a system for dealing with a "TODO" - something that has been identified as needing rework eventually.
In my Android Game, I have recently started using a class to denote such beasts. Behold:
Saturday, May 14, 2011
An alternative to the Android emulator and setting up ADB for TCP.
[Update 7/28/11 :See updated information at the end of this post]
I touched on it in my last post, but Android x86 running on Virtual Box can often (but not always) perform better than the standard Android emulator. OpenGL is painfully slow on either. I'm running one of their pre-built Froyo binaries, but Gingerbread source is on the site, if you're feeling adventurous.
The main advantages are:
Launching Android-x86 is not automated like the emulator and ADB takes slightly more effort to setup, but it's not hard. So here's my quick-start guide
I touched on it in my last post, but Android x86 running on Virtual Box can often (but not always) perform better than the standard Android emulator. OpenGL is painfully slow on either. I'm running one of their pre-built Froyo binaries, but Gingerbread source is on the site, if you're feeling adventurous.
The main advantages are:
- it starts up faster
- less prone to lockups the the SDK emulator
- it depends somewhat on what you're app is doing, but many things, like file system IO and math intensive code, seem to execute much faster
The main disadvantages are:
- Not very representative of a "main stream" Android device.
- Cant be used if you're using NDK with native code targeting the Arm processor.
- Configuration of things like screen dpi, and emulated hardware is not as easy or non existent.
- You can't emulate certain operations like SMS
A guide to setting up your x86 virtual machine can found here: (It takes less than 10 minutes) Install Android Froyo on PC
Wednesday, May 11, 2011
Android OpenGL ES texture management.
My Android game is still 'coming along'. I'll be making an announcement post soon. It's consumed most of my late evening "dad time", I haven't touched a soldering iron in a while, I'll make up for lost time later.
Progress on the game has generally gone like this: bang out some framework code, bang out cool feature, cool feature, find a minor bug, spend the next few evenings pulling my hair out, framework code, cool feature, cool feature, rinse, repeat. This post is about one of those hair pulling moments and my solution. It revolves around Android's handling of the OpenGL texture buffer management API's.
Recently, I was reworking my texture management code in my "engine" (if you can call it that, it's really just a few folders of Java files with a focus on lower level Graphics and my own Collision detection). I wanted to add the ability to have "dynamic" textures, ones that could be created and modified in the middle of a game in progress. Android has been fun to work with, but the there is a dearth of documentation when it comes to the 3D stuff, you are typically refereed to external Open GL ES docs, or to the SDK samples, which invariably don't do what *you* are trying to do.
Disclaimer: Though I have been in the video game business for a long time, I have rarely done low level graphics rendering work. I would not consider myself a guru in that area, so take this post as food for thought and not as an authoritative doctrine. If you think I'm wrong on something, call me out!
Progress on the game has generally gone like this: bang out some framework code, bang out cool feature, cool feature, find a minor bug, spend the next few evenings pulling my hair out, framework code, cool feature, cool feature, rinse, repeat. This post is about one of those hair pulling moments and my solution. It revolves around Android's handling of the OpenGL texture buffer management API's.
Recently, I was reworking my texture management code in my "engine" (if you can call it that, it's really just a few folders of Java files with a focus on lower level Graphics and my own Collision detection). I wanted to add the ability to have "dynamic" textures, ones that could be created and modified in the middle of a game in progress. Android has been fun to work with, but the there is a dearth of documentation when it comes to the 3D stuff, you are typically refereed to external Open GL ES docs, or to the SDK samples, which invariably don't do what *you* are trying to do.
Disclaimer: Though I have been in the video game business for a long time, I have rarely done low level graphics rendering work. I would not consider myself a guru in that area, so take this post as food for thought and not as an authoritative doctrine. If you think I'm wrong on something, call me out!
Sunday, May 1, 2011
Rebuilt Swingset.
We inherited 1/2 a swing set from our neighbors. Last weekend, I turned it from this:
to this:
Alright, this isn't at all electronics or programming related, but it is still "hacking" in a form. The local hardware store doesn't stock parts for this purpose, they only sell "playground kits". It's mix and match, but they assume that you are buying a complete swingset, so they package some important parts in the big expensive kits, and don't sell them "loose". So I was on my own. At least they sold the actual swings separately, but I did have to make a return trip when I realized they did not come with hooks to mount the swing chains to the frame.
to this:
Alright, this isn't at all electronics or programming related, but it is still "hacking" in a form. The local hardware store doesn't stock parts for this purpose, they only sell "playground kits". It's mix and match, but they assume that you are buying a complete swingset, so they package some important parts in the big expensive kits, and don't sell them "loose". So I was on my own. At least they sold the actual swings separately, but I did have to make a return trip when I realized they did not come with hooks to mount the swing chains to the frame.
Friday, April 29, 2011
Size matters...
I don't have a solid plan for it, yet. I think I'd like to make a balancing two wheel robot with it. It boggles the mind that technology has progressed to the point we can mass produce something this small with moving parts (sort of).
Thursday, April 28, 2011
Better Blogging.
I realize now that I should be using jumps in my blog posts. It's one of those features of other blogs I've appreciated for years without realizing it was happening. I added them to my existing posts, the only problem is that they weren't really authored with jumps in mind.
I also just discovered the "view" feature in Blogger. The "Sidebar" view (http://bytecruft.blogspot.com/view/sidebar), I think, is actually a better way to view a blog than one monolithic page.Though, when I get better with the jumps that should help also.
Also, I tried manually making a "Page 1, Page 2", link-menu thing with related posts. I think a better idea is to use project tags for that...
In other news...
My Android app is coming along nicely, and I got permission from my employer to publish it. Time to start working on some posts about it.
My Homemade Touch Mechanism used in the Good Times timer generated some interest, I'll clean up the code and package it up. I definitely plan to use it again anyways, so it would be nice to make it general purpose. This probably wont happen until my game is out, so maybe sometime in early summer.
-P
I also just discovered the "view" feature in Blogger. The "Sidebar" view (http://bytecruft.blogspot.com/view/sidebar), I think, is actually a better way to view a blog than one monolithic page.Though, when I get better with the jumps that should help also.
Also, I tried manually making a "Page 1, Page 2", link-menu thing with related posts. I think a better idea is to use project tags for that...
In other news...
My Android app is coming along nicely, and I got permission from my employer to publish it. Time to start working on some posts about it.
My Homemade Touch Mechanism used in the Good Times timer generated some interest, I'll clean up the code and package it up. I definitely plan to use it again anyways, so it would be nice to make it general purpose. This probably wont happen until my game is out, so maybe sometime in early summer.
-P
Tuesday, April 26, 2011
Word Clock, Part 1
This was probably my biggest, most ambitious electronics project I've done so far. (And also one of my first)
It was inspired by this:
http://www.instructables.com/id/A-Word-Clock/, which in turn was inspired by: http://blog.makezine.com/archive/2009/09/qlocktwo-clock-tells-time-with-word.html. (I see that the guy who did the instructables clock has since done new version of it, it looks really nice.)
Anyway, here is mine:
It was inspired by this:
http://www.instructables.com/id/A-Word-Clock/, which in turn was inspired by: http://blog.makezine.com/archive/2009/09/qlocktwo-clock-tells-time-with-word.html. (I see that the guy who did the instructables clock has since done new version of it, it looks really nice.)
Anyway, here is mine:
| My word clock. If I could have taken a picture that hid the flaws, I would have :) |
Monday, April 18, 2011
Teaching programming to kids with Scratch
I think I grew up in a great in era in personal computing. My first computer was a Commodore VIC-20, the predecessor to the C-64. The manual centered on programming it in BASIC. Now, I cannot recall seeing a meaningful computer manual in 20 years. But computers then were so simple; from a 12-year-old's perspective, it was approachable, even if far less capable that what you get today. I've often wondered if I would have been put off by the complexity of todays machines, if I had been born later.
As long as I've been a father, I've anxiously waited until the day my kids were old enough that I could bring them into the enchanted realm.
I discovered Scratch last year, it's really a great visual programming environment for kids, especially ones who are just learning how to read.
As long as I've been a father, I've anxiously waited until the day my kids were old enough that I could bring them into the enchanted realm.
I discovered Scratch last year, it's really a great visual programming environment for kids, especially ones who are just learning how to read.
Thursday, April 14, 2011
Greetings.
So my little experiment with blogging has been pretty rewarding so far. It's very nice to see blogger stats show traffic coming from all over the world. I'm very honored to see that Hackaday has twice featured my blog.
I have a few other projects I'd like to write up, as well as some more information, maybe some schematics and code, about the projects I've written about so far. Looking at other blogger blogs recently not for content, but presentation and aesthetics, I can see I have a lot of work to do, this one's pretty sad. I'll improve it over time.
My goal to to try and post something worthwhile, at least once a week(this post doesn't count :) ), to try not to be like 99% of blogs that start strong, then whither. Time will tell. Most posts will probably not be Hackaday worthy, but I hope to be able to share things that someone who likes what I like would find interesting and inspiring. I have a few older completed (mostly) projects that I want to write about, and a million project ideas I want to do one day.
I haven't done a lot with a soldering iron in a few months, I've been working on an Android app in my free time. I hope to be able to start writing about it soon. I also hope to publish it soon (within a month, but that's what I thought a month ago ). I did register with the Android market the other day, made a Facebook page, and have my eye on a web domain, that was pretty exciting, it felt official.
-P
I have a few other projects I'd like to write up, as well as some more information, maybe some schematics and code, about the projects I've written about so far. Looking at other blogger blogs recently not for content, but presentation and aesthetics, I can see I have a lot of work to do, this one's pretty sad. I'll improve it over time.
My goal to to try and post something worthwhile, at least once a week(this post doesn't count :) ), to try not to be like 99% of blogs that start strong, then whither. Time will tell. Most posts will probably not be Hackaday worthy, but I hope to be able to share things that someone who likes what I like would find interesting and inspiring. I have a few older completed (mostly) projects that I want to write about, and a million project ideas I want to do one day.
I haven't done a lot with a soldering iron in a few months, I've been working on an Android app in my free time. I hope to be able to start writing about it soon. I also hope to publish it soon (within a month, but that's what I thought a month ago ). I did register with the Android market the other day, made a Facebook page, and have my eye on a web domain, that was pretty exciting, it felt official.
-P
Monday, April 11, 2011
Build System Status Monitor
This is a project I did a while back.
"Indictron" (You might guess that I like to come up with goofy code names for my projects) is a device I use to monitor the status of the continuous integration servers for some projects I've worked on. It's a USB powered grid of LEDs run by an Atmel ATmega88 processor. The device is controlled by a Windows application that queries the build servers for the status of various projects and then sends commands over USB to the AVR chip.
"Indictron" (You might guess that I like to come up with goofy code names for my projects) is a device I use to monitor the status of the continuous integration servers for some projects I've worked on. It's a USB powered grid of LEDs run by an Atmel ATmega88 processor. The device is controlled by a Windows application that queries the build servers for the status of various projects and then sends commands over USB to the AVR chip.
I should take a moment here to say that I am not at liberty to say for what "build projects" I actually used this, so some details or pictures may be altered/redacted.
Sunday, April 10, 2011
Good Times, Part 3.
[ Part 1 Part 2 Part 3 ]
Welcome to my 3rd and probably last post on the Good Times timer. I want to write about the pieces of flair I put into it.
This project was for my wife, and the timing of the project happened to be late November last year, so I decided I would make it Christmas gift, and I stopped showing her progress on it.
Of course, I had to add some Easter eggs to the project :)
Welcome to my 3rd and probably last post on the Good Times timer. I want to write about the pieces of flair I put into it.
This project was for my wife, and the timing of the project happened to be late November last year, so I decided I would make it Christmas gift, and I stopped showing her progress on it.
Of course, I had to add some Easter eggs to the project :)
Tuesday, April 5, 2011
Good Times, Part 2.
[ Part 1 Part 2 Part 3 ]
One of the most fun parts of making the timer was the capacitive touch buttons. So in this post, I'm going to touch on how I did it. I might even post a little code :) ( I'm still getting the hang of this blogger thing so bare with me as I play with formatting, etc).
One of the most fun parts of making the timer was the capacitive touch buttons. So in this post, I'm going to touch on how I did it. I might even post a little code :) ( I'm still getting the hang of this blogger thing so bare with me as I play with formatting, etc).
The inspiration.
I've worked with mechanical buttons on past projects, and I was always less than happy with how the buttons looked, or cost, or how much effort you had to put in to "getting it right". I've spent hours on mouser or digikey looking at buttons, only to discover the datasheets didn't really give you a good grip on the aesthetics or "feel" of the mechanics. Also, the physical chassis construction work, (my least favorite part of a project), seemed to consume a disproportionate amount of effort. Touch buttons, I thought, would be easy, cheap, and I had a lot of options for how to make them look nice. I was aware of the Atmel QTouch chips, but every time I went to tack some on to one of my hobby parts purchases, they were always out of stock. Then I came across this in an Arduino forum (I don't actually own an Arduindo, but a lot of people do some clever things with them):
That got me thinking, the low AVR microcontrollers are cheaper than most of the touch sensor controllers, and come in DIP form factor. It's such a simple idea, it's brilliant!. So with with a breadboard, my trusty AVR Dragon, and some aluminum foil, I experimented.
The implementation:
I didn't have this blog in mind when doing the project, so I neglected to get a good shot of the early experiments, but this one shows my test touch panel, as well as other parts of the project at various levels of completion.
| My test touch panel. (also check out the finished display board, and my homemade breadboard/6 pin isp adapter) |
Wednesday, March 30, 2011
Good Times, Part 1.
[ Part 1 Part 2 Part 3 ]
I've been meaning to create this post for a while. Besides my day job, and my recent sojourn into Android, I'm into hobby electronics. Now I've had the code slinging itch since I saw my friends Timex Sinclair 1000 when I was 11, but in the past couple of years, I've really embraced the breadboard and the soldering iron. Software is very satisfying, but there is something about making something that you can hold, touch. And that you appear to your loved ones to possess some sort of voodoo that can transform a mess of wires and chips and LEDs into something that does something.
In fact, it was my desire to show my wares to the world that inspired me to finally get off my rump and create this blog.
Now to exhibit A...
The background:
Last year, after working for several grueling months on a clock, (still at 90% complete a year later, the topic of a future post), I wanted to make something that my wife would not just appreciate, but enjoy, get excited about. So I asked her what type of electronic device she felt was missing in her life. She replied that she wanted a "time out/ time's up timer" for our kids, who happen to be procrastination aficionados, and occasionally earn a trip to the stairs to "think about what they've done". And so was born the "Good Times" timer.
Here is the finished result: (right before boxing to put under the tree last Christmas)
(Apologies, I'm really an awful photographer)
I've been meaning to create this post for a while. Besides my day job, and my recent sojourn into Android, I'm into hobby electronics. Now I've had the code slinging itch since I saw my friends Timex Sinclair 1000 when I was 11, but in the past couple of years, I've really embraced the breadboard and the soldering iron. Software is very satisfying, but there is something about making something that you can hold, touch. And that you appear to your loved ones to possess some sort of voodoo that can transform a mess of wires and chips and LEDs into something that does something.
In fact, it was my desire to show my wares to the world that inspired me to finally get off my rump and create this blog.
Now to exhibit A...
The background:
Last year, after working for several grueling months on a clock, (still at 90% complete a year later, the topic of a future post), I wanted to make something that my wife would not just appreciate, but enjoy, get excited about. So I asked her what type of electronic device she felt was missing in her life. She replied that she wanted a "time out/ time's up timer" for our kids, who happen to be procrastination aficionados, and occasionally earn a trip to the stairs to "think about what they've done". And so was born the "Good Times" timer.
Here is the finished result: (right before boxing to put under the tree last Christmas)
(Apologies, I'm really an awful photographer)
![]() |
| Front |
![]() |
| The juicy innards |
Saturday, March 26, 2011
Java Conditional Compilation.
For a "main stream" programming language, Java has a few aggravating shortcomings. The lack of conditional compilation is one of them.
Wednesday, February 23, 2011
Socially awkward.... Facebook musings...
I'm working on an Android app (A game, I can't release details yet for legal reasons)..
I did professional Java development back in the day, but I had not done much with it in years, I miss a lot about C# and C++ when coding in Java, but I cannot say the converse is true. (ok, inner classes are a neat trick ,but like virtual functions I wish they weren't the default behavior)
I did professional Java development back in the day, but I had not done much with it in years, I miss a lot about C# and C++ when coding in Java, but I cannot say the converse is true. (ok, inner classes are a neat trick ,but like virtual functions I wish they weren't the default behavior)
Tuesday, February 15, 2011
Subscribe to:
Posts (Atom)





