Category: Code

jQtouch app not working on Android?

jQtouch app not working on Android? Try turning off useFastTouch. I had an issue where none of the navigation or interaction was working on a website I built using jQtouch and jQuery 1.7. I set useFastTouch to false and it took care of the problem.

Using YouTube’s image API to get higher quality images

I needed a higher resolution image back from YouTube for a site I am working on and after poking around YouTube’s API documentation and not finding what I needed I took a look at the HTML output.

Consider this video from my trip to Rome last year.

To get a small thumbnail you would use this line.

http://i.ytimg.com/vi/{video id}/{1-3}.jpg

To get back a higher resolution image you can use the following.

http://i.ytimg.com/vi/{video id}/hqdefault.jpg

Launch Maps App from PhoneGap

If you need to launch the maps application from a PhoneGap application you can do so by editing your AppDelegate.m file with the code below. If you’re not using ChildBrowser you can comment out the else condition.

Archived here for my own sake from the PhoneGap Google Group.

- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest: (NSURLRequest *)request navigationType: (UIWebViewNavigationType)navigationType { NSURL *url = [request URL];

if (![[url scheme] hasPrefix:@"http"] ||
    [[url scheme] isEqualToString:@"gap"] || 
    [url isFileURL] )
{ 
    return [super webView:theWebView shouldStartLoadWithRequest:request 
        navigationType:navigationType]; 
}
else
{ 
    ChildBrowserViewController* childBrowser = [[ChildBrowserViewController alloc] 
                                                initWithScale:FALSE]; 
    [super.viewController presentModalViewController:childBrowser animated:YES ]; 
    [childBrowser loadURL:[url description]]; 
    [childBrowser release]; 
    return NO; 
}

}

HTML5, CSS3, Microformats and Disqus

An older couple enjoys the view
I can add captions to photos

I spent the weekend updating this site to HTML5, CSS3 and Disqus in an effort to refresh things and learn more about the new technologies for work. I haven’t made any effort to test for IE compatibility yet, and I don’t know when I will.

I created this theme in 2008 so it needed a fresh coat of paint and the hope is that with this update I can move forward with a couple ideas I’ve had for a long time now. No pressure though.

I also updated my sidebar to support WordPress widgets and marked up my contact page with the hCard microformat.

some of the tools I used

Critique my code and design in the comments.

HTML 5′s “real deal” video player

  • update, 2010-02-03 – Tried it again this morning and had the same results. CPU spikes well over 100% and the UI is unusable.

John Gruber writes,

Seriously, this is the real deal — full-screen H.264 playback with no Flash, no browser plugins, full iPhone OS support, and sane CPU usage, better in every single regard than any video player ever made with Flash.

Have a look for yourself.

What I experienced is nothing like Gruber describes. I saw my browser lock up and my CPU usage spike and stay spiked while the video played. I sent it to Matthew and he experienced the same performance issues.

I look forward to better implementations and support from browsers. Better performance, real full screen, sharable implementations.

ReferenceError: Error #1065 re: E4X XML search

I was trying to do a simple E4X search of my XML for an attribute named “type” and I came across this error.

ReferenceError: Error #1065: Variable @type is not defined.

After ramming my head against a wall for around 30 minutes I asked Duncan if he ever saw such a thing. After all, other searches on the same XML were working perfectly. After some thought he remembered having a similar issue. Turns out that every node you are searching needs to have that attribute, in my case every node needed the “type” attribute.

Subversion merge cheat sheet

At the office we are responsible for managing our source code in Subversion. Since no one here is all that familiar with Subversion I had to do some research and bug Matthew to find out how to merge back and forth from trunk to branch.

This is a little cheat sheet that I added to our wiki as well.

svn merge

These are command line processes.

Merge a branch back to the trunk

  • From the branch, svn log –stop-on-copy, this returns the revision number where the branch began (XXXX)
  • From trunk, svn update which will return the last revision number (YYYY)
  • From trunk, svn merge -r XXXX:YYYY path/to/branch where XXXX is the branch’s revision and YYYY is the latest revision
  • Last but not least svn commit the changes back into trunk with a nice message

Merge from trunk to a branch

  • From the branch, svn log –stop-on-copy, this returns the revision number where the branch began (XXXX)
  • From trunk, svn update which will return the last revision number (YYYY)
  • From the branch, svn merge -r XXXX:YYYY path/to/trunk where XXXX is the branch’s revision and YYYY is the latest revision
  • svn commit

For both of these processes I have had more success going directory to directory, example merge the web directory and the src directory separately. Also be sure to svn update both the branch and the trunk to be sure you have the latest source code.

1172: Definition fl.video:VideoEvent could not be found.

I came across this error and am blogging about it so I won’t forget the solution and maybe it will help someone else.

1172: Definition fl.video:VideoEvent could not be found.

In order to access a number of the “fl” packages you need to have a component in your library. In this case I added the FLVPlayback component and all was well. Apparently you can use flash.utils.getDefinitionByName as well.

back to the top