Posted by: Matt Kull
Thu, 13 Jul 2006 04:07:00 GMT
Summer is halfway over, unbelievable.
Time has been flying by. Between the nice weather, shore house, and work being extemely busy I haven’t spent much time on here or on ybg. At work we are wrapping up footballfanatics.com, the big asp.net/c# ecommerce site mentioned before. It has been a lot of work, but I have learned a ton and theres some cool stuff done which I will blog about soon.
Lately I have been burnt out on ybg and other side projects, after a long day of coding at work its tough to come home and get back at it. I’m trying to get over that though.
I have made some progress on the Flickr integration, not going to make any promises when that will be up though. In other areas I have been messing with Pl/SQL and finally got my distance calculations going.
I ended up using the “Haversine” forumula and created simple Pl/SQL function that calculates the distance between two sets of longitude and latitude. Could probably be tidied up a bit but heres my first go at it that works.
CREATE OR REPLACE FUNCTION distance
(
lat1 decimal,
long1 decimal,
lat2 decimal,
long2 decimal
)
RETURNS decimal AS $$
DECLARE
r decimal := 6371; -- earth’s radius (mean radius = 6,371km)
rLat1 decimal := degreesToRadians(lat1);
rLat2 decimal := degreesToRadians(lat2);
rLong1 decimal := degreesToRadians(long1);
rLong2 decimal := degreesToRadians(long2);
dLat decimal := rLat2 - rLat1;
dLong decimal := rLong2 - rLong1;
a decimal;
distance decimal;
BEGIN
-- "Haversine" Formula
a := sin(dLat/2)^2 + cos(rLat1)*cos(rLat2)*sin(dLong / 2)^2;
distance := r * 2 * atan(sqrt(a) / sqrt(1-a));
-- Spherical Law of Cosines
-- distance := acos(sin(rLat1)*sin(rLat2)+cos(rLat1)*cos(rLat2)*cos(rLong2 - rLong1)) * r;
RETURN distance * .62; -- convert to miles
END;
$$ LANGUAGE plpgsql;
That code uses a simple degree to radian conversion function
CREATE OR REPLACE FUNCTION degreesToRadians
(
degrees decimal
)
RETURNS decimal AS $$
BEGIN
RETURN degrees * (pi() / 180);
END;
$$ LANGUAGE plpgsql;
First use of this will be to show “Other bars in the neighborhood” when looking at a bar detail page.
Posted in Web Dev, .NET, General BS, yourbarguide.com | 4 comments | 73011 trackbacks
Posted by: Matt Kull
Wed, 10 May 2006 22:04:00 GMT
So apparently embedded text qualifiers are not supported in SQL Server 2005 yet when attempting to import data from a flat file.
I really hope I am wrong, but myself and another developer spent the better of an afternoon debugging this.
Heres the really simple test case which demonstrates the breakage:
Create a dummy table to import into, lets pretend it’s called “test” with two varchar(50) columns named test1 and test2.
Now create a dummy data import file (just a .txt file) with the following contents….
“this”,”is ok”
“even “”this”” works”,”12”“x18”” Print”
Now in MSQL Management Studio right click on your database name and hit import data. Set your data source to flat file, and enter your text qualifier as a double quote (“).
Hit next and you should see a warning about embedded text qualifiers… and then upon executing the procedur You will see the error:
Error 0xc0047038: Data Flow Task: The PrimeOutput method on component “Source - test3_txt” (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. (SQL Server Import and Export Wizard)
Importing the exact same file on SQL Server 2000 runs without a hitch.
Pretty lame Microsoft, you would think this would have been fixed by SP 1.
Posted in Web Dev, .NET | Tags sql2005 | 7 comments | 3195 trackbacks
Posted by: Matt Kull
Tue, 25 Apr 2006 04:01:00 GMT
Things have been going good, albeit slow. The past weak has been spent doing minor tweaks and finishing up version 1 of the “I’m Going” feature.
You can currently schedule dates / times you are going to bars, through a slick but ugly lightbox / ajax interface. You then get an itinerary on your profile which you can edit. The highlight of this is, is that by copy pasting a small piece of javascript onto your blog or website you can get an events feed of all of the Events you have subscribed to. See it in action on my sidebar. Still haven’t worked out the best way for users to customize it any way they want.
I started out using IFrames. I hate frames. Ended up switching to a method I stole off of flickr. Basically I created an action on my server “Badge” which outputs plain javascript “document.writes”. For example, here is the “Badge URL” for my account. http://yourbarguide.com/im_going/badge/1
The output of those document.writes will be displayed anywhere a user adds <script src=”mybadgeurl” type=”text/javascript”> to their document. Simple, and it works. See it in action on my sidebar.
The next step for “Im Going” is to clean up the way you choose a date you are going, I am going to use a calendar display for this. Also need to let users see who else is going to a particular event.
Posted in Web Dev, yourbarguide.com | no comments | 1502 trackbacks
Posted by: Matt Kull
Wed, 12 Apr 2006 04:18:00 GMT
Its been 3 days since the http://www.yourbarguide.com has been up and thus far things are going great.
Frankly I’m pretty surprised I was able to get it up. I, like most developers suffer from “just one more thing”. Theres a never ending list of features to add and things to polish, the important part is to realize what counts now, and what can be visited again later.
I actually made a list, on paper of the features I wanted on the site. I then scrubbed every feature that I felt wasnt absolutely necessary to get the site launched, and stuck to it. (well not really, if i did completely the site would have been up by christmas….)
Even though its still in pretty rough shape the feedback I have gotten has been invaluable. As was expected, tons of bug fixes, tweaks, and feature ideas were generated. But more importantly it has been a huge motivator.
It’s been a lot fun too. I have launched plenty of sites before, but never one that was completely developed by me and of this nature. I feel like a little kid with his ant farm.
Posted in Web Dev, General BS, yourbarguide.com | 3 comments | 2462 trackbacks
Posted by: Matt Kull
Tue, 28 Mar 2006 04:25:00 GMT
Trip to Jacksonville last week went great. We kicked off a big new ecommerce project, which I am pretty excited about.
Without getting into too much detail, the client has reached the limits of their legacy architecture and is bringing us in to deliver the scalability they require.
The site does a ton of traffic, over 1.5m page views a day. The new system is being built in ASP.Net 2.0. We hope to cut the amount of hardware they need by over half. (they are using a lot of hardware on their current site)
Project has a pretty short timeline though, go-live is set for the begining of July… going to be a busy 3 months.
Should be a very interesting projec, finally will be an excuse to play with some load / performance testing tools.
Posted in Web Dev, WebLinc, .NET | Tags asp.net, ecommerce | 4 comments | 1663 trackbacks
Posted by: Matt Kull
Wed, 15 Feb 2006 03:29:00 GMT
It was announced today that Measuremap was bought out by Google.
This is especially interesting because it never even got out of a closed alpha test.
I signed up for the service a couple weeks ago, I never got an invite to try it out though. Basic jist of it that I got was blog hit and stat tracking on steroids.
Measuremap was being created by the folks at Adaptive Path (remember them? these are the same guys that cointed that damned AJAX term which helped jumpstart all this “web2.0” business)
This is also the first big buyout of a ruby / rails based application I’m aware of. Too bad they didnt disclose the price… Any guesstimates?
People may be surprised Measuremap was bought this early, but I think it makes a lot of sense. The Adaptive Path guys don’t have to worry about competing with the powerhouse that is google analytics (urchin), and google gets some great talent at (what I assume was) a reasonable price.
Read about it here…
Posted in Web Dev, Ruby / Rails, Random | Tags buyout, google, measuremap, rails | no comments | 1346 trackbacks
Posted by: Matt Kull
Mon, 13 Feb 2006 05:14:00 GMT
A common need in ybg
is the ability to be plot different models (users, bars, restaurants, neighborhoods) on a map.
I think this common functionality would be useful as a rails plugin and I am working on packaging it up into a new plugin called acts_as_mappable.
The goal of this plugin is to abstract away grabbing an address and retrieving geocode information. I’ll see if I can fit in distance calculations also.
Posted in Web Dev, Ruby / Rails, yourbarguide.com | Tags acts_as_mappable, plugins, rails | 9 comments | 1624 trackbacks
Posted by: Matt Kull
Mon, 13 Feb 2006 04:55:00 GMT
For the past couple of months I have been working on a social neworking / location based vertical search engine. (hooray for buzzwords)
Theres lots of social networking sites out there (myspace, friendster, facebook, and the newest contender tagworld). Examples of vertical search based sites would be tripadvisor or citysearch
What I envision is something along the lines of myspace meets citysearch meets imdb.
The site is not ready for public consumption yet, but within the next couple of weeks an early stage prototype will be up.
Posted in Web Dev, Ruby / Rails, yourbarguide.com | Tags rails, yourbarguide | no comments | 6961 trackbacks
Posted by: Matt Kull
Sat, 04 Feb 2006 21:31:00 GMT
Getting my rails sites up and deployed with lighttpd took a bit of time and research.
Lighttpd: The painless way is the essential guide and is just plain awesome. These tidbits here are mainly for my own reference, but they may prove useful.
With a bit of mucking around, I was able to get multiple rails apps on multiple domains hosted on my one textdrive account.
These are the steps I took…
Read more...
Posted in Web Dev, Ruby / Rails | Tags hosting, lighttpd, rails, ruby, textdrive | no comments | 52786 trackbacks
Posted by: Matt Kull
Fri, 03 Feb 2006 18:51:00 GMT
There is no built in equivalent in ActiveRecord to Hibernate’s Query By Example
Basically, Query By Example lets you create an object, set the fields on the object, and then query the database by providing that object as an example.
This is especially useful in a search situation, lets say I want to search on the attributes of a person. Person has a firstname, lastname, address, and lots of other searchable fields. Rather then having to worry about dynamically generating the SQL, I simply instantiate a person object, set the fields I want to search by, and use that object as my :conditions.
Heres a good base block of code to work off of…
Read more...
Posted in Web Dev, Ruby / Rails | 3 comments | 858 trackbacks
Older Posts