Wednesday, October 26, 2011

Busy as hell, and that's a good thing...

Been programming a lot with students and our two student dev teams are now really starting to pick up speed.

HTML5+CSS3+JS == bliss.

Tuesday, August 30, 2011

Freesound, let's give it a try....



I create so much stuff all the time -- and then throw it away.  Songs.  Artwork.  Lesson Plans. 

I feel fine doing so because I'm one of those people that just has the urge to create stuff.  In the past I used to save everything--but found it to be a burden on creativity. 

Still, I sometimes feel guilty when I go to an open project and realize that I have craploads of stuff that others could possibly use.  Soooo.....

I've opened an account on Freesound.org (the new beta site) and have begun to share some of the oddball sounds I come up with when playing around with various instruments and Audacity.  Check it out.

Tuesday, August 23, 2011

Imagemagick

This method was sooooooo much easier than using GIMP or Photoshop.

Install it and then navigate to the folder where the pictures you wish to resize are located. Type:

mkdir resized

This will create subfolder called resized in that directory. This is where your resized pictures will be located. Now type:

find . -name "*.jpg" | xargs -i convert -scale 50% {} ./resized/{} 

Wednesday, July 27, 2011

Just made a time-lapse movie with an Arduino....

Watch it here!

Arduinos and old LCD displays



Been playing around with Arduinos a lot lately.  One of the most challenging things to do is make the Arduino communicate correctly with old interface devices.  I'm working on an old Royal incandesant filament tube display at this time, but here's something I did with a salvaged LCD display.

This was used to send a message of luv across the ocean.

Saturday, June 25, 2011

Fix the apt-xapian-index error in Ubuntu

Some people complain that using Ubuntu or Linux in general involves too much "messing around."  To be sure, it helps to have some command line knowledge, know how to move through the file system, and how to use vim or nano to edit a file in sudo mode.

I don't run Windows at all.  Haven't since ... 2006?  But inevitably I end up trying to help someone with their Windows laptop.  Compared to tweaking something on Linux, it is a painful experience.  The entire setup works against you having any real control over your operating system (probably because it isn't YOUR operating system--you're just renting it).

Anyway, use Linux long enough and you may develop a keen sixth sense between you and your computer.  Warning signals started going off a day or two ago and I traced it down to a common problem: the apt-xapian-index file is hogging the processor at times, while rebuilds it's entire index.  Now, I had no clue about any of this before this morning, but the Ubuntu Forums, as usual, got me right to a simple fix.

Friday, June 24, 2011

The HTML5 Canvas in Education




















I've been playing around with the HTML5 canvas element lately. In fact, I even got a whole book on the canvas element and it has been fun to see how similar this element is to the Processing language. It was nice to be able to wrap up Processing sketches into applets and post them for the world to see.

Applets, though, are sooooo 1990s. Sure, I've played around with processing.js and it works pretty well. Still, it removes you one more step from the real thing. Now I'm not saying I'd like to go back to programming assembly, but sometimes it's hard to find the core language that you're using when it's wrapped in so many levels of libraries, conversions, etc.

Reminds me of  a past staff meeting that failed miserably because teachers were expected to access a shared Google document for collaboration's sake. Oh boy, what a mistake. Teachers make horrible students, for the most part.

Anyway, the Google docs collaboration activity failed when many of the teachers present were asked to visit a specific Google docs url.  About half the class was lost there, for various reasons.  Some made typos in the url.  Many simply used the default Internet Explorer, which has never been known to play nicely with internet standards.

I helped as many as I could, as did a few other tech-savy teachers.  During the chaos, one of the other helping teachers had a little laugh with me.  Apparently a teacher she was helping had not only used IE, but had done so via connecting to her Citrix thin client because that was the only way she ever used her laptop.  We had fun trying to describe just how strange that was--what a convoluted process to simply visit a web address.  The first thing that popped into my mind was:


That's like kissing a robot that then goes over and kisses your lover, rather than you doing the kissing yourself!


Made sense to me at the time.

So anyway, you can see the result in the image, but why not see the real thing: Link to the HTML5 File. Please, use Chrome or Firefox or Safari or Opera to view this--and not through some kissing robot proxy!

Tuesday, June 21, 2011

Wacom Bamboo in Ubuntu

I got a Wacom Bamboo tablet that I've been using on my iMac for Inkscape.  However, since I prefer to do most of everything on Ubuntu, I looked into getting the Bamboo Pen tabled to work on my favorite OS.

Well, I was just about ready to compile from source, which is a lot less painful than most people make it seem--but then I came across this helpful blog post and discussion

I've been working on tweaking my Wordpress blog a lot lately.  That got me thinking of just how easy this blog is to maintain (thanks Google!).  Then, I thought of how I used to take notes on all sorts of stuff like the Wacom driver installation.  What better place to write down those notes than right here?

Soooo....

Here's what I did.  I'm running 10.04 (LTS edition):



  sudo add-apt-repository ppa:doctormo/wacom-plus
  sudo apt-get update
  sudo apt-get install  xf86-input-wacom
  sudo apt-get install wacom-dkms
  sudo modprobe wacom


That was easy.

Thursday, June 2, 2011

Moving day

I bit the bullet and decided to make my own Wordpress blog over at futureskyline.com.

Edit:  Blogger rules.  Wordpress is great--in fact it's currently my favorite CMS.  Still, Blogger rules.

Wednesday, June 1, 2011

ProcessingJS on Chrome



Was experimenting with ProcessingJS today, which is pretty awesome.  Anyway, Firefox was handling the processing sketches just fine, but on Chrome I kept getting errors. 

Turns out a bug report had already solved this problem.  On Ubuntu you can just go to System/Preferences/Main Menu, find the Chrome browser icon, go to Properties and add this to the end of the "Command" field:

--allow-file-access-from-files

That was easy.

Wednesday, May 11, 2011

My Latest Leet Program

Just for fun today I did an update of an EnglishToLeetSpeak translator I had written a couple years ago.  I noticed that when I posted my update, my post count was almost ironic.  :-)

For a sample of how it works, look at this paragraph from my previous post:

Before:

Spent some time today installing a barebones (ie. no desktop) version of Ubuntu on an old Acer Aspire One netbook.  Feels weird to refer to it as old, as it was only a few years ago....


After:

S|>en† So]V[e †!]V[e †o])ay !nS†aLL!nG a (3aRe(3oneS (!e. no ])eS|<†o|>) veRS!on of µ(3µn†µ on an oL]) aceR aS|>!Re one ne†(3oo|<.  feeLS UUe!R]) †o RefeR †o !† aS oL]), aS !† UUaS onLy a feUU yeaRS aGo....

Here's the code: 

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# leet.py
# an experiment in python to produce a good leet encoder
# that does not use a one-to-one mapping
# mFragin May 2011
# version 1.5 maps first and then substitutes, so
# each example is internally letter consistant

import random, string

myDefinitions = [["4","@","/-\\","∂","λ","a","A"],
["6","I3","ß","|:","(3","/3","b","B"],
["¢","(","©","c","C"],
["∂","])","[)","T)","cl","d","D"],
["€","£","ë","e","E"],
["]=","ph","|=","f","F"],
["6","(_+","9","(γ","(_-","cj","g","G"],
["/-/","]-[",")-(","|~|","]~[","}{","h","H"],
["!","|",":","i","I"],
["_|","_/","]","j","J"],
["|<","k","K"], ["1","|","|_","l","L"], ["|v|","]V[","(T)","|\\/|","/\\/\\","m","M"], ["|\\|","]\\[","~","n","N"], ["0","[]","¤","Ω","o","O"], ["|o","|>","p","P"],
["(_,)","0_","O,","q","Q"],
["12","®","|2","r","R"],
["5","$","§","s","S"],
["+","-|-","†","t","T"],
["|_|","L|","µ","u","U"],
["\\/","√","v","V"],
["vv","\\V/","\\X/","UU","w","W"],
["%","><","}{","x","X"], ["Ψ","¥","y","Y"], ["2","z","Z"]] myKeys = string.ascii_lowercase # Make a dictionary of the keys and values myDict =dict(zip(myKeys, myDefinitions)) # Get a string from user and make it lower case stringToConvert = raw_input("\nEnter a string: ").lower() leetString = "" variations = int(raw_input("\nHow many variations? ")) for i in range(variations): leetString = "" chosenLetters = {} for letter in stringToConvert: if letter in chosenLetters: leetString += chosenLetters[letter] elif letter in string.ascii_lowercase: choice = random.choice(myDict[letter]) leetString += choice chosenLetters[letter] = choice else: leetString += letter print leetString

Saturday, May 7, 2011

Ubuntu Command Line Only Installation

Spent some time today installing a barebones (ie. no desktop) version of Ubuntu on an old Acer Aspire One netbook.  Feels weird to refer to it as old, as it was only a few years ago that netbooks were hot as anything.  Of course then Microsoft felt the need to spread their OS virus onto all the Linux netbooks.  The rest is history--no one uses netbooks anymore.  So I guess Microsoft won, and lost. 

Pretty silly to imagine running Windows on a netbook....

Notes to self:
  1. I used Unetbootin and the Ubuntu Minimal Install iso image.
  2. Installed only the basic command line stuff
  3. Now to add CLISP and a few other things....

Thursday, April 28, 2011

Homebrew to the rescue--part two



Been having a terrible time lately with Text Wrangler in my Python class.  For some reason, Text Wrangler is causing a ton of problems handling whitespace correctly.  Of course we already Googled the heck out of the issue, set the expand tabs, etc....  The problem, however, is that TW is simply not that great if you've ever used Geany.

So now I at least have Geany on my MacBook.  Testing it for the lab.

Hard to blame students for being frustrated with a ton of "unexpected indent" errors.

Friday, April 22, 2011

Homebrew to the rescue!


I recently purchased a book on Lisp programming that looks quite good.  Getting CLISP installed on Mac OSX 10.6, however, was not easy--until I found Homebrew.

At first I had used MacPorts, but that was a bit painful.  After a few hours I finally gave up and figured I'd just limit my LISP programming to Ubuntu. 

Lately I have been writing a LOT of Python code.  Because of that, my "temporary" absence from using XCode and iOS dev has become ... well ... prolonged.  I simply can accomplish so much more in Python, and in one-tenth the time.

I dove in to Mac development with a positive attitude, despite using Ubuntu Linux for 99% of my computer work the last several years.  Sure, it's nice to have GarageBand and the hardware on a Mac that works so well with media projects.  But ... I miss Geany.  I miss the package manager in Ubuntu.  Most of all, though, I miss the feeling of using free and open-source software, and the fact that you are NEVER harassed by the software you use.

I left Windows long ago and have never looked back.  When I first came (back) to a Mac recently, I was happy to see how similar OSX was to Linux (or BSD).  Now, however, the differences are starting to accumulate. 


Anyway, at least Homebrew got me CLISP....

Monday, April 18, 2011

A Place for Our Stuff....

Remember George Carlin's great "a place for my stuff" act?  Well, I kind of feel that way now, as I consider letting my Dreamhost account (www.futureskyline.com) expire and take advantage of alternatives for posting my stuff. 

In particular, I'm looking into options for storing a bunch of Creative Commons stuff that my students and I would like to share with the world.  Things like incidental music for video games (both MIDI and audio files), images and sprites, and also a crapload of screencasts and instructional videos.

Wednesday, March 30, 2011

Getting better....



As you can see, the dungeon floor plan generator is getting better.  In fact, it's starting to look more and more like the dungeon floorplans I used to draw up on graph paper when I should have been paying more attention in high school.  :-)

Well, it's now Spring Break (already to the midpoint, actually), so I've had a little extra time to play around with some comp sci topics that I haven't really used much in the past.  Of course I've been having fun with genetic algorithms, but those were easy to learn for me, having a degree in biology.  Not as easy are artificial neural networks.  Haven't much experience with them, so this is new ground for me.  There are many situations, though, that I suspect lend themselves to neural networks more than, say, genetic algorithms.  Regardless, it will be fun to compare and contrast....

Sunday, March 20, 2011

Getting there....


Debugging this has been the usual nightmare: any time you nest loops for these, no matter how many times you've done this, you still get mixed up between rows, colums, i, j, x, and y.  Anyway, I just need to clean up the code a bit and make a few adjustments before I can start turning these into environments to explore using the keyboard....

Saturday, March 19, 2011

A-mazing we will go.


Have been goofing around a lot lately with recursion, cellular automata, and Pygame.  Working with students to develop a floor-plan generator for dungeons and mazes has led to some fun programs.  The image above is from a Python program that creates a depth-first search maze, and then attempts to solve it using a slightly different algorithm.  The beginning square is the far upper left, and the ending is the far lower right.  White corridors have never been visited.  The pink ones were visited but led to dead ends.  The green path, however, is the correct solution.

Currently working on a version that goes beyond mazes to dungeon-like floor plans.  The program will print out the data to a text file to be used by other programs and other languages.

Wednesday, March 16, 2011

Is there something in-between?














Lately we have been goofing around a LOT with Cellular Automata and Agent-Based simulations.  Of course we're working on the Genetic Algorithms cases study, but some students have asked about other applications of these really interesting parts of computational science.

So today I was reading Cities and Complexity and came to the part where they shift from strict rule-based, deterministic cellular automata simulations, to simulations that include random elements.  I immediately remembered something that I had thought of a while back while working on some of Wolfram's one-dimensional CA studies (and then, for some reason, I completely forgot about it again until this morning).  Here's the thought:

When we think of a typical CA simulation, we use a single set of rules, like, say, Rule 110 for the one-dimensional CA that Wolfram had studied.  That rule is a strict one-to-one mapping of situation to response, so there is NO randomness at all. 

Naturally, one gets curious about what adding random elements would do to the patterns.  But then I thought of something else, and it really got me to thinking about determinism and randomness.  Let me just show you what I was thinking:

Rule 30 from Wolfram is the base 10 name for this binary mapping:

0 0 0 1 1 1 1 0

Now of course that tells each cell what to do (whether to be "on" or "off" in the next phase) for each of the eight possible situations it could be in. 

So, if we wanted to, we could randomize it by replacing one of those digits with a coin flip (f):

0 0 f 1 1 1 1 0

Here, in the third digit from the left, we have switched from "always turn off" to "turn off with a 50% chance. "  By that we mean something like, "flip a coin, dude, and heads you are on, tails you are off."

But then I remembered something I had toyed around with when thinking up some AI patterns and state machine stuff for a simple game I was working on.  What if, instead of something like "choose 1 80% of the time, chose 0 the other 20%" was handled differently?  What if we instead put an array of numbers into that particular position, with a string of results in it:

0 0 [ 1 1 1 1 0 ] 1 1 1 1 0

Now, instead of an 80% CHANCE of choosing 1, we simply tell the agent that she should respond with the number in the array--and she should increment by one each successive turn.  Meaning, using the example above, when the 3rd position in the array first comes up, she chooses 1.  She does that the 2nd, 3rd, and 4th time, also.  However, the fifth time she chooses 0.  After that she simply loops around and starts over at the beginning.  So you can see that she will choose 1 exactly 80% of the time, but there's no chance involved.  It's completely deterministic, and yet it takes the whole question of one-dimensional CA to a whole new level of, well, complexity.  Or does it?  I really haven't had much time to think about this in detail, but it seems strangely different than randomness. 

I guess what it really makes me think about is how attractive the finite set of 256 rules that Wolfram studied seemed to me at first.  How ... cozy it seemed that the structure was so, well, structured.  Now I'm thinking that there's an infinity of rules--all strictly deterministic--that could be looked at for good ol' one-dimensional CA. 

Time to hit the books....

Sunday, February 6, 2011

Coding During the Big Game





I hope the above image somehow leads to a Superbowl win for the Green Bay Packers.  I mean, here I am, after wrestling with some objective-c code for the last hour or so, and I cross my fingers, hit "build" and ... it worked!  
Maybe today is just a day for Wisconsin to rule the world.  Watched the Badgers blow out Michigan State this morning, my code just compiled cleanly, and now it's up to the Pack to win the Big One....

Go Pack!