Tuesday, 5 March 2019

Improving an old application - MVC Bundler

I'm maintaining an MVC application that was built in 2015. It works, but it doesn't work great, so today I'm looking at assets.

Thankfully at least it uses MVC Bundler for bundling and minification. This is a good tool for an app of this era.

These are the bundled scripts (only JS) according to Chrome:

Pass and receive data in Aurelia routes

Aurelia allows for a pretty flexible routing configuration. Your main router can call views which themselves contain sub-routers.

But how do you pass data into those sub-routes? What if your main router gets some data from the server that you don't want to re-get for every sub route?

Let's define a couple of routes, details and payments:

Tuesday, 4 September 2018

Destructuring assignments in TypeScript

This is a really quick post to show some examples of destructuring assignments in TypeScript.

First, what is a destructuring assignment in JavaScript?

Tuesday, 7 February 2017

MSMQ between two computers

According to Wikipedia, Microsoft Message Queuing or MSMQ is a message queue implementation developed by Microsoft and deployed in its Windows Server operating systems since Windows NT 4 and Windows 95. It's a super-easy method of Inter-Process Communication in Windows.

Recently I wanted to use Hangfire to coordinate jobs across internal and external web servers, but Hangfire has a 15s delay thanks to it's use of polling SQL Server. You can use Redis or MSMQ to reduce that delay to "instantaneous", but these are two separate computers, so how do they communicate using MSMQ? There are a few gotchas, as you'll see below!

Friday, 27 January 2017

Aurelia and select2

Aurelia - a great JavaScript framework for web development - but it's still in it's early stages so sometimes documentation isn't verbose enough and third party libraries haven't been integrated properly

meet

Select2 - The jQuery replacement for select boxes.

Tuesday, 5 April 2016

Windows isn't phoney 8.1

Windows Phone 8.1. Do you use it or ignore it?

After dropping my old phone and using a cheap replacement Lumia for a couple of weeks, here are my impressions of windows phone 8.1 in a nutshell:

It looks impressive. Features on paper are excellent and the minimal UI is cleaner, more grown up, easier to see and coherent unlike other major operating systems.

It promises a lot, with things like continuum, if you can upgrade to windows 10.

Friday, 28 December 2012

Surface Tension

I have in my hot hands a Microsoft Windows Surface running Windows RT (the ARM / lite version of Windows 8).

There's been a lot of criticism of the Surface, and the world always needs another opinion, so here's:

My take on three Windows 8 criticisms:

Tuesday, 29 November 2011

Highlighting elements in a Webdriver automated test

So, you use Selenium 2's Webdriver to automate some unit tests in your C# .NET enterprise web application? Me too.  Our list of tests is growing longer and longer, and watching web pages fly by automatically can be amusing - but which element is being looked for, or clicked?  Can you highlight the element before Webdriver clicks on it?

Saturday, 15 October 2011

Sharing iTunes apps for free

There are various instructions on sharing iTunes apps between different devices used by different people (linked to different iTunes accounts).  I just discovered how to do it without manually copying files between computers, so long as you can enable "Home Sharing" between your various devices.

Friday, 14 October 2011

Dennis Ritchie

The tributes to Dennis Ritchie won’t match the river of praise that spilled out over the web after the death of Steve Jobs. But they should. 
And then some.
http://www.wired.com/wiredenterprise/2011/10/thedennisritchieeffect/

Wednesday, 10 August 2011

ASP DX GridView Command Column buttons per-row visibilty

The DevExpress GridView used for showing a list of data objects has a neat Command Column in which you can put a delete button, or edit button (and others).  On clicking this button the related data source event is fired, adding, deleting, or updating the required object.
Command Column showing the Delete button

Wednesday, 23 March 2011

If only all EULAs were this good!

I installed some MS fonts in Ubuntu recently, and this is the EULA I was presented with:


If only all EULAs were this good!

Thursday, 17 March 2011

A Call Centre for Security Software, Condoms, V, and a Melbourne Pharmacy!

Wait... what?

I received a phone call today that went something like this.  I've had these before, but this time I had some spare time to play.  This is the best I can remember, the real phone call went on for nearly 15 minutes, and there was a lot more going around in circles!

Me: Hello?
(Indian) Voice: Good afternoon sir, may I speak with Mr Bootchernaan? [those who know me will recognise my name in there somewhere!]
Me: What about?
Voice: I am calling from Microsoft, and we have detected that your computer is infected with viruses from the information it is sending to us
Me: really?
Voice: yes sir, you computer is infected with viruses and trojans and ...
Me: how do you know this?
Voice: your computer sends us information...
Me: How?

Friday, 28 January 2011

Customising Dates in Evolution

Evolution is Gnome's official email, calendar, contact, & task management software.  ie. I use it daily to check my emails.

I've always had a pet peeve with date formats that look like this:
It's fine when I'm thinking about mail relative to today.  However, sometimes I have to check for certain emails with regard to the absolute date.  For example, "What was all the correspondence to a certain customer on the 21st".  I would quickly scan the date column for 21/01/11, and find there isn't any.  However the 21st was last Friday, which is shown as "Fri 02:42 PM".  There are various reasons why this is not a good thing with regard to efficient human-machine interfaces, however there are also good reasons for a fuzzy date.

Since Linux gives you so much choice (in the right places) it's gratifying to see the option to change the date column to any of a number of presets, or your very own format:


As you can see, I've selected a simple day/month/year format:

Note: the version of Evolution used here is 2.32.1

Thursday, 27 January 2011

hop counter

I was playing with traceroute and felt like "rolling my own" hop counter, so this is what I put together in a few seconds:

for ((i=1;i<21;i++)); do echo -n .; if ping -c 1 -t $i somehost.com >/dev/null 2>&1; then break; fi; done; echo " $i hops"

You'll reasonably quickly see a few dots (especially if the router in question doesn't respond to pings) and a final count.  You can of course tweak the options to ping to make it more like traceroute (max wait time, max hops, etc).  The output is something like:

.......... 10 hops

Now, for some reason `traceroute` needs superuser access for the ICMP option, and yet you can do the same with ping.

Tuesday, 28 December 2010

Internet TV... without the internet TV bit.

So I bought a 32" LED backlit (not LED pixel) LCD Samsung a couple of months ago.  It's hard to compare "Internet" TVs because each brand puts their own spin on exactly what "internet" means.

The Samsung series 6 has an Ethernet port, and by default Windows (Vista and higher) detect it and ask if you want to "trust" it or not.  The TV detects DLNA servers you might have easily on your network too.

But what about this "internet" claim?  When I first bought it, there were some simple internet "apps" that you can choose from and install.  Mostly boring stuff from a TV perspective like Google Maps, Picasa, Facebook, Youtube, etc.  This is all good but not exactly what I'd call internet "TV".

Wednesday, 8 December 2010

SATA disk beeping

I've never heard a hard drive beep!  Until yesterday.

I just yoinked a free second hand Inspiron 9400 laptop for a media centre, sans disk.  I purchased the cheapest SATA 2.5" disk I could find - 320Gb for about $50.  I started installing MythBuntu and then the drive started clicking and beeping, and the installation froze!  It was the usual crunch of a failing drive with an intermittent "beep" (much like the electrical interference noise you sometimes get in laptops / desktops).  The drive worked fine in a USB caddy.

At a complete loss, I turned to the oracle (Google) and found this.  Strangely, some drives are sensitive to the 5V power supply (it was the cheapest drive I could find).

Up until then I had been working on battery, so I plugged in the power, rebooted, and the drive worked flawlessly.  Hopefully it won't do the same when I loose power...

update: The problem seemed to be getting worse, so I returned the drive under warranty.  With the Christmas break I'll have to wait until they get back to me...
update: The drive was returned, and Seagate replaced it under warranty.  For the same price I purchased a 320Gb Western Digital Caviar Black 2.5".  It is infinitely quieter (I can't hear it with my head pressed to the laptop).

Live and Learn!

Wednesday, 6 October 2010

WakeOnLan from your Pocket PC

There are various programs and tips around for those of us who still use Windows Mobile (yes, I don't have an iPhone nor and Android phone...)

I've gathered some tips to set up "Wake on Lan" so you can wake any computer in your house from your mobile/PPC.

Wednesday, 8 September 2010

nvidia, opengl, compositing: play nice!

I was pleased to see this in the ChangeLog for the nvidia drivers 256.53:
"Fixed a bug that caused extremely slow rendering of OpenGL applications on X screens other than screen 0 when using a compositing manager."
Well that sounds nice.  Hands up who runs compiz on an nvidia card with two screens using xinerama?  You might notice your GL screensavers run incredibly slow.  Here's some examples, for testing I used glmatrix which you might be able to run directly via /usr/lib/misc/xscreensaver/glmatrix.

I have a Core(TM)2 Duo CPU T9500 @ 2.60GHz laptop with an nVidia Quadro FX 1600M, 1920x1200 screen and a second 1920x1200 LCD.  I've loaded the new 256.53 nvidia module.  Here are the results:

Tuesday, 24 August 2010

The Principle of Least Surprise

An oldie but a goodie.

When you write / design / create, be it a building, a program, a document or something else, try and think what reaction would cause the least amount of surprise to some input (eg. if you walked down a hallway and came to a dead-end, you would probably be surprised, ergo don't design dead-ends into hallways for no reason).

Why then, does the Windows XP "ctrl + alt + del, u" always shutdown straight away, unless there happen to be 50 updates waiting to be installed?  Now I'm stuck waiting for half an hour with a dead computer, because the shortcut I always use to shut down has changed from "shut down now" to "install updates and then shut down".
 
Copyright 2009 Another Blog. Powered by Blogger Blogger Templates create by Deluxe Templates. WP by Masterplan