weekends are for leisure

Node and Redis project update

Moved away from storing individual string values to storing whole objects/documents in redis hashes. Hashes make more sense when you need to store a group of data values like a blog post.

But I’m not making a blog. My task it to create an updated version of my personal journal and information storage system. Daily I use it to log my thoughts, to stage blog posts (like this one), keep track of links to check later (which often doesn’t happen), keep todo lists for projects, and other things. But the old version relied too heavily on subfolder-type organization. The new version will be tag based, which will hopefully make it easier for me to keep things from getting buried in my hierarchy. Since the new design is tag-based, the data structures involved are simpler, opening the door for me to give redis a try.

Continue reading

Crowd Counting

Thought this episode of Science Friday was interesting and worth-mentioning. It talks about the methods of counting the number of people in crowds (at rallies and such) and the merits of doing so. Especially interesting is the idea of having an independent party systematicaly counting crowds at events, in order to present a more accurate picture of the populous’ support for a given issue (mentioned at around 10:30 in the audio). Would be great for democracy.

Continue reading

Node Explorations

In my quest to learn new things, specifically the following things, I’ve been both excited and drained:

By “new things” I really mean “some cutting edge stuff that seems pretty cool”, the “cutting edge” portion being the source of most of my struggle. New tools, languages and software have sharp edges.

Since I love fast and light software, node.js is my current casual focus. Also helps that I’ve been learning more JavaScript lately (through work and various side projects).

Continue reading

Expression Parsing

I’ve worked on several new and different things since July, and all thanks to my new job. Say “hooray” with me… Hooray! Luckily I recently got to do some compiler-style expression parsing. Not sure whether it’s my 100% favorite brand of problem to solve, but anything compiler-related is very, very near the top of my list.

We’re working on a jQuery plugin that I won’t share the details of yet, but the API contains a way to filter data using string matching expressions. It supports the normal comparison operations like “starts with”, “equals”, “matches regex”. Those are simple. Tack on logical operators like AND, OR and NOT, and you’ve now got some fancy parsing footwork to do. Imagine something like “Title^=Jimbo AND ID<45 OR Category IN 45,56,67”.

Continue reading

IE bugs: link tags, href, jquery

Trying to do a brain-dump of things I’ve encountered at my new job, since I’ve been doing work in several new areas.

My employer’s website was crashing on IE7. When I tried to re-create the issue on my IE8 machine, it crashed for me as well. Also crashed when I put IE8 in IE7 mode (the Developer Tools are quite nice).

Took me a while to get used to the IE Developer Tools, and eventually I found the JavaScript debugger. Problem was, I couldn’t figure out how to debug a site that crashes the browser once it loads. I thought maybe I could load the page and start the debugger before it crashed. But that didn’t work because what I really needed to do was start the debugger and also tell it to break immediately. If I remember correctly, it defaults to breaking on errors. You have to de-select that button and then click the one next to it so it breaks immediately. Needless to say I didn’t have enough time to do both.

Continue reading

jQuery's live click handler on mobile Safari

Won’t fire: $(‘section’).live(‘click’, function(){ … });

But if the element you’re binding to is an anchor tag, it WILL fire.

The workaround: add onclick=“” to the element you’re binding to.

This applies to iOS 4.0.

Update (Oct 7, 2010): I should add that this is a known bug. And that I’ve discovered a workaround.

Continue reading

Quick and Dirty ORM

In January 2010 I decided to break from common database convention and design a new style of ORM. It was also an excuse to dive deeper into Python 3. The result is my Data Type Tables project, which currently only supports sqlite3.

Features:

  • You don’t have to write any SQL to use it, not even create table statements. Right, you’re not impressed, given that you can do the same with Ruby on Rails. BUT, whatever.
  • If you add fields to a class you still don’t have to write any SQL, or perform any migrations. The ORM handles it for you (read on to find out how).
  • You can do simple relations, like Products in Categories.
  • You can do trees, like Categories and Sub-Categories (to infinity).
  • You get field-level revisions without having to do a thing. So when you update a Product’s name, all previous values are preserved. You can fetch the history if you need to.

However:

Continue reading

Szelector

A month ago I got excited about node.js. Watched two presentations, installed it, ran a few tests, and then ran out of steam for lack of a real project idea. Hate when that happens.

At the same time I also got excited about learning advanced Javascript concepts since it would no doubt help me with node.js, so I decided to investigate jQuery and see what makes it tick. And what better way to really investigate jQuery than to try to build something similar on my own? Actually, that’s only part of the story: I wanted to use jQuery on an XML document, but discovered that the namespaces render it useless. I saw no reason why it shouldn’t work. If I couldn’t fix jQuery, I’d have to build something similar myself.

Continue reading

On the Road - June 24

This continues my coverage of our trip out west … the move to Portland. This leg is from Cheyenne, WY to Salt Lake, UT.

We were happy to leave Cheyenne but it seems we pressed on a bit too quickly. Kristen started out driving, but we reached barren desert terrain quite soon, and the sun was beating in on her side pretty heavily. The bad La Quinta breakfast, horrible coffee, no fruit, and forgetting to drink sufficient water all contributed to her getting a bit dehydrated. No fun. I took over so she could recuperate.

Continue reading

Software Ideas

Techies and startup dreamers, how about another Friday distraction?

Please enlighten me if any of these exist. This is just a brain-dump of half-thoughs I’ve had over the past year.

Pluggable, Context-aware Help System (Updated again, 02/21)

Many web apps don’t have an integrated help system, or help docs at all. The system I’m imagining would make use of AJAX and JavaScript to add context-sensitive help to a web app that would otherwise not offer much assistance to its users.

Continue reading