April 17th, 2009
Well, Ubuntu has supported it for a while via the wpa_supplicant tool, but finally the GUI network manager works without a hitch. Here’s what you need to select from the GUI:
Security: Dynamic WEP (802.1x)
Authentication: Protected EAP (PEAP)
PEAP Version: Automatic
Inner Authentication: MSCHAPv2
Plus your UTD username/password.
To upgrade, hit Alt-F2 and type in “update-manager -d”.
Posted in open source | No Comments »
April 13th, 2009
CUDA is Nvidia’s C-like API for non-graphic number crunching on their 8xxx level and above video cards. For certain operations, it is amazingly fast. Unfortunately, it is painful in the extreme to use, especially when compared to Numpy, Python’s wonderful scientific computing package.
So, to marry the two, I wrote for myself some wrapper code. It’s pretty much only good for one thing: multiplying large matrices together really fast. But it’s really good at it. (and it’s really easy to use) For example:
import numpy
from pycublas import CUBLASMatrix
A = CUBLASMatrix( numpy.mat([[1,2,3],[4,5,6]],numpy.float32) )
B = CUBLASMatrix( numpy.mat([[2,3],[4,5],[6,7]],numpy.float32) )
C = A*B
print C.np_mat()
All CUBLAS alloc and free calls are mapped to the CUBLASMatrix object’s life in Python, so you don’t have to worry about memory management. (other than filling up the card, or course)
Here are some performance numbers: (includes memory transfer times)
(4160×4160)*(4160×4160) = 43.0X faster than numpy
(4096×4096)*(4096×4096) = 34.0X
(3900×3900)*(3900×3900) = 47.3X
(2048×2048)*(2048×2048) = 28.2X
(1024×1024)*(1024×1024) = 58.8X
(512×512)*(512×512) = 24.1X
(256×256)*(256×256) = 6.3X
(128×128)*(128×128) = 1.1X
CPU: Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz stepping 06
GPU: nVidia Corporation GeForce 8800 GT (rev a2)
Note: This version only supports float32.
Note: CUBLAS limits matrix dims to (65536×65536).
Source code available here: pycublas.py (rename download to pycublas.py to use)
Posted in open source, programming | 6 Comments »
December 30th, 2008
Marrying Lingyan has been the most wonderful, exciting experience of my life.
Here are some wedding photos.
Posted in other | No Comments »
December 19th, 2008
My fiancĂ©e and I registered at Target a few days ago, and after spending more than a little time wandering the store with the special scanner gun they give you, we handed it back to them and they said “Thank you very much! Your items will be viewable online within 1-2 hours.” We said great, went home, and went to bed.
The next day I tried to look it up online, and low and behold we have an empty registry. I call up the local store, and they explain the syncing happens automatically, wirelessly through the unit. They assured me it wasn’t sitting around unsynced somewhere, forgotten. They then transfer me to some regional office, they transfer me to general customer support, who transfers me to the bridal registry, who assures me (quite curtly) it’s in the system, just that it takes up to two days to display on the website. She said there was nothing to do but to wait another day, and call back if it didn’t appear.
Well, today, it’s still an empty registry. I go through the same series of phone calls again, and I’m told there are no items registered in either system, and that we need to return to the store to select the items again. Or, “we have convenient registry access online! You can pick out what you want there without having to go back again!” Gee, thanks lady. I’m astonished by the ease and convenience of the options you have presented me, and and eternally thankful for the care and level of professional support Target has provided me so far. Would you please delete my registry from your system?
Grrr. Argh.
Posted in personal, stupid | No Comments »
December 9th, 2008
Google’s LDC2006T13 corpus is organized in an understandable but slightly annoying way; as a tar of split gzipped files. To avoid having to untar it repeatedly, (in fact, at all, as it’s >100GB extracted), I wrote a small Python generator that let’s you iterate over them in their compressed state. Usage is something like this:
corpus = LDC2006T13()
for ngram, count in corpus.ngrams(3):
print ngram, count
Code is here: LDC2006T13.py
Posted in open source, programming | No Comments »
November 24th, 2008
I’ve been a home-brewer for I suppose a year and a 1/2 now. (My friend John got me interested several years ago in AL) And I made another batch last night. Here’s the recipe:
- 1 can Cooper’s Stout extract
- 6 lbs DME
- 2 tsp premium vanilla extract
- 1 lbs uncooked oats
- small handful of 88% cocoa bitter chocolate
On a side note, some people look down pretty hard on those of us who use the canned extracts, but they taste great to me. And they’re easy to work with, you get a consistent flavor, etc. Maybe years from now I’ll laugh at my current naivetĂ© while cooking over a $200 10-gallon stainless steel mash pot next to a $500 immersion chiller, but I currently suspect that will be more post-hoc expense rationalization and less about the actual flavor of the beer.
But anyway, 6 lbs of dried malt is a lot. My last batch was 4.5 lbs. Usually 3 is used, if making an all-malt batch and you want 6% ABV, or 1.5 if you’re making an 50% batch (malt+dextrose) The 4.5 batch bubbled over out of the fermenter and all over the floor, which I had forgotten. So my surprise was pure stupidity seeing the same this morning.
So I cleaned it all up, mopped, and marveled at the non-trivial breeze coming from the air-lock at the top of the bucket. (not to mention that amazingly delicious yeast-orgy smell) And then sat down to call around for a new clutch for my washing machine. (I didn’t even know they had clutches until last night…another story) I was on hold for what seemed like forever waiting for someone to check their stock, when *BOOM*. I run into the kitchen, and beer is everywhere. Walls, floors, papers, you name it. The air lock had gotten plugged, and the carbon dioxide buildup had blown the lid of the fermenter clear across the room. Fuck.
So I cleaned up again.
Fortunately I was here and could re-sanitize the lid and get it back on before it was spoiled. And it’s still bubbling away like no tomorrow. I guess we’ll find out how it tastes in another 2 months or so…
Posted in homebrew | No Comments »
November 18th, 2008
I had to spend a bit of time working out the install procedure for PyCUDA on Ubuntu 8.10. So I thought I’d share…
cd downloads/
Install the CUDA toolkit. Ubuntu already comes with the 177.80 NVidia driver, so I didn’t install v177.73.
# install CUDA
wget http://developer.download.nvidia.com/compute/cuda/2_0/linux/driver/NVIDIA-Linux-x86_64-177.73-pkg2.run
wget http://developer.download.nvidia.com/compute/cuda/2_0/linux/toolkit/NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86_64.run
wget http://developer.download.nvidia.com/compute/cuda/2_0/linux/sdk/NVIDIA_CUDA_SDK_2.02.0807.1535_linux.run
chmod +x *.run
sudo ./NVIDIA_CUDA_Toolkit_2.0_ubuntu7.10_x86_64.run
# accepted default install location: /usr/local/cuda
su -
echo "include /usr/local/cuda/lib" >> /etc/ld.so.conf.d/cuda.conf
ldconfig
cd /usr/bin/
ln -s /usr/local/cuda/open64/bin/* .
exit
Install Boost libs, v1.35.
sudo apt-get install libboost-python1.35-dev
Install PyCUDA.
wget http://pypi.python.org/packages/source/p/pycuda/pycuda-0.91.tar.gz#md5=339dac0641cc5da2f5c153d134592ed3
tar -zxvf pycuda-0.91.tar.gz
cd pycuda-0.91/
./configure
Edit siteconf.py to look like this…
BOOST_INC_DIR = ['/usr/include/boost/']
BOOST_LIB_DIR = ['/usr/lib']
BOOST_PYTHON_LIBNAME = ['boost_python-mt-py25']
CUDA_ROOT = '/usr/local/cuda/'
CUDADRV_LIB_DIR = []
CUDADRV_LIBNAME = ['cuda']
CXXFLAGS = []
LDFLAGS = []
Then take her home…
python setup.py build
sudo make install
Now to test:
#export C_INCLUDE_PATH=/usr/local/cuda/include/
#export CPLUS_INCLUDE_PATH=/usr/local/cuda/include/
export PATH=$PATH:/usr/local/cuda/bin/
cd test
python test_driver.py
The tests run successfully for me, sans test_mempool (__main__.TestCuda). I’ll update this as I find out more.
Posted in open source, programming | 1 Comment »
October 16th, 2008
Obama’s lead in *Virginia* has grown to 10%. CNN just took it out of the swing category and put it as “for Obama”. His lead in Florida is 5%. Overall Obama has 277 “safe or leaning towards” electorial votes, compared to McCain’s 174. 87 are still considered too close to call.
66% of people thought Obama won the debate last night, vs. 35% that thought McCain won.
Also, watch the ad Obama made out of McCain’s best line of the evening:
http://voices.washingtonpost.com/thefix/2008/10/obama_practices_political_juji.html?nav=rss_blog
It ends with video of McCain saying “I’ve voted with President Bush over 90% of the time, even more than most of my Republican colleagues”.
I’m a happy man.
Posted in political | No Comments »
August 12th, 2008
The format of a ARPA language model file, as far as I can tell, is not documented outside of the CMU SLM toolkit source code. I’m regurgitating it here in the hopes that future Google searches on this topic are more fruitful than mine were.
/* This is the format introduced and first used by Doug Paul.
Optionally use a given symbol for the UNK word (id==0).
*/
/*
Format of the .arpabo file:
------------------------------
\data\
ngram 1=4989
ngram 2=835668
ngram 3=12345678
\1-grams:
...
-0.9792 ABC -2.2031
...
log10_uniprob(ZWEIG) ZWEIG log10_alpha(ZWEIG)
\2-grams:
...
-0.8328 ABC DEFG -3.1234
...
log10_bo_biprob(WAS | ZWEIG) ZWEIG WAS log10_bialpha(ZWEIG,WAS)
\3-grams:
...
-0.234 ABCD EFGHI JKL
...
\end\
*/
Posted in programming | 1 Comment »
June 30th, 2008
There was a really interesting story about a month back about a scientist who has grown a culture of e-coli over 20 years, and discovered a series of mutations leading to an ability to metabolize citrate – something never before observed in this species. Well, this has apparently angered the anti-evolution crowd at “conservapedia” (which was founded because wikipedia was supposedly too liberal), and they’ve taken to discrediting the guy. Hilarity ensues.
http://arstechnica.com/articles/culture/conservapedias-evolutionary-foibles.ars
http://www.conservapedia.com/Conservapedia:Lenski_dialog
Reminds me of one of my favorite Steven Colbert quotes: “reality has a well known liberal bias” =P
Posted in political, science | No Comments »