Web Tech Studios

Web Tech Studios is a company I created to cover the work I do in my spare time. The focus of the company is providing custom solutions for clients. We will also supply free Firefox add-ons. For the add-ons we are asking for donations to cover the development cost.

After much trial and error the website for my company “Web Tech Studios” is now live. Please, look it over and let me know what you think. You can also follow me on twitter @webtechstudios.

The Muppets: Ringing of the Bells

Absolutely hilarious.

Diamond in the HTML “Rough”

KwiClick Search CloversFor the latest version of KwiClick we introduced a feature called search clovers. When you highlight a word on a page, a single diamond shaped “clover” appears. When you hover over the diamond, 3 more diamonds appear creating a 4 leaf clover configuration. To create these diamonds we use two html tags, an img surrounded by a div. Clover OverlapIn Firefox versions prior to 3.5 we used a background image on the div to create the look of a the diamond. The corners of the images overlapped each other causing problems when a user tried to hover or click on one of them.

Continue Reading »

My Mom’s on Facebook

Although my mom isn’t yet on Facebook, there are enough other relatives that it makes this video hilarious. It’s not like my posts were exactly R rated before, but you do really have to think about who you are friends with before you make a post. This is dedicated to my recent post :)

Caching Parsed Django Templates

Standard Django rendering parses a template every time it is rendered. Storing the parsed template can be a nice little speed up for your Django site. This code snippet does a great job of doing that for all templates. One drawback to this approach though is that the server needs restarted whenever a template changes. I’ve taken a slightly different approach to this where I create a separate method for caching and rendering templates. I only call this when rendering several templates in a view and the speed up is absolutely necessary. Some places you might consider doing this is when sending out bulk emails or when rendering a long list of objects and each object uses the same template.

First create a file called template.py in your application. Then we create a method that will cache a template when called and return the rendered template.

from django.template import Context, loader

template_cache = {}
def render_cached(template_name, dictionary=None):
    global template_cache

    t = template_cache.get(template_name, None)
    if not t or settings.DEBUG:
        template_cache[template_name] = t = loader.get_template(template_name)

    dictionary = dictionary or {}
    context_instance = Context(dictionary)
    return t.render(context_instance)

This method takes two arguments the template name and a dictionary to use for the template context. It first gets the template out of the cache. It then looks if the template was retrieved or if your debug setting is on. If either of these cases exist, it uses the base django loader to retrieve the parsed template and store it in the cache dictionary. Then we create a context instance for the dictionary and return the rendered code.

To be able to use the method you just import and call it.

from template import render_cached
html = render_cached("sometemplate.html", {})

KwiClick 2.4.1

KwiClick 2.4.1 was released on AMO this week. This is a pretty large update from the last AMO release so make sure to check it out. Here is a list of what is new in this release:

  • New Search Clovers for selection based searching functionality
  • Updated Bing provider
  • Updated compatibility for ff 3.6betas
  • Improve sqlite performance
  • Trim leading and trailing spaces from searches to improve accuracy
  • Updated kwiclick skin
  • Replace getBoxObjectFor with getBoundingClientRect
  • Clover preferences to fine tune functionality
  • Turn on/off clover from statusbar button
  • Updated wikipedia provider increases accuracy of searching and results

Here is the video for the 2.4 release which was submitted to the extend firefox contest. This is a pretty good explanation of the things you can do with KwiClick.

Halloween Prank Gone Too Far

Halloween is not just for treats, it’s about tricks too. Most everybody I know loves a good Halloween prank, there are even sites dedicated to them. Today in my hometown was an example of Halloween pranks gone too far. The Indianola high school is closed today because vandals damaged the radiators on 14 buses last night. You can read more about it here. My Facebook feed has been consumed with the news today. Not only does this disrupt peoples schedules, having to find last minute baby sitting, etc… but the day will have to be made up at the end of the year. That’s not to mention the cost of parts for the buses and the overtime paid to repair them.

I feel sorry for the parents of the kids that did this. If the vandals are caught, what do you think is an appropriate punishment?

Yip Yip Martians tries Gangsta Rap

Another one of those videos that combine my two favorite things. Sesame Street and Gangsta Rap. You all know how much I love mashups, so here is another good one for you.

FAIL: libIDL on Mac OS X 10.6 (Snow Leopard)

Since I upgraded my laptop to Snow Leopard, I’ve been trying to setup my development environment so that I can compile idl files. I need to do this for one of the Firefox extension I work on. I’ve been able to put this off for a while since my interfaces haven’t changed in a while. I’ve recently changed an interface so now I need to get the idl compiling setup. When I’ve set this up in the past, I haven’t had any problems. I install the gecko sdk, install libidl, and I’m ready to roll. This time I can’t make it work so I’m turning to you, the interweb, to help me figure this out. Here is what I’ve go so far.

I install the Gecko 1.9.1 SDK from developer.mozilla.org. I then install libidl using the following commands in MacPorts:

sudo port selfupdate
sudo port sync
sudo port install libidl

Now, when I run my build script I get the error:

     [exec] dyld: Library not loaded: /opt/local/lib/libIDL-2.0.dylib
     [exec]   Referenced from: /Developer/xulrunner-sdk-1.9.1/bin/xpidl
     [exec]   Reason: no suitable image found.  Did find:
     [exec] 	/opt/local/lib/libIDL-2.0.dylib: mach-o, but wrong architecture

Figuring that libidl is compiled as 64 bit and the gecko sdk is 32 bit, I go searching the web. This leads me to a forum post on compiling Camino on Snow Leopard.

Mac OS 10.6 is 64-bit as native, while Camino is far from 64-bit ready. So cross-compiling to 32-bit is required.
First hurdle was to cross-compile and install the required libIDL library, in 32-bit. Luckily MacPorts contain a universal libIDL, so after I got the hint about “versions” I got that going using the command – “sudo port install libIDL +universal”.

Alright, so now I’m trying to install the universal libIDL file and I hit another error.

Command output:       _IDL_inhibit_get in libIDL_2_la-parser.o
      _IDL_queue_new_ident_comment in libIDL_2_la-parser.o
      _IDL_file_set in libIDL_2_la-parser.o
      ___IDL_do_pragma in libIDL_2_la-parser.o
      _IDL_ns_scope_levels_from_here in libIDL_2_la-ns.o
      _IDL_tree_properties_copy in libIDL_2_la-util.o
      _IDL_tree_walk2 in libIDL_2_la-util.o
      _IDL_tree_to_IDL in libIDL_2_la-util.o
      _IDL_tree_get_scope in libIDL_2_la-util.o
      _IDL_tree_remove_inhibits in libIDL_2_la-util.o
      _IDL_tree_property_remove in libIDL_2_la-util.o
      _IDL_tree_property_get in libIDL_2_la-util.o
      _IDL_tree_property_set in libIDL_2_la-util.o
  "_g_log", referenced from:
      _IDL_check_type_cast in libIDL_2_la-util.o
      _IDL_tree_walk_real in libIDL_2_la-util.o
      _IDL_tree_walk_real in libIDL_2_la-util.o
      _IDL_emit_IDL_literal in libIDL_2_la-util.o
      _IDL_tree_get_node_info in libIDL_2_la-util.o
      _IDL_tree_get_scope in libIDL_2_la-util.o
      _IDL_tree_remove_empty_modules in libIDL_2_la-util.o
      _IDL_tree_remove_inhibits in libIDL_2_la-util.o
      _IDL_tree_process_forward_dcls in libIDL_2_la-util.o
      _load_inhibits in libIDL_2_la-util.o
      _IDL_tree_free in libIDL_2_la-util.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [libIDL-2.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Here is where I’m stuck. I have no idea what symbols are missing. Please, leave me a comment if you have any ideas on how to make this work.

** Update **
This is what I did to get this to work.

sudo port -f uninstall installed
sudo port install libIDL universal

Noah Dancing

Rachel’s mom stopped by for a visit the other day and she left us a disc of photos she has taken over the past couple of years. We ran across this gem of Noah playing and dancing at Andrew and Holly’s wedding.

« Newer Entries - Older Entries »