(I was messing around with PIL and realised that the dithering capabilities were perfect for my graphical LCD. As you can see, it turned out rather well!)
Blabber about computing and electronics.
(I was messing around with PIL and realised that the dithering capabilities were perfect for my graphical LCD. As you can see, it turned out rather well!)
GTK is awesome. PyGTK is awesome. PyGTK on Windows is far, far less than awesome. I recently wrote some software that runs fine on my Linux box after a couple of apt-gets, but unfortunately the software is for Windows users. I spent a good part of the morning getting all the stuff needed for PyGTK installed in a VM; it was a painful process of trial and error. To save everyone else the trouble, here is how I ended up doing it. Continue reading ‘Installing PyGTK on Windows’
Every so often, a post pops up in my RSS reader that is something along the lines of “20 optimisation tricks” or “10 techniques to make your code run faster”. Sure, everyone wants their code to run faster, but a number of these techniques only serve to make code run slower and become less readable. The problem is that people blindly accept these posts as factual information(myself included) because optimisation is hard, and the next time they come across a situation they use the false optimisation which makes their code run slower. I decided to investigate a one of the tips I read recently. Continue reading ‘The trap of false optimisation’
SPOILER ALERT: This post contains a solution to Project Euler problem 20.
I gave some more Project Euler a go last week and when I came across problem 20, I knew it was time for me to finally learn how to use closures. I could not find much accessible information for beginners, so I figured I would write up what I discovered. That means it’s time to grab a cup of coffee and put on your theory cap, because this topic needs a bit of explanation. Continue reading ‘Using lambda in Python’
In one of my various orders to Sparkfun, I picked up a vs1002 IC on a breakout board. Just yesterday I got round to having a good look at it, and I figured if I show my code then others will not have to do the boilerplate and just get it working. My setup is a ATMEGA88 running at 3.686MHz on a STK500 board, but it should work for most anyone with a decent clock speed. Just remember that all code is ATMEGA88 specific and may need to be changed for other devices.
Things that may be useful: the Sparkfun page, the datasheet.
Communication modes
(Note: The vs1002 has a backwards compatability mode with the vs1001. We will not be using it)
The vs1002 IC does all meaningful communication over the SPI port. It has two submodes if you will, one being SCI (Serial Command Interface) and the other being SDI (Serial Data Interface). SCI is for things like play control, reading and writing registers and small technical changes. Conversely, SDI is there for MP3 data and a few testing modes.
Since the AVR has only one SPI bus, we will be sharing the CS (Chip Select) line with both submodes.
Continue reading ‘Using the vs1002 MP3 IC with an AVR’
I have had several people ask what the state of development is on this application. To be honest, I have not touched it in a long time. Technically speaking, if you can install cherrypy on your iPhone (no, it’s not in a Cydia package) it should work. Otherwise, you may be out of luck.
I really would like to get it working on 2.0, but I am strapped for time at the moment. I shouldn’t even be spending time writing this post; I have lots of other things I need to do. Cydia has a nice pyObjC package now I see, but I daresay that you will not see any developments in jComix for the next few months as I try to wade through all the exams and work I need to get done.
For those of you that don’t know, the AppleTV is a small, low powered OSX-running PC that has been built specifically for streaming and playing videos to a TV via WiFi. It has HDMI, component, optical audio, 802.11n and is completely fanless (yay!). Thanks to a few people (notably Turbo and the NitoTV team), the AppleTV has been opened for development.
Although I didn’t realise it at first, writing a portable driver for the USB13700 in python was a very good idea. There is a USB port on the back of the AppleTV that is initally disabled. If I remember correctly, all set top boxes sold in the US need an external debug port to be approved by the FCC (or something along those lines). Since Apple doesn’t want anyone using the port, it is disabled by the Mach kernel after loading. To get around this is quite a complex process and I wont go into it completely here, but follow these steps (google is your friend here): Continue reading ‘USB13700 on AppleTV!’
I have been playing with Henri’s USB13700 graphical LCD controller for some time now on my Windows box. Its a neat little piece of hardware; very flexible and powerful. A few days ago, I set about programming a python pseudo-driver for it so I could use the screen under Linux. The screen is encapsulated in an easy to access class, USB13700. It currently runs quite slow (I am still trying to work out why) but PoC code to draw a moving sine wave follows: Continue reading ‘Using the USB13700 controller in Linux with Python’
I recently discovered Project Euler in one of my trawls through Stumbleupon. If you have ever done work with complex numbers, you will know all about Euler. True to its name, it is a website that lists a series of algorithm design problems, often with bit of math thrown in. You are given a description of the problem and a box to enter your result in. So far, it has proved to be an invaueable resource for refining my skills.
The website is great because it fosters an environment in which people can choose to be competitive or not. Users are ranked by their skill, but this ranking is never displayed unless you go looking for it. My favourite thing is that the problems can be completed in your own time. I enjoy a good programming puzzle, but I generally have very little time to spare. Having a high score on Project Euler could also look good on a CV/resume.
It was difficult for the first few sets as, in my case, I had never really done these kinds of problems. However, once you get a small cache of reusable functions going (checking for primality, etc) the problems transform from intimidating mind-benders to simple programming exercises. I will definitely be attempting more problems over the next few years, hopefully I can make it all the way to 100%!
I heartily recommend that everyone who is interested in programming gives it a go.
First of all, thanks to everyone who is currrently using jComix! It’s great to see people actually use your software. Another note: please read this whole post before trying the new jComix. Continue reading ‘Merry Christmas: jComix kinda does CBZ’