• Using XSL to convert a KML file to a static Google Map image

    Maps provided by Google can be embedded into a website using three approaches. The first approach consists in simply creating a custom map via the custom map editor. It allows you to add placemarks, draw lines and shapes, and publish your map for public consumption. The map can be then embedded in your website.

    The second approach consists in customizing the map via javascript using the Google Maps JavaScript API.

    The downside of these two approaches is that it requires the client to download complex pieces of JavaScript. With mobiles, the bandwidth is always a bottleneck. Additional, the clients on some older mobiles may not be advanced or powerful enough to let the user interact, and in some cases, view the map.

    The third option then consists in relying on static images to deliver maps. Google provides such a functionality via the Static Maps API. This service creates a map based on URL parameters sent through a standard HTTP request and returns the map as an image that can be displayed on the web page. Similarly to custom maps, placemarks and lines can be added via additional URL parameters.

  • Scroll quickly to a column with SAS Entreprise Guide

    Finding a specific column while browsing a wide table with SAS Entreprise Guide may be a little bit tricky.

    One tip that will save you time is to use the shortcut Control + G with the data editor. It creates the “Go to Cell” pop-up window that allows you to go to a specific column by either specifying the column position or the column name. In addition, you can cycle through the columns starting with a particular letter by selecting the drop-down list and pressing the key corresponding to this letter.

  • Linking to a folder in SharePoint

    Linking documents in SharePoint is a quite common task. For example, a local PowerPoint presentation may contain a link to a Word document stored in SharePoint. There may be also cases where the author needs to refer not only to a single document, but also to a folder stored in SharePoint. It turns out that the process of retrieving the URL of a folder in SharePoint is different than the method used for a document.

  • Coalesce in SAS

    Coalescing refers to the process of checking the value of each input parameter in the order in which they are listed and returns the first non-missing value. In SAS, the behavior of each of the coalesce functions depends on the processing context, either in a data step or in a PROC SQL statement. These differences are important to acknowledge, especially when the code is migrated from PROC SQL to a data step.

  • Slide Number in PowerPoint

    Recently, I was working on a PowerPoint presentation based on a specific template from a client. As I was about to print the deck, I realized that the slide numbers were missing. As I struggled to figure out how to make the slide number to appear on all the slides, I thought it would be good to share here my experiences. The illustrative screenshots have been taken from PowerPoint 2003. The approach should be similar for more recent versions of PowerPoint.

  • Formatting scaled numbers

    Standard formatting in .NET is sometimes not enough to fill specific requirements. For example, when high-level financial reports from big corporations need to be produced, the numbers dealt-with are generally around hundred of millions. Consider the following report where the scale and the currency (M$) is being displayed in the row header.

    Quarter 1Quarter 2
    New York (in M$)102.7621.40
    Florida (in M$)32.7667.40

    In order to achieve this formatting, a straightforward solution would be to apply a scaling factor to the numbers beforehand.

    string.Format("{0:N2}", valueToFormat / 1000000); 

    Sometimes, it is not appropriate nor possible to scale the numbers. In this situation, number scaling using the “,” custom specifier could be used. Note the use of two commas since the number to be formatted is divided by 1000 for each comma:

    [csharp] decimal valueToFormat = 1345278000.346M; string.Format(“0:#,#,,”, valueToFormat ); // displays 1,345 with the invariant culture [/csharp]

  • MWSnap Review

    When it comes to create screenshots, I often use MWSnap, a freeware written by Mirek Wojtowicz. This tool offers all the core functionalities one may expect from a screenshot application. MWSnap was recommended to me by Michael Olivero.

  • Order returned by GetMethods

    When calling the GetMethods function which lists the methods for a given type, we should keep in mind that this function does not return methods in a particular order. More specifically, the methods are not necessarily in the same order it has been declared in the source code. This discrepancy is due to some caching performed by the .NET Framework for better performance as explained in a post by Haibo Luo. This article is aimed at outlining solutions to order the methods returned by GetMethods in the declaring order.

  • CanShrink and CanGrow Behaviors

    In Reporting Services (version 2005) , the CanGrow property indicates whether the size of the text box can increase vertically according to its content. Similarly, CanShrink decreases the height of the text box according to its content. Controlling dynamically the height of report elements is only possible through these properties since the Height property cannot be bound to an expression. These two properties are therefore useful to create reports which can be scaled to both small and large contents. Unfortunately, CanGrow and CanShrink behave differently for each rendering extension.

  • Load Testing using The Grinder

    Performing preliminary load testing on web applications does not require the use of complex tools such as Load Runner. An open-source tool called The Grinder provides a simple way for developers to perform load testing before handing out the application to Quality Assurance. With The Grinder, the load tests are defined using Jython scripts, and then are run by agents which could be distributed over the network. A property file defines which load tests should be run, how many times, and on how many threads. A central application referred to as the console starts the agents, collects the responses, and monitors the number of requests per second (RPS). The authors of this tool provide a short but useful overview of the architecture.

    Installing The Grinder is a matter of unzipping the archive since the tool is written in Java. However, making the tool work as indented requires to dig into the documentation a little bit. This article is intended to assist people interested in getting up and running the tool on a Widows environment as quickly as possible.