The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.

Tuesday, May 20, 2008

Ruby on Rails Chron Job

This is just for reference RunnerScript

One option for running scheduled processes for a rails application.

see also HowToRunBackgroundJobsInRails

Monday, May 19, 2008

Free Rice

FreeRice.com

Just came across this site - a good idea and a great cause
Help end world hunger

From their website - http://www.freerice.com/about.html

FreeRice has two goals:

1. Provide English vocabulary to everyone for free.
2. Help end world hunger by providing rice to hungry people for free.

This is made possible by the sponsors who advertise on this site.

Sunday, May 18, 2008

MSSQL drop and re-add constraints

One of the guys at work hooked me up with this code - quite useful if you want to do a bunch of data inserts but don't want to worry about the order you apply the inserts because of foreign key constraints

Before performing data actions:
-- generate these and run
SELECT
'ALTER TABLE ' + so.NAME + ' NOCHECK CONSTRAINT ALL'
FROM sysobjects so
WHERE xtype = 'u'

After performing data actions:
-- generate these and run
SELECT
'ALTER TABLE ' + so.NAME + ' CHECK CONSTRAINT ALL'
FROM sysobjects so
WHERE xtype = 'u'

Thanks to ET for this code bit!

Wednesday, May 14, 2008

SnagIt promotional code (coupon) for $10 off

I have used SnagIt off and on over the past few years, usually with the trial version for a month here and there, finally broke down and got a license.
It runs $39.95 for single user - so I did a quick google search to see if any promotional codes were available and came across one - the promotional code SNUG will get you $10.00 off the standard price. The posting I found for this discount was from 2007 and it is now May 2008 so who knows how long it will be around?

SnagIt is a great tool - if you have never used it I recommend downloading the trial, best screen capture tool ever!

UPDATE 2009-01-07: the promo code SNUG expired on 2008-12-31, bummer; it was great while it lasted!

Saturday, May 10, 2008

Rolling Over Rails production.log file

Just came across this on a rails forum (post by Freezzo), rails production.log files can grow very large - but no chron job required - this is very handy.

config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 'daily')

where 'daily' can be 'daily' to 'weekly', 'monthly', '5mb', etc...

Python MVC web framework - web2py

Recently I did a google search for a Python MVC web framework. I have never done any coding in Python but it seems to be one of the primary languages used at Google and currently the only language supported on the Google App Engine so it seemed worth getting familiar with.

Django seems to be one of the most robust python mvc frameworks around at this time and I was going to dive in and create a small toy application with it, but then I stumbled across a comment on some blog that talked about the web2py MVC framework, still in it's infancy, development is very active on the project. It seems very easy to get up to speed with the framework and even someone who does not know Python can get a simple site up and running.

I love this graphic from one of the pdfs on the site

The feature list taken directly from the site
  • No installation, no configuration, no dependencies. All in one package. You can run it off a USB drive
  • Runs on Windows, OSX, Unix/Linux, and Windows CE phones.
  • Allows development, debugging, testing, deployment, maintenance and administration, including database administration, via the provided web interface.
  • Enforces good Software Engineer practices, like the Model-View-Controller design, validation and self-submission of forms.
  • Strong on security. Prevents the most common types of vulnerabilities: Cross Site Scripting, Injection Flaws, and Malicious File Execution.
  • Talks HTML, XML, RSS, ATOM, AJAX, JSON, RTF, CSV, WIKI, XML-RPC, REST, Flash, etc.
  • Dynamically and transparently generates SQL queries for you for SQLite, MySQL, PostgreSQL and Oracle. Even creates and alters tables for you when required. Performs automatic transactions.
  • Allows you to create apps easily, byte-code compile them, and distribute them in open or closed source under any license you like.
  • Faster then the competition, designed for small as well as large projects, includes the ability to upload/download/stream large files, internationalization support, distributed transactions, ...
Web2py is worth checking out!

.