How to Web-2.0ify your CV

Posted by Prolific Programmer Sat, 02 Aug 2008 23:10:00 GMT

Lifehacker has gone off its rocker, in suggesting that applicants try posting a video resume to Youtube. The comments seem to echo this view.

How to Avoid Laptop Seizure when Traveling

Posted by Prolific Programmer Fri, 01 Aug 2008 20:40:00 GMT

My laptop usually does travel with me wherever I go. Given my recent research into the post-911 terrorism defence legislation, I'm getting increasingly concerned with my privacy. A timely article in Lifehacker details how to how to avoid laptop searches. Yesterday's note was a little disturbing to me, and I'd like to avoid anything similar in the future.

How to Mine Craigslist

Posted by Prolific Programmer Wed, 23 Jul 2008 21:04:00 GMT

I've been working with Jameel on filtering the local Craigslist board. Lifehacker suggests an alternate approach using Google. So, you process your query using the search api, parse what comes out the other end, and apply whatever filters you configured. It would be good for people like Elie, who replies to posts "wanting to talk, usually on the phone ... i always post in different cities ... then i don't have to meet anyone in person ... and i call with my number blocked". Perhaps if she ever gets some social skills, she'd ask for help, but I'm not holding my breath.

How to Write a Firefox Extension

Posted by Prolific Programmer Mon, 30 Jun 2008 13:51:00 GMT

Lifehacker often releases Firefox extensions, the latest being Better Lifehacker. To build these extensions, they use Anthony Lieuallen's Greasemonkey script compiler. The only restriction is that Greasemonkey does not let you change the Firefox user interface, only the HTML.

How to Tweak the Firefox3 Location Bar

Posted by Prolific Programmer Sat, 21 Jun 2008 17:21:00 GMT

I don't like the new Firefox location bar. Lifehacker tells us how this can be customised.

How to Hear your Email

Posted by Prolific Programmer Mon, 09 Jun 2008 17:14:00 GMT

Lifehacker tells us how to get our email read to us, as a bedtime story, no doubt.

What's Going on with Lifehacker

Posted by Prolific Programmer Sun, 01 Jun 2008 02:09:00 GMT

My inspiration for most blog posts isn't working properly. They've broken their permalinks.

How to Score the MacHeist Bundle for Free

Posted by Prolific Programmer Thu, 17 Apr 2008 17:28:00 GMT

Every now and again, the Macheist chaps bundle shareware applications together and sell them at a substantial discount when compared to buying the applications standalone. As is the case with many such applications, there are plenty of freeware alternatives that Lifehacker doesn't hesitate to point to.

How to Quickly Organize your Files on Any Platform

Posted by Prolific Programmer Thu, 10 Apr 2008 22:53:00 GMT

DirUtils was featured on lifehacker, but platform specific. Below, I've posted the beginnings of a port of functionality to any platform. I invite readers to contribute improvements. I've marked a few spots for improvement.

package com.prolificprogrammer.dirutils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.zip.GZIPOutputStream;

import javax.swing.JFileChooser;
import javax.swing.JMenu;
import javax.swing.JMenuItem;

public class DirUtils {
	private static final int ZIP = 0;
	private static final int ALPHABETISE = 1;
	private static final int EXTENSIONISE = 2;
	
	public DirUtils() {
		// TODO Auto-generated constructor stub
	}
	File folder;

	public void sort(int alphabetise2) {
		File sortedFilesFolder = new File(folder.getAbsolutePath()+File.pathSeparator+"sorted");
		sortedFilesFolder.mkdir();
		List  files = this.getFiles(folder, null);
		ListIterator fileobj = files.listIterator();
		while (fileobj.hasNext()) {
			if (alphabetise2 == ALPHABETISE) {
				File currentFile = fileobj.next();
				String storageBucket = new String(new Character(currentFile.getName().charAt(1)).toString());
				new File(sortedFilesFolder.getAbsolutePath()+storageBucket).mkdir();
				FileChannel ic = null;
				try {
					ic = new FileInputStream(currentFile).getChannel();
				} catch (FileNotFoundException e4) {
					e4.printStackTrace();
				}
				FileChannel oc = null;
				try {
					oc = new FileOutputStream(sortedFilesFolder.getAbsolutePath()+File.pathSeparator+storageBucket+File.pathSeparator+currentFile.getName()).getChannel();
				} catch (FileNotFoundException e3) {
					e3.printStackTrace();
				}
				try {
					ic.transferTo(0, ic.size(), oc);
				} catch (IOException e2) {
					e2.printStackTrace();
				}
				try {
					oc.close();
				} catch (IOException e1) {
					e1.printStackTrace();
				}
				try {
					ic.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			} else { // alphabetise2 == extensionise
				File currentFile = fileobj.next();
				String storageBucket = new String(new Character(currentFile.getName().substring(currentFile.getName().lastIndexOf(".")).charAt(1)).toString());
				new File(sortedFilesFolder.getAbsolutePath()+storageBucket).mkdir();
				FileChannel ic = null;
				try {
					ic = new FileInputStream(currentFile).getChannel();
				} catch (FileNotFoundException e4) {
					e4.printStackTrace();
				}
				FileChannel oc = null;
				try {
					oc = new FileOutputStream(sortedFilesFolder.getAbsolutePath()+File.pathSeparator+storageBucket+File.pathSeparator+currentFile.getName()).getChannel();
				} catch (FileNotFoundException e3) {
					e3.printStackTrace();
				}
				try {
					ic.transferTo(0, ic.size(), oc);
				} catch (IOException e2) {
					e2.printStackTrace();
				}
				try {
					oc.close();
				} catch (IOException e1) {
					e1.printStackTrace();
				}
				try {
					ic.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}

		public void zip() {
			chooseFolder();
			GZIPOutputStream gzip = null;
			try {
				gzip = new GZIPOutputStream(this.makeZipFileName(folder));
			} catch (IOException e1) {
				e1.printStackTrace();
			}
			List  files = this.getFiles(folder, null); 
			ListIterator fileobj = files.listIterator();
			while (fileobj.hasNext()) {
				File file = (File) fileobj.next();
				byte[] data = new byte[(int) file.length()];
				try {
					gzip.write(data);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			try {
				gzip.finish();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

		private void chooseFolder() {
			JFileChooser fc = new JFileChooser(new File("/"));
			fc.showOpenDialog(null);
                        // TODO ensure it's a folder
			folder = fc.getSelectedFile();
		}

		private List getFiles(File folder2, List  helperList) {
			List  ret = new ArrayList();
			if (helperList != null)
				ret.addAll(helperList);
			File [] folder2files = folder2.listFiles();
			for (File f : folder2files) {
				if (f.isFile()) {
					ret.add(f);
				} else { // f.isDirectory() so recurse
					this.getFiles(f, ret);
				}
			}
			return ret;
		}

		private OutputStream makeZipFileName(File directoryName) {
			FileOutputStream ret = null;

			String rootName = directoryName.getAbsolutePath().substring(directoryName.getAbsolutePath().lastIndexOf(File.separator))+".zip";
			try {
				ret = new FileOutputStream(rootName);
			} catch (FileNotFoundException e) { 
				e.printStackTrace();
			}
			return ret;
		}
		
		public static void main (String[] args) {
			DirUtils dirutils = new DirUtils();
			// TODO JMenu with possible options 
		}
	}

How to Buy Off Amazon Visually

Posted by Prolific Programmer Thu, 27 Dec 2007 11:37:00 GMT

Lifehacker points to SavvyGraph, a novel-to-me visualisation of Amazon. May try this next time I need to buy something? Say, 5 minutes from now. ;)