- How to
A few months ago, I got drunk and decided it might be fun to simulate the orbit of planets using the Processing language at around 3am. At my work, we use Processing quite a lot to simulate this and that, so this is a tool I know pretty well, and my Newtonian physics is still pretty good, so this sounded like a good idea.
Anyway, programming this stuff parametrically is pretty trivial, and after a while, you can make pretty neat simulations without much effort. Of course, we're doing this through parametric iterative simulation, so it gets more and more innacurate as time goes on, but, at least you don't have to apply the solution to the n-body problem.
I tend to build a lot of projects with Processing because it's a very quick, fairly simple way to work with data in near-real-time. Most of the work I do for my job involves small devices that create streams of data. Typically, they either constantly stream values, or they have a very simple serial language that listens for commands and responds back. In some ways this is quite easy to handle in Processing, but in others it can be a real pain. So, since I've been working with controlP5 interface builder, I thought I'd go through some ideas on how to deal with streaming data in an environment that has other complicated tasks going on. Also, I wanted to give some simple solutions to some annoying problems I've found with controlP5.
I know very little about IRC, and Python is probably my weakest language, but, for some reason, I've decided to write some code in one to work with the other. This all began because I use a really, really old computer for IRC. I like to have a Linux box running at home at all times, and the machine I have as a server is almost 15 years old. So, mostly it just sits there scrolling up text.
The problem comes up when somebody sends me a link for a video or a page with some sort of advanced web page crap on it. The Linux box always craps out on me, and the pages fail, or hang. So, here's my project outline.
The other day, one of my friends posted some information about segregation in Los Angeles, and how it has gotten worse over time, not better. This reminded me of something I had read about before about how segregation can occur without malice, so, I had to look it up and spend a bit more time on the subject.
In short, the idea was presented by economist and game theorist Thomas Schelling, in 1969-1971, who showed that people having a slight preference for people of their own race could result in complete segregation of communites over generations. Schelling also conceived the idea of "tipping" points in his thesis, referring to critical values which, once met, could create great overall changes in systems.
I've been looking at a number of LED drivers for various projects, and the AS1130 from Austria Microsystems is a pretty interesting one for a couple of reasons. The first is that it gives you a LOT of outputs using a small package. The second is that it's a giant pain in the ass to get started with. Because it took me so long to get it working myself, I'm going to save you all some effort and describe how to make it work, including tips on the circuitry and programming a driver in C. First, though, you should get the datasheet here: http://www.ams.com/content/download/185846/834724/105034
Wiring up the AS1130 is not a terribly difficult project, but it is long and tedious. For the complete array, you're going to need 132 LEDs, each connected to the chip in a particular way. The datasheet has a very good diagram which must be followed to the letter.
Somebody asked me the other night about using the Arduino to send special characters over serial, like an old keyboard would do. I have no idea what the project was, but it was an interesting question, so I did some research on my own system and I have some results that are interesting-ish. I think I gave answers that are only sorta wrong, which is nice. He's a smart guy. I'm guessing he figured it out eventually.
Anyway, if you find yourself wanting to figure this stuff out by yourself, you can use the following horribly complex program for Arduino:
I've been wanting to mess around more with certain services that are better handled using virtual machines, so I decided to actually spend the time yesterday to make things work.
Viduata's law states that "Everything is always way more of a hassle than you expect it to be," and this was no exception. I'm going to cut out all the nonsense that took me 4 or 5 hours to get this crap working, and just get to the meat of it, and hopefully it helps somebody.
The goals for this project are the following:
When this is all done, you should be able to run one of the Fedora boxes as a firewall, or a tool server, or an intercepting proxy, or whatever you want to experiment with.
I've been spending a lot of time working with Apache builds and RPM recently, and I've been trying to do things the right way, even thought it's not entirely necessary. My current project is all being done on a completely deletable virtual machine, so, it's not terribly important to have permissions configured correctly. In fact, as soon as I finish making the rpms I need, I plan on saving one archived directory and destroying the VM.
I've come to a point where one of part of the make routine is dying because of a very minor permission issue. Basically, it's defaulting its install to a certain directory that doesn't exist, and it can't build the directory, because it doesn't have privs in the containing directory. So, the question is this: How can I give the necesary privileges without breaking the rule of least privilege?
A lot of companies use custom builds of certain programs in order to better serve their own purposes. A typical example of this would be a customized version of Apache that strips out un-needed features and adds in a few extras to make things work more quickly and more predictably.
The downside of this is that custom builds aren't very friendly with some automation systems, and they may not be getting registered with programs like Yum and RPM.
I love the PIC, and I spend a lot of time finding ways to deal with serial protocol, because it's very interesting to me, and fairly essential to my robot building project. So, I had this idea of building a handheld one-time pad encoder/decoder. I picked a chip with lots of pins and a decent amount of flash memory so I could eventually connect it to a little LCD screen.
Anyway, somewhere along the road to doing that, someone asked me if I could make a device that just does ROT13 "encryption." The simple answer is that my original project (one-time pad) will do ROT13 all by itself if you make the key "mmmmmmmmmmmmm," but, for some reason, I slacked off and just created it in such a way that it only does ROT13. It's fun, though.
The other day, I taught a class on how to get started with the PIC, and afterward, one of the "students" suggest this as an interesting problem that is possible with even the lowest-level PICs.
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
You may recognize this as Problem #1 at ProjectEuler.net
Anyway, I think it's a good task that will show you how to use some of the math functions, and introduce you to finding algorithms with a very limited instruction set.
I am working on my solution now and I'll post it in a few days. I'd be interested in seeing what other people have done.
I've been playing a lot with 555 timers recently and I decided to make a full soldered prototype of one of my breadboard designs. I think in a little while I'll build a PCB for it and maybe make it available, because it is truly obnoxious, and everyone should have one.
Here's how it works:
Since somebody was cool enough to actually ask this question in the comments on my YouTube video, I figured I'd take the time to explain how to make a boost converter. For a better discussion by someone who actually has an EE degree, I highly recommend looking at ladyada's page, here. It is awesome and she's awesome. The project listed there is a little different, and the boost converter is built in a different way from mine, but it's essentially the same idea. If you have some idea about how mosfets and standard npn transistors work, you'll see how similar they are.
So, a friend of a friend got me a great deal on a gently used ASSA V-10 cylinder, and I've spent quite a bit of time trying to pick it over the last couple of days. It's a high security lock that's supposed to be impossible to pick, but, obviously it isn't, judging by the YouTube videos on the subject.
The folks at NSL are really into PCB fabrication these days. I mean REALLY into it. It's kind of an obsession over there. The latest fascination is though-hole plating, which allows proper vias that go from one side of the board to the other.
There are many ways to plate through-holes, but most of them involve electrical means. I've heard that there are some that use chemistry only, but research has shown that in industry, they always use electroplating, and I'm guessing that people who do this for a living know a little bit about it.