Generating TypeScript documentation generation

There’s a great little tool called TypeDoc that allows us to generate html documentation based in our comments inside our TypeScript files similar to what JavaDoc does. To use this tool follow these steps:

  1. Install nodejs: http://nodejs.org/dist/v0.10.35/node-v0.10.35-x86.msi
  2. Open command line and run nodejs by typing: node
  3. In the nodejs prompt install typedoc by typing: npm install –global typedoc
  4. Type: typedoc -t ES5 –out doc/ references.ts

This will compile all the documentation (classes, namespaces, functions, etc.) that can be referenced by the file references.ts and it will be put under the doc folder in the current directory where that command is ran.

It’s preferred to update your project’s documentation from time to time and TypeDoc has integration with tools like Grunt but if you want this to run after you create a build you can add this command to the post build events list of commands the way I’ve shown in the previous post. For example:

<Exec Command="typedoc -t ES5 --out &quot;$(ProjectDir)/doc/&quot; &quot;$(ProjectDir)/tsDec/references.ts&quot;" />

TypeDoc follows JavaDoc comment tags:

@param <param name> <description>
@returns <description>

Examples:

/**
* This is a function.
* @param arg This is the argument.
* @returns Returns a value.
**/
function func(arg: text): string;

/**
* This is a name.
**/
var name:string = "a name";

You can also use the @preferred tag if you have different comments for the same thing (e.g. a module that is declared in different files and has different comments in both files or an interface and its class implementation) and you want to use a specific comment over the other as TypeDoc will use the first comment that it finds.

Adding pre and post build events in Visual Studio (Windows Store / JavaScript projects)

In Visual Studio you can add pre and post build events, basically these are commands that you can program to run before the build command executes and after it finishes building the solution configuration. To configure these you can easily go to Project -> Properties -> Build Events and write whatever commands you want to run in the Pre and post build events boxes. Of course that this is only true for C# or C++ projects. If you tried to do this in a Windows Store JavaScript application project you most likely noticed that these pre/post build events were missing. Not sure what was the reasoning behind it but I guess the folks at the VS team thought it would be a good idea. Anyway, you can still get access to these by editing you jsproj file and looking for:

<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>

You’ll notice that there’s a whole section that is commented out with this comment:

To modify your build process, add your task inside one of the targets below then uncomment that target and the DisableFastUpToDateCheck PropertyGroup.
Other similar extension points exist, see Microsoft.Common.targets.

So you just need to follow the instructions and add a command inside one or both of the pre/post build event xml nodes. To add a simple copy a file named lib.dll from the output directory to your project directory after building you’d do something like:

<Target Name="AfterBuild">
  <Exec Command="copy &quot;$(OutDir)/lib.dll&quot; &quot;$(ProjectDir)/&quot;" />
</Target>

Note: the &quot; is intentional so that the string gets quoted when it’s used by the copy command.

TypeScript declarations for Player Framework

- Are you programming in JavaScript?
– Yes.
– Are you using TypeScript?
– No.
– Please stop! Do yourself a favour and go learn TypeScript to use it in your project.

I’ve been programming JavaScript for Xbox One projects and since I saw a TypeScript session at Build 2014 that I was completely sold to it.

TypeScript is a language that is a superset of JavaScript compiling the result to plain JavaScript. It makes JavaScript development easier to manage by adding types, classes, modules and interfaces. And because it compiles to JavaScript, you don’t really need to have any TypeScript compiler to run a project.

What if you already have a big JavaScript project?
No problem, you just start slowly converting the code to TypeScript or you can create declarations (similar to a .h file for C/C++ projects) for your utility libraries that work just as well.

My TypeScript contribution to the world is a Player Framework (MMPPF) declaration file available at the DefinitelyTyped GitHub repository.

Enjoy and start using TypeScript!

Raspberry Pi Wifi dropping connection

Started playing with my Raspberry Pi this weekend and noticed that the wifi connection would not stay up for long when connected through SSH. After some digging online I found that the wifi was getting put in sleep mode. Here’s how to fix it:

  • Create a new file named 8192cu.conf at the following location /etc/modprobe.d/8192cu.conf
    sudo nano /etc/modprobe.d/8192cu.conf
  • Write the following command
    options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

    (This makes sure that the power management is turned off thus preventing the dongle from going to sleep mode.)

  • You can go further and ensure that the connection remains up and stable by sending a ping request from your Pi to the router using crontab:
    crontab -e

    (Adds a new entry to crontab.)

  • Enter the following at the end of the file:
    */1 * * * * ping -c 1 192.168.1.2

    (Change the 192.168.1.2 to the IP of your router. The IP of the router can be found by opening a command prompt in Windows and running the ipconfig command and checking the number besides “default gateway“.)

If you don’t have a Edimax wifi dongle you may have to find how to disable the power management for your device.

Source: http://www.xbmchub.com/forums/raspberry-pi-discussion/8037-your-wifi-dongle-dropping-connection-mainly-edimax-ew-7811un.html

CLIArgsMadeEasy2

CLIArgsMadeEasy is back with a long overdue update. This is the third major release of this extension although the second one didn’t receive a major version number.

This is still an alpha version. Please report back any bugs you may find.

New features

  • Dropped toolbar support in favour of toolbox which makes it more easy to manage and edit your command line. Open it inside View -> Other Windows -> CliArgsMadeEasy
  • Remove or change between command line arguments with a click of a button.
  • No more clogging the windows registry, data gets saved in .suo file.
  • Detect startup project inside solution folders.
  • Compatible with VS2012 and VS2013.

Changelog

  • v1.0.6:
    • Added support for Visual Studio theme layouts.
    • Fixed bug where pressing the delete key while editing an item would delete the item and not the next character.
  • v1.0.5:
    • Added ability to duplicate and edit (buttons were added for each CLI arguments.)
    • Changed the way CLI args get added and changed.
  • v1.0.4:
    • Fixed VSIX problem for VS2012 installation.
    • Fixed bug where deleting command line arguments wouldn’t set them in Visual Studio.
    • Fixed bug where we could add the “Type some arguments”.
    • Changed default shortcuts:
      • ctrl+alt+0 – open CLIArgsMadeEasy window.
      • ctrl+alt+9 – focus on command line arguments.
      • ctrl+alt+8 – focus on project filter.
      • ctrl+alt+7 – focus on command line history.
  • v1.0.3:
    • Fixed VSIX installation for VS2013. Common installer for both VS2012 and VS2013.
    • Fixed bug where changing CLI Args through project properties didn’t update the extension.
    • Added empty CLI args when pressing enter with no arguments in the box.
  • v1.0.2:
    • Added key shortcuts:
      • ctrl+alt+0 – focus on command line arguments.
      • ctrl+alt+9 – focus on project filter.
      • ctrl+alt+8 – focus on command line history.
      • tab – focus next command line.
      • enter or space – select current command line.
      • delete – removes current command line.
      • escape – set focus on command line arguments.
    • Fixed bug detecting when startup project was deleted.
  • v1.0.1:
    • Removed erroneous menu entry from Visual Studio under Tools – You can find the tool window in: View -> Other Windows -> CliArgsMadeEasy
    • Command line arguments text box expands to show full text.
    • Added new icon.

Description

Command Line Arguments Made Easy (CLIArgsMadeEasy) is a Visual Studio extension that eases the access and change of the startup project’s command line arguments. Instead of having to go to project properties or instead of using the command window to run your program with different arguments, CLIArgsMadeEasy adds a toolbox for you to add and edit your custom arguments.

If you like this add-in and want to support it, donate by clicking in the button:

Download

Download CLIArgsMadeEasy2 v1.0.6 alpha here. (for Visual Studio 2012 / 2013)

Many thanks to Diogo Teixeira (aka fozi) for the add-in idea and testing of the program. And I also have to thank Matt Phillips for showing interest in the add-in which inspired me to make a second release.
Thanks to everyone who’s been reporting bugs and helping me building a stable version of CLIArgsMadeEasy.

Realtime Bus

I’ve used TTC (Toronto Transit Commission) to get to work and move around in Toronto. They implemented a good service where each bus is equipped with a GPS device transmitting its location and through today’s technologies that information reaches the internet and the phone of each one of us accurately and in real-time.

The apps available for WP7 didn’t have all the features that I wanted so I decided to build my own app.

Some features I wanted in my app that didn’t find in others:

  • Fast access to favourites
  • Map with routes
  • Information for multiple cities
  • Alerts (TTC only)

RealtimeBus_3 RealtimeBus_1 RealtimeBus_4

You can find the application here: http://www.windowsphone.com/en-us/store/app/realtime-bus/69bd4a05-65b4-4633-b40d-7d18d9f46edc

How to debug a Windows 8 app upgrade in Visual Studio

Some times it’s useful to debug if your new update breaks anything to users who have the previous version of your app. The process to debug this is not very straightforward but here it is:

– Create a package with first version (right click on the project -> store -> create package)
– Install the package.
– Run app and make sure it saves some user data.
– Make a new package with second version.
– Install package.
– On the Start menu, search for Debuggable Package Manager and then start it.
– A PowerShell window properly configured for the AppxDebug cmdlet appears.
– To enable debugging of an app, you must specify the PackageFullName identifier of the app.
– Type Get-AppxPackage at the PowerShell prompt (to view a list all apps that includes the PackageFullName.)
– At the PowerShell prompt, enter Enable-AppxDebug PackageFullName where PackageFullName is the PackageFullName identifier of the app.
– Run app
– Launch Visual Studio
– Go to Debug -> Attach to process…
– In the list of available processes select the one called WWAHost.exe and with the name of your app in the Title column.

A Walk In The Dark

The game I’ve worked on for more than one year is finally available for download from Amazon or the game’s website.

We’re trying to get the game on Steam so if you like the game and you’d like to see it there, please vote for it here.

Check the gameplay and launch trailers below:

 

 

We hope you enjoy the game as much as we did making it! :)

UVideos Xbox Application

I moved to Canada last summer by the end of July to join Digiflare. As soon as I arrived I was assigned to work as a Lead Developer on my first Xbox project. The project had to be ready for Black Friday (Nov 23rd) so it had to be launched on November the 20th because new Xbox application roll out on Tuesdays.

It was a tough project but we we’re able to deliver successfully on time.

 

You can find more information on the project in this page: http://www.xbox.com/en-US/live/partners/univision

It has been very interesting to learn the insides of a Lakeview application and I’ll keep at it in the near future.