Category Archives: Computers

Back it up.

This message is for those few people on Earth who don’t know about Dropbox. The dark times have ended. A new day has dawned. You no longer have to live in fear of data loss.

As a writer, one of my biggest fears used to be data loss. I constantly worried that I was one accidental click away form destroying a book. Sure, I had a USB drive where I backed everything up. But what if I lost it, or I didn’t remember to copy everything to it for a week? And what if I worked on something on the USB drive and then forgot to transfer it back to the master copy of my laptop?

The solution to this is Dropbox. Like many of its competitors, the Dropbox service that gives you free (2GB, but you can pay for more) space in the cloud. However, there’s a big difference. Dropbox has clients for Linux, PC, Mac, iPhone, and Android. It will also let you share files of any size with anyone.

Here is a picture of a dog jumping hurdles linked from my Dropbox account. Woof. Woof.

The other thing I like about Dropbox is the ease of use. Once the program is installed, there is a folder called Dropbox in your “My Documents” folder. Copy your writing to that file, and it syncs to the cloud. It even does a limited amount of revision history. Then you can just use your files like you always have. Dropbox takes care of all the tricky business.


Have a laptop and a desktop machine? Set up both, and Dropbox will automatically sync them when they are connected to the Internet. Want to collaborate? Have your co-author install Dropbox and share a folder with you. I even use Dropbox to help my friend Jose with his wine store website.

I’m not claiming Dropbox is perfect, or even that they don’t have some competitors who are doing good stuff. I’m just saying that I find it a good way to back up and share data, and if you’ve never heard of this type of application, you should try it out.

jQuery adding jpeg icons and preview.

Over a decade ago, when I started in my current job, I started out by building a portal page for the organization, with easy links to useful resources and applications. Today, it has grown to a full content management system with commenting, a file store, a notifications system, and a trade sheet. It has also gone through three major revisions as I moved from straight HTML, to a simple framework, to a complex framework, to a simple framework of my own devising. Maybe I’ll blog about my framework someday.

In an effort to beautify my CMS, I decided to put icons next to the filenames for knows types of files (and a generic one for unknown types).

I did this via this piece of jQuery:

$(‘.file[href$=”.jpg”]’).prepend(‘<img src=”images/icons/jpg.png” border=”0″ /> ‘).removeClass(‘unknown’);

For people who can read jQuery, this is pretty simple stuff, but I’ll walk through it. The $(‘.file[href$=”.jpg”]) tells jQuery that what follows will be applied to all elements with the class “file” and an href attribute ending in “.jpg”. This would find elements like the following:

<a href=”documents/image001.jpg” class=”file unknown”>This is image 1</a>

The method call .prepend(‘<img src=”images/icons/jpg.png” border=”0″ /> ‘) adds the call to the image of the icon, changing the element to this:

<a href=”documents/image001.jpg” class=”file unknown”><img src=”images/icons/jpg.png” border=”0″ /> This is image 1</a>

Finally, the .removeClass(‘unknown’) removes the “unknown” class. When I get done will all the “known” file types, I’ll apply a generic image to items with that class.

A little more complicated trick.

Next, I wanted an easy image preview that didn’t require me to create thumbnails on the server. Originally, I tried an image preview jQuery plugin which I didn’t like, but then I remembered I was already using the clueTip plugin. I wondered if there was a simple way to use clueTip as my image preview.

I came up with this script:

$(‘.file[href$=”.jpg”]’).each(function() {

$(this).attr(‘title’,’image preview|<img src=”‘ + $(this).attr(‘href’) +'” width=”200″>’).cluetip({splitTitle: ‘|’,width:’220′});


This uses the same selector as above, but instead of chaining all the methods,  I used the each() method to pass each object to a function. I did this so I could refer to each object matching the selector as “this“. There might be a way to do this manipulation without “this”, but “this” was the way I did it.

The rest is pretty easy. I put this string in the “title” attribute of the href:

image preview|<img src=”documents/image001.jpg” width=”200″>’

Then I call clueTip with teh splitTitle option, which tells it to take the title and use “|” as a delimiter between its title and content. The result looks like this:

All-in-all. I think this is a much more engaging interface than a list of text links. One weakness of the preview, however is the lack of a thumbnail, so the previews will load slowly. Of course, if I had thumbnails, I probably wouldn’t have bothered doing it this way.

WYSIWYG vs. Markdown

Currently, at work, I’m writing a knowledge base and ticket system. If you’re not familiar, a ticket system is a way to ask for assistance from your IT department, or a way for them to talk to each other.  Why am I doing this, when there are several commercial products available? Because my boss would rather pay my paycheck than give the money to a vendor. I think this is a fine plan.

So, in my knowledge base, which is basically a speed bump on the user’s way to writing a ticket, I wanted to do some simple rich formatting, bold, italics, bullet lists, and hyperlinks. However, the other employees in my tiny IT department are not as familiar with HTML as I am. So, I want to use some kind of intermediary plugin to help them write it.

The first solution I looked at was Markdown. Markdown is a simplified syntax used in site like the Reddit and Stack Exchange for rich formatting. If you are at all into computers and don’t know about Stack Exchange, you should take a look. Markdown looks kind of like this:

**bold text ** _emphasis_  [html link (url)]

Markdown might not be the easiest syntax in the world, but if you goof it up, you don’t have broken HTML in the middle of your page. For this application, I’d probably use a jQuery Markdown interpreter and keep the Markdown in the database.

The other solution I looked at was, and I have a feeling you’ve already guessed, WYSIWYG, or What You See Is What You get. WYSIWYG editors have a high comfort level for users, as they can literally see what the page will look like. However, that doesn’t always work so well. WYSIWYG interfaces have to deal with anything the user throws at them, so if a user plays around with the formatting, you can easily get some weird, leftover markup hiding in the background. Still, some of these WYSIWYG editors do very nice things, I’m nearly happy with TinyMCE, the editor used in WordPress. It looks like this:

In the end, I think I’m going to move ahead with Markdown. It might mean a little more learning curve for the staff developing the knowledge base, but I think will ultimately be the better user experience for the people using the knowledge base. Also, having used some WYSIWYG editors in the past, I think I want to try something different.

Alan Turing

I don’t think that people expect to hear the term Computer Science and Hero in the same sentence, but if I had to choose a hero, I can think of no one better than Alan Turing.

To me, Turing is one of the great geniuses of the Twentieth Century. His list of accomplishments were long. During World War II, he was instrumental in breaking German codes, for which he received the OBE. His Turing Machine was a major step towards what we call a “computer” today. His Turing Test is still used as a benchmark in Artificial Intelligence.

However, in his own time, Turing was persecuted for he sexual preference. In 1952, after a break in at his home, police discovered that Turing was a homosexual. At the time, Homosexuality was illegal in Britain, and Turing was convicted. He spent the last two years of his life under probation and forced chemical castration, finally taking his own life in 1954, by biting into a cyanide-coated apple.

I’ve always found it tragic that, because of the bigotry of others, not only was a great man wronged, but the world was robbed of what would have been Turing’s most productive years. Many of his ambitions were limited by the technology of his time. What wonders might this man have produced had he lived to see the integrated circuit or the microprocessor? I can not help but think that had Alan Turing lived to see the latter half of the 20th century, our world would be a little bit better today.

The Alan Turing Memorial, Manchester England

Social Media has a few gray hairs

I was reading a report today that claimed the average age of a social network user was 40 years old. Now, I knew there were lots of old women on Facebook sharing pictures of their grandkids, but I had no idea that the average age was that high. When you take out sites like LinkedIn, the number doesn’t skew downward. The average Facebook and Twitter user is somewhere between 38 and 39 years old.

Now,I admit I’ve dismissed Social Media on several occasions as being a haven for kids, but it turns out I was totally wrong. In my defense, I’m a bit anti-social anyway. Seriously, I didn’t get into computers to be more social. Still, today there are are even social sites for anti-socials, like 4chan–No, I know what you’re thinking, but if there is any goodness in your heart, don’t check them out.

I guess the moral of this datum is that you might not be able to teach an old dog new tricks, but you can teach him to send a friend request.

Social media is a hammer, not everything is a nail

Today, I met with my boss and a social media expert. Now, generally, I think of social media experts as middle-aged women on Facebook, as they are using the hell out of that medium, but this was the other kind, a guy who gives you advice on how to grow your business.

However, due to the nature of our business, there are only about a hundred specific people in the whole world who can actually help us to grow. My boss wanted to get them very specific, confidential information.

Social Media is all about being social. It’s about being honest and above-board. It’s a great place to put information you don’t mind sharing with the entire world, but it’s not a great place to put anything you never want anyone to see. It is not and will never be a good place to hide anything. That goes double for Facebook.