house9

random code and what not

Australia

just got back from a vacation in Australia, some things worth knowing
  • A pitcher of beer is a jug of beer
  • ketchup is sauce
  • standard hotel checkout is 10:00am
  • the people are nice, no worries!
The travel guides we used
more posts

Seriously we had a great time - Sydney, Brisbane, Cairns and Port Douglas


Rant: Exchange drives me crazy!

At work we have a QA Inbox where tons of emails generated by our application are sent, of course nobody ever takes the time to clear it out and even after numerous requests to the IT department to automatically purge anything older then a few weeks it always seems to be really full when I get around to testing some email functionality

This post is just a rant about one thing in particular I really do not like about Exchange and Outlook - why is it so hard to delete email? if exchange would just do this on the server it would save me a lot of time

so here we go - delete all of the ‘Older’ mail - and there is a lot

oh look not enough memory to delete all that mail? why don’t you just do the delete on the server, I don’t want to bring local copies of each of them and then delete them?

ok so we select a few thousand at a time, about 1 minute to delete say 2,500 emails - just guessing but there are probably like 10,000 COM+ calls being executed from my workstation across the network to the exchange server for this operation?yeah, so now select another couple of thousand emails - what ‘operation failed’ - doh! re-open that inbox and try again
so then here we are 36,000 emails deleted later - now we need to purge the Deleted Items



and look at that - only 40 seconds to purge 36,000 emails from the Deleted Items - I guess this part is ‘optimized’?



</rant>
.

Comments

Anonymous
AAAaaaaaargh!!!!!!
I totally agree with you… Deleting is somehow ‘optimized’ only in the Deleted Items…
It’s exchange for crying out loud… What the hell did we fork all that money out if it can’t do simple drop table queries… stoopid server

Your RSpec on Rails plugin is incompatible with your installed RSpec

just getting into rspec, after reading The Rails Way by Obie Fernandez, a very nice testing framework.

after installing the gems and plugins I ran into this error when trying to run my tests Your RSpec on Rails plugin is incompatible with your installed RSpec

a simple workaround, run spec from your local script directory

this one raises the error, because it is running from the ruby gems?
spec spec/models

this one does not raise the error because it is running the locally installed version
from your rails application root
script/spec spec/models
or make the output pretty
script/spec spec/models -fs

the install was as follows
gem install rspec (sudo gem install rspec, on some OS)
script/plugin install svn://rubyforge.org/var/svn/rspec/trunk/rspec
script/plugin install svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails

.

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.

Comments

bluesky
Another great charity site is AIDtoCHILDREN.com. It donates money to children in need through World Vision.

Check it out at http://www.aidtochildren.com

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!

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!

Comments

Asim Zeeshan
It is not working anymore, says the offer expired 12/31/2008 :(
Anonymous
Unfortunately this code expired on December 31st 2008. I just missed out!
Anonymous
Still works. You saved me $10.00.

Thank you.
Anonymous
Still works 12-31-2008
Anonymous
still works thanks as of 12-20-08
Anonymous
Still works today
Anonymous
Still working on Dec. 5é08
Anonymous
Still going Nov 26, 2008.
BillyG
Worked on 11/22/08.
Thank you!!!
SnagIt at 49.95 was a little hard to stomach, 39.95 better!!!
Blessings From The Cobbs
SNUG Still Worked On 11/18/2008. As soon as you enter SNUG, it says “Active” beside the box. Thank you so much for the code.
Abbra
Well written article.
Anonymous
still works on 11/5/2008
Anonymous
SNUG worked on 10/17/08 for $10.
Anonymous
Worked on 10/6 for $10 :)
House 9
Gary, the price of snagit went up to 49.95 with version 9, so the price of 39.95 does reflect the $10.00 discount
Gary
Just purchased Snagit using the Snug promo code, I received a message that I would get the $10 discount, however at billing I was still charged $39.95. I am sending a request for a refund to TechSmith. Even if I don’t get the discount, awesome product.
Anonymous
Not good on upgrade.
Anonymous
Does nothing for bulk buys of 5
Anonymous
Worked 24.09 :)
Anonymous
I just used the $10 off coupon and it worked as well.

I heart SnagIt forever!
Toby
Sept. 16, 2008 and “SNUG” still works. Got $10.00 off my single user license. :)
Anonymous
Still working on August 21st. BTW, SnagIt is a great tool.
Anonymous
Thanks so much - $10 off for SNUG promo code…08-08-08
Anonymous
… and it is still working as of August 8. Thank you for posting!
gwguruman
It did not work for me on my Upgrade Price that I had at $19.95 electronic only version.
Anonymous
Worked on July 30, 2008.
Leigh Brown Charlotte NC RE/MAX
Thanks so much-it worked!
Anonymous
Worked on 7/14/2008.
Anonymous
yeah, price went up, but SNUG still gave me $10 off. THANKS for sharing!
Anonymous
Still good, saved $10 with promo code SNUG. Thanks!
Peter Lubbers
Awesome, saved $10 today.
Note, however, that the regular price has gone up to $49.99 now…
Anonymous
Thanks, saved $10
Caroline
Thanks for the tip, saved $10 with Snug!
Anonymous
Yep, savid $10.00 with promotional code SNUG. Thanks!
Anonymous
Confirming. Saved $10.00 with SNUG.

Snuggles!
Dave
Thanks…I agree, it’s a great tool and you saved me $10.

Dave

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!

.

Comments

Anonymous
He’s found the right balance!

No, I am not affiliated with him, nor the university. I am just a user who is glad that I didn’t go down the “everybody is using __framework already so let me use that too” path.
kindablue2
I’m going to take a look. And btw - I like the credentials as well. A framework written by a CS Prof is more likely to embody the abstract qualities cherished in acadamia - this in my mind is a good thing. The problems start when the abstract conflicts with the practical - *good* frameworks find the right balance.
Anonymous
“Because the creator is a professor of Computer Science …”

Oh dear god. Being a computer science professor says nothing about your ability to design or implement a framework. Some of the worst programmers I’ve ever met have been computer science professors.

This might be an awesome framework (I’m skeptical, but I’ve not tried it), but if so it’s not because he’s a professor.
Gregor
It’s more than that … this is a step into a whole new world!

You may recall the recent release of the Google appengine, but what you may not know is: that platform will fundamentally change the way webapps are done, largely due to the Bigtable datastore and the banishment of the SQL-based relational database model to the realm of localhost, and eventually to the status of a horse-and-buggy.

What’s exciting about web2py is that you live in the browser all the time, and, because it’s written in python, it will integrate that much more quickly into the appengine domain.

Because the creator is a professor of Computer Science, you get all the good stuff boiled down to the essence of just what you need for webapp development.

Download it, run the tutorial, and you too will be hooked.

Komodo Edit - new text editor of choice for Ruby on Rails

Komodo Edit is my new text editor of choice for ruby and rails stuff. I use windows OS and have tried alot of different editors and IDEs; most of the IDE are too slow for my tastes and I have been using an alpha version of InType or NotePad++ for any Rails development.

This product is free and available from ActiveState. Note that there is also Komodo IDE which is a full blown IDE and is not free. I have not tested out that product but may in the future.

Go to http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml click the ‘Get Komodo Edit’ button, ignore the contact details form, it is optional and kind of annoying? Click Continue to download, there are versions for Mac, Linux and Windows.

After installing the MSI package I only needed to make a few minor tweaks to my preferences
First things first, create a new ‘Project’ (File -> New -> New Project), just point to one of my existing rails applications and save the kpf file in the root. Then I actually want to see the files so View -> Tabs -> Projects


And a few tweaks; get rid of that right hand edge line, not a big fan. Edit -> Preferences -> Smart Editing -> uncheck ‘Show edge line / Hightlight characters beyond…’ ok - i have been converted to the dark side so, Edit - Preferences -> Fonts and Colors -> select Dark from the Scheme, bump the font size to 12 and go bold - you will be prompted to give this new scheme a name


bada bing bada boom - we are good to go