Posted by hide1713 on November 20, 2009
In [71]: m=10
In [72]: i=[3,4]
In [73]: j=[m for m in i]
In [74]: j
Out[74]: [3, 4]
In [75]: m
Out[75]: 4
Notice that the value of m changed from 10 to 4 and it’s not my intention.!!
Next time when you write [x for x in y]. Make sure x is unused!!!
Posted in Python | Leave a Comment »
Posted by hide1713 on November 8, 2009
I just installed Ubuntu 9.10 yesterday. The only problem is that 9.10 fail to detect my dual monitors; therefore, the resolution of my two monitors were set to 1024*768 by default. I spent one day to complete solve this problem. My graphic card is a ATI one. You may skip this page if your graphic card is not ATI. Here’s how.
1. Download ATI driver from Ubuntu Hardware Driver setting. Run the following command.
sudo amdcccle
2. Set correct resolution for both screen. (1280*800 and 1600*1200 for me). It was weird at the beginning, because ATI control center only allowed me to set my second monitor to 1280*800. I solved this problem by unplugging the monitor and reboot my box(Maybe).
3. (Optional) Revert the screen location. My second monitor is on my right hand side. I tried to set the screen position in AIT control center. But the control center always crash after I apply the change. I have no option but changing xorg.conf manually.
Section “Monitor”
Identifier “0-LCD”
Option “VendorName” “ATI Proprietary Driver”
Option “ModelName” “Generic Autodetecting Monitor”
Option “DPMS” “true”
Option “PreferredMode” “1280×800″
Option “TargetRefresh” “60″
Option “Position” “0 0″
Option “Rotate” “normal”
Option “Disable” “false”
EndSection
Section “Monitor”
Identifier “0-CRT1″
Option “VendorName” “ATI Proprietary Driver”
Option “ModelName” “Generic Autodetecting Monitor”
Option “DPMS” “true”
Option “PreferredMode” “1600×1200″
Option “TargetRefresh” “60″
Option “Position” “1280 0″
Option “Rotate” “normal”
Option “Disable” “false”
EndSection
The position option indicates the start point of a screen.
All Done!
Posted in Ubuntu | Leave a Comment »