Wednesday, 6 May 2015

Citrix Access Gateway crashes on startup

Recently Citrix Access Gateway has started crashing on startup when I work from home.

Steps to resolve:

Uninstall
Download a newer version
Run the VPN client using Firefox
It will then ask to downgrade
Then it works

Thursday, 30 April 2015

Visio hidden gems

Curved connectors

To add a curve point, select the line, then select the Freeform tool (the fourth Tool, CTRL+T, normally defaults to Rectangle), hold down the CTRL key and place a point on the line.

To remove a curve point, select the line with the pointer tool. Click on the point and it will turn red. Press the delete button.

Adding Connection Points to shapes

Select the shape first. Make sure the correct shape is selected otherwise you will add the point to the wrong shape and it will probably be floating with an offset. Select the Connection Point Tool (CTRL+SHIFT+1). Hold down the CTRL key and press the left mouse button where you want the point to appear.

Monday, 27 April 2015

Code Analysis CA1704: Identifiers should be spelled correctly

I had a variable, DisableDtc, that was throwing code analysis error

CA1704: Identifiers should be spelled correctly.

The description is slightly confusing. What it really means is that it doesn't think one of the words is a real word.

In this case, it recognises Disable, but doesn't recognise Dtc.
The solution is to add Dtc to Dictionary/Words/Recognised/Word.

Saturday, 11 April 2015

Betting Online - what they DON'T tell you

It's the annual Grand National and a chance for the family to engage in a very gently competitive and fun event: choose a horse and put a pound on it to win and a pound each-way. So we put down quite a lot of £1 bets.

And you might win a small amount; a few quid.

This year we did.

So we logged in to Paddy Power to collect our £5. But hold on, no; it's £4. Apparently there is a Rule 4, which enables the bookmaker to reduce the winnings by a percentage because a horse pulled out.

But hold on - the horse that pulled out, Carlito Brigante, pulled out YESTERDAY. And we live in a modern gambling world with in-play gambling where they can alter the odds during a game. Where if Ronaldo scores the next penalty the odds are constantly updated. So surely they could have altered the odds accordingly 2 hours before the race, 5 minutes before, 30 seconds before?

No, it's in the small print.

So OK, it's £4 then. Can we have it?

No, apparently not. There are minimum withdrawal limits. £10 please.

So you either have to put down a bigger stake, or perhaps you would like to bet with us again sir?

When I asked, I was told

"The limits and terms are all on site for customers to check before depositing if they wish."

and

"We have a search function within the help centre"

All very correct, but not very benevolent. So I'd better read the T&C's then. I copied them into Microsoft Word. They were 27 pages and 13,236 words.

Do companies really expect us to read all of that before engaging in an activity? I'm sure there are more words there than my household insurance.

With all that tech at their finger tips and all their advertising might, Paddy Power don't make it clear that the small £1 bet is meaningless.

The morale of the story? Small bets suck. Paddy Power don't help. Stay away from a mugs game.

Saturday, 4 April 2015

Stock Messaging App keeps crashing on Android - Samsung Galaxy S3 mini

On a friend's Samsung Galaxy S3 Mini when I went into the stock Messaging app, it would pause on a black screen, and then crash with the error dialog.

Some research suggested going into Settings > Application Manager and swiping right until "All" is selected at the top. Select messaging and then "Clear Data" and "Clear Cache".

Unfortunately this didn't work.

I then rebooted the device into Safe Mode. This required turning the device off, turning it back on and holding the Volume Down button when the Samsung logo was displayed.

I then went  into Settings > Application Manager and selected Log Provider (it was at the bottom). It said "Disabled" against it. I clicked it, enabled it, and then the messages app started working again.

I noticed by debugging the app there was an error "Failed to find provider info for logs". Also "Process com.android.mms (pid xxxx) has died."

Tuesday, 31 March 2015

Android Concurrent Programming

Here is a short summary of available options for concurrent programming in Android

AsyncTask<> - useful for a short-lived task that has UI interactivity. The work is done in the doInBackground method, and there are methods for pre and post-task that will execute on the UI thread. This option should not be used for long running operations lasting more than a few seconds as it could be terminated by the system.

Background threads - Manually created. You can choose between an explicitly created thread and one from a thread pool. A background thread may still be terminated by the operating system before it finishes. Useful for operations from 100ms up to a few seconds.
The thread class has to be passed an implementation of the Runnable interface and Thread.Start is called.

Future - a representation of a value that has not yet been computed. The example below creates a future and starts the work. Other tasks are performed in the background. However the calling thread is then blocked as the future's get method is called and the caller awaits the result. (Of course the result may already be available at this point and so the caller is not blocked in this situation).

Future future = executor.submit(new Callable() {
         public String call() {
             return searcher.search(target);
         }});

displayOtherThings(); // do other things while searching

try {
       displayText(future.get()); // use future (will block the caller)
}
catch (ExecutionException ex) { 
       cleanup(); 
       return; 
}


FutureTask - an implementation of a future. It implements the Runnable interface and so may be executed by an executor.

FutureTask future = new FutureTask(new Callable() {
     public String call() {
       return searcher.search(target);
   });
 executor.execute(future);}
 
Some useful slides detailing a lot more techniques are here.

Saturday, 21 March 2015

Recording video

Fraps is good for recording in-game video. To transcode it to something more suitable for YouTube, use Handbrake.