2015-11-20

Google Play cannot download error 495

When downloading an application from Google Play while using mobile / cellular network, the download may fail and Google Play reports "error 495". In my case, the fix was to enable background data for the "Media" application (I restrict almost all applications from downloading background data on my phone).

  1. Navigate to Settings, Data Usage.
  2. Select the mobile operator tab.
  3. Scroll down until you find "Media" application. If has "restricted" next to it, it is prevented from downloading background data, so enable it and try to install your application again.

2015-11-10

Recursive preorder traversal of a folder tree in VBA

To process files in a folder tree using Excel, I implemented a recursive preorder traversal of a tree in VBA below. I haven't had to do this earlier because I usually use Gnu "find . -exec" to process files in folders.
Option Explicit

'References
'1. Microsoft Scripting Runtime

Global gFso As Scripting.FileSystemObject

Sub Main()
  Set gFso = New Scripting.FileSystemObject
  TraversePreorder "C:\KS Work\Temp"
End Sub

Sub TraversePreorder(ByVal sPath As String)
  Dim oFolder As Scripting.Folder, vMember As Variant
  
  If gFso.FolderExists(sPath) Then
    Debug.Print sPath 'Process folder
    Set oFolder = gFso.GetFolder(sPath)
    For Each vMember In oFolder.Files
      TraversePreorder vMember
    Next vMember
    For Each vMember In oFolder.SubFolders
      TraversePreorder vMember
    Next vMember
  Else
    Debug.Print sPath 'Process file
  End If

End Sub

2015-10-21

Excel auto-fill keyboard "shortcut"

Excel's AutoFill is usually activated by selecting a group of cells and dragging the fill handle (the black square on the bottom-right hand corner of a selection) with the mouse until you have the range you want. The keyboard "shortcut" (more a sequence of keystrokes than a simple shortcut) is to select the range you want first then type: Alt+h,fi,s,Alt+f,Return. The breakdown of the steps are:

  1. Select the range you want.
  2. Alt+h: show the Home menu strip.
  3. fi: show the Fill sub-menu.
  4. s: show the Series dialog.
  5. Alt+f: In the Series dialog, select Type=AutoFill.
  6. Return: In the Series dialog, press the OK button.

2015-08-23

SVG Clocks

12 1 2 3 4 5 6 7 8 9 10 11 UTC Time AM PM Local Time AM PM

Display UTC and local time using analogue clocks. This document uses Javascript and inline SVG code in an XHTML document. It can be viewed using a SVG-capable browser such as Chrome. I wrote this page nearly a decade ago and only ported it to Blogger.

2015-06-26

Activation context generation failed ... HsxClient.dll

After a server patch, the HFM (Hyperion Financial Management) Windows client could not start. Below is the error message in Event Viewer.

SideBySide,
Activation context generation failed for "... HsxClient.dll". Dependent Assembly Microsoft.VC80.MFC,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053" could not be found. Please use sxstrace.exe for detailed diagnosis.

Oracle Support suggested reinstalling VC++ Redistributable 2005. Searching for the version number brings up "Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update". Installing the x86 redistributable package solved the problem.

2015-01-29

Excel cannot find the data you're searching for

Sometimes Excel cannot find text in a cell that is clearly visible. Some workarounds and solutions:

  • In the "Find and Replace" dialog, untick "Match entire cell contents".
  • In VBA, specify the LookAt parameter, .Find(..., lookat:=XlLookAt.xlPart)
  • In your worksheet, remove custom formatting from the cell range you are searching.

The last workaround is pretty weird. One would think that formatting shouldn't affect searching for data!