Technology

Political Correctness at Google

Friday, August 29th, 2008 -- By ET

Google blog posted an article on “Strengthening the Study of Computer Science”.

It started with:

At a time when more and more digital technologies are becoming indispensable to millions of people, the field of computer science (CS) is in trouble. Enrollment and retention of CS students, particularly those historically underrepresented in the field (women, African-Americans, Native-Americans, and Hispanics) has declined sharply.

I think the sharp decline in enrollment is really an issue, but the inner-economist of mine keeps saying that there is something wrong with the argument that we are able to address the issue by promoting this major to underrepresented people.

cssi_students

I believe in the invisible hand theory of resource allocation. There was definitely an excess in supply of CS students during the bubble years, but then the students shifted attention to other desciplines. We only have certain amount of brain power in the society, and the flow of these brains to different industries is definitely a good thing for the society as a whole. If computer science proves to be playing an ever increasing role in the society, I’m sure the brains will flow back. Just reward these brains accordingly.

Overall, the marginal decision maker should be indifferent to choose between any major if the market is effecient and can reward the students through the market system.

Perl Reading A File

Thursday, August 28th, 2008 -- By ET

Read from a file, and write out. Just put it here for my own reference.

#!/usr/bin/perl

$data_file=”file.csv”;

open(DAT, $data_file) || die(“Could not open file!”);
@raw_data=;
close(DAT);

#print “Content-type: text/html\n\n”;
#print “”;

foreach $lines (@raw_data)
{
chomp($lines);
($var1,$var2,$var2)=split(/\|/,$lines);
print “$var1,$var2,$var3\n”;
# print ”
\n”;
}

#print “”;

Firefox Download Day: World Record

Tuesday, June 17th, 2008 -- By ET

Download Day 2008

2008-June 17 (Tuesday)

certificate

Some Interesting Trends

Saturday, May 31st, 2008 -- By ET

Which segment are you in?

Looks like we should go to the creative class that represent less than 1/3 work force, but gets 1/2 the total money.

screen-capture2.png

X-ray Photography

Wednesday, April 16th, 2008 -- By ET

I like photography, and I like photos that view this world from different angles.

Nothing compares to the following photograph which was taken with an X-ray enabled camera.

xray2pa1304_468x734.jpg

It shows an office building, you can even see someone kneeling there to fix a copier.

While I like this photo. I think the photographer is crazy. If I were in the building, I’d surely sue this redneck photographer.

HKUST Library at night

Thursday, March 20th, 2008 -- By ET

Our library is a very beautiful building. Here is a picture I took yesterday.

Click on the image to get a bigger version.

librarytower2.jpg

Worst Captcha

Monday, March 17th, 2008 -- By ET

Captcha has been around for a while.

 

It is used to make sure that the reader is indeed a human. Although there are some algorithms to crack captcha, none of them is working well.

 

Here are some examples:

 

ob-ab313_captch_20060524170113.gif

 

The worst one I saw (or should I say the “best one”?) is the following:

 

capcha.jpg

 

If you can get it right, you are not only human, but also a rare human. :-)

Add Ports to Windows Firewall

Friday, January 25th, 2008 -- By ET

To add a range of ports to Windows Firewall from the Command Line

  1. Start Command Line
  2. Type in the following where the range is specified in ( ) and the name of the firewall entry is in ” “.
    FOR /L %I IN (5001,1,5010) DO netsh firewall add portopening TCP %I “PassiveFTP”%I
  3. Each port in the range will be added with an “OK” confirmation.

[Mac Tip] Home/End Keys and “Recent Applications/Documents”

Tuesday, November 20th, 2007 -- By ET

The default key bindings for the home and end keys in Mac OS X are different to any other operating system Ive ever used. By default, they seem to be bound to the viewport, rather than the line of text you are editing. In a multi-line document, the Home key scrolls up to the top of the document, and the End key scrolls down to the bottom. In each case the caret stays where it was.

As a programmer I find this behaviour to be just plain wrong I want Home and End to move to the start and end of the current line.

I have found a way to fix this problem by editing the default keybindings file, ~/Library/KeyBindings/DefaultKeyBinding.dict. Create the directory and / or the file if theyre not already there, and make it look like this:

{

       /* Remap Home / End to be correct :-)  */

       "\UF729"  = "moveToBeginningOfLine:";                   /* Home         */

       "\UF72B"  = "moveToEndOfLine:";                         /* End          */

       "$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */

       "$\UF72B" = "moveToEndOfLineAndModifySelection:";       /* Shift + End  */

}

If there are already entries in DefaultKeyBinding.dict, just add the 4 new mappings above to the main section of your file.

Add the following line to get a “recent applictions/documents folder” on the dock.

defaults write com.apple.dock persistent-others -array-add '{"tile-data" = {"list-type" = 1;}; "tile-type" = "recents-tile"; }'

Installing MATLAB in Mac OSX with CrossOver

Friday, November 9th, 2007 -- By ET

screen-capture-2.jpg

I have my MATLAB installed in Parallel Desktops for Mac. Since I do majority of my work in Mac now, I hate to open Parallel Desktops very often. So I’m thinking about porting some important packages to use in Mac OS natively.

CrossOver is a good package, I managed to port my BaKoMa TeX into Mac OS, it works fine. MATLAB turned out to be hard. When I install it within CrossOver, it gives an error:”Can not install OLE server”. It is related to Database, so I cleaned up all the extra toolboxes, and only install MATLAB itself. The error message still comes up.

Then I zipped the MATLAB from Parallel Desktop and unzipped the files to the “Drive_C” in CrossOver. Running MATLAB gives an error “License Manager Error -9.”. Checking MATLAB website, it seems that even if I have the serial number, I still need to reinstall, but in CrossOver, I simply can not install.

Here is the solution. Just open %CrossOver_Drive_C/MATLAB7/bin/win32/license.dat, and look for something like this: “HOSTID=DISK_SERIAL_NUM=d8682dc9 PLATFORMS=i86_n SN=0″.

Go to %CrossOver_Drive_C and create a file “.windows-serial” and “echo d8682dc9 > .windows-serial”.

Everything will be fine.

As soon as I can port SAS into CrossOver, I can delete Parallel Desktops and save me 30G hard drive space.

UPDATE: I forgot to mention that I installed the latest JRE in CrossOver before I copy MATLAB.

Full version of MATLAB 2006 for Windows. Java GUI included (_without_ -nojvm).

The new Java Runtime Environment Version 5.0 Update 6 for windows (jre-1_5_0_06-windows-i586-p.exe) must be downloaded from: http://www.java.com/en/download/windows_manual.jsp.

JRE must be installed either in windows or through wine.

Then the jre folder in matlab (../Program Files/MATLAB/R2006a/sys/java/jre/win32/jre) directory must replaced by the newly generated jre1.5.0_06 in ../Program Files/Java/.

After that the ../Program Files/MATLAB/R2006a/sys/java/jre/win32/jre.cfg file must be edited to contain a single line withe: 1.5.0_06

After that, MATLAB 2006a will be fully functional (as far as know). You can either use the windows installed version or copy the whole MATLAB folder to ~/.wine/drive_c/Program Files/ (that way you won’t need the windows partition anymore).


BlogTimer
You are visitor number several since September 1, 2001

Copyright Xiaoquan (Michael) Zhang, 2004-2010. All rights reserved.
All trademarks property of their owners.