Archive | Tech Tips RSS feed for this section

What I Learned While Developing a Firefox Extension (Add-on)

17. May 2009

Comments Off on What I Learned While Developing a Firefox Extension (Add-on)

I recently developed my first Firefox extension: Social Network User Mapper. Here is a brain dump / postmortem of what I learned. 1) All Add-ons are Open Source. At least the javascript and xul part are. This is extremely helpful when you are starting out. Find an extension that works the way you want yours […]

Continue reading...

Redirecting to a 404 page in Django

4. April 2009

Comments Off on Redirecting to a 404 page in Django

There are a few ways to redirect to a 404 page (or page not found error) in Django. The easiest way is to raise Django’s built in 404 exception, like so: from django.http import Http404 def myView(request, param): if not param: raise Http404 return render_to_response('myView.html') You can add a file called 404.html to your templates […]

Continue reading...

DateDiff Equivalent in C# – 3 Options

1. April 2009

3 Comments

If you are looking for a DateDiff function in C# like in VB or SQL Server, there is none. However here are some options to perform date operations in .Net via C#. Option 1 You can subtract two DateTime objects which returns a TimeSpan object. Here is an example: //To get the amount of days […]

Continue reading...

How to Manually Uninstall a Broken Silverlight

28. March 2009

3 Comments

I couldn’t run the latest Silverlight because an older beta version was installed. I kept getting an error during the install process that vaguely suggested removing the old version. So I went to Add/Remove Programs and I got an error when trying to remove it. After some research I found some instructions on how to […]

Continue reading...

Taking Shortcuts with Internal Style Sheets

22. March 2009

Comments Off on Taking Shortcuts with Internal Style Sheets

As simple as it is, I can never remember the syntax for defining a block of css within html. It is of course better practice to put your css in a seperate file and reference it. However, here is sample snippet to define internal style(s): PLAIN TEXT HTML: "text/css" body {color: blue} a {color: blue; […]

Continue reading...