A pleasant walk through computing

Comment for me? Send an email. I might even update the post!

Enable Synaptics touchpad 2-finger tap context menu

For some reason, my laptop’s Synaptics touchpad settings dialog doesn’t include two-finger tap to bring up a context menu (mimicking the right-click).

Having to position the mouse and physically right-click is error-prone and slower. Likewise with the included feature to two-finger click (in fact, that’s worse). It turns out the touchpad is capable of double-tap. You just have to go to the registry.

Here are the steps, mostly copied.

http://www.tomshardware.com/answers/id-1851375/finger-tap-click-windows.html

https://forums.lenovo.com/t5/Idea-Windows-based-Tablets-and/2-Finger-Tap-right-click-not-working-Win-8-0/td-p/1324087

1. To re-enable two finger tap, press Windows key + R, enter "regedit" then press enter, and on the left pane browse to the following locations:
HKEY_CURRENT_USER\Software\Synaptics\SynTP\TouchPadPS2

AND 

HKEY_CURRENT_USER\Software\Synaptics\SynTP\TouchPadSMB2c
(the first location didn't work for me, but the second location did)

2. In the right pane, double click on 2FingerTapAction and change the value to a "2" (Hexadecimal) for right click, or a "4" (Hexadecimal) for middle click

3. Double click on 2FingerTapPluginID and clear any value it may have.

4. In the right pane, find the MultiFingerTapFlags key and change it from a 2 to a 3.

4b. Additionally, if you want to enable three finger tap for middle click, double click on 3FingerTapAction and change the value to a "4", also clear any value for 3FingerTapPluginID and set 3FingerTapPluginActionID to "0".

5. Restart your PC and you can see the changes well enough.

Note that if you change any setting using the Synaptic dialog, the above will get unset and you’ll have to manually do it again.

Installing fcm flow cytrometry library on Windows 8.1

My friend Andrew is working with flow cytrometry, which is a fancy way of saying “a field I don’t understand.” He wanted to use a python library for analyzing data, but was having trouble getting it installed. After some effort, I found this worked. The core problem is that py-fcm hasn’t been updated to work with later versions of its dependencies. It also doesn’t list the versions of its dependent libraries, making installation difficult.

Fortunately, I happened across a site that maintains Windows binaries for lots of packages, plus a science-ready Python distribution. I don’t know if this will install properly on Windows 7, but believe it will.

Downloads

Enthought Canopy Express

This is a free Python distribution. I installed the x64 version, specifically 1.4.0-win-64, which used Python 2.7. It includes the following packages that py-fcm depends on: numpy, scipy, matplotlib, cython.

https://www.enthought.com/downloads/

DPMix

The Windows installer version of DPMix. I used version dpmix-01.win-amd64-py2.7.exe.

http://www.lfd.uci.edu/~gohlke/pythonlibs/#dpmix

Py-FCM

Download the Windows installer fcm‑0.9.1.win‑amd64‑py2.7.exe from

http://www.lfd.uci.edu/~gohlke/pythonlibs/#py-fcm

Also, download the latest source. This just makes it easier to get the sample file.

https://code.google.com/p/py-fcm/source/browse/

NOTE

I did not install mpi4py, as it is an optional dependency, but here are the links. I also didn’t install the fcm GPU support.

http://www.lfd.uci.edu/~gohlke/pythonlibs/#mpi4py

https://bitbucket.org/mpi4py/mpi4py/downloads

Installation

1. Run the Canopy installer. It does not require administrative privileges. I stuck with the defaults.

image

image

image

Clicking “Start using Canopy” will configured the environment. When configured, a window will open, which you can then close. Your desktop will have two icons, one for Canopy, the other for PyLab.

2. Run the DPMix Windows installer. It will find the Python installation and use it.

image

image

image

3. Run the py-fcm Windows installer. It likewise will find and use the Python installation.

image

4. Modify gate.py script. This is critical, as the matplotlib library no longer uses nxutils.

  1. Open this file in a text editor (using your own Username for the directory): C:\Users\Charles\AppData\Local\Enthought\Canopy\User\Lib\site-packages\fcm\core\gate.py

  2. Comment out line 56, and uncomment line 52.

if name is None:
    name = self.name
idxs = points_in_poly(self.vert, fcm.view()[:, chan])

# matplotlib has points in poly routine in C
# no faster than our numpy version
#idxs = points_inside_poly(fcm.view()[:, chan], self.vert)

Also comment out the nxutils import on line 2

import numpy
#from matplotlib.nxutils import points_inside_poly

Test

  1. Unzip the py-fcm source. In the sample_data folder is a file named 3FITC_4PE_004.fcs.
  2. Open a text editor, and copy the complete path to the file, e.g.
    C:\Users\Charles\Documents\FCM Flow Cytometry\Py-FCM\py-fcm-91701cc7a98e\sample_data\3FITC_4PE_004.fcs
  3. Now, replace all back slashes with forward slashes.
    C:/Users/Charles/Documents/FCM Flow Cytometry/Py-FCM/3FITC_4PE_004.fcs
  4. Open PyLab from the icon on the desktop, and run the samples found here (reproduced below).

image

fcm provides the loadFCS() function to load fcs files:

>>> from fcm import loadFCS
>>> data = loadFCS('../sample_data/3FITC_4PE_004.fcs')
>>> data
3FITC_4PE_004
>>> data.channels
['FSC-H', 'SSC-H', 'FL1-H', 'FL2-H']
>>> data.shape
(94569, 4)

Since the FCMdata object returned by loadFCS() delegates to underlying numpy array, you can pass the FCMdata object to most numpy functions

>>> import numpy as np
>>> np.mean(data)
410.38791252947584
>>> np.mean(data,0)
array([ 538.76464803,  421.57733507,  340.03599488,  341.17367213])
>>> import pylab
>>> pylab.scatter(data[:,0],data[:,1], s=1, edgecolors='none')
>>> pylab.xlabel(data.channels[0])
>>> pylab.ylabel(data.channels[1])
>>> pylab.show()

_images/basic-1.png

 

References

Info about the nxutiles error. https://groups.google.com/forum/#!topic/py-fcm-dev/HibEajOCTEY

https://pythonhosted.org/fcm/install.html
https://code.google.com/p/py-fcm/
https://www.enthought.com/
http://www.scipy.org/index.html
http://matplotlib.org/
https://github.com/andrewcron/dpmix
http://docs.cython.org/src/quickstart/install.html
https://bitbucket.org/mpi4py/mpi4py/downloads
http://mpi4py.scipy.org/docs/usrman/install.html#requirements

Windows 8.1 Update 1 Driver Problem DTMB BDA TV USB

After updating to Windows 8.1 Update 1, my wife installed a USB flash drive that previously gave her no problems, and now wouldn’t show as a drive in Explorer. I got the same error on my (also updated) computer.

image

A notification was in the system tray to view devices, which showed the flash drive icon. Right-clicking that and choosing Troubleshoot suggested removing the device and reinserting. Some web searching said the same thing—which was almost right. However, the driver wasn’t being fully removed, so kept getting used again, resulting in the same error.

1

Instead, the driver needs to be completely removed. To do this:

  1. Plug in the flash drive.
  2. Open Device Manager.
  3. Find the bad device.
  4. Right-click and choose Uninstall.
  5. When prompted, check Delete the software for this device.
  6. Unplug the drive, then plug it back in.
  7. The drive should now be available.

image

4