Motorola Droid vs. Apple’s iPhone

October 20th, 2009 by peasleer

There has been a lot of hype around the Motorola Droid (release date October 30th, yay!), which I think is well-deserved. A lot of people, myself included, have been waiting for an Android phone on Verizon’s network since HTC came out with the G1 on T-Mobile. But with all the hype has come the inevitable comparison of the Droid and the iPhone.

I can only speak for myself here, but really, the comparisons are a waste of time. I’m surrounded by Apple supporters who continually attempt to convince me of the merits of the iPhone versus other phones. What most seem to not understand is that it doesn’t matter. The iPhone can win on the fronts of aesthetics, user experience, hardware performance, application availability, whatever – it is still a closed device backed by anti-competitive Apple on a pretty poor AT&T network. So save your arguments, I don’t care which phone you believe to be better because of whichever features you choose to flaunt. The fact is that my buying another phone is not a loss of a sale for Apple, because I was never an Apple customer to start with.

The same goes for the Droid advertisements, too. They don’t do anything for me. I want the Droid to deliver functionality that I want, and it doesn’t matter how it relates to the iPhone, because I don’t care about the iPhone. Instead of showcasing the many features that the Droid will have that are lacking in the iPhone, I want an ad that says “It is a great phone with substance, it is on the excellent Verizon network, it runs the open Android mobile OS, and it is produced by the proven mobile handset manufacturer Motorola.” We all know the iPhone exists and that it is the phone the Droid will be compared against – but why stoke the fires? Let the Droid speak for itself as the best option for those who aren’t interested in the iPhone.

There are lots of reasons to consider the Droid. Insisting it is better than the iPhone isn’t one of them.

Stop Tweeting. Stop Emailing.

October 18th, 2009 by peasleer

Giving bad news to employees over email.If anything causes me to go postal in the near future, it is going to either be Twitter or email.

Both mediums are great for communicating, if you are a already a good communicator. It is the same across mediums – know your audience, show them respect, speak clearly, and be concise. The problem with each medium is that your audience has now changed to a foreign size or composition, which is unfamiliar. That, and also that giving a computer to a normal person results in retardation.

Email should be pretty well settled by now. We’ve had it for over 20 years, most people have been using it for at least 10 years in the workplace, and any kid born after 1990 has probably had an e-mail account since they could use the Internet. Yet still we have people making unforgivable mistakes in using this familiar technology. Outlined, the ones that get me the most are:

  • Giving bad news over email when more personal avenues are available. This makes you look like a coward.
  • Sending grossly inappropriate things over email in the workplace. Come on, we don’t realize this is a bad idea?
  • Emailing people with a single link and no explanation of why it is worth clicking on. Mark as spam -> delete.
  • Sending emails without a subject. If I don’t know whether it is important or not, my default is to ignore it.
  • Sending emails with a subject and no body (Subject: “We need to see you upstairs” Body: “”) This is just lazy. If you really want to one-line me, text, chat, or call me. We don’t need an archive of it.
  • Being too verbose. Yes, your emails can be as long as you want them to be, but how many paragraphs do you really need to make your point? The shorter it is, the more likely I’ll be to read it.

If you are an offender of those points and can’t evolve your behavior, STOP EMAILING.

Twitter is arguably newer, but people have been working overtime to prove just how quickly they can forget the fundamentals of communication and act like complete idiots. The advantages of Twitter is that it encourages brevity, forcing people to quickly make their statements without rambling.

The disadvantage of Twitter is that people affected with IICD (Inefficient Internet Communication Disorder) fail on every other point of effective communication:

  • Know your audience. Your audience isn’t composed of just the people following you. This results in tweeting about things that can later be used to blackmail the twetard into buying additional insurance or a carton of baby snakes.
  • Speak clearly. If you are posting nebulous things to Twitter, are being passive-aggressive, or have some hidden agenda behind your tweets, or posting some emotional breakthrough without providing background, you suffer from IICD and are being a twetard. The basic idea is that if I can’t discern the purpose of your tweet, or can smell a hidden agenda, I’m going to light you on fire. See how clearly I communicated my last point?
  • Finally, showing your audience respect. Now I’ll admit I’m guilty of this one at times in terms of outright insulting my followers, but hey – following is voluntary, there is leeway here. What is not acceptable is posting anything to Twitter (to the anonymous Internet) which should have first been communicated to an individual or group. For example, reading from your management: “Had to let an employee go today” before anyone has spoken to the actual employees is proof of extreme retardation and will again result in the tweeter being lit on fire.

If you are an offender of those points and can’t evolve your behavior, STOP TWEETING.

And people label geeks as being ineffective communicators? Hah. Geeks don’t get made fun of for being terrible at using email or Twitter.

LostAFollower Alpha Release

July 19th, 2009 by peasleer

Managing relationships in social networks is difficult, just like managing real-world relationships is difficult. If someone unfriends you on Facebook, or stops following you on Twitter, is it because of something you posted? If a friend in real life stops talking to you, is it because of something you said? It can be difficult to tell, and the best course of action is probably to ask your friends what is going on, whether on social networking sites or in the real world.

But there is a difference here: the breaking-point status online is binary. Either someone is friends with you or they aren’t, they were following you but now they’ve stopped. And while sites like Twitter and Facebook are happy to tell you when you have a new friend request or a new follower, they sweep under the rug when someone reverses that action – all you notice is you have one less follower, or one less friend. Honestly, it bugs me – and I’m not the only one. Others have written services to monitor a user’s followers on Twitter, but they all fail in some function or another. Qwitter is an example of this – their service is so overloaded that your user only gets hit every couple *months.* Pretty terrible.

Which is why I wrote Lost A Follower. Lost A Follower addresses the problems I’ve described thus far – it is a service that monitors your Twitter profile. When you lose a follower, Lost A Follower gathers your last post to Twitter and the username of the individual and sends them both to you. Now you get a notification sent directly to your email that tells you who stopped following and, importantly, *why.* It is in its initial release right now, so I expect plenty of bugs on the server side – but I’m excited to get it off the ground. I have a lot planned for future versions and extensions of the Lost A Follower platform, but all that will come in due time :)

So if you are a stat-monger like me, or you just wish Twitter would help out a bit with managing your social network, give Lost A Follower a shot. It is free, developed by yours truly, and is currently in need of test subjects :)

Announcing: Barcamp Tacoma

June 29th, 2009 by peasleer

This blog has been silent for a couple months, but the news I have to share is well worth breaking that peaceful quiet :) I’ve been living in Tacoma Washington since I graduated college, and I am really loving the area. Surrounded by water, two mountain ranges in sight, green all year… it really is beautiful. The only downside of the area, while having more than a few technical companies, lacks a “tech scene.” This is thankfully starting to change with the introduction of Tacoma’s first Tech Meetup earlier this month (thanks to Erik Emery for setting that up!), and strengthened by a collaborative effort between Scott Kuehn, Michael Maitlin, and myself. That effort being…

The First Annual Barcamp Tacoma!

Barcamp is labeled as an “un-conference,” where people come together and talk about whatever it is they feel like discussing. Or, from the Barcamp.org website:

BarCamp is an ad-hoc gathering born from the desire for people to share and learn in an open environment. It is an intense event with discussions, demos and interaction from participants who are the main actors of the event.

We’ve had some help getting a space to hold the event from Suite 133, a local collaborative workspace, and with that locked down we also have a date: August 8th, 2009. The event is free (food and drinks included!), and if we have enough sponsors we’ll be trying to lock down t-shirts for everyone as well.

On behalf of myself and the other hosts, we really hope you are all able to come help us make Tacoma’s first barcamp a success. Check out the site for all the details, and be sure to sign up so we know how much food to pack. If you don’t know what you would talk about, we’ve created a page with presentation topics we would love to hear about. Share what you know, even if you don’t consider yourself an expert. All we care about is sharing information, everything else is just icing :)

Hope to see you all there!

mod_python Project Configuration Files

April 30th, 2009 by peasleer

In my last post I brought up how to get around mod_python’s default inability to handle relative paths for imported modules. The next night after writing that, I faced a very similar issue with configuration files.

It is a sin to duplicate data in a project (except when caching), so most sane desktop applications will have a central store that contains the configuration parameters for the application (usually packaged as a resource with the application, or in the registry for Windows users). Mod_python can’t do this because, as was discussed in my last post, it views the current working directory of whatever script it is executing as the root directory of the filesystem (”/”). So where do you put the configuration file for your mod_python based project if you can’t refer to it relatively, don’t want to hardcode an absolute path, and want to distribute the configuration with the project?

The solution hit me like a bucket of cold water. Give up on the property or ini format file, and make your configuration a python dict object that you can directly import:

# config.py
#
# This is the project's configuration. Import it when a class needs to access
# project configuration variables.
#

_config = {
    # The name of my app so pathHack knows what string to look for
    'rootname': 'sampleWebApp',
    # Database options
    'db_host': 'localhost',
    'db_dbname': 'sampleWebApp',
    'db_user': 'sampleWebAppUser',
    'db_password': 's0m3p455w0rd',
    # Debug logfile path
    'debug_logfile': '/tmp/lostafollower.log'
    };



This file needs to live in your project’s root directory as far as mod_python is concerned. For more information, read my last post. If you’ve already read it, then you’ll understand when I say that config.py lives in the same folder as pathHack.py.

Once you can import it from your main source files, use it like this:

<%
# sample usage of config
from config import _config as _c
req.write(_c['rootname'])
%>


Tada! Extraordinarily simple configuration file that is easily accessible and can be distributed with your mod_python application. I’m pretty happy about it :)

Relative Import Paths Using Mod_Python

April 27th, 2009 by peasleer

A long while back (a year already? Jeeze!) David Brenner and I wrote a web application without using any frameworks, only mod_python and python server pages (PSP). We ran into a few problems along the way, one of which being that the import path mod_python used had to be composed of absolute paths. It isn’t a huge problem to just hard code a path to your project’s lib directory, but it is hardly portable and adds to the fragility of the system.

I’m now doing another project (more on that later), again using mod_python and psp. This time around however, I have a hack that gets around the absolute path problem. The solution looks like this:

# This file has only one function: to add directories to the path
# so we can import other python files/modules.

import sys

# Default directories to add to the path
_dirs = ["/src", "/lib"]
_applicationRoot = "sampleWebApp"

# Will go through the list and add the directories given relative to the
# lostafollower base path. Allows us to do paths relative to our installation
# instead of hard-coding absolute paths.
def addLibs( dirs ):

  # If [] was provided, just use the default.
  if not dirs:
    dirs = _dirs

  base = ""
  for entry in sys.path:
   if entry.find(_applicationRoot) != -1:
     base = entry
     break

  for dir in dirs:
    try:
      # Test if the path contains the path we want
      sys.path.index(base+dir)
    except:
      # The path doesn't already contain our path
      sys.path = sys.path+[base+dir]

The reason we normally can’t use relative paths when doing imports is because the mod_python handler considers the root (”/”) of the filesystem to be the current working directory of the application, regardless of where the application is actually running from. However, Apache will put whatever alias it has for your application’s directory [1] in the PYTHONPATH for mod_python, which is what allows us to do this hack. By finding the path that Apache has in the PYTHONPATH, we can add whatever paths we want relative to that. No .htaccess PythonPath directives, no hard coding of paths to your project’s module locations. Just:

  1. Put the above code in a file (I call it pathHack.py) in your application’s root directory (root as far as Apache is concerned) [1]
  2. import pathHack (or whatever you called it) in whichever file needs your other modules
  3. Call pathHack.addLibs([]) to add the defaults (/path/to/sampleWebApp/lib, etc), or pathHack.addLibs(”/lib/3rdParty”) to add /path/to/sampleWebApp/lib/3rdParty to your path
  4. import any python module in those newly added directories!

That is really it. Hard coded paths begone!

[1]

When I say “the alias it [Apache] has for your application’s directory,” what I mean is that even though, for example, my application runs out of /home/robertp/src/sampleApp/src, mod_python sees the root as being /home/robertp/src/sampleApp because of some unknown magic. It doesn’t really matter what the path is, in all honesty – when specifying a value for _applicationRoot in the solution code above, you are just looking for a string unique to the path to your application (just be sure to make all supplied paths relative from that base). Try just your project’s deployment folder for starters. If you are still having trouble finding it, create a quick psp file in the same folder as your other psp files, and do:

import sys
from mod_python import apache
req.write(str(sys.path))

That will just print out all the path elements to your browser window when visited. Pick out your application’s name or path from there, and set _applicationRoot to that. It isn’t completely ideal, but it is better than hard-coding ;)

Alien Milk

February 14th, 2009 by peasleer

This? This is tasty. Hope everyone is enjoying their weekend as much as I am – happy Valentine’s day!

Lime Skittles and Vodka

Measuring Execution Time in Nanoseconds in Java

February 9th, 2009 by peasleer

Sometimes measuring time using the trusty System.currentTimeMillis() static call isn’t of high enough resolution to measure the execution time of methods with any meaning. Fortunately for those facing this problem, Java 5 introduced a method of accessing the system’s most precise clock through the System.nanoTime() static call. This returns a long that represents the current clock time in nanoseconds, easily solving the problem of measuring time more precisely than milliseconds can provide.

Thus ends another quick post, get back to work :)

Reading Environment Variables in Java

February 5th, 2009 by peasleer

A quick search on google for “Reading environment variables in java” yielded a lot of (older) documentation stating that System.getEnv(”varname”) has been deprecated. This is no longer accurate, as System.getEnv(”varname”) and System.getEnv() have been reinstated as of Java 1.5. Quick post, I just wanted others to know that the API again exposes those useful method calls.

Part 2: Connections and Configuration

February 3rd, 2009 by peasleer

In part one of this series, I covered the hardware and basic operating system installation for a home theater PC running Mythbuntu. In other words, part one covered the easy stuff. Running the audio cables between the PC and the TV is actually a more complicated affair than I had imagined, yielding three major issues that had to be overcome before ending up with an acceptable configuration.

The blue lights are very subtle, but neat in the dark

The blue lights are very subtle, but neat in the dark

1. Audio

I should clarify that connecting the cables isn’t the problem, it is the technical limitations and configuration issues accompanying their connection that poses challenges. My audio connection is straight stereo-out to stereo-in via a 10 foot 3.5mm interconnect. Upon plugging it in and turning on the TV however, no audio was present. The reason behind the problem ended up being with how ALSA was loading modules, and was easily fixed with a configuration change. If you copy my setup and are using a Creative Audigy 2 sound card with an Ubuntu variant, try the following:

  1. Run ‘alsamixer’ on the command line and verify your Master and PCM channels are turned up.
  2. Verify you have your cable plugged in to the correct slot on your sound card.
  3. My fix: another sound device (my motherboard’s onboard sound) was stealing ALSA’s focus. Adding the following to /etc/modprobe.d/blacklist and rebooting fixed my problem: blacklist snd_intel8x0

2. Video – Analog Connection via DSUB15

The Viera has an analog mini-DSUB 15 port for hooking up a PC directly to the TV. I had never had an issue with signal quality before on smaller monitors, so I didn’t forsee any problems with hooking a ten foot VGA cable from the computer to the TV. There are a multitude of issues with this setup, however.

First, read the specifications for the Viera carefully (in the manual, I couldn’t find the information anywhere else), and Panasonic states the TV is capable of producing a maximum resolution of 1280×1024@60hz. This is a slight problem, because in order to display content at 1080p, 1080 lines of vertical resolution are needed. Furthermore, with a 10′ run of analog signal 1024×768 is clean, but pushing 1280×1024 causes a significant amount of signal and color bleeding.

The pits of this is that if you stick with an analog connection, you are really stuck with these problems. You can clean up the signal by running a shorter cable from the HTPC and the TV, but that limits the placement of the machine. The resolution limitation is the real kicker, as spending all of that money on a HDTV capable of producing 1080p becomes a complete waste if you can only fully display 720p content. I refused to believe that the TV couldn’t produce its native resolution of 1920×1080 from a computer source, so the next fix comes from addressing that issue.

3. Video – Digital Connection via DVI -> HDMI (and More Audio Solutions)

The TV is capable of producing 1080p from a source connected through component or HDMI cables, displaying at 1920×1080. My solution to the problems found in section two of this post was to then find a way to get my HTPC’s video output to an HDMI cable. HDMI is really only DVI with added support for sound, so another $15 purchase of a DVI -> HDMI cable and a week of waiting was all I needed to make the connection. The benefit was immediate – being digital, there is no signal bleeding or interference. The drawbacks presented themselves just as quickly, however. I found that my analog audio connection had cut out, I could no longer produce sound on the TV. Additionally, the HTPC was displaying at 1920×1080, but the TV was only displaying a portion of it, with my mouse going off-screen to access common menus.

The video display was the most immediately annoying part. Reading many online forums suggested that it was a problem with overscanning, and there were even guides on how to access the service menus of the Viera to grant a 1:1 pixel match (effectively disabling overscanning). I haven’t found this documented anywhere else, so I want to say it clearly: ADJUSTING YOUR VIERA’S OVERSCAN SETTINGS IS UNNECESSARY (is it still bad design to use marquee and blink tags? I’m tempted to use them here). The easy and smart fix is documented in the service manual (not the user manual), and is as easy as the following:

  1. Plug in your DVI -> HDMI cable, ensure your source HTPC is on and change the TV’s video input so the HTPC’s screen is visible.
  2. On your remote, press “Menu,” then go to “Picture”
  3. Scroll down to the second screen, and go to “Advanced Picture”
  4. Go to the last option, “HD size,” and change it from “1″ to “2″

That fixed it for me. Restarting Xorg and a change of the resolution to 1920×1280@55hz had me running in full high-def glory. But without sound.

The sound issue was a nuisance. HDMI normally carries a digital audio signal with the digital video feed, so the Viera is nice enough to automatically ignore all analog audio input sources when your display comes from an HDMI source. Unfortunately, getting audio spit out over DVI was more difficult than I cared to pursue (with a lot of forums claiming the task impossible), and buying a DVI + analog audio -> HDMI converter is in excess of 200 euros. Again, the simpler and smarter solution is again in the Viera service manual (not the user manual), and can again be done by following these steps:

  1. Plug in your HTPC and get it set up again so the screen is visible.
  2. On your remote, press “Menu,” then go to “Audio”
  3. Select “Advanced audio”
  4. Go to “HDMI 1 in” (or to whichever port your HTPC is plugged in to)
  5. Scroll over until the port your audio source is in is selected (I selected “PC”)

You should now have overridden the default of using the digital signal from your HDMI cable to now use the analog input.

For me, these three steps resolved the major issues (and relieved the major headaches) I encountered while setting up my HTPC. I sincerely hope that these steps will help people avoid making the mistakes I did, and save them the many days spent polling forums looking for answers to these issues. In part three of this series of posts, I will address setting up the system to make retrieving media especially easy, and some other configuration tweaks that make my system an easy-to-use content retrieving monster. Subscribing to my RSS feed will ensure you don’t miss it.

I’m off to watch The Dark Knight in 1080p – until next time!