Talk Like a Pirate Day

Yes, a day late.  Because I’m not going to talk like that kind of pirate, and I’m going to break my “non-controversial” seal a little bit.  This is going to be about piracy through technology.

Sometimes I marvel at the various technologies we have and the ability to receive entertainment through a variety of channels.  I can watch television shows, movies, and other videos on my phone, computer, or television via DVD, Blu-Ray, streaming video from my cable provider or from the Internet.  However, various and frustrating barriers remain preventing this from being easier, more convenient, diverse, and overall, practically useful.

Continue reading


Linux aliasing changing directories

Not terribly complicated or clever, but I wanted to try something different… and learn something.

alias u="cd .."
alias uu="u;u"
alias uuu="uu;u"
alias uuuu="uuu;u"
alias uuuuu="uuuu;u"
alias uuuuuu="for (( i=1; i<=6; i++ )) ; do cd .. ; done"
alias uuuuuuu="uuuuuu;u"

All this because I change directory levels like crazy, and often, in the shell. I worked out #6 when I was trying to figure out a way to count the number of U’s I typed. But then I reckoned that was too complicated, but didn’t want to completely lose it.

At least it is amusing to me.

I may try to figure out how to script this at some point and count the number of U’s or pass in a parameter.


UNIX find writable files

Way back when, I posted about using find and grep.  I have learned a couple of things since then.

1) find your critiera | xargs grep your grep criteria … is nicer to your processor, memory, and quickly returning the results.

2) finding writable files.  This has been particularly useful when using a really backwards SCS that doesn’t integrate nicely, cleanly, or usable with an IDE.

My command:  find . -type f -perm /u=w

So simple. So elegant. So simply says “find all files in this directory, recursively, that are writable by the user/owner”. The one confusing thing I had about this was /u instead of /o. I figured “owner, group, world”, but it is actually “user, group, other(s)”.

Anyway, this has improved my programming life.  Yeah, I’m gonna say it… take that, Windows.


The Robots Have Me (aka I switched to Android)

The positive reasons why I moved to Android are that it is new, I wanted to play with it, I love Linux, I think Google is on to a good thing, and I can put my music on my phone without the need for software that doesn’t run under Linux*.  I switched from an iPhone 3G to a Motorola Atrix … and wow the change is unbelievable.  I know I was using very old technology**, but even comparing the performance of this phone to various iPhone 4 phones, I haven’t yet seen one perform as well.  After about a month of ownership, I don’t think I can name anything I really dislike about this phone***.  There are, however, things I had trouble with at first and had to fix.

Edit (8/24):  Corrected “iPhone 4” reference.  Added Amarok2 remote app to the “things I just love”.

Edit (8/24):  Added FTP app (like)!

Continue reading


diff in ‘nix environments

After a long silence… he surfaces!  I have a couple of things to say, but I’m going to start with a very simple pleasure: diff.  First, let me clarify that I generally love the command line.  But in a world of many different pieces that all have different importance, I have come to appreciate what GUI tools have to offer.  I find the compare functionality in something like eclipse to be handy in an efficiency++ way.  So when I go back to the command line for something like this, it is because nothing else can truly replace it… like the beauty that is vi.  ;D

The short story is this:  diff -w -B -y -W 200 {file1} {file2}

Now some of you are reading that and saying, “No kidding.  Welcome to the real world.”  The rest of you may be saying “gonk… gonk… goo gonk.”  So to quote the help on diff:

  • -w:  ignore all white space (like tab expansions and changes to white space)
  • -B:  ignore changes whose lines are all blank (just in case the above is finicky)
  • -y:  output in two columns
  • -W 200:  make the output 200 columns wide (this permits both files to be displayed in full width, with room, assuming 80 char width)

I have yet to find a graphical diff tool that can manage that so nicely.  The side-by-side output is very clean and I can redirect it to a file if I want to.  Smooth, simple, elegant.  And if there’s a way to improve on this, I hope a casual passerby will comment!

Ciao!


Acer AspireONE D255 Wireless Network and Kubuntu

One of the things I really love about the Ubuntu community is how helpful it is.  By following these easy directions,  I was able to get the wired network up and running on my netbook.  Yes, that’s right.  I have a situation where the wireless works and the wired doesn’t!  Even stranger, the fix is in an wireless network adapter package!

Because I’ve been burned by stale links, I’m going to repeat some information here.

Netbook:  Acer AspireONE D255

Wireless (lspci):
01:00.0 Ethernet controller: Atheros Communications AR8152 v1.1 Fast Ethernet (rev c1)
02:00.0 Network controller: Intel Corporation WiFi Link 1000 Series

The steps:

  1. Go here (http://linuxwireless.org/download/compat-wireless-2.6) and download “compat-wireless-2.6.tar.bz2”
  2. Run the following commands:
sudo apt-get update
sudo apt-get install build-essential
cd ~/Desktop
tar -xjvf compat-wireless-2.6.tar.bz2
cd compat-wireless*
scripts/driver-select atl1c
make
sudo make install

At this point a reboot should load the network driver.  For me, the “sudo make install” took a very long time.  Well, 10 minutes.  But it felt like an eternity.

If a reboot doesn’t load the module, try “modprobe atl1c” (that’s ay-tee-el-one-cee).

And that was it.  Lovely!  Again, I can’t promote the friendliness and helpfulness of the Ubuntu community enough.  They have been great.

Update 2011-03-30: I had to repeat these steps after upgrading to kernel 2.6.32-28 or -29.  But it worked.


Interview Techniques

Interview Techniques… you are probably wondering what that has to do with technology.  This is partly to do with technology, partly a way for me to remember these, and partly, well, a ramble as usual.  I have been exposed to some simple interview techniques for “software engineering” positions and they are worth remembering.  These have come in a variety of difficulties, so I will attempt to organize them as such.

First, technology!  See Mike Code, is cool.  It is a way an interviewer can ask simple questions over the phone and see the person write the code.  That gets a darn cool in my book.  Perhaps it is as modern as VHS is these days, but who says a technology needs to be on the order of Star Trek to warrant recognition?

Also, I recently found this:  http://formatmysourcecode.blogspot.com/.  It is excellent for automatically formatting HTML/XML and code for posting in a blog.

Beyond the technology is the questions I have either been asked or found in my own prowling around.  These are thing ones I find to be the most interesting.

Practical Questions:

  • fizz-buzz, written in any language — basically, for some multiplier of a loop print “fizz”, for a different multiplier write “buzz”.  For a multiplier equal to one divisible by A and B, write “fizzbuzz”.
  • given two lists (e.g., friends lists), and assuming list-2 represents changes affected upon list-1, who was added, who was removed, who is the same.  Written in any language.
  • Extend a standard Java class (e.g., HashMap) such that it meets new constraints such as, and using HashMap as an example:
    • limit the number of values that can be stored popping off the oldest when a newer one is inserted
    • disallow overwriting an existing key; key/value must be removed first
    • lock the list if three unsuccessful attempts are made to retrieve a value
    • lock the list if three unsuccessful attempts are make to insert a value (e.g., inserting an existing key)
  • web application to retrieve basic statistics from somewhere like flickr, using web app technology of choice

Conceptual Questions:

  • What information should a bug tracking system have?  How should it be stored?
  • What project did you make the most difference on?  What did you learn?  What would you do differently?
  • Create an interface from a legacy system to a newer UI.  Assume an API or web service exists.  Describe the architecture you would use; describe high-level design considerations; define milestones.
  • A database has been demonstrating progressively degrading performance (either via an application or reports).  What diagnostic steps would you take?

Mean Questions:

  • I file lists like this as mean because they contain a lot of questions that either a person knows from practical use, or can look up.  To put someone on-the-spot to answer deep details like this in an interview is merely a test in making the interviewee squirm.  To me, these questions are a lot like asking a mechanic about metallurgy — while they use metal in their daily work, but they don’t need to know the minute details about the metals they use to get their job done or do their job well.