Things I've Learned Working With Embedded Systems
So here will be a collection of things I've learned while working on an embedded system, so far just wiring it up and testing the chip. For those interested I'm using an ATMEGA8-16PI.
C#: Thread Safty with Monitor.TryEnter() and Thread.Sleep(0)
For my Embedded Systems class I'm working on a project where we are doing some webcam capture and video processing/effects work. To make life simple we are using OpenCV, which rocks. Our language of quote-in-quote choice is C# and to work with OpenCV we are using EmguCV wrapper/binding/what-have-you. So, while working on code that has to capture a video frame, process the frame to do face detection and a video effect, then draw a frame to display to the user I decided to throw everything into its own frame.
The Power of Generators: Simple Animation Example for MatPlotLib
I have for some time now been using matplotlib to do all my graphing in python. Its a great package! Recently I've been wanting to do basic animation of graphs, while you'd think it would be simple has turned into a bit of a trek. There is a simple animation example found here: http://matplotlib.sourceforge.net/examples/animation/simple_anim_gtk.html it works okay, but if you try to move the window it freezes, and you can't use anything on the toolbar.
Information Gain in Discretized Timeseries
I've been learning about information gain and playing around with it and its relation to timeseries data. For several reasons it is sometimes desirable to descretize timeseries data. For one it limits the number of unique values attainable by any time series, so for a finite lenght series there are only a finite number of possible different series.
Another Reason To Love Decorators: Pickled Functions
The more I work with python the cooler it becomes, especially the more I let my mind think of way out there things to do with the tools python provides. In my work I frequently find my self writing code in this order:
Chainned Comparisons, Generators, For-Else Loops and N-ary-Operators
So one of the coolest things I just found out about python is that it will let you chain comparisons, so 1 < a < 10 works. Even 1 < a < 10 < b < 25, and so on, you can even get really crazy and try a < 5 > b, wich is a funky way of saying a < 5 and b < 5, pretty cool huh!
Function Closures in Python
So today I used my first function closure in Python. I had always wondered why/how someone would use them, but today after reading an article earlier this morning I ran across a place to use them while coding this evening. Here we go:
Sync your iPhone/iPod to Multiple Computers
One thing that I don't like about the way iTunes handles things is thats not multi-computer friendly. I have my desktop running windows, my macbook and my iPhone. And I want the music on them to be the same, all three of them. Now before today, and really I should have googled this before today, I had always just been faced with the "Do you want to sync with this computer? Doing so will erase all the files currently on the device." message which I clearly didn't want to do. Then today, after finally googling the problem I came across the answer.
Tight Convex Hulls: Who Are My Neighbors?
In one of my research projects we have a set of points on a two dimensional plane that when given a single point from that set we want to be able to know who its "neighbors" are. For our work we have the mesonet stations spread across the state of Okalhoma and we want to be able to select the neighboring stations. There are a couple of methods that are intuitive but require setting a parameter, something I'm not fond of. Also we have the concept of multiple levels of neighbors, so my first neighbors, my second neighbors and so on.
Another Thing I Dislike About MatLab
Every so often I try to write some code in MatLab instead of my beloved Python, it generally turns into a marathon even of trying to get MatLab to do what I know how to make Python do in a couple of lines. One thing that I am missing right now is Python's sort and the ability to pass it in a key function that will be used in sorting an array.
Delicious
Digg
StumbleUpon
Reddit
Facebook