Tuesday, December 30, 2008
Dilbert Share Point Web Part
http://www.nogeekleftbehind.com/2007/11/21/download-daily-dilbert-web-part-for-sharepoint/
no share point portal is complete without it!
Saturday, December 6, 2008
Rails 2.1 and 2.2 documentation
Ruby on Rails guides at http://guides.rails.info/
Saturday, November 1, 2008
Calling rake tasks from another rake task
Rake::Task['task_name'].execute
A rake task to rebuild the development database
desc 'drop, create and rebuild development db' task(:rebuild_development_db) do puts "drop the db" Rake::Task['db:drop'].execute puts "create the db" Rake::Task['db:create'].execute puts "run the migrations" Rake::Task['db:migrate'].execute # do other stuff... end
Resources
Thursday, October 23, 2008
Obama for president
Sunday, October 19, 2008
Assembla to start charging for all private services
they do offer a great service and the fact that it has been free up until now has been really great!
I can understand why they need to start charging and it still seems very reasonable,
but it would be nicer if it was based purely on disk space instead of per project
read more here
Saturday, October 18, 2008
ActionView::TemplateError uninitialized constant
I just made a silly mistake which was generating this error; I have a Literals class in my Ruby on Rails application that has some strings stored as constants, everything was working great until I put this code on a server (Linux) didn't have any issues on the mac or windows machines before deploying
turned out to be so simple...
I originally named the file Literals.rb which defined the class Literals
the fix: rename Literals.rb to literals.rb
- doh!
Thursday, October 16, 2008
GE Microwaves are junk
Running Scripts on windows cscript vs wscript
Saturday, September 27, 2008
scRUBYt
Sunday, August 24, 2008
Buy.com and Google checkout doesn't work
I select 3 items, each with free shipping, select check out, select Google Checkout and I am presented with shipping costs none of which says 'Free'
I've used Google checkout a few times before without issue and I've ordered from buy.com before without issue, but after wasting my time with 'false advertising' - no more
I guess I'll go order my stuff from Amazon instead.
Saturday, August 2, 2008
Archipelago Studio Apartments Port Douglas Australia
Archipelago Studio Apartments Port Douglas Australia
72 Macrossan Street, Port Douglas, QLD 4877, Australia
http://www.archipelago.com.au/
This place was great! Port Douglas is great!
Next to the door is an electric burner not as nice as cooking with gas but good enough to cook in, if you like
Walk outside the apartments, turn to your left, yes! that is the ocean and the start of four mile beach just a few hundred yards from the apartments
Coral Tree Inn Cairns Australia
Coral Tree Inn Cairns Australia
166-172 Grafton St Cairns North, QLD 4870, Australia
http://www.coraltreeinn.com.au/
Hotel George Williams YMCA, Brisbane Australia
Hotel George Williams YMCA, Brisbane Australia
325 George Street Brisbane, QLD 4000, Australia
http://www.hgw.com.au/
View Larger Map
Medina Grand Harbourside Sydney Australia
Medina Grand Harbourside Sydney Australia
55 Shelley St, King Street Wharf, Sydney NSW 2000
http://www.medina.com.au
View Larger Map
Great place to stay, we didn't get a harbour view but it was very pleasant, full kitchen, in room washer and dryer - it was not cheap but no accommodation in Sydney is?
Wednesday, July 23, 2008
Australia
- A pitcher of beer is a jug of beer
- ketchup is sauce
- standard hotel checkout is 10:00am
- the people are nice, no worries!
more posts
- Medina Grand Harbourside Sydney Australia
- Hotel George Williams YMCA, Brisbane Australia
- Coral Tree Inn Cairns Australia
- Archipelago Studio Apartments Port Douglas Australia
Seriously we had a great time - Sydney, Brisbane, Cairns and Port Douglas
Friday, June 20, 2008
Rant: Exchange drives me crazy!
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>
.
Sunday, June 8, 2008
Your RSpec on Rails plugin is incompatible with your installed RSpec
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
.
Tuesday, May 20, 2008
Ruby on Rails Chron Job
One option for running scheduled processes for a rails application.
see also HowToRunBackgroundJobsInRails
Monday, May 19, 2008
Free Rice
Just came across this site - a good idea and a great cause
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
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
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
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
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, ...
.
Saturday, May 3, 2008
Komodo Edit - new text editor of choice for Ruby on Rails
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
Thursday, April 24, 2008
Update: FireFox and multiple cookies for the same site
so I did some more googling and now using this technique
Initial Setup
- close all instances of firefox
- Start -> Run -> firefox.exe -ProfileManager
- create 5 or so profiles, I named them p1 - p5
Then when you want to use different profiles launch each one from the command line
- Start -> Run -> firefox.exe -P p1 -no-remote
each profile is totally distinct (history, cookies, etc...), only issue there does not seem to be an easy way to tell which profile you currently have open, I think I can live with that
Sunday, April 20, 2008
NAnt build with TFS changeset as revision number
- deletes the CommonAssembly.cs file (linked to all projects)
- uses the nant asminfo task to recreate the CommonAssembly.cs file, but after we query TFS for the changeset (revision) number which is used in the version number
- build the solution in release mode using the ide.exe (there are other - better ways, but this one works)
- xcopy files to C:\temp\{app} and clean up all the source files
basically I just put together a few bits that I found on other blogs (should have saved the urls - doh!), most were related to using svn for source control and then I added in the code block for the c# stuff to query TFS.
A quick note about the linked CommonAssembly.cs file, visual studio has an option when you are adding an existing file to a project to select 'linked', click the arrow on the 'Add' button when you select your existing file
what this script does not do - get latest from TFS, I usually do that part manually or from ccnet
the c# bit that goes in the nant script block above
NOTE: see updated version of this code block
nant is awesome!
FireFox and multiple cookies for the same site
In the past I tried to find a solution for FireFox, but always came up short. Well today I did a google search and came up with two different ones!
both are FireFox extensions
after a quik spin with both I am liking CookieSwap better
With CookiePie you right click on the individual tab to toggle seperate cookie sessions on or off; just didn't have good luck using it the way I would do stuff with IE
With CookieSwap you right click in the lower right hand status bar area of FireFox and can toggle between named profiles (default is Profile1, Profile2, Profile3) - this worked right out of the box as I would expect!
Monday, March 3, 2008
'vincent-vega' is now 'The Tarantino Project'
Monday, February 18, 2008
Saturday, February 16, 2008
Rails like migrations in the .NET world
There are a few ports of rails migrations to the .NET world (that's where I spend alot of my time). I have not used any of these for 'real' but I have 'sampled' them. They all look promising but it seems like there is not very much activity on these projects.
Migratordotnet
http://code.google.com/p/migratordotnet/
RikMigrations
http://www.rikware.com/RikMigrations.html
SubSonic Migrations
I don't know if they ever did incorporate this into the official release of sub sonic? maybe it will come in a future release
http://blog.wekeroad.com/2007/10/03/subsonic-migrate-me/
I recently stumbled across vincent-vega and have begun using it on a small project and am planning to incorporate it into some of our larger applications. It is an Nant task that handles database versioning. It is not a migration in the same way as the other solutions as it uses actual sql scripts for all schema changes instead of c# code, which makes sense to me!
Vincent-Vega
[update 2008/10/14]
vincent-vega is now part of the tarantino project.
http://code.google.com/p/tarantino/
Thanks for the heads up Dan!
[/update]
Rhino.Mocks basics
http://house9-code-samples.blogspot.com/2008/02/rhinomocks-basics.html
The official Rhino Mocks Documentation is very good and available here
http://www.ayende.com/Wiki/(S(33lpuuuz4itdtnjwlncidy55))/Default.aspx?Page=Rhino+Mocks+Documentation
Rhino.Mocks - the basics
using
using Rhino.Mocks;
The mock repository
// use the mock repository to create the mocked objects MockRepository mocks = new Rhino.Mocks.MockRepository(); // example System.Object someObject = mocks.CreateMock(); // set up the behaviour you want from calls to your mocked object Rhino.Mocks.Expect.Call(someObject.Equals(someParameter)).Return(false); // then don't forget mocks.ReplayAll(); // now do stuff that calls your mocked object Equals method ...
Mock a call to the db
// create our mocked repository object - IProductRepository, the real one calls the db IProductRepository repository = mocks.CreateMock(); // tell rhino.mocks when we call the method GetProduct with the argument 33 to return null Rhino.Mocks.Expect.Call(repository.GetProduct(33)).Return(null); // get the mocking ready mocks.ReplayAll(); // pass our mock to our product service layer ProductService service = new ProductService(repository); // service.GetProduct makes a call to the mocked repository.GetProduct which will return null IProduct product = service.GetProduct(33); // should be null Assert.IsNull(product);
Ignore any arguments
// any call to GetProduct will return null no matter the value of the arg Rhino.Mocks.Expect.Call(repository.GetProduct(null)).Return(null).IgnoreArguments();
mock a method that returns void
IProduct product = new Product("003092", "Sierra Nevada", 6.49); // this void call will handle our product 003092 Rhino.Mocks.Expect.Call(delegate { repository.Save(product); }); // this void call will handle any argument Rhino.Mocks.Expect.Call(delegate { repository.Save(null); }).IgnoreArguments();
Handle multiple calls to the same method
IProduct product = new Product("003092", "Sierra Nevada", 6.49); // note the .Repeat.Any() Rhino.Mocks.Expect.Call(repository.GetProduct("003092")).Return(product).Repeat.Any(); // send the mock to our product service object ProductService service = new ProductService(repository); // find by sku calls GetProduct on the mocked Product repository IProduct beer = service.FindBySku("003092"); // find decent beer calls GetProduct on the mocked Product repository also IProduct decentBeer = service.FindDecentBeer();
Partial Mock
// create a partial mock with constructor args (our product repository again) IProductService service = mocks.PartialMock(repository); // our test case data IUser loggedOnUser = new User("John", "Doe", CustomerType.Gold); // mock product service calls to GetLoggedOnUser Rhino.Mocks.Expect.Call(service.GetLoggedOnUser()).Return(loggedOnUser); // get the mocking ready mocks.ReplayAll(); // now GetDiscount is not a mocked method but it does call the mocked GetLoggedOnUser method decimal discount = service.GetDiscount(); // assert the result Assert.AreSame(44.4M, discount, "Gold customer discount not correct?"); // NOTE: this will not work (compile) unless the mocked method GetLoggedOnUser is public
SyntaxHighlighter and Google Blogger
- Download the SyntaxHighlighter javascript and css files from http://code.google.com/p/syntaxhighlighter/
- Upload those to my googlepage website, if you don't have one go to https://www.google.com/accounts/ManageAccount and click on the 'Page Creator' link
- Edit the blog template -> Layout -> Edit Html
- Add the references to the css and javascript files in the head section
- Add the initialization javascript calls right before the /body tag at the end of the html template
- see http://morten.lyhr.dk/2007/12/how-to-get-syntax-highlighting-in.html
- then use pre tags like this around your code pre class="c-sharp" name="code"
- see http://code.google.com/p/syntaxhighlighter/wiki/Usage
One issue I ran into was that the google blogger automatically adds br tags where newlines appear in any content - makes the code pretty much unreadable, but the fix is well documented and easy to implement - http://code.google.com/p/syntaxhighlighter/wiki/BloggerMode
Sunday, January 6, 2008
mssql reporting services - logs
{drive}\Program Files\Microsoft SQL Server\{instance}\Reporting Services\LogFiles