Lolrus.org
This is a header that goes on every page.New Theme
August 20, 2007 at 01:51 PM | categories: Uncategorized | CommentI'm updating my theme. Ugly things will be happening in the next couple days. Please bear with me.
BarCampBlock
August 19, 2007 at 03:19 AM | categories: Uncategorized | CommentSo good. Will elaborate tomorrow when not in state that is in now. :)
Lots of cool people, lots of good sessions, and lots of crappy demos at DemoCamp. Oh, lots of free drinks as well. *sigh* Sometimes being a geek has it's advantages.
Rails, Django, Pylons, CakePHP, TuboGears, etc. Choosing the Right Web Framework.
August 17, 2007 at 04:24 AM | categories: Computer | CommentI'm planning on doing a web application that will have to scale immensely. It will require support for complex SQL queries (or using stored procedures in PostgreSQL), and it will have to scale.
The first framework I looked at was using Rails, which is an obvious choice. I've done some basic apps in it in the past, and I am very familiar with the Ruby language itself. Ruby is slow. On some benchmarks I've seen it 3-5x slower than Python. Also, I don't like how it's a struggle to make complex queries that are efficient. If there's an easy way, it's not well documented. I'm a little beyond the "Here's a movie that will show you how we made a blog in 10 minutes using scaffolding." Gems is pretty nice too, but I think I will pass on rails this time.
I found CakePHP next, but I really would like to stay away from PHP. I'd write my own lightweight framework if I were to use PHP. I've also heard that people have had issues with it.
After that, one of my friends suggested Django. From what I can tell, it would be great for an intranet or something like that because it can have many portals and such. It looks like the templating system is pretty solid too from what I've read. It hasn't sold me. I want to try something different from rails that isn't a full stack.
Next, my friend recommended I try TurboGears. Sure, it flaunts it's 20 minute wiki, like Rails flaunts writing a blog in 10 minutes or whatnot. I like how it just ties existing components together. This means in the future if I need to write my own custom templating engine, or model to suit a specific need, it won't be a huge pain to integrate it with the rest of the site. I'm kind of sold for now, but I still need to set it up. I also REALLY like how TG2.0 is converging with Pylons to make it play with WSGI nicely
After looking at TG, I was obviously lead to Pylons after reading about TG2, because it's a web framework as well, that acts like a glue with certain Python web technologies to make an MVC framework.
While looking for the perfect framework, I keep going around in circles. I obviously can't write my app in each one and see which one is the best. None of them are really proven. I mean, I keep consider just using PHP and smarty for templating. I really want to stay away from PHP though. I'd like to learn something new.
Also, it seems like all the reviews/comparisons on frameworks I have found are dated at least a year and subjective. I understand it's not really possible to have an objective comparison on frameworks. At least with languages you can have benchmarks, but with frameworks it's not always CPU cycles that wins.
I also looked at Zope, but it's not really practical for what I am trying to accomplish.
Right now I am going to attempt TurboGears (using SQLAlchemy and Genshi). SQLAlchemy looks tempting because I read that you have more control over your queries with the "Data Mapper" paradigm versus the "Active Record" one. Genshi seems sweet too, even the author of Kid (the current default templating engine for TG) endorses Genshi. It seems like there is a lot of momentum behind it.
I will share my experiences with TurboGears or whichever framework I end up going with. Stay tuned!
Also, please feel free to correct me if any of my assumptions are wrong.
Trac and Subversion
August 04, 2007 at 12:10 AM | categories: Uncategorized | Comment
I finally got around to setting up trac on my server. While I was at it I upgraded to Python 2.5 and got mod_wsgi to work with trac.
Moved my subversion base to svn.lolrus.org and my trac base to trac.lolrus.org.
Anyways, I've been working on a little project lately which is a vectorized implementation of Conway's Game of Life.
You can check it out here
Translating Hard Copies of Documents for Lazy and Cheap Folks
July 31, 2007 at 10:50 PM | categories: Computer | CommentHere's a little background before I get into the tutorial. I'm studying abroad in Germany this fall and was sent a bunch a documents in German to fill out and return. My German is pretty bad, and these are documents I can't misinterpret else I'd probably mess things up and arrive and not have housing because I mailed something to the wrong address. My friend was in the same boat, so I did some thinking and came up with a solution:
- Scan hard copies to tif files
- Turn the images into text using OCR software
- Translate the German text into English. It didn't have to be perfect because I know a small ammount of German.
The first piece of software you need is scanning software. Hopefully you can set that up on your own. Make tiffs of all the documents you want to translate. Black and white, no compression.
Next, we need some OCR software. I tried GOCR first, but I had no luck. Then I came across Tesseract OCR that is mostly released by Google. It's open source, so I gave it a shot because it said it might work on OS X but didn't give any promises. Here's how to install it on OS X. It's super easy.
Download the source from here. I used 2.0. Extract it, and fire up a terminal.
Navigate to the source directory
cd Desktop/tesseract-2.00
Configure it and make it
./configure
make
sudo make install
Hopefully that went smoothly. Now you'll need language support for the language you're scanning. Download the language tar.gz langauge pack from the download page, and extract it. You will want to copy the contents of the tessdata fold that extracted to /usr/local/share/tessdata.
Run /usr/local/bin/tesseract (or tesseract if /usr/local/bin is in your path) in the terminal just to see if it installed properly. It should spit out some usage info.
Let's try running it on a file now. Since I used german my lang keyword is deu (so change this to your appropriate language). My files are also sequentially labeled OCRXX.tif. So run
/usr/local/bin/tesseract OCR01 1 -l deu
And if that succeeds, it will output to 1.txt, so you can make sure everything is okay by running
cat 1.txt
OS X outputs these files not very correctly if you open them in TextEdit.app so cutting and pasting them isn't advisable unless you have a better editor that supports UTF-8 (which is what I think the output files are in). What I did since I have some webspace is I uploaded all the text files to my server and then passed the url to the .txt file to google language tools and it displayed perfectly in my browser, translated and all.
Tesseract is good stuff, especially for the price (free).
Even lazier? Here's some bash code for you! Just save all your tifs in a single folder. I bolded the parts that you should change to suit your needs (changing the language).
for f in *.[tT][iI][Ff]*; do
out=`echo $f | sed 's/\\.[tT][iI][fF].*//'`
/usr/local/bin/tesseract $f $out -l deu
done
Now after running that you should have a bunch of text files. If you're even lazier and don't want to upload each one and send them through Google language tools you can use cat or something and just sent one of them.
I've had some issues with multiple columns in documents. You can just use a simple image editor, even Preview.app to crop and rearrange columns into a linear format to help the OCR software along.
I think that's all. The same methodology should work with other operating systems as well. You might need some MacPorts utilities installed. I didn't test without them. Sorry!
Magsafe, iPods, Cars, and Vinyl
April 06, 2007 at 01:24 AM | categories: Uncategorized | CommentSo... today started pretty good. Accomplished some great stuff at work. I got some stuff threaded in a half a day that my boss thought would take weeks. It scales alright too :). n-threads. word.
That's about all the good in my day. The macbook pro I use for work's power connecter (known as a magsafe connector) kinda stopped working and then melted and sparked a bit. They were nice enough at the Apple store to replace it even though the MBP was out of warranty (I don't think they really want to put up a fuss about something that could have started a fire)... and that was sweet because I don't have to file an expense report and it's a good story.
It gets worse. After I left the Apple Store I come back to my car and guess what? My window is smashed in and my iPod and GPS is gone. This is a really nice mall too. Like 5:00 pm. How random is that? It sucks a lot. Especially because I have glass all inside my car and no drivers side window.... and no iPod. Luckily I have a few CD's I can throw in my car.
Yeah that sucks. I got my new Clap Your Hands and Say Yeah album on vinyl today. I'm a little disappointed the first song, Some Loud Thunder, still sounds like not so good. Half of the album is solid. There's some songs that are just mediocre too. Am I disappointed? A little bit. The album was hella expensive because it had to be imported.
At least tomorrow is Friday.
California
February 15, 2007 at 01:27 AM | categories: Uncategorized | CommentEh, finally something good happened to me as far as getting a co-op is concerned. I got an offer from Intel today which means I will be moving to California in 3 weeks after finals (driving there). I will be there for 6 months.
Yup. No more snow for me this year! No more -15 degree weather. No more potholes. No more 8:00 am classes.
If things work out right I will only have to spend one more quarter at RIT. And by things working out right I mean going straight to Germany to study abroad for 5 months after my Intel internship. I won't be back for a year! Weeeeee. Rochester is cool and all in it's own way, but it's just not for me. I need a change of scenery.
So what am I going to be doing at Intel? It's a bit vague now, but I do know a few things. I will be working on a team that optimizes software for Apple. They look at everything from the high level algorithms to the low level assembly. I will be working on Mac's. And apparently, the second day I am there they are flying me to a conference in Phoenix, AZ, which I wasn't told much about.
Believe it or not, I don't have much to complain about, except for maybe a lonely Valentine's day, but not everything always goes your way.
Greasemonkey and Craig's List
February 11, 2007 at 02:02 PM | categories: Computer | CommentI've been searching for an apartment on Craig's List lately near where I am probably getting an internship.
A couple things I notices is that the google maps link on the pages often were bad because they used "at" instead of "&" and google maps likes the ampersand more it seems. Also, I always changed it to a direction search to a specific address. Inefficient, right?
I was bored this morning and I realized that this was a job for Greasemonkey. I'm not super good at javascript (because I never have to use it), but I hacked together a script that would turn the links to the google maps into a link to a link to directions to the location you defined in the script.
It's not super robust, but it does the job. Here's what you need to run it.
- Firefox
- Greasemonkey add-on for firefox
- My script
- You'll have to edit one line in the script where it says "Destination Here" and replace with a location (you pretty much have to search for the location once with google maps and paste the url) example:1+lomb+memorial+drive,+rochester,+ny
x86
January 23, 2007 at 11:48 AM | categories: Computer | CommentHeh, so this quarter is killing me... in every aspect except for my grades (yay for trying and getting A's for once).
Yesterday I started my second project for SysProg and it's pretty much text manipulation in assembly. Fun? Hell yes... if you're a masochist. Basically I sat down for 5 hours straight in the DSL lab and cranked out 300 lines of x86 assembly. That includes the learning curve of a new language and figuring out how to make system calls properly and getting file I/O to work and determining how I am storing my data and such.
I don't really like the keyboards in the lab, or the way the computers are configured (old version of vim, zsh, and such) and this is a project that you're more or less forced to work on in the lab. It's not all that bad, at least there are speakers for listening to tunes. Yeah, I am only 1/3 done with this project. It's so worth it though. I understand C and the x86 so much more now. Also, GDB rocks my socks.
« Previous Page -- Next Page »