2011
08.15
VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)

FpML 5.2 has been released. For those of you who have not come accross FpML it is the industry-standard protocol for complex financial products, defined by the ISDA (International swaps and derivatives association). It is based on XML (eXtensible Markup Language), the standard meta-language for describing data shared between applications.Take a look at this powerpoint presentation for more details on FpML

VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)
2011
08.06
VN:F [1.9.10_1130]
Rating: 8.0/10 (5 votes cast)

Submersion cooling

With existing transistor processor technology reaching its physical limits, cooling technology is getting more sophisticated. Companies such as Hardcore Computer already supply submersion cooled desktops that enable the CPU to be overclocked further than with air cooling or liquid cooling technology.

What is submersion cooling?

Traditional water cooling involves keeping water well away from electrical components because as we all know: water + electronic components := short circuit! But there are liquid substances that do not conduct electricity known as dielectric (not electrically conductive) substances. Vegetable oil is an example of a dielectric but Mineral oil is preferred due to its odourless, colourless and safe properties. With submersion cooling, all of the PC components are submersed in a dielectric substance, other than optical and HDD drives, maximising the heat transfer rate from all components. Dielectrics can be 1300 times more efficient at displacing heat than traditional cooling systems. A secondary benefit of submersion cooling is that there is no cooling fan noise, as a result submersion cooled systems run almost silently.

How does submersion cooling benefit HFT systems?

HFT is all about squeezing every millisecond of performance out of all the technology involved, be it physical networking through locating hardware geographically close to the financial exchange. Or in this case getting the most out of the CPU and GPU through overclocking. Overclocking means that the processor has to work harder which generates higher temperatures. The lower you can keep temperatures, the higher you can overclock the processor, and that’s where submersion cooling comes in.

Click here for an interview with one of the founders of Hardcore Computer.

VN:F [1.9.10_1130]
Rating: 8.0/10 (5 votes cast)
VN:F [1.9.10_1130]
Rating: +2 (from 2 votes)
2011
08.05
VN:F [1.9.10_1130]
Rating: 4.0/10 (1 vote cast)

Contributing to high levels of liquidity in the financial markets; I think HFT is here to stay. However the challenges facing HFT developers is just as much about hardware and networking as it is about software and mathematics.

This article gives an insight into the types of skills that are involved in a world where every cutting edge concept within computing is being applied to a very fast moving and specialist area. Fascinating…

You can read the full article here

Also check out this article on the topic.

VN:F [1.9.10_1130]
Rating: 4.0/10 (1 vote cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)
2011
07.28
VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)

Sometimes its useful to extract the variables from a persisted workflow to debug an issue or to verify your persistence for various reasons. Workflows are persisted in binary xml format by default, so it’s possible to extract the data into an xml file. Creating a project in visual studio to do this is somewhat tedious so I created a PowerShell script to help me out a little.

The script uses Ado.Net to connect to the workflow persistence store, which in my case is a Sql Server database. It reads the relevant table and then exports the data to a file which is given the name of the workflow instance id.

I am assuming you have used PowerShell before. If not then check out PowerGUI to get you started. If you have not installed PowerShell yet you will need to do two things to run this script in PowerShell…

Firstly you will need to run the Set-ExecutionPolicy cmdlet so that you can run scripts. I use RemoteSigned which ensures that any scripts downloaded onto my machine need to be signed before they can run. This will allow you to run scripts created on your machine freely.

Secondly I am using .Net 4.0 classes in my script so I need to make sure that PowerShell is running in the 4.0 runtime or above.

To check which version you have running; type “[System.Environment]::Version” into your PowerShell console. If the version is less than 4.0 then you will need to add the following registry key to your registry:

32-bit apps on a 32-bit operating system
64-bit apps on a 64-bit operating system
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
“OnlyUseLatestCLR”=dword:00000001

32-bit apps on a 64-bit operating system
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework]
“OnlyUseLatestCLR”=dword:00000001

So now you can paste the following script into your PowerShell script file replacing the connection string value and the query with your required settings. In my case I am extracting data from the ReadWriteComplexDataProperties column so you may also want to change this.

$connectionstring = "Data Source=localhost\SQLExpress;Initial Catalog=SQLPersistenceStore;Integrated Security=True;"
$connection = New-Object System.Data.SqlClient.SqlConnection $connectionstring
$command = $connection.CreateCommand()
$command.CommandText = "select * from [system.activities.durableinstancing].instances"
$connection.Open()
$reader = $command.ExecuteReader()

[System.Reflection.Assembly]::LoadWithPartialName("System.Runtime.Serialization")

while($reader.Read())
{
$report = $reader["ReadWriteComplexDataProperties"]
if (!$report.Equals([System.DBNull]::Value))
{
$stream = New-Object System.IO.MemoryStream (,$report)

$xmlReader = [System.Xml.XmlDictionaryReader]::CreateBinaryReader($stream,[System.Xml.XmlDictionaryReaderQuotas]::Max)
$xmlReader.Read();

if($xmlReader)
{
$xml = $xmlReader.ReadOuterXml()
$instanceid = $reader["instanceid"].ToString()
$xml | Out-File c:\temp\reports\$instanceid.xml
}
}
}

$connection.Close()

trap [Exception]
{
$connection.Close()
}

I think the script is fairly self-explanatory. The only thing I think worth mentioning here is the trap exception block at the end which will ensure that the connection is closed in the event of any error.

You can download the script and registry file from here

VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)
2011
07.19
VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)

The cool thing about developing on the Air platform is that the end result should be device independent. So if I am developing an application for an Android tablet I can probably get away with testing the app on any tablet OS that supports the Air runtime. At least in the development stages anyway. Of course most of the time you will be able to get away with using the ADL desktop player but testing on a device simulator is necessary to test gestures work as you would expect for your application. So we know the Android Emulators are slow. To be honest they are so slow I think they are the wrong tool for doing intermediate development testing. I now use the android emulators when I want to test the application actually works on specific devices before I submit to the marketplace. Of course you should always test on the actual hardware if you can. So what can we use in the development stages?

Use the Playbook simulator

Of course if you are using Flex Builder then this may seem a little more obvious. However with Flash Develop the device support is not so integrated.

RIM have a great Playbook simulator which works a treat. Simply download the Playbook SDK and simulator package, install it and use the following command line to package to the simulator substituting the arguments with your project specific values.

blackberry-airpackager -package bin\MyFlexProject.bar
-C bin -installApp -launchApp application.xml
bin\MyFlexProject.swf -device 192.168.189.128

You will need to start up the simulator virtual machine before you run this command and swap the IP address with the IP of the virtual device.

You can find more information on the command line deployment process on the RIM website

You can download the sample Flash Builder project containing the DeployToPlaybook.bat file that I have created from here.

VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)
2011
07.18
VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)

Following on from my last post about getting up and running with Flex. Here is how to quickly get an end to end Android dev environment up and running with Flash Develop.

You can download the complete Flash Develop project from here. But you will need to update the SDK paths.

Step 1 : Install Flash develop and the latest Android and Flex 4.5 SDKs

Install Android SDK

Download Abobe flex 4.5

Download and install Flash Develop

Step 2 : Create a new Flash Develop Project

Create a new Air Flex 4 Projector project and give it a name e.g. “MyFlexProject”

Create a new flash develop project

Step 3 : Enable the project for Flex 4.5 compilation

In FlashDevelop go to Project -> Properties and under the “Output” tab you will need to create a custom command to test your movie as follows : $(FlexSDK)\bin\adl.exe;application.xml bin. Replace $(FlexSDK) with the path to the flex 4.5 SDK that you downloaded.

Set the platform target

Under the “Compiler options” tab set the “Custom path to flex sdk” property to your flex SDK bin directory that you downloaded earlier.

Add the following additional command line arguments:
-swf-version=11
-target-player=10.2

Set the compiler options

Step 4 : Create the application.xml file

Now we need to replace the application.xml with the latest supported version from the SDK. I always start with the Applicaiton.xml content that comes with the SDK to pick up any changes. In your flex 4.5 SDK directory under “Templates\Air” copy the contents of the descriptor-template.xml and paste into your application.xml file.

Step 5 : Setup the package and deployment .xml files

Open the PackageApplication.xml and change the adt call to :

call adt -package -target apk-emulator %SIGNING_OPTIONS% %AIR_FILE% %APP_XML% %FILE_OR_DIR%

Change the signing options by removing the TSA option:

set SIGNING_OPTIONS=-storetype pkcs12 -keystore %CERTIFICATE%

Change the AIR_FILE variable to point to an apk file instead of a .air file e.g.

set AIR_FILE=air/YourProjectName.apk

You will also need to update all the references to “$(FlexSDK)” to the path of your flex SDK. The same will need to be done for the CreateCertificate.bat file.

Step 6 : Create an android deployment bat file

Just to make things a little easier, create a deployment bat file with a call to…

call adb install -r air\MyFlexProject.apk

Create a deployment bat file

Step 7 : Test your project

Build the project to test the new settings. If everything has been setup correctly your project should build successfully.

Step 8 : package for android

Now let’s package the application for installation on an Android device.

Run your CreateCertificate.bat file and then run the PackageApplication.bat file. For the package to work you will need to ensure you have valid values set in the applicaiton.xml file. If all goes well you should find a .apk file in the air sub directory of your project working folder.

Step 9 : Deploy to the android emulator

Run the Android SDK and AVD Manager which you will find in your start menu once you have installed the Android SDK.

Android AVD manager

Create an Android Device which must be running Android 2.2 and above to be able to run the Flex 4.5 Air runtime. Start up the Device.

Android device

Step 10 : Test your application on the device

Just to make sure the environment is running smoothly; go back to Flash develop and open the main.mxml file and add a panel with a simple label control. You will need to change the Root “WindowedApplication” tag to a “Application” tag. WindowedApplication is not supported by Android.

Create a simple panel

Now Build the project and run it. You should See your Panel and Label in the Air debug launcher.

Debug your application

Now Install your application onto the device using the PackageApplciation.bat file and then run the DeployToAndroid.bat file that you created earlier.

Deploy your application

You should now see your application appear in the Apps on the emulator

Your application should now be installed

After running the application it should look as it did when you ran it in debug mode.

The running application

Enjoy!

VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)
2011
07.14
VN:F [1.9.10_1130]
Rating: 8.6/10 (5 votes cast)

The finished Button

It’s amazing how a simple effect can transform an application. I have tried to find ways to create a simple glass effect as quickly as possible and with as few brushes and layers as possible to aid in render performance, particularly for Windows mobile 7. My previous attempts looked more like a pipe than glass and involved too many brushes. I have managed to get mine down to two brushes. I think i could get it down further and just use colour substitution but that’s for another post! So here is how I am currently doing it…

Step 1 – Create the first rectangle

Start with a blank user control and ensure you have a layout root grid. This will be very important for the scaling later on.

Expression blend project start

Create a new rectangle in your required dimensions, in my case its 150 x 50 pixels. Set the fill to a gradient fill maintaining the default gradient. Set the first colour to Black and the second colour to a dark grey, i have used #FF454444 as the dark grey. Set the corner radius to 3 for both x and y.

Create the first rectangle

Step 2 – Create the glass effect rectangle.

The next step is to create the inner rectangle which will give us the glass effect. To do this simply copy the previous rectangle and paste. For now we just want to shrink it so we can get the look right and feel right. Shrink the inner rectangle so that it’s just under half the height of the first rectangle and so that there is a nice gap on either side. Change the gradient colours to white and set the Alpha of the first colour to 10 and the second to 75.

Create the glass rectangle

Step 3 – Make the button

Now it’s time to make a Button out of the rectangles we have. First we need to group everything into a Grid. So right click and select “Group Into” and select “Grid” or Ctrl + G.

Group the elements into a Grid

Now select “Tools” -> “Make into control” and select the button control. Give the template a name.

Make the elements into a control

Make the elements into a button control

You should now see the button text appear in the centre of the control. This will also put you in template edit mode. You will need to either double click on the canvas or click the ‘Button’ element at the top of the designer. This is so that You can set the font size and colour of the button to the desired settings. I have set them to 23 and White.

Exit template mode

Step 4 – Make the button scalable

You should now have something that looks like a button however if you try to scale it the elements won’t stay in proportion to the height and width of the actual button.

Button layout complete

The Easiest way to get around this is to place the elements into a layout element that scales its content. I find the Grid makes the most sense so enter template edit mode by right clicking the control and selecting “Edit Template” -> “Edit Current”.

Enter template edit mode

Select the Grid you grouped the elements into earlier from the “Objects and Timeline” toolbar and add to it three columns and three rows. You can do this from the layout tool bar.

Select the grid

Add rows and columns from the layout toolbar

Set the column with to 0.025,1 and 0.025 star respectively and the row heights to 0.15, 0.75 and 1 star respectively. This is very important as it is what will retain the relevant proportions of the elements.

Add rows and columns to the grid and set the width and height

Place the background rectangle and the content presenter in row and column 0 with row span and column span set to 3. Place the glassy rectangle in row 1 column 1 and now set the glassy margins to 0 and its height and width to Auto with horizontal and vertical alignment set to stretch.

Set element grid positions

Make sure that the Content element is a layer behind the glassy rectangle by moving it in the Objects and Timeline toolbar. This is so that the whole button will appear to be glass including the text. You can test this is the case by changing the foreground of the button to a shade that will make this clear to see.

Set element ordering

That’s it. You should now have a very simple scalable glass button.

The finished Button

VN:F [1.9.10_1130]
Rating: 8.6/10 (5 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)
2011
07.12
VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)

My job is a great passion of mine and although sometimes I forget why, it’s clips like this that remind me why I wanted to become a software engineer so badly when I was a wee boy! TV programs such as Star Trek engaged me not for their stories but for the concept technology and paradigms that I hunger for even today.

Check out this cool clip from Corning

VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)
2011
06.10
VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)

For too long I have been banging on about a paradigm shift in desktop user interfaces. The whole menu drop down and desktop Icon thing is just not cool. More importantly it’s not intuitive and it’s not engaging.

So looking at the “Building Windows 8” video released by Microsoft it looks like the Tiles paradigm introduced in the Windows Phone 7 is here to stay. For now at least.

Some have said that the Tiles paradigm is no good – that it’s too visually noisy. Yes tiles can be noisy but I’m not sure I agree that this is the fault of the tiles themselves. Tiles are far less noisy than a desktop full of Icons. I hate Icons because they don’t offer me enough information. With tiles I don’t actually have to open the application to see that I have a new email for example. As the user, I can decide how much noise I want in my desktop of tiles.

I’m not saying that tiles are the paradigm shift we have been waiting for but at least it’s a shift in the right direction. In any case, Tiles are just A small part of the new user experience (UX) that Windows 8 offers. Windows 8, like the Phone 7, encourages the seamless integration of OS and application with the full screen style of application that is demonstrated in the video which is far less visually noisy than the traditional style of applications of the past. I have recently written UI in that style and I have to say, designing for that layout really makes you think about what the user is looking at. I find myself asking questions like: “Does the user really need to see this button right now?” and “How can I hide this noise/content in a way that is intuitive for the user to get back to”.

So is this new style of UX intuitive? Well that remains to be seen but it’s certainly engaging so it ticks that box.

But there is a down side of this new style of UI. The file menu and UI design of the past was pretty standardised. Most applications looked the same and this made discoverability consistent between applications. The menu structure usually had all the available commands in there somewhere! As a result developers didn’t really need to think about UX. Now they do and it’s about time!

So why do we need to think about UX? Well that’s perhaps a topic of discussion for another post. But let me just say one thing: Apple have demonstrated that good UX is what people want-no wait, it’s what people need. It’s in demand ! People are paying big money for it. The bottom line is software is used by people, human beings that laugh, cry, smile and frown! User interfaces inevitably trigger emotion in people and in the past its mainly been that of frustration. The time of the users is just as valuable to them as the time of the developers so helping users save time through good user interaction must be a first class requirement rather than a “nice to have” feature!

VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)
2011
06.02
VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)

So with the latest version of Flex 4.5 hero SDK its now possible to package for IOS although market place support is not quite there yet but I am willing to let that one slide for now!

So being a C# guy, naturally I wanted to see if I could get up and running with flex in Visual Studio for a smaller learning curve. Guess what. I did ! Quite frankly I was amazed at the level of support for this.

Amethyst by Sapphire steel software is a visual studio plug-in that allows you to develop flex applications. It’s all there; debugging, a visual designer, unit testing and it all just works, I was up and running in minutes writing my first flex application. It’s not free (fair enough ! It’s that good !) so I thought I would check out the free options too.

I am currently spiking out FlashDevelop with flex 4.5. FlashDevelop feels much lighter weight than Visual Studio. Its simpler, leaner and faster and I like it for that! Getting up and running is not quite so smooth but going through all the setup helps with the whole learning experience. At the moment I am going for a complete end to end spike so I’m interested in unit testing, IOC and other design pattern frameworks, build automation and deployment (just android for now).

I am trying to use FlexUnit for unit testing, Spring actionscript for IOC and I will see how it goes from there.

So far I have to say the experience has been a pleasant one. I don’t feel restricted by the tools in any way, just my lack of knowledge.

So why did I ditch Amethyst? One thing that put me off Amethyst is the proprietary attributes that it decorates methods with. It was too much black magic that I didn’t have time to learn. I didn’t want to get into any complications with compatibility down the line and I also didn’t want to rely on more vendors than I needed to. Just being dependent on Adobe feels more natural to me as it’s what I am used to in the Microsoft world. So I decided that vanilla Flex is the way to go. Sorry Sapphire steel !

VN:F [1.9.10_1130]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.10_1130]
Rating: 0 (from 0 votes)