Ok so I have really been slacking lately, but hey with school and work things are really crazy. Its been a crazy week, I was able to present at Code Camp last Saturday. It was a great experience to present to such a large group. While at Code Camp I was able to talk to and meet many great people,D’Arcy Lussier, Chris Sutton, and Javier Lozano among others. It was amazing the discussions that we had there. My talk went off good and had some great people in the session that contributed to the discussion even teaching me a thing or two.
Later in the day I went to a couple different sessions about MVC and .NET. The first one was put on by Chris Sutton, it was a second part to the introduction of Microsoft's MVC Framework for ASP.NET it was very interesting and brought me closer to understanding .NET by actually being able to implement a web application in the style I like to use.
The second session I went to was put on by D’Arcy Lussier, this was a very informational session as D'Arcy skipped the powerpoint and code examples and led us in a round table discussion of .NET, MVC, and general web application theories. It was nice to hear that I'm not the only one that feels that the ASP.NET framework has brought about a mass amount of developers that don't understand statelessness.
Here is my code and slide deck from Code Camp
Tuesday, April 08, 2008
Thursday, February 07, 2008
Installing ImageMagick and RMagick on OS X
I ran into a little problem the other day. I needed to use ImageMagick and RMagick to do some image handling in a system I am working on. So I busted out the "Rails Cookbook" from O'Reilly, and followed along with the directions of setting up my development machine. Part way through their tutorial nothing was working at all so I decided to look for some other directions on getting everything set up. I found some information leading me to believe that Mac Ports would be the best way to install both ImageMagick and RMagick. This turns out to be only half true, while ImageMagick works great from the Mac Ports install RMagick does not. The solution I found was to use gems to install RMagick. Word of caution once you install RMagick with Mac Ports it blows away all your gems. I have had to reinstall all of my gems including Rails 1.2.3. Take my advice with a grain of salt but this is what I had found out.
-CH
-CH
Tuesday, December 04, 2007
Its Beging To Look A Lot Like Christmas
So in my new diggs at least I can look out side and its snowing! I like snow cause then I can play with my snowblower. I know this sounds like a dorky thing but I actually like snowblowing and even mowing the lawn from time to time. But at least with snowblowing I can make a big mound of snow!
Monday, November 26, 2007
Office Remodel
So here I sit in a random cube across the office from where I usually work. The cube is a little different than what I am used to. My really old office used to be in a computer lab and when I transfered from UW-Stout to UW-Eau Claire we were working a room in the basement of one of the buildings. Then we got moved to a large cube were all of the students work in another building. In our new diggs they decided to build a wall now so we are scattered throughout the entire office area in random cubes. It's not bad working on my laptop because I am mobile, everyone else is crammed into one regular cube which is way to hot for me.
I have been working on a housing listing site and just started to implement the advanced search feature. I found that I had not handled all the edge cases in my tests. Have no fear its up and working and of course I have some code to show you.
Here it is:
-CH
I have been working on a housing listing site and just started to implement the advanced search feature. I found that I had not handled all the edge cases in my tests. Have no fear its up and working and of course I have some code to show you.
Here it is:
def self.search(params = {})
composed_cond = EZ::Where::Condition.new
cond_number_of_bedrooms = EZ::Where::Condition.new :properties do
number_of_bedrooms == params[:search][:number_of_bedrooms]
end
cond_min_price = EZ::Where::Condition.new :properties do
if !params[:search][:min_price].blank?
price >= params[:search][:min_price]
end
end
cond_max_price = EZ::Where::Condition.new :properties do
if !params[:search][:max_price].blank?
price <= params[:search][:max_price]
end
end
composed_cond << cond_number_of_bedrooms
composed_cond << cond_min_price
composed_cond << cond_max_price
@properties = Property.find(:all,
:include =>[:amenities, :utilities],
:conditions => composed_cond.to_sql)
end
-CH
Thursday, November 15, 2007
Elf List Goes Live
I really don't have much to say, but Elf List is live and ready for use. Its in the pre-beta release with features to arive daily. So check it out, http://www.elflist.net
-CH
-CH
Monday, November 12, 2007
Godfather on Wii
So time for another one of my reviews. Last week I finally picked up a copy of Godfather for the Wii on the recommendation of a friend. I really can't say more than this game rocks. I have had a great time playing it even though it has sucked me in for many hours already (as if I didn't have a million other things to do). So if your going to get it make sure you have a few hours of free time on your hands as the missions are completable but not overly hard making the game play very enjoyable from the start. Speaking of Godfather I better get back to my game.
-CH
-CH
Saturday, October 27, 2007
find or create by
So today I was working on a venture application I am trying to develop, when I cam across the need to only create a product if its not in the database. In this case I want to create the product only if the name of it is not in the database. While this is dangerous because of spelling but I am trying to keep it open for local (community) use. Slang terms may come up for one area so they need to be allowed. However I was having a difficult time looking at the pile of code for actually doing this.
So I found out about this method from someone in the rails chat on irc.freenode.net (there is always someone willing to help in that chat room.)
So now the product will be either found or created by the name of the product and if it is going to be created it adds the category_id just like a normal create.
Here is the test that proves this works.
-CH
if Product.find_by_name("spotted cow")
product = Product.find_by_name("spotted cow")
else
product = Product.create(:name => "spotted cow")
end
So I found out about this method from someone in the rails chat on irc.freenode.net (there is always someone willing to help in that chat room.)
Product.find_or_create_by_name( params[:product][:name],
:category_id => params[:product][:category_id],
:for => 'creation' )
So now the product will be either found or created by the name of the product and if it is going to be created it adds the category_id just like a normal create.
Here is the test that proves this works.
def test_find_or_create_by_name
assert Product.find_or_create_by_name("spotted cow",
:category_id => 1,
:for => :create)
assert Product.find_or_create_by_name("spotted cow",
:category_id => 1,
:for => :create)
assert Product.find_or_create_by_name("spotted cow",
:category_id => 1,
:for => :create)
assert Product.find_or_create_by_name("spotted cow",
:category_id => 1,
:for => :create)
products = Product.find_all_by_name("spotted cow")
assert_equal(1, products.length)
end
-CH
Friday, October 26, 2007
CVNUG (Chippewa Valley .Net User Group)
Last night I was able to explain the basics of Ruby on Rails to the .Net group that I belong to. It was really a great experience and was greatly received by the group. I was nervous about the response I would get initially from the group as some members of the Rails community come across as arrogant bastards.
The presentation when off with out a hitch thanks to the help of Brian Hogan (http://www.napcs.com/) who was there to answer questions and explain information more in depth as I demonstrated building a "Cookbook" application. I stripped down a version of Brian's cookbook tutorial and turned it in to a demonstration.
I want to give a shout out to CVNUG (http://cvnug.wi-ineta.org/) for letting me present to them the wonders of working with Rails. I would also like to thank Brian for helping me out with the presentation.
-CH
The presentation when off with out a hitch thanks to the help of Brian Hogan (http://www.napcs.com/) who was there to answer questions and explain information more in depth as I demonstrated building a "Cookbook" application. I stripped down a version of Brian's cookbook tutorial and turned it in to a demonstration.
I want to give a shout out to CVNUG (http://cvnug.wi-ineta.org/) for letting me present to them the wonders of working with Rails. I would also like to thank Brian for helping me out with the presentation.
-CH
Tuesday, October 23, 2007
Connecting to ms SQL from OS X
This one got me again today as I usually do not use SQL Server for my rails apps. I was having a hard time remembering the steps for updating my odbc connector for SQL server. Brian Hogan over at New Auburn Personal Computer Services has a great post on how to do this so check it out here:
http://www.napcsweb.com/blog/2007/03/08/15/#more-15
http://www.napcsweb.com/blog/2007/03/08/15/#more-15
Thursday, October 11, 2007
Rock N' Roll Jesus
I recently purchased Kid Rock's new album, "Rock N' Roll Jesus" So far I have really enjoyed this album. All I can really say is this is a great album and Kid Rock is keeping up his tradition of keeping the southern-rock-rap-country mix flowing. Like every other Kid Rock album it's going to be a main stay in my car and on my ipod!
Subscribe to:
Posts (Atom)