Firefox messed up!!

February 4th, 2009

So I messed up firefox on my ubuntu installation somehow the other day. The address bar would not show the correct current page, bookmarking wouldn’t work, and none of the navigation buttons would work. If this ever happens to you here is the fix.

ryan Uncategorized

CLMailer update

February 3rd, 2009

my craigslist email notifier now got its own url www.clmailer.com. In addition to the new url I also gave it a facelift so it is not just ugly unstyled text. Now it is styled text and you can make your own judgements on its look. I also tried to make it easier to understand how to use and gave some error messages if data is input wrong. I also did some work on the back end of it to hopefully fix some issues with parsing international dates and also make it fully multithreaded.

ryan Craigslist, screen-scraper , , ,

New projects section

January 31st, 2009

I added a projects tab with a few (not all yet) of the projects I am working on/completed. It is mostly just little basic classes I wrote as part of bigger projects, but I figured to post them here in case the code meets someone elses need too. It is all LGPL unless I state otherwise.

ryan Java

Craigslist Mailer update…now more frequent searches

December 14th, 2008

As per request from a number of users I switched up CraigslistMailer so that it now performs searches every 5 minutes so you won’t miss that amazing deal.  Anyone else reading this check it out at www.ryanjustus.com/craigslistmailer.  Its free and could save you money. Unfortunately the page is still completely non-styled…my free time coding has all been spent on neural networks.

ryan Craigslist, screen-scraper

Optical character recognition made easy

December 12th, 2008

As a datagriculturalist (a person similar to a data miner but lazier) I have come across a number of times where there was a key piece of information on a website that I would love save into my datumsbase, but unfortunately the text is contained in an image.  To get around this dilemna I did a little research into OCR.  After researching a bit I decided on using Tesseact-OCR.  Tesseract is open-source and easy to use.  To convert an image to text just run ‘tesseract image.tif image_output’ and it will output the text to image_output.txt.  The input of tesseract needs to be an 8 bit tif image.  I use ImageMagick, also open source, to convert jpegs, gifs, etc to the tif format.  I also found that playing around with resizing the text often results in a more accurate conversion, so I use ImageMagick for that too.  I wrote some Java code that does the conversion and modification, but until I have filled out my personal image manipulation java code a little bit, ImageMagick is a little more robust.  Eventually I plan on making a nice java wrapper for the tesseract dll but in the mean time I make system calls from Java.  Both Tesseract and ImageMagick are in the the apt repositories on Ubuntu, so installation is a snap. Here is a little Java method that I wrote to get the job done.

public static String convert(File image, int resize)
{
Random generator=new Random();
int r = generator.nextInt(1000000000);
try
{
String s;
StringBuffer input = new StringBuffer();
StringBuffer error =  new StringBuffer();
Process p = Runtime.getRuntime().exec(”mogrify -format -flatten tif -depth 8    -compress None    resize” +resize + “% “+ image.getAbsolutePath());
BufferedReader stdInput = new BufferedReader(new     InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new    InputStreamReader(p.getErrorStream()));
while ((s = stdInput.readLine()) != null) {
input.append(s);
}
while ((s = stdError.readLine()) != null) {
error.append(s);
}
System.out.println(s);
p = Runtime.getRuntime().exec(”tesseract phone”+r+”.tif phone”+r);
stdInput = new BufferedReader(new
InputStreamReader(p.getInputStream()));
stdError = new BufferedReader(newInputStreamReader(p.getErrorStream()));
System.out.println(”Output of Tesseract:”);
while ((s = stdInput.readLine()) != null) {
input.append(s);
}
while ((s = stdError.readLine()) != null) {
error.append(s);
}
System.out.println(s);
File phonetxt = new File(”phone”+r+”.txt”);
File phonejpeg = new File(”phone”+r+”.jpeg”);
File phonetif =new File(”phone”+r+”.tif”);
FileInputStream fstream = new FileInputStream(phonetxt);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String phone=br.readLine();
phone = phone.replaceAll( “\\D”, “” );
System.out.println(phone);
phonetxt.delete();
phonejpeg.delete();
phonetif.delete();
return phone;
}
catch(Exception e){
return e.toString();
}
}

Sorry about the ugly formatting of my java. I just copied and pasted it for expediency but it looks much nicer in Eclipse.

ryan Java, Uncategorized, screen-scraper , , ,

Ultimate deliciousness? YES!!!

November 24th, 2008

Bacon flavored chocolate has arrived. Finally I can have my dessert before dinner. Hopefully hotdog flavored jollyranchers are on the way.

ryan Uncategorized

We’ve almost won. Don’t give up now.

November 15th, 2008

Public perception and morale, not firepower, numbers, or strategy, often plays the decisive role in war.  Our modern society occupies a curious place in human history.  We have the opportunity to finally end a war that has raged, on one field or another, for thousands of years.  We have effectively won the war, but recently the zeitgeist has shifted away from winning being a desirable goal.  Winning wars has now become politically incorrect.  Combating terror and spreading basic rights of life, liberty, and the pursuit of happiness is no longer sufficient fuel power our resolve to eliminate our enemy once and for all.  There is even a strong movement to offer aid and support to the very same enemy that has remorselessly killed many of our countrymen and allies.

I plead with the people of the world to not give up now, when we are so close to victory.  We have the polar bears on the run, but until their defeat is absolute humanity will remain in peril.  Remember the wise actions of David in the Old Testament.  When he had a run in with a bear did he mess around and put it on a protection list?  Of course not.  He fought and slew the bear.  I encourage everyone who cares about their fellow man to do their part to support the war on bears.  Buy bearer bonds. Increase your carbon emissions.  Send Christmas packages to the Eskimos on the front lines.  And if you are an environmentalist, that is if you despise the subset of the environment that includes sentient beings, do it for the helpless baby seals.

Don\'t let the smiling eyes deceive you. He WILL try to eat you.

Don’t Let those beady little eyes lull you into complacency.  Help save the planet from polar bears.

ryan Random, Uncategorized

Book Meme

November 13th, 2008

Book sitting on my dresser underneath two cd’s and a box of sleeping pills.

“It’s all just parts and relationships and analyses and syntheses and figuring things out and it isn’t really here.”                                                                                                                                –Zen and Art of Motorcycle Maintenance, Robert M. Pirsig

  1. Grab the nearest book.
  2. Open it to page 56.
  3. Find the fifth sentence.
  4. Post the text of the sentence in your journal along with these instructions.
  5. Don’t dig for your favorite book, the cool book, or the intellectual one: pick the CLOSEST.

ryan Random

How did computers get so cheap?

November 11th, 2008

While browsing the interwebs the other night I headed on over to tigerdirect and newegg.com to see what computer I could put together for under $1k.  Much to my surprise I ended up with a dual quad core system with a terabyte hard drive, and 8 gigs of memory.  That is about as powerful as the best supercomputer from when the time when I built my first computer.  The video card I selected was a cheapo, but it did support two monitors.  I wanted the video to be a passively cooled video card because I use my x-box for gaming these days and I want as quiet a computer as possible.   I didn’t end up buying any of the parts, though I was tempted, but if there are excess funds after the christmas shopping and ski trips this winter I know what is on the list.

ryan Uncategorized

Dell mini 9

October 31st, 2008

I had been looking at ultraportables since the Asus eee pc and i finally took the plunge.  The low cost and feature set of the Dell mini 9 was what pushed me over the edge.  As an added bonus it came with Ubuntu installed.  For a long time I have had two wishes in a notebook.  First of all I want a notebook that has a battery that lasts 24 hours, and second I don’t want it to have any moving parts.  My mini 9 accomplishes one of those goals…no moving parts.  I got mine equipped with a 16 gig solid state drive, and with the power conscious Intel Atom processor it doesn’t even have a fan.  Another feature I love about this little beaut is the integrated card reader.  My first purchase was a 16 gig sdhc card ($35 from Newegg) to supplement the hard drive.

I wouldn’t ever want this to be my primary computer but it works great as a little brother to my Lenovo notebook and my aging yet venerable Shuttle desktop.  So far I have few complaints about the computer, mostly just features that I will have to learn to live without when I am using it…like the ability to type apostrophes without looking down at my hands.  Due to the compact keyboard the apostrophe is located one key just below the key my finger invariably toggles.  Another difficulty is the tilde button.  I know that for most people the tilde is the least of their concerns but I honestly use it hundreds of time a day and I really got used to its old location.  For being such a small keyboard the layout is surprisingly usable though (I have been typing this entire blog post on it).  Another feature i miss is the little keyboard joystick mouse nub.  It only comes with the touchpad.  I hate touchpads.  Maybe this will give me an opportunity to overcome my irrational hatred of touchpads and ultimately end up a better person for it though.  We’ll see.  The only other thing i really miss on this computer that my other notebook has is a keyboard light.  I especially miss that light at times like right now when I am typing at 3:30 am. trying desperately to find the apostrophe button by the little bit of light from the screen, which by the way reminds me of another thing I wished was different about this machine.  Who decided it was a good idea to have a glossy reflection staring back at you when you are looking at your laptop screen?  I guess the idea appeals to some people, but I try not to form friendships with those people.  Either they are vain and like looking themselves too much or they are ignorant of a better option.  Anyway the point is I wish the mini 9 came with an option to have the matte screen.

I am glad Dell did offer the option to pay a little less money and not get a built in camera.  I can’t imagine a time I would ever want to use a webcam and have, in my younger, more sinister days on the interwebs, hacked into too many computers to not recognize the disadvantage of a camera hooked up to the internet, always peeking at you and just waiting for you to do something foolish that will forever be archived on YouTube.

All in all it is a great little machine for a cheap price.  Below are a few picture I took of it for kicks and giggles, of which i came away with a disappointing amount.

side profile of the mini 9Mini 9

ryan Ubuntu , ,