Category Archives: Other

ASCII Delimited text

From Wikipedia

ASCII delimited text
The ASCII and Unicode character sets were designed to solve this problem by the provision of non-printing characters that can be used as delimiters. These are the range from ASCII 28 to 31.

ASCII # Unicode Name Common Name Usage
28 INFORMATION SEPARATOR FOUR file separator (FS) End of file. Or between a concatenation of what might otherwise be separate files.
29 INFORMATION SEPARATOR THREE group separator (GS) Between sections of data. Not needed in simple data files.
30 INFORMATION SEPARATOR TWO record separator (RS) End of a record or row.
31 INFORMATION SEPARATOR ONE unit separator (US) Between fields of a record, or members of a row.

The use of ASCII 31 Unit separator as a field separator and ASCII 30 Record separator solves the problem of both field and record delimiters that appear in a text data stream.[

Installing .NET 4 – Error 1719

Was having a lot of trouble installing .NET 4 on to Windows 7 Home Premium 64 SP1

The solution was:

regedit

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MSIServer

Change WOW64 from 1 to 0

cmd

%windir%\system32\msiexec.exe /unregister
%windir%\syswow64\msiexec.exe /unregister
%windir%\system32\msiexec.exe /regserver

And then it was fine 🙂

My error log looked like this

MSI (s) (DC:FC) [20:37:13:023]: Invoking remote custom action. DLL: C:\Windows\Installer\MSICE11.tmp, Entrypoint: SchedSecureObjects
MSI (s) (DC:B8) [20:37:13:024]: Generating random cookie.
MSI (s) (DC:B8) [20:37:13:051]: Created Custom Action Server with PID 1884 (0x75C).
MSI (s) (DC:98) [20:37:13:092]: Running as a service.
MSI (s) (DC:98) [20:37:13:094]: Custom Action Server rejected – Wrong Context
MSI (s) (DC:B8) [20:37:13:097]: CA Server Process has terminated.
Action start 20:37:13: SchedSecureObjects_x64.
MSI (s) (DC:94) [20:37:13:098]: Note: 1: 1719
CustomAction SchedSecureObjects_x64 returned actual error code 1601 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (DC:94) [20:37:13:738]: Product: Microsoft .NET Framework 4 Client Profile — Error 1719. The Windows Installer Service could not be accessed. This can occur if the Windows Installer is not correctly installed. Contact your support personnel for assistance.

Error 1719. The Windows Installer Service could not be accessed. This can occur if the Windows Installer is not correctly installed. Contact your support

Fix loud or stiff space-bar Microsoft Ergonomic Keyboard 4000

The Microsoft Natural Ergonomic Keyboard 4000 is an excellent product, no other keyboard really comes close to it for touch typing in my opinion.

However there can be one very annoying bit – the spacebar.  It can be excessively loud and/or stiff to press.  Fortunately though you can easily fix it yourself!

Loudness:

The problem is that the bottom of the plastic space bar connects with some plastic on the keyboard base.  To fix this you’ll want to add some cushioning to the base of the keyboard which you’ll find easy to do yourself.

First of all, you need to pull the spacebar off the keyboard, which is easiest if you pull from the top.  You’ll need to use a bit of force, though don’t worry your keyboard will be ok :-).  Once the space bar is off you can put in your cushioning.  The image below shows where you’ll be attaching your cushions.

base-bits

I made my cushions from inexpensive heat-shrink tubing filled with some cotton wool and attached it to the keyboard with some double-sided tape, though you could easily substitute this with whatever else you have around, just as long as it is nice and squishy.  The image below show what it should it looks likes with one of the cushions.

cushion

Once the cushioning is in, remount the space bar and you should be good to go!

Stiffness:

The space-bar can sometimes be stiff to press, particularly on its side-edges.  The stiffness will usually go away after a period of normal use, though you can speed this natural process up a bit by simply tapping it a couple of thousand times where your thumbs normally press it.  For me this spot is underneath the ‘V’ key on the left and about halfway across the ‘N’ key on the right.  Just sit there and tap these spots really fast for several minutes.  You can also try pressing with very little pressure in order to get the key to stick, and then apply more pressure so that it rubs really hard inside the keyboard.  Press on the top corners of the space bar to get even more resistance.

If this doesn’t work, this you’ve basically got a dud that will only frustrate you, so return it to the shop and get another one!

Python unicode + xml.dom.minidom + write to file

# -*- coding: utf-8 -*-
import xml.dom.minidom, codecs
impl = xml.dom.minidom.getDOMImplementation()
dom = impl.createDocument(None, "root", None)
root_el = dom.documentElement
ascii_el = dom.createElement('ascii')
root_el.appendChild(ascii_el)
ascii_el.appendChild(dom.createTextNode('abc'))
utf_el = dom.createElement('utf')
root_el.appendChild(utf_el)
utf_el.appendChild(dom.createTextNode(unicode('µ 6000', 'utf-8')))
# There's a couple of ways of dealing with output:
if True:
# Will write a utf encoded file without BOM
# <?xml version="1.0"?>
# Will print "µ" to the console
# type(xmlstr) == 'unicode' i.e. unicode string
xmlstr = dom.toxml()
f = codecs.open('utf_test.xml', 'w', 'utf-8')
f.write(xmlstr)
f.close()
print xmlstr
print type(xmlstr)
else:
# Will write a utf encoded file without BOM (same as above)
# <?xml version="1.0" encoding="utf-8"?>
# Will print "??" to the console
# type(xmlstr) == 'str' -- i.e. byte string
xmlstr = dom.toxml('utf-8')
f = open('utf_test.xml', 'w')
f.write(xmlstr)
f.close()
print xmlstr
print type(xmlstr)

Getting Actionscript 2.0 ComboxBox to work when using Loader component

If you’re using a and Flash Actionscript 2.0 Loader to import another .swf file to the stage and your ComboBox/dropdown is no longer working – all you need to do is import the ComboBox component to the library of the .fla file that contains the loader i.e. drag it to the stage then delete it.

It’s basically a bug though we’ll be polite and call it a quirk =)