Monday, September 29, 2008

Flash, Silverlight and JavaScript Performance

Here is an interesting head to head performance comparison of Flash and Silverlight:

http://www.itwriting.com/primetest/index.html


 

Both grind thru a less than optimal algorithm for finding a bunch of prime numbers.

Code is provided in another link so that you can see that it is apples to apples in terms of the code implemented.


 

On my machine, I saw an over two one advantage for Silverlight. Silverlight ran 1M prime checks in .8892285 seconds and Flash took 2.153 seconds for the same. This ratio held up over a range of values:


 

Number

Flash

Silverlight

Ratio

1 M

2.153

0.8892285

2.42119995

2 M

5.477

2.3092736

2.371741486

3 M

9.627

4.056832

2.373033934

4 M

14.324

6.0697226

2.359910155

5 M

19.692

8.3445947

2.359850982

6 M

25.895

10.802571

2.397114539

7 M

31.773

13.3872827

2.373371857

8 M

38.599

16.1520106

2.389733449

9 M

45.238

19.0887398

2.369878812


 

Another individual, Tobin Harris no doubt, has provided a JavaScript implementation at:

http://www.tobinharris.com/primes.html


 

It took 54 seconds for the 1M to run in JavaScript. But this result had to be thrown out because IE was constantly popping up a dialog asking if the JavaScript should be terminated. Although that is a lesson in and of itself that JavaScript running loose in the browser will face ever increasing scrutiny that diminishes it's usefulness.


 

Friday, September 26, 2008

What Does Agile Lack?


In this "The Register" article AgileDevelopmentLessonsLearned the truth comes out.

Agile is suffering from what it lacks, specifically:
Effective Management
Design and Analysis
Developer Tools








Wednesday, September 24, 2008

Roll Back on Team System Source Control

To perform the equivalent of a roll back with Team System Source Control, you must create a changeset that contains the contents of the roll back.

  1. Get specific version
  2. Right click the root of the Source Control tree and select compare
  3. Select all and then select reconcile from context menu
  4. Reconcil Folder Differences"
  5. On drop down menu "Files that do not have pending changes select "check out"
  6. Check in

Saturday, September 20, 2008

Code F#: Generate Pascal Triangles

The following is code written in F#. It generates a list of Pascal Triangles.

#light


 

let oddTriangle x = [x, ( x * x - 1) / 2, (x * x + 1) / 2]

let evenTriangle x = [ 2 * x, (x * x) - 1, (x * x ) + 1]


 

let pairTriangle x = [ oddTriangle (2 * x - 1), evenTriangle x ]


 

let numbers = [ 1 .. 100]


 

let perfectTriangles = List.map pairTriangle numbers


 

printf "%A" perfectTriangles


 

open System

Console.ReadKey(true)


 

Output:

[[([(1, 0, 1)], [(2, 0, 2)])]; [([(3, 4, 5)], [(4, 3, 5)])];

[([(5, 12, 13)], [(6, 8, 10)])]; [([(7, 24, 25)], [(8, 15, 17)])];

[([(9, 40, 41)], [(10, 24, 26)])]; [([(11, 60, 61)], [(12, 35, 37)])];

[([(13, 84, 85)], [(14, 48, 50)])]; [([(15, 112, 113)], [(16, 63, 65)])];

[([(17, 144, 145)], [(18, 80, 82)])]; [([(19, 180, 181)], [(20, 99, 101)])]]

Tuesday, September 9, 2008

Publishing to Blogger From MS Word


 

XML has always been difficult to get posted on blogger.

Here is a test case:

<?xml version="1.0"?>

<!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<configuration>

<appSettings>

</appSettings>

<connectionStrings>

</connectionStrings>

    <system.web>

<sessionState

cookieless="true"

regenerateExpiredSessionId="true"

timeout="30" />


 

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

-->

        <compilation debug="true"/>

        <!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

        <authentication mode="Windows"/>

        <!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.


 

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

    </system.web>

</configuration>