tepidpond Online

September 10, 2007

Source Code: OOP in 114 lines

Filed under: Uncategorized — tepidpond @ 12:14 pm

I found a need for a simple object-oriented framework for an app I’m writing for work. I found both snit and incr Tcl to be too large and complex for my usage, not to mention the time required to learn and become proficient in those toolkits. In order to save myself that time, here is simpleOO.

simpleOO is a tiny (114 lines of code) Tcl Package that includes only the absolute bare bones of OOP: methods, private data, and single inheritance.

Download simpleOO.tcl

September 5, 2007

Source Code

Filed under: Uncategorized — tepidpond @ 5:02 pm

I’ve written some code for an app in use at my place of employment. Here’s an extract:

# This handles all but the pathological
# cases I haven’t thought of yet.

proc regexp_sanitize {text} {
# escape ALL(most?) regexp special characters
regsub -all {([\\\*\+\?\{\}\(\)\[\]\.\^\$])} $text {\\\1} text
return $text
}

I was going to post the entire thing properly formatted, but this blog software is really only designed for diatribes about parents who don’t understand me. So, check the download, it’s sure to be most informative.

Download searchText.tcl

June 19, 2007

feelSpace log, #5

Filed under: Tech — tepidpond @ 7:09 pm

Wherein I post pictures(!) of the hardware at its current state.

Workspace
This is my workspace, where the magic happens.
Box - Closed

And this is the sum total of my creative output for the past three weeks. Impressive, no?
Box - Open
Sexy opening-the-box pic, a lá every single Apple product. (Ooh, look, the iPod comes in fuschia now!)

Box - Closeup
Closeup. From here, you can almost see my shoddy soldering work. I’m a little out of practice.

Box - Duct tape
And closed back up again, complete with a 9V battery…and this is why it’s “Revision A”. I didn’t measure before purchasing the case. Luckily for me, I had my handy roll of duct tape sitting right there on the table.
I still don’t have a functioning serial cable to plug this thing into, unfortunately. I went through my collection of old hardware, and found a cable with female DB9 plugs on both ends. Apparently that means it’s a null-modem serial cable. My research indicates that there used to be people who would use these “null-modem” cables to link two PCs together in a sort of crippled LAN. It boggles the mind.

Ahh, well. I’ll add a real serial cable to the list of things I’m waiting on to come in the mail. I’m hoping the vibrator motors arrive tomorrow, and I’ll actually be able to start programming.

Edit: I just noticed most of those thumbnails weren’t linked. That’s intelligent of me.

F*** THE PO-PO.

Filed under: Freedom Dies — tepidpond @ 9:54 am

If you live in the United States of America, and you, for any reason whatsoever, come to the attention of one of our fine guardians of the public peace, expect to be assaulted and tased.

I was instantly and with absolutely no verbal warning whatsoever attacked from behind and thrown to the ground. … Officer Bryant then shot me with the taser. I fell uncontrolled to the pavement…As I lay still on the pavement, Officer Wingate walked over to my glasses and smashed them into the ground with his boot. — Stephan Orsak

What was the heinous crime committed to justify the use of near-lethal force and destruction of hundreds of dollars of this man’s property?

He rode his bicycle on the street.

Get out of the country. Anybody who can, leave now. Before it’s too late for you.

June 18, 2007

feelSpace log, #4

Filed under: Tech — tepidpond @ 10:11 pm

Wherein I encounter the first of what are surely to be many problems.

Namely, the cheap serial-to-USB adapter I have doesn’t, for some reason, function with the Basic Stamp. I was briefly concerned by the apparent lack of digital life, but prodding it with a proper serial cable brought success. Well, success of a sort, the crippled kind of life that BASIC code brings.

The second problem, once the circuit has been completed and wired up, is the relative accuracy of the HM55B chip. Using the sample code linked in log #3, there is an error of up to +/- 30 degrees. I plan to implement a smoothing algorithm for the chip, which should eliminate this rather bothersome jitter.

Tonight, we code in HELL!

June 15, 2007

feelSpace log, #3

Filed under: Tech — tepidpond @ 2:17 pm

I love learning new things. This morning, I learned all about how to control DC motors using PWM. I also learned that working a ten hour shift, getting three hours of sleep, then going to the dentist is a good way to get very cranky.

Anyway, I’m hoping to pick up a ULN2803, which is an IC containing 8 “Darlington” arrays and diodes to protect the fragile logic circuits from motor back emf. I want to avoid placing another order with Digi-Key, though. Shipping to a forgotten desert island is expensive. So I will again be making the trek to Radio Shack. If I can get it, the 2803 would neatly complete the rest of my electronics for the belt, although having only one of the things also limits me to 8 vibrator motors. If I can’t get it, I’ll have to settle for buying a handful of diodes, resistors, and transistors.
Would 8 motors be the right amount? I think it would. I can also interpolate them to fake having more, at least assuming I can write compact-enough code for the CPU.

June 14, 2007

feelSpace log, #2

Filed under: Tech — tepidpond @ 2:58 pm

Reference this post.

Today is shopping day:
The CPU and compass unit have been purchased from Parallax, awaiting delivery. Also ordered an “ED50056-ND” and an “A126-ND” from Digi-Key to mount the CPU and compass on. For simplicity’s sake, I’m using all pre-assembled components for my “Rev. A”. I plan to later replace them with an OEM-type version to lower the cost and make a more professional version. Radio Shack will be providing a DB15 serial plug and a breadboard, and lastly, I purchased 10 of these “coin-type” vibrators from eBay.
I still need to find a belt to hook this all to–probably a “duty belt”, if I can find the right kind–a belt-mounted project case, and some way to drive the motors. Given a guess, I’d imagine TTL signals aren’t so good to directly run 10 x 1.5V motors. Is the best/cheapest way to do that simply a transistor? I don’t particularly care if they loose “oompf” when the battery runs low. Must work on that.

Question: Is anybody interested in owning one of these things, and how much would be an agreeable price point? This first version is about $130 in parts, but I expect that to drop to about $30-40 if I can move from “hobbyist kit” to “OEM” pricing.

Amusing.

Filed under: Personal, Games — tepidpond @ 8:56 am

In which a Slashdot poster displays a lack of reading comprehension, of their own post no less.

(more…)

June 11, 2007

Do not follow this advice.

Filed under: Tech — tepidpond @ 7:46 am

Whilst randomly browsing this beast we call the Intarweb, I discovered a blog post by one Kristian Dupont Knudsen. Amusingly entitled “Top Ten of Programming Advice to Not Follow“, KDK writes in opposition to much of the advice that seasoned programmers are wont to give. I found that the “advice to not follow” genuinely was advice that would harm a young programmer. The author addresses ten points, ten programming standards. In my estimation, the article is seriously wrong on at least six of these points. Follow me below the fold to see why.
(more…)

June 6, 2007

Hackintosh Project

Filed under: Uncategorized — tepidpond @ 1:40 am

Having purchased the AppleTV, I find myself now wanting an actual iMac, just to complete the iPod-AppleTV-Macintosh trifecta. However, every time I go to Apple.com and look for an iMac, the pricing of the base model just makes my wallet scream in terror. Apple, I love ya, but I’m not made of money.
(more…)

Powered by WordPress