On a recent project I needed to test my application with lots of data so I remembered my good friend the Faker Gem from the Ruby world.
I didn’t know how to connect ActiveRecord to SQL Server, so I searched the webs and found this article by Ray Houston at Los Techies.
Unfortunately since the article was 13 months old, the Ruby libraries have evolved to not work that way anymore :) So after some head scratching I got it to work again.
How to connect ActiveRecord to SQL Server
- If you don’t have Ruby installed, grab the one-click installer from http://rubyforge.org/frs/?group_id=167&release_id=28426 and make sure you check the box to install rubygems.
- Open up your PowerShell or console, and run:
gem update ––system
gem install activerecord activerecord-sqlserver-adapter
*This should install all prerequisites gems as well. - Grab my example from github:
http://github.com/alexmoore/activerecord-with-sqlserver-example/tree/master - Run the CreatePersonTable.sql script to add the example table to your database.
- Open Config.rb and put your database connection info in.
- Run: ruby PersonFactory.rb and you should be golden!
In my next post I will show how to use the Faker gem and some statistics tricks to quickly mock up a plethora of test data.
-- Alex
So I've been following PDC this week as much as possible, and came across this gem on
Vance Morrison's Blog.
Slides for our All Day PDC 2008 talks on: Performance By Design
I recommend the Parallel Talk as it is more in depth than mine (they had more than 10 minutes for their presentation

).
Two things to take away:
- You can run your Garbage Collector on a separate thread:
EXE.Config <gcServer enabled="true" />
- Shared state is the enemy!
The ASP.Net slides are good too, and go into great length about caching and IISconfiguration.
-- Alex Moore
Here are the slides for my “Shallow Dive: PFX” talk, as promised.
http://www.slideshare.net/alexmoore/shallow-dive-pfx-presentation-695596
For the demos, I used the LINQRayTracer and C# Raytracer examples that come with the June08 PFX CTP.
If you have any questions about PFX or the slides, just email or twitter DM me.
Till next time,
Alex Moore
So I gave my 10 minute “Shallow Dive: PFX” presentation at CONDG tonight, and it went really smoothly. There were a lot of good presentations tonight, and it’s wonderful to see people in the development community giving back by doing these presentations, teaching, and inspiring people. I will post my slide deck this weekend, after I add some notes so readers can follow along.
I would like to give props out to Steve Horn for his JQuery presentation, and to Greg Malcolm for his Mono presentation. Great stuff!
I did stay up late last night and submitted a CodeMash perspective titled “Belly Flop: PFX”, hopefully it gets accepted. I would love to extend on this presentation to show more of the architectural and design implications of Concurrent / Parallel Programming, and I think CodeMash would be the perfect venue for this.
More to come soon…
-- Alex
Here are some links to help you get started with the Microsoft Parallel Extensions to the .Net Framework (PFX).
Starting Out
PFX CTP – Here are the latest CTP bits from June 2008. They come with a whole lot of good examples and good documentation to get you started.
MSDN Parallel Computing Dev Center – Plenty of white papers, videos, podcasts, and articles to get you started.
Channel 9 Back to Basics Series (RSS) – This series is just getting started but looks very promising as a resource for developers new to parallel and concurrent programming. It plans to cover Race Conditions, Deadlocks, Task Granularity, Load Balancing, and Data Locality.
Blogs
Joe Duffy (RSS) – Joe is one of the lead developers for the Parallel Computing Platform, and also just got done writing “The” book for concurrent programming in Windows and .Net. There is a lot of great information here.
Herb Sutter (RSS) – One of the great names in concurrent programming, a little more for the C++ crowd.
PFX Team Blog (RSS) – News and information straight from the horse’s mouth.
Books
Concurrent Programming on Windows, Joe Duffy – This is supposed to be “The” book about programming concurrently in Windows. I have personally bought the “Rough Cut” from Safari and can safely recommend it to anybody trying to learn about concurrent and parallel programming. It is divided into 4 section: Concepts, Mechanisms, Algorithms, and Systems, so there is fun for the whole family.
Videos/Screencasts
Channel 9 Parallel Extensions (RSS) – Great collection for learning all about the Parallel Extensions in and out.
Channel 9 Parallel Computing (RSS) – Focuses more on the whole of the Parallel Computing Platform movement.
I hope these resources can get you started into the world of Parallel/Concurrent programming.
-- Alex