Flash Upload Update for "A script in this movie is causing Flash Player to run slowly" Problem

Posted by: Matt Kull Sun, 22 Apr 2007 19:44:00 GMT

The last version of my flash multiple upload script would spawn an alert box containing the message “A script in this movie is causing Flash Player to run slowly” after the script had been open for 15 seconds. Even if the user chooses to let the script run, the window will pop up again every 15 seconds.

Flash Alert

This obviously is a huge problem, as many users will unknowingly abort the script. You can Read More about the issue through Adobe’s Technotes.

The fix was to add a dummy onEnterFrame event which refreshes the timer. I have updated my code here

The only update was to change how I initialized the movie in multipleUpload.fla, and to attach the onEnterFrame event handler.

import com.vixiom.utils.MultipleUpload

System.security.allowDomain ("*.localhost.com");
var uploadMovie = null; 

_root.onEnterFrame = function() {
    if (this.getBytesLoaded() / this.getBytesTotal() > 0.99) {
        uploadMovie = new MultipleUpload (this.files_dg, this.browse_btn, this.upload_btn, this.cancel_btn, _root.object_type, _root.object_id, _root.token);

        _root.onEnterFrame = function() {
            trace ("onEnterFrame called");
        };
    }
};

Posted in ,  | 3 comments

Rails Multiple File Upload

Posted by: Matt Kull Sun, 18 Mar 2007 20:02:00 GMT

For the photos feature on YourBarGuide I needed a way for users to easily upload multiple files at once.

Read on about the different options I looked at, and how I finally settled on a Flash upload widget

Read more...

Posted in ,  | Tags , ,  | 14 comments

Rails: How to regenerate file_column images

Posted by: Matt Kull Tue, 13 Mar 2007 03:49:00 GMT

The rails plugin file_column provides a simple method of handling uploading files. I am using it to store location “avatar” images. The image needs to be resized into several different versions, and file_column handles this nicely with one method call in my model.

file_column :image, :magick => { 
         :versions => { :square => "75x75!", 
                        :profile => "275x260" 
                      }
        }

However, recently requirements changed. I now needed an additional version of the image and change the sizes of the old versions.

Since file_column does not provide an out of the box method of regenerating the images, and I had several thousand records with images associated already I had a problem.

Read more...

Posted in ,  | Tags ,  | 2 comments

State of the Project Address

Posted by: Matt Kull Tue, 30 Jan 2007 05:00:00 GMT

And now for this year’s blog post…

YourBarGuide is coming along. Charlie has been working on a redesign, which is really coming out awesome. So many nightlife sites really do not put much effort into their design, and end up super cheesey, unusable, and graphically overloaded. The only “night life” site I have found which really has a clean design is the latest incarnation of philly2night their designers did a great job.

We are focusing on a something that is light weight with usability as main emphasis with a minimization of gaudiness. Here is a sneak preview of a portion of the new header…

YBG Header Preview

Two items are present in that header are indicators of what is new. An Events management system is in place, as is user-submitted photos. These features are currently available for testing. An Evite style Guest List system is still being being worked on for events and once that is complete all of the major features needed for launch will have been implemented. (they may be a little rough around the edges, but the core is there)

In other news the yourbarguide.com site is no longer public. Previously created accounts will get you access, if you would like access use the form on the beta splash page. The site will remain closed until the new design is in place and testing is completed.

Code-wise things have been going well, I have really enjoyed working with Rails. There is no way I could be close to this far along with the site using any other framework I am familiar with. The test will come when it comes time to make it perform.

In the course of development to date I have created several plugins which I hope to at some point clean up enough to release. Acts_as_picturable, acts_as_mappable, and acts_as_searchable. I don’t foresee that happening in the near future however, as the current priority is to get the site finished.

Posted in , ,  | 1 comment

Summer

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 , , ,  | 4 comments | 73011 trackbacks

SQL Server 2005 DTS (Integration Services) Woes...

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 ,  | Tags  | 7 comments | 3195 trackbacks

"Im Going" v1 complete

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 ,  | no comments | 1502 trackbacks

Ratings, Ratings, Ratings

Posted by: Matt Kull Fri, 14 Apr 2006 02:36:00 GMT

I’ve been trying to figure out how to handle “rating” different bars.

The end goal is have a very drilled down rating system whereby a user could see all of the top-rated sports bars; the top-rated beer bars; the cheapest bar with a good singles scene; etc.

My initial implementation was to have four fixed rating types using an AJAX “Star Rater”. (an ajax star rater is what sites like Netflix and Ajaxian use) I found a couple premade scripts, but ended up throwing them away and coming up with my own. You can see it in action on any location detail page

The problem is, different ratings only make sense for certain bars. IE Monk’s Is a belgian beer bar… it does really make sense to have a rating for “Dancing”. (in a different sense it actually does, the rating should be “n/a”)

My solution was to set it up such that bars have a many-to-many relationship with rating types. For instance now Finnigans Wake can have a “Dancing” rating and Monks can have a “Beer Bar” rating.

We’ll see how this pans out. Currently I have 22 different rating types. Putting all of these on one page would be way too cluttered. But I still need to figure out a way to present to the user why certain ratings only apply to certain bars.

Ok its 10:45, Thursday night, and I think I need to go do some “research” :D

Posted in , , ,  | no comments | 2022 trackbacks

Launch Redux

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 , ,  | 3 comments | 2458 trackbacks

YourBarGuide.com Soft Launch

Posted by: Matt Kull Mon, 10 Apr 2006 02:14:00 GMT

http://www.yourbarguide.com

Its up, finally :)

Its pretty plain looking, but lots of functionality under the covers. I need to find a designer.

Tons of work yet to do, but its at least at a state where people can start playing around and can start generating content.

The site is reaaally fast, for now at least. What a difference lighttpd makes. Its being hosted by OCS Solutions

no comments | 2191 trackbacks

Older Posts

Older posts: 1 2 3

eXTReMe Tracker