Saturday, January 10, 2015

Life Lessons and Reminders

As part of the Life Lessons series, it's important to be reminded when those life lessons will be needed.  To help with this problem, with the goal of not missing those critical periods in which each life lesson is relevant, I'll need to do the following:

1.  Figure out the earliest age at which each life lesson is relevant.

2.  Calculate the earliest date, using the answer to #1 and my child's birth date.

3.  Set a reminder that will hit me before the date from #2 arrives.

OK, #1 and #2 are pretty easy.  Technology should be able to help me with #3.

I use GMail, and thought it could send me an E-mail at a future specified time out of the box.  That would be the perfect reminder system, considering that I don't figure I'm guaranteed to be using any particular calendaring system.  However, upon further inspection, I'm not seeing an easy solution.  I see plenty of third-party solutions online, but I'm not interested in giving other companies access to my E-mail, or in paying a fee.

I see that there's a script that will integrate with GMail and Google Spreadsheets to give this kind of control.  I'll check into that, and get back with my solution.

Thursday, January 8, 2015

On the Tragedy of Life Lessons

There are many things I want to teach my kids, including life lessons.  Because I am a dad, this should not be surprising.  As I go about my day, it is not unusual for me to think about these life lessons.  However, my kids are still little, and most of the life lessons I think of are beyond their understanding or are otherwise not age-appropriate.


So, I make a mental note to remember to one day tell my kids about how to manage their money, or whatever.  As I do this, a part of my mind screams out.  It says:

"You!  Idiot!  You are going to forget this lesson!  The time will fly by, and the day will pass, and then it will be too late!  If you even remember, your kid will have already been educated by ol' Billy Bonehead, and learned all the wrong things, and good luck unseating all that crap."

And I don't do anything about it, but maybe resolve to really remember.

Double Bummer.  It is tragic, really.

Because I've already forgotten so many of those things.

So, one New Year's Resolution for this year: Write that stuff down.

As I think of them, I'm going to write those life lessons here, mostly to help myself remember them.  It's better than some old notebook, at least.

Tuesday, January 6, 2015

LEGO Mindstorms and the Case for Free Software

Looking back at my broken LEGO Mindstorms creation made me realize how much work I put into that little jerk.  Actually, he doesn't deserve to be called names.  It's LEGO that deserves it. They're the reason I had to jump through so many hoops.

Let me explain:

I inherited these LEGO Mindstorms from a friend who was cleaning house for a long-distance move.  These were the NXT 1.0 set, and NXT 2.0 was already out.  I have a household with two newish Macs, and it turns out that the Mindstorm programming environment for NXT 1.0 only runs on Windows and PowerPC Macs (i.e. old Macs that don't have processors made by Intel).  There's a ton of assorted updates to the software on the LEGO Mindstorms website, but none of them make it work on Intel-based Macs.

And here's the kicker: if you want the 2.0 software that will run on Intel Macs, you need to buy an NXT 2.0 set (or a software disk), which means shelling out a lot more money.  I wasn't about to do that.

I looked around for alternatives, and discovered LeJOS, which is a Java compiler and firmware for the NXT platform.  I am very comfortable with Java, so that was a big plus.

LeJOS required me to flash my Command Brick, but that turned out to be very easy with the provided software.  My key takeaways were:

  • The build files worked well enough, even though they were a little clunky.  The Ant ones worked with some fiddling, but the Maven ones didn't seem to work out of the box.  
  • Transferring my programs to the Command Block was easy.  
  • Support for the various functions of the sensors and motors was good.
  • Documentation was good enough that I had little trouble creating my programs.

All in all, installing LeJOS on my computer and Command Brick was a positive experience, and let me easily and quickly set up a development environment that worked with my LEGO Mindstorms NXT 1.0 set, all in a modern Mac-based computing environment.  That gets a big thumbs up from me.

However, that doesn't negate the fact that LEGO should make their Mindstorms brick-programming software free to download.  Not only could second-hand purchasers of Command Bricks then use it, but people with the older products wouldn't be left with crapware as computing evolved.  It also might just make a pretty cool standalone learning tool for people who didn't already have a LEGO Mindstorms NXT set, and convince some parents to invest in one!

Monday, January 5, 2015

LEGO Mindstorms and a Dead Robot

An old friend visited the other day.  Like me, he has kids, and is interested in exposing them to toys that breed creativity, especially ones with a technological bent.

In the course of talking about things like Minecraft, LEGOs, and the Hour of Code, I remembered that I had some old LEGO Mindstorms.  I pulled them out, including the robot I'd built a few years back.  Man, it's crazy to think how old these things are.

Sadly, my robot no longer works.  After replacing the battery, I found that there's a problem with the Control Brick.  Apparently, a piece of solder inside the Control Brick has cracked and caused the display to no longer function.  Searching Google, I found that this is a common problem with LEGO Mindstorms NXT V1.0, which is what I have.  I didn't have the time, resources, or gumption to fix the brick then and there.  However, I'm looking at it as a near-term project.  It'll be a good excuse to use the soldering iron, and it's not like I can make it much less useful.

It was a pretty cool little robot, too, even if it wasn't that sophisticated.  It used the sonar sensor to detect walls, back up, and change driving direction in the case that it detected an obstacle.  It also had the ability to back up and change direction if its wheels got caught and bound up in an unseen obstacle.  The sonar sensor was mounted on a motorized swivel, to allow for future expansion, with the idea that it might be able to do some primitive mapping.

All in all, he's a silly little robot, but worth saving, even if it's just to reuse his Command Block.

Sunday, January 4, 2015

Bots are Cool

As a software developer, I enjoy most things technology-related.  Lumped in that group are robots.  It's always fun to see a piece of hardware in action, especially one you can program.  And as an inquisitive engineer, I'm always looking for new projects.

How about a Robot?

What would really push my buttons is to create a robot.  However, robots require a money investment: you have to buy the hardware to make them work.  That whole money requirement is a downer.  It's not that I couldn't do it.  I just don't want to.  (In fact, I have done it in the past with Lego Mindstorms and leJOS, but my Master Block is currently borked.)

Software Bots

But software bots on the other hand... now there's something that I could get into.  No money barrier to get past, and a smaller learning curve in that I already have the necessary software background (i.e. no having to learn how to work with new hardware).

So, I know I want to start a project.  Where exactly to go with this?  What's a solid platform with which to interact with a bot?

I see two neat ones off the top of my head:


I'm not much into Twitter, but interacting with the API sounds like a fun challenge.  Just from a brief search, there appear to be plenty of options for which software tools to use to hook into the Twitter ecosystem.  I'll probably look for something in one of the following language flavors:


This could be a good excuse to try a new language, too.  I'll just have to look closer at the available tools, and jump off from there.

Stay tuned as I continue my journey to build my first Twitter bot!

Finally, a Use for My iPad - Codea!

I discovered Codea a week ago, and have finally found a use for my iPad.

For those of you who don't know what Codea is, here's the low-down:

Codea is a $10 iPad app made by Two Lives Left that lets you program on the iPad in the LUA programming language.  Codea provides lots of handy features, libraries, and examples to make game programming easy and quick.  You can find out more here:

It's pretty darn cool, and I've been having a lot of fun with it.  Just downloading the app and installing it on my kid's iPad nabbed him a few hours of entertainment playing (and mucking with the code for) the example games.  It's enough to make a dad think that he might just succeed in turning his son into a code slinger.  In fact, a day later he said, "I want to be a coder, like Dad."  Awesome!

I haven't done a whole lot with Codea yet.  I've done my own experimenting with the different example game projects.  I have an idea regarding an example game that came with Codea.  It's an anagram game that involves unscrambling words from a given word list.  My idea is to turn it into a full-fledged spelling game that I can load with my kid's weekly spelling words.  I've taken the first step toward that goal in making the game download new word lists using an HTTP request instead of using a hard-coded list.  Pretty awesome feeling, just making that simple change.

I've also started a simple game project that allows the user to navigate a character around an empty field and shoot at enemies that spawn in random locations.  We'll see where that goes.  Even something as simple as this is enough to entertain my kid for a little bit, though.  And being able to tell him, "I did that today," is pretty cool.

Not sure where this will go, but I'm having fun.  Could it intersect with my bot programming project?  I don't know, but it's definitely a possibility.

Thursday, January 1, 2015

Blog-Hacking Bingo

Ever have your blog hacked?  I haven't, at least as far as I know.  The closest I've come is having one targeted by one (or more?) of those annoying spam comment spewers, and having to install captchas to filter it out.

However, an associate of mine thought hers had been hacked a few days back.  Our back and forth about it got me thinking about how you'd detect such a thing.

The most important thing is knowing your investigative tools:


Got Google Analytics installed, or something similar?  If not, you should, and not just to troubleshoot weird behavior.  Hopefully you knew this already.  This is one of your key tools in determining if you've been hacked, or if you're just seeing innocent, yet strange, traffic where you don't expect it.

My associate noticed a spike in hits on an unlikely page of her blog, and that made her worry about a virtual break-in.

Now, let's break for a second.  I doubt her website was being attacked, because it is a low-traffic site.  In general, you're not at high risk if you don't have high traffic, because there's not a whole lot to gain by hacking you.  I suppose that adding your server to a bot net might be nice (or using it as a platform to launch more nefarious activities), but it still seems like a lot of trouble to go through.

There's lots of possible innocent reasons you're getting odd traffic behaviors.  Here's what to find the traffic's cause and reassure yourself.

Which Pages

Which pages are getting hit?  Anything special about those pages?  Got a custom form or custom programming on them?  If so, then this could be a vector for attack, especially if someone's trying to do an SQL-injection or other cross-site scripting attack.  If they're straight-up HTML, or a vanilla blog page like any other, chances are good you're safe.

Traffic Sources

Are these direct hits, or did they come from a referrer link?  If there's a referrer, then you have your explanation.  If not, then people could still be coming to your site via E-mail link, bookmark, or a link disseminated by some other media (e.g. paper).  Maybe an English teacher is using your blog in her classroom as an example of crappy writing, and all her students have come to point and laugh.

Count the Users

Are the hits coming from many multiple users or just one?  Multiple users indicates real people, or in the worst case, a bot net (or you're being targeted by the ANONYMOUS Hacker Collective and their legion of rampaging Guy Fawkes imitators).

Browser Variety

How about browsers?  Is there a nice spread-out distribution of browsers, and not just one (e.g. FireFox 4.0.1, IE 12.5.666, etc)?  If there are many, then it's probably innocent.  One browser could indicate a piece a software masquerading as a browser.  All your users could use one version of browser, but that's really unlikely.

Blog Software Vulnerabilities

Are you hosting your own blog, or using a service?  If you're hosting your own blog, you have a lot more to worry about when it comes to securing your site.  In particular, you should make sure you're using the latest version of whatever blogging software you have installed (e.g. WordPress), and keep an eye out for vulnerability notices on the blog software's website.  Make sure you have a decent admin password as well (not the default!).

Custom Software Vulnerabilities

Lastly, do you have custom scripting on your site that is being accessed repeatedly?  If you do, someone could be trying to find a vulnerability in your code.  In particular, that person could be trying to exploit an SQL-injection vulnerability (or other cross-site-scripting vulnerability) you or one of your developers inadvertently coded in.  To avoid this, follow good security practices when developing custom scripts for your site.  Here are some resources that can help out:

There are certainly many possible innocent reasons that you're seeing a strange traffic pattern. Answering some of the questions above might help you figure out what's actually going on.