The Archives

SEARCH

Windy City Rails

WindyCityRails - September 11, 2010 - Attendee

Archive for April, 2010

Adding Another Piece to My Mac-universe?

Posted in: Family, Home by Steve on April 23, 2010

ipadSo after getting my first Macbook, I am again considering adding another Apple product.  This time, it’s not just for me.

The iPad looks like a wonderful device.  I can see myself using it for the web and email quite frequently on the couch and with my son (2 years old already, wow).  The app store would be wonderful for getting game for him to play.  We would be able to play videos and music for him in the car.  We are also embarking on a vacation soon and he is going on his first airplane ride. 

I am looking to minimize the inconvenience for all parties involved, including my son.  I would like to keep his attention for more than an hour watching the Muppet Show or Clone Wars and not thinking about the fact that he is flying.  The pressure changes are going to be hard enough.  Between any apps that I get and the videos, I’m hoping that instead of bringing my laptop, the iPad will be easier to bring with on the trip and take less room. 

I’ve searched and found a few toddler apps on the store, but since I don’t have an iPod or iPhone, this will be my first experience with the app store.  What apps to people with kids install?

I am still mulling over this idea, considering every bullet point before pulling the trigger.  If you have any suggestions, I’m willing to hear them.

SQL Query Madness

Posted in: Programming by Steve on April 15, 2010

I would consider myself to be pretty good with database design and queries, but this one has me stumped.

Our application allows administrators to add “User Properties” in order for them to be able to tailor the system to match their own HR systems.  For example, if your company has departments, you can define “Departments” in the Properties table and then add values that correspond to “Departments” such as “Jewelry”, “Electronics” etc…  You are then able to assign a department to users.

Here is the schema:

image

In this schema, a user can have only one UserPropertyValue per Property, but doesn’t have to have a value for the property.

I am trying to build a query that can use the PropertyValues as the filter for users.  My query looks like this (SQL Server 2005):

SELECT UserLogin, FirstName, LastName
FROM Users U
LEFT OUTER JOIN UserPropertyValues UPV
	ON U.ID = UPV.UserID
WHERE UPV.PropertyValueID IN (1, 5)

When I run this, if the user has ANY of the property values, they are returned.  What I would like to have is where this query will return users that have values BY PROPERTY.

So if PropertyValueID = 1 is of Department (Jewelry), and PropertyValueID = 5 is of EmploymentType (Full Time), I want to return all users that are in Department Jewelry that are EmployeeType of Full Time, can this be done?

I’m not sure how this can be accomplished without building dynamic SQL, so I thought I would throw this out to see what I could find.


UPDATE:

I posted this question on StackOverflow to see if there are any more ideas

http://stackoverflow.com/questions/2647570/where-clause-on-joined-table-used-for-user-defined-key-value-pairs

My First Rails Application

Posted in: Programming by Steve on April 2, 2010

After CodeMash, I decided it was time to see what the hubub was about with rails, so I picked up a Mac, a few books and a lot of beer.  The result is my first website built using rails and Heroku.  There’s not much to it right now other than my resume, but I’m looking at building a contact form as well.   So it’s not much of an application other than an HTML page rendered using rails, but at least it’s the start of something new.

stephenwright.name

stephenwright.name

 

Here’s to learning more in the coming months!

I’ve embarked on a new career

Posted in: General by Steve on April 1, 2010

I have decided that programming is no longer a viable career, so I have decided to being mentoring under Eduard Khil: