background top

Take a look at Dave's bio.

Open Source and Governments: The White House and Bank of Canada

There have been a couple of high profile announcements about government institutions using open source products in place of proprietary systems.

One of the biggest announcement came from the White House and they have released some great new modules for Drupal.  All three modules work well to fill noticeable voids and provide a better browsing experience. One module, “Context HTTP Headers”, allows developers or system administrators to customize caching for pages based on type.  This means is that you can have your news pages cached for five minutes on a high traffic website and have your ’standard content pages’ such as About Us cached for sixty minutes.  Another module release is called Akamai and helps target scalability as well by enabling integration into a their Content Delivery Network. Another module called GovDelivery makes it a lot easier to send out tailored emails to the governments email list.

The White House also released one of the most desired modules for any developer who is working hard to build accessibility complaint websites. Dubbed “Node Embed” the module helps deliver rich content (photos and videos) with all of the appropriate meta data that makes them fully accessible by screen reading software.

The Bank of Canada has also made some contributions back to the open source community. They released three WordPress plugins that were developed for their website.  The AJAX Scroll plugin adds a graceful fade in and fade out for next/previous links when a user is navigating content.  Another recently releases plugin is called PBox and it allows a developer to create custom content widgets and standardize the display of the content within them.  This is very useful as it helps ensure all information will have the same look and feel across a site.

The Bank of Canada has also released a WordPress plugin that helps remove the handcuff’s when it comes to widgets and customizing them.  The plugin called XWidgets allows for a page-by-page customization of any widget which means you can have a news feed or any type of widget customized to fit any specific pages layout or design needs.  This means you can easily have your about us page display a Flickr feed and the same widget could display a twitter feed on your contact us page.

All these announcements are great news for all types of internet users, from casual surfers, to content producers and developers. Its great to see political offices getting on board with open source and we hope that this is just the start to many more contributions from all levels of government.

What online government features would you like to see made available to the general public?


10 Things To Do Before You Start Coding

Building on our experiences over the years we’ve developed a list of key tasks required to complete prior to developers writing a single line of code. We hope these tips will save you some time on your next project.

1. Review everything

When it comes to any project its important to review all the material that your sales team and project manager are handing you.  Make sure you take the time to sit in a quiet area and read through all of the material making notes as you go.

2. Ask Questions

Following up on the first task its very important to ask lots of questions.  Even if the answers to every question is a simple yes, never underestimate the importance of asking questions and clarifying your understanding of functionality.

3. Review proposed technology

Anytime someone makes a decision to use a specific technology to solve a problem its always useful to review the technology proposed and ensure there are no missed opportunities.  More often then not the person who is recommended the technology is doing so on tried and true past project successes.  This however does not mean that new cutting edge technology wouldn’t be a better fit.

4. Talk with your development team

Even if you deployed every piece of functionality on previous projects it’s important to talk through what your going to be doing at a high level with your development team.  It’s especially important to discuss functionality you’ve never deployed such as a twitter feed or other new technology solutions. Someone more often then not has a good idea to save you time, or recently solved a very time consuming problem with one of the technologies you’ll be deploying.

5. Plan your attack

Take the time to sit in a quiet area, think about how you’ll be developing this solution and then write it down!  We can’t stress this enough as to how important it is to document what will be done first, second and so on.  On top of that it’s important to have this information available to your project manager, after all he’s going to want reassurance you can hit and deliver on the clients time lines.  Try using a gantt chart to create your plan as this is a simple yet effective way to dip your toes into this process.

6. Review your plan

Remember that even if you’ve spent two hours or six hours planning out what you’ll be developing first and second and what you’ll be developing last it’s important to review this with the project manager.  They’ll be able to provide necessary feedback on concerns about client expectations and potentially bottlenecks you may not have considered.

7. Comp out functionality

At this point you should already have a design for your application however this design won’t illustrate every piece of functionality, and it’s not important to illustrate how a simple page will look before you get started.  Any functionality that isn’t 100% cut and dry should be laid out.  You can do this by hand, with many free layout tools or simply work with a designer to create rough composites that you can show to the client for sign-off.

8. Review everything with a team member

Take the time to review your plan and comps with another developer.  It’s always easier to have a mistake or suggestion pointed out to you know before your 50% down the project.  Have the other developer review your plan, your comps and talk him through everything so he understands what’s going to be developed without reading all of the information for the entire project.

9. Use pseudocode

Unless you’re the only developer in the world that doesn’t make mistakes or logic errors then this step is essentially for success.  Layout your functionality in pseudocode being as detailed as possible.  Overtime you’ll learn where details need to be very specific and where they can be a little less detailed.  This process will help you stop logic problems within your code every single time.

10. Start coding!

By putting some planning upfront you’ve just saved yourself lots pain and suffering moving forward.

Good luck – we hope this will save you some time and ensure things move smoothly for you on your next development project. Please share any tips you have for improving the development process in the comments.


Millar GolfingDavid Millar, Lead Developer
Millar, as he is known around the office, is a rock-solid, workhorse coder. If anyone really understands what a chunk of code is doing it’s him. Family, friends, sports, and his wife are the most important things in life to him. He plays sports weekly and golf in the summer when he’s not busy hanging out with friends and family. Recently he got married to his wife Kate in a beautiful ceremony surrounded by friends and family on a perfect summer day. A humanitarian at heart, his positive demeanour is rattled most when “society makes decisions without considering more relevant information from the present”, and people “make self indulgent decisions that hurt society and everyone else”.


Crystal Reports Images not showing up

When deploying a .NET web application with Crystal Reports you will need to install the appropriate crystal reports library on the server to use any reports you’ve built.

I recently ran into an issue where Crystal Reports Images (images in a report) would not show up on a new Windows 2003 Server.  After extensive web research with no solution in sight I decided to try to solve the problem on my own.

Note:  If you’re having problems with the images in the header bar (BusinessObjects toolbar) then please see this site below:
- http://www.gutgames.com/post/Crystal-Reports2c-issues2c-and-fixes.aspx
- or simply google “toolbar images for crystal reports not showing up”

To resolve my error I went into the Web Server(IIS) manager and performed the following steps:

Image showing the configuration variables entered into new Handler1) Clicked on ‘My Website’ where I was using crystal reports
2) Clicked on ‘Handler Mappings’
3) On the right side under ‘Actions’ I selected ‘Add Managed Handler’
4) Request Path: CrystalImageHandler.aspx
5) Type: CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions…….
6) Crystal Reports Image Handler
7) Press OK
Success!


I was able to track down this issue by looking at the URL for non-working images.  All pointed to the following:
http://www.MySite/CrystalImageHandler.aspx?*****useless info******

As you can see, the system is trying to access a handler to read out images specified in the report.

I hope this solution can save you hours of potentially wasted time and frustration.


Millar GolfingDavid Millar, Lead Developer
Millar, as he is known around the office, is a rock-solid, workhorse coder. If anyone really understands what a chunk of code is doing it’s him. Family, friends, sports, and his wife are the most important things in life to him. He plays sports weekly and golf in the summer when he’s not busy hanging out with friends and family. Recently he got married to his wife Kate in a beautiful ceremony surrounded by friends and family on a perfect summer day. A humanitarian at heart, his positive demeanour is rattled most when “society makes decisions without considering more relevant information from the present”, and people “make self indulgent decisions that hurt society and everyone else”.


WSS 403 Forbidden & DCOM Errors in Eventlog

One thing that can be frustrating for any developer is when you run into a problem and despite millions of search results when searching for a resolution nothing seems to solve the issue.  I thought I would share some simple solutions to two very frustrating WSS issues we’ve run into this past year.

The first issue is intermittent 403 Forbidden errors on a WSS (Windows Sharepoint Services) site.  We were seeing  anonymous users in our test environment who couldn’t use the website at all until an admin logged in.  After someone had logged in then anyone could use the website with or without a login.  What ended up being the problem was a permissions issue on the bin folder for the website.  To fix this problem please follow the simple steps below.

  1. Ensure all sub folders that are virtual directories on the site are using the same application pool as the root site.  (This didn’t help me as everything was set properly, however I read countless posts of this causing problems for others)
  2. Add read access on the bin folder for the account IUSR.  (You don’t need to add read access to the files, which is somewhat confusing but none the less that protects the files from being downloaded)
  3. Success!

If you have any other problems please post your questions/solutions below.

Continuing on, I also ran into a strange DCOM error popping up in Eventlog on most of our servers with WSS sites running.  The error looks like this…

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {61738644-F196-11D0-9953-00C04FD919C1} to the user <serverName>\networkservice SID (S-1-5-21-<serviceSID>). This security permission can be modified using the Component Services administrative tool.

Needless to say, getting this error several hundred times a day in Eventlog is not ideal.  The resolution is rather simple but not overly easy to explain.  Please carefully follow the steps below.

  1. Copy the GUID (In my case it was {61738644-F196-11D0-9953-00C04FD919C1})
  2. Open the registry editor by running regedit
  3. Click on ‘My Computer’ at the top then select Edit -> Find and Paste the Guid (remove the {})
  4. You should see an application name in the right pane when the Guid is found – in my case this was “IIS WAMREG admin service”
  5. Close the registry editor and open Component Services from Control Panel -> Administrative Tools
  6. Expand Component Services, My Computer, DCOM Config and find the application name discovered above in step #4.
  7. Right click on the the application name and select “Properties” then select the Security tab
  8. The first block should be set to Customize – select edit on the right side.
  9. Now add the service account (in my case this was network service) and add the appropriate access which in my case was “Local Activiation” (which you can see in the error above)
  10. Success!

Please share this information as both of these errors can be both frustrating and a waste of time.

Good luck and happy coding!


Howto Setup PHP (Apache, Mysql) on Windows

First Grab the latest copies of the following:

Apache (MSI with OpenSSL): http://httpd.apache.org/download.cgi
PHP Windows Binary (Zip Package): http://www.php.net/downloads.php
MySql Community Engine (MSI): http://dev.mysql.com/downloads/mysql/5.1.html#win32
MySql Tools (MSI): http://dev.mysql.com/downloads/gui-tools/5.0.html

Once you’ve downloaded the latest files follow these steps below:

  1. Install Apache
    1. Network Domain: it doesn’t matter
    2. Server Name: it doesn’t matter
  2. Unzip PHP into c:\php
  3. Install MySql
  4. Install MySql Tools
  5. Create a folder c:\websites (or call it what you want)
  6. Go to My Computer -> Right Click Properties -> Advanced -> Environment Variables
    1. Select Path -> Click Edit
    2. Add a ;c:\php on the end
  7. Restart your computer!
  8. Browse to the Apache Folder (Should be in Program Files\Apache Software Foundation\Apache
    1. Go into conf and open httpd.conf
    2. Change the following and Save
      1. ServerRoot (Should be set to your Apache folder – nothing should be changed here)
      2. Listen (In the event you want your Apache WebServer to not run at localhost:80 – you can specify a specific ip/port here
      3. In the LoadModule section you might want to enable rewriter_module (not necessary!)
      4. DocumentRoot "C:\websites"
      5. <Directory "C:\websites"> <– This is about ~15lines below the document root (REQUIRED CHANGE)
      6. Under the DirectoryIndex save yourself some time and add index.php after index.html with a space separating them
  9. All Done making configuration changes to Apache
  10. Copy the index.html file in htdocs to c:\websites
  11. Click on the Apache Server Monitor in your TaskBar and restart Apache (if you have any problems check the logs folder in the Apache directory)
  12. Open your Web Browser and Browse to http://localhost – You should see ‘It Works’
    1. If this failed to work – check the settings you’ve changed (typo’s will break things) also check the error logs in the apache\logs folder (Post any problems you can’t resolve in the comments)
  13. Now that you have Apache working – lets get PHP working so you can start coding with php/mysql
  14. Rename php.ini-distribution to php.ini
  15. Open php.ini
  16. Change the following and Save
    1. max_execution_time (Suggested for development to increase to 60)
    2. max_input_time (Suggested for development to increase to 120)
    3. memory_limit (Suggested for development to increase to 256M – great for any type of video conversion)
    4. error_reporting = E_ALL & ~E_NOTICE (Un-comment this and ensure other error_reporting lines are commented
    5. display_errors = On
    6. log_errors = On
    7. session.save_path = "c:\tmp"
    8. post_max_size = 16M (Suggested for development)
    9. doc_root = (You can leave this blank)
    10. extension_dir = "c:\php\ext" (Required)
    11. upload_max_filesize = 16M (Suggested for development)
    12. Un-comment the following extensions:
      1. extension=php_curl.dll
      2. extension=php_gd2.dll
      3. extension=php_mbstring.dll
      4. extension=php_mcrypt.dll
      5. extension=php_mssql.dll
      6. extension=php_mysql.dll
      7. extension=php_openssl.dll
    13. If you have access to an SMTP server configure SMTP
  17. Re-open the httpd.conf for apache and add the following lines after the end of the LoadModule section
    1. LoadModule php5_module "C:/php/php5apache2_2.dll"
    2. AddType application/x-httpd-php .php
    3. PHPIniDir "C:/php"
  18. Restart Apache
  19. Create a file in c:\websites called test.php
  20. Put <?php phpinfo(); ?> in the file and save
  21. Access http://localhost/test.php
  22. You should see a dump of all the information – All the extensions you’ve loaded above should have a section within the information displayed (If you can’t find mysql on the page for example then the .dll did not load properly – Verify your Environment Path variable (restart if you change it) and try again)
  23. Don’t forget to look at your log files if you’re having problems – and if php says it can’t load a module that exists in a specific path then it’s likely an Environment Path issue.
  24. Happy Coding!


Gumblar.cn – Virus in the wild

We’ve been noticing a lot of traffic related to a new virus that has been attacking users/websites recently.

The virus works to exploit your system is several distinct ways.

  1. An infected PC transmits FTP information to Gumblar.cn
  2. Gumblar.cn connects to FTP’s submitted from infected pc’s and injects code into any php/html pages it finds
  3. Any user visiting a site will have JavaScript run in their browser that does the following:
    1. Loads obfuscated JavaScript to connects to gumblar.cn if your running windows and not infected
    2. This in turn loads a nice piece of JavaScript that will load an SWF file
    3. This SWF file is the virus payload – it contains a byteArray that will inject a virus onto the computer (I believe it’s another SWF file being loaded as the byteArray)
  4. If this computer is running windows and has flash it will become infected
  5. See Step #1

The JavaScript code you’re looking for will look something like this:

One thing to note in the above code is the words gumblar in plain text.

When it comes to cleaning your webhost up you should take the following steps.

  1. Take your website down (turn the web server off – stop infecting your users)
  2. Remove the FTP information from your PC
  3. Change the FTP username/password on your webhost
  4. Look for new files created (image.php, etc…) that shouldn’t be there
  5. Now that you’ve removed the backdoor & changed the password you need to perform cleanup
  6. Find any PHP or HTML pages injected with the virus code and remove it

Once you’ve done this – everything should start getting back to normal.

There have been some useful scripts posted in the comments about this virus at blog.unmaskparasites.com.

If you’ve had any success or troubles with this virus please post your comments below.

If anyone knows of an easy way to convert a byteArray that’s being passed to an ActionScript Loader back into readable text please leave me a comment below.

Good Luck!


Konami Code – Cheat Code – Easter Egg

Have you ever thought about adding a Easter Egg to your website?

Using a Cheat Code such as the Konami Code you can now easily add one to your website using jQuery and the plugin that Trevor Morris developed.  Get the plugin here.

The code is simple and easy to follow.  Here’s a snippet to demonstrate how simple it is to perform a basic javascript action.

	$(document).ready(function() {
		$(document).cheatCode({
			code : '38,38,40,40,37,39,37,39,66,65',
			activated : function(){
				alert('Hidden');
			}
		});
	});

Don’t forget you’ll need to grab a copy of jQuery if you don’t already have it loaded up!

Please let us know if you like our Easter Egg.


Boldly go… to the movies (courtesy of rtraction)

UPDATE – The movie was fantastic and we all had a great time. We’ll be having another even later this summer so keep your eye on our blog or our Twitter feed for more info.

We’re considering 3 flicks for the next outing – District 9, Terminator Salvation and Transformers: Revenge of the Fallen – e-mail (email hidden; JavaScript is required) or tweet (www.twitter.com/rtraction) your opinion.

CONTEST CLOSED – We’re all pretty pumped about this Friday’s launch of the new “Star Trek” movie, and we want to share the joy. We’ve got 25 free tickets* to give away. If you’re available to join us in London, Ontario on Friday May 8th for a 3:30pm showing of Star Trek, you can join us for at SilverCity Masonville. Just send an email to rtraction at email hidden; JavaScript is required and tell us the middle name of Captain James Kirk. Easy, right? The first 25 people to submit correct answers will win.

Live long and prosper!

* And we mean FREE – no presentations, no sales pitches and definitely no spamming you later. No strings – we’re just looking for some good company for what promises to be a great flick.

· Sorry no rainchecks but keep your eye on our Twitter feed throughout the summer for more events.


Looking up CSS Styles in JavaScript

This can be extremely useful in the event you have a toolbar, menu, or custom piece of code that is changing styles on the fly. We had a need to look up CSS Styles affecting an object on our page with JavaScript.  Unfortunately, it’s not as easy as document.getElementById(‘myobject’).style.background.  If you want to get the CSS styles that have been set by other JavaScript code, you’ll need to use this function to look up those styles.  Let’s say you want to put a div at the top of the page, but doing so would break the background styles on the body.  You can look up those styles, make an adjustment for the height of your div and then display it.

One thing to note is that IE and Firefox (as well as other W3C standards browsers) use a different function to accomplish this.  The W3C standard function is “getComputedStyle” whereas IE uses the proprietary “currentStyle”.

A working script for IE and Firefox is below:

getstylebanner = function(prop, element) {
    if (element.style[prop]) {
        return element.style[prop]; /* if its an inline style in IE */
    }
    else if (element.currentStyle) {
        return element.currentStyle[prop]; /* if its style set in IE */
    }
    else if (document.defaultView &amp;&amp; document.defaultView.getComputedStyle) { /* Firefox */
        prop = prop.replace(/([A-Z])/g, "-$1");
        prop = prop.toLowerCase();
        return document.defaultView.getComputedStyle(element, "").getPropertyValue(prop);
    }
};

An example of looking up the top margin on the body of your page:

var marginTop = getstylebanner('marginTop', document.body);

Technology & You – Canadian Federal Election – Oct. 14th

With major concerns in the Information Technology industry around Digital Rights Management (DRM), the Canadian version of the Digital Millennium Copyright Act (DMCA) named “Bill C-61″ and other hot topic issues you need to know where your politician stands on these critical topics that could affect every man woman and child in Canada. Where does each party stand on open source software, DRM, Copyright Reform, Net Neutrality?

What are the current government’s views on these topics? Well, we can make assumptions based on the copyright bill “Bill C-61″ but unfortunately at this point we don’t have any promises or statements from the Conservative Party of Canada on any of these topics. We were shocked that most parties didn’t include any of these critical issues in their platforms. South of the border, in the current presidential election, each candidate has specifically noted their stance on many technology issues facing their IT industry.

After reviewing the New Democratic Party’s platform we found that none of these important topics are mentioned, however at the very least they’ve expressed their views on copyright reform in several news releases. Specifically we were able to find out that the Green Party of Canada and some NDP MP’s are in support of a copyright reform proposal by Michael Geist. Obviously these vital topics not registering on parties platform’s is far from ideal so we were again surprised to see that the Liberal Party of Canada had nothing on all of these topics along with the BLOC Québécois.

The only party that has addressed these issues in their official party platform is the Green Party of Canada. You can read more about their views here and here. We must applaud the Green Party for taking a stance on these important issues.  The Green Party has come out in support for open source software development, and open discussions on a variety of topics including internet privacy, copyright and DRM issues.  This is a step in the right direction but rather disappointing that no other parties are providing their views and stances on these important issues.

We need to demand more as professionals in the IT field and help our politicians make informed decisions on these critical issues by providing information, support and feedback.

Let’s work together and demand that all parties in Canada provide their stance on technology challenges moving forward within Canada and internationally.

Don’t forget to exercise your rights and Vote!

For more information on these topics we recommend Michael Giest’s blog. We would also recommend contacting your member of parliament and all political parties to bring these important issues to their attention. Click here to find your member of parliament.