25 Jun 2008
Python笔记:class
1. 使用一个名为 __init__ 的方法来完成初始化。
2. 使用一个名为 __del__ 的方法来完成类似析购操作。
3. 所有的实例方法都拥有一个 self 参数来传递当前实例,类似于 this。
4. 可以使用 __class__ 来访问类型成员。
>>> class Class1:
def __init__(self):
print "initialize..."
def test(self):
print id(self)
>>> a = Class1()
initialize...
>>> a.test()
13860176
>>> id(a)
13860176
23 Jun 2008
Ubuntu的Mac模拟
##CONTINUE##
第一步:下载Cursor , GTK和Icon的主题
在这里下载Cursor , GTK和Icon的主题:
下载
下载完毕后,点击System -> Preferences -> Appearance,然后点击Install,安装刚下载的主题Mytheme.tar.gz
载完毕后,点击System -> Preferences -> Appearance,然后点击Install,安装刚下载的主题Mytheme.tar.gz
安装完毕之后,点击Customize,在Controls标签下选择Mac4Lin_GTK_Aqua_v0.3,Icons标签下选择LeopardX,Pointer标签下选择Shere_Khan_X,Window Border下选择Mac4Lin_GTK_Aqua_v0.3。 、
现在你应该看到一些界面的变化了。
、
第二步:使用Compiz效果并安装Mac4Lin主题 、
打开一个terminal,输入
sudo apt-get install compizconfig-settings-manager
安装完之后,你就可以在System -> Preferences -> Advanced Desktop Effects Settings里面进行设置了。、
在terminal里运行:、
sudo apt-get install emerald
来安装Emerald,安装完之后在这里下载MacOS X Emerald主题:
http://gnome-look.org/content/show.php/Mac4Lin+Leopard+Emerald+Theme?content=68409
完毕后,打开System -> Preferences -> Emerald Theme Manager,点击Import、
加入你刚才下载的主题文件,然后点击refresh刷新、
第三步:安装Mac工具栏Avant Window Navigator
打开terminal,依次运行:
echo "deb http://ppa.launchpad.net/awn-testing/ubuntu hardy main" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/awn-testing/ubuntu hardy main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install awn-manager-trunk awn-extras-applets-trunk
如此安装完毕后,你可以到Applications -> Accessories -> Avant Window Navigator来设置你的Dock工具栏
虽然说AWN自带的主题挺好的,这里有一个更漂亮的
http://rapidshare.com/files/71511920/Transparent.tgz.html
在刚才的AWN Manager窗口里,点击theme -> Add,加入最新下载的主题。
第四步:安装桌面Widgets Screenlets(此步不是必需的)
你可以安装一些桌面的小程序Screenlets(Widgets)。
在terminal里运行
sudo apt-get install screenlets
第五步:下载Max OS的桌面壁纸
http://appleology.com/images/space-desktop.png
http://dr-photoshop.com/zfile/tutorials/wallpaper/OS%20X%20Wallpaper.jpg
22 Jun 2008
超级BT的百度啊
1,http://www.udiab.com.cn/
就是把baidu反着打,试一试
2,http://www.mamashuojiusuannizhucedeyumingzaichangbaidudounengsousuochulai.cn/
这也是百度的域名之一
域名是拼音,翻译成中文是:"妈妈说就算你注册的域名再长百度都能搜索出来"
8 Jun 2008
7 Jun 2008
关于sb和euro cup
刚好这个周末也没有什么事情,考试过去了90%,
要好好看看了.
可惜google/百度了半天,都找不到一个像样的直播地址
当然,也许是我要求太高
我所说的像样,就是有健翔和大眼解说的,能在linux下正常播放的
sop地址,哎,难啊....
想起了好些年来流传的,google搜索SB,第一个肯定是百度,
百度搜索SB,第一个肯定是google一样.
我可不管sb是不是SafeBrowser的意思,要我看,就真的跟Sb没什么两样
没辙,重启吧,进win好歹还能找个辽tv的直播凑合凑合.
看来这win还得留好些时间呢.
6 Jun 2008
ubuntu解决flash中文乱码
改了configure文件之后发现,所有的flash中的中文都变成了方框,
饿滴神呀!我情愿所有英文都是方框,中文方框我还混个p啊.
##CONTINUE##
没关系,兵来将挡,水来土淹.
道高一尺,魔高一丈.
问世间情为何物-一物降一物!
... ...
看来只好祭出我的法宝了,google/百度伺候,
2s之后,方框怪物偃旗息鼓,鸣金收兵作罢.
分析: 毛病主要出在/etc/fonts/conf.d/49-sansserif.conf/49-sansserif.conf这个配置文件上.
方法如下:
1,备份
cd /etc/fonts/conf.d/
sudo cp 49-sansserif.conf 49-sansserif.conf_backup
2,修改
sudo geany 49-sansserif.conf
是个xml文件好像,把pattern下第1/2/4个
很多人用wqy-zenhei,我改的是simsun.
3,注销看看就行了.
==============================
How to fix flash problem with displaying chinese characters under Ubuntu 8.04.
this problem is caused by the configure file named 49-sansserif.conf, if you got another chinese font in your system, you can fix it by the following steps:
1, backup file
sudo cp 49-sansserif.conf 49-sansserif.conf_backup
2, modify
sudo geany 49-sansserif.conf
it's easy to find that this is a xml file. you can change the fonts specified by the < string > under pattern section, to whatever chinese fonts in your system.
3, logout & login again to see the change!
DONE.
4 Jun 2008
Wine warning on Ubuntu
##CONTINUE##
--------------------------
wine preloader: Warning
Warning: failed to reserve range 00000000-60000000
Warning: failed to reserve range 00000000-60000000
err:dosmem:setup_dos_mem Cannot use first megabyte for DOS address space, please report
Warning: failed to reserve range 00000000-60000000
err:dosmem:setup_dos_mem Cannot use first megabyte for DOS address space, please report
Warning: failed to reserve range 00000000-60000000
err:dosmem:setup_dos_mem Cannot use first megabyte for DOS address space, please report
err:dosmem:setup_dos_mem Cannot use first megabyte for DOS address space, please report
Warning: failed to reserve range 00000000-60000000
=====================================
Here I found the solution about this issue:
sudo sysctl -w vm.mmap_min_addr=0
then type in terminal:
sudo gedit /etc/sysctl.conf
search
vm.mmap_min_addr = 65536
and replace it with:
vm.mmap_min_addr = 0
Done!
3 Jun 2008
2个下载在线视频的方法
http://clipnabber.com/
http://www.playinmel.com/flv/
======================
Hey, guys, if you are looking for some special ways to download the online videos,
these two sites support almost all the online video websites you have seen before,
like YouTube, Megaupload, SexUploader....
for chinese users, there are tudou, 6.cn, 56, yoqoo and so on
http://clipnabber.com/
http://www.playinmel.com/flv/
安全删除硬件消失解决办法
开文本文档,写入:
rundll32.exe shell32.dll,Control_RunDLL hotplug.dll
保存为.bat文档,运行即可.
=======================================
If you work a lot with different USB devices, you probably use the "safely remove hardware" icon quite a bit. you're supposed to safely remove a USB device by clicking on the icon in your taskbar and stopping the whole process instead of just unplugging it without any warning. So, what if you lost that icon? Then what are you supposed to do?
We can find some way to deal with it.
open notepad and write:
rundll32.exe shell32.dll,Control_RunDLL hotplug.dll
then quit and save it as a .bat file.Now, run this bat file by double clicking. You see what?
显示桌面消失解决办法
开文本文档,写入:
[Shell]
Command=2
IconFile=explorer.exe,3
[Taskbar]
Command=ToggleDesktop
保存为.scf文档,运行即可.
ps.一时无聊,改了改第三行那个参数3,改成1和2可以看到不同的图标,^_^
==================================
The "Show Desttop" is one of the mostly used icons in our daily life,
but sometimes you delete it by mistake, what should you do?
Tips:
open notepad and write:
[Shell]
Command=2
IconFile=explorer.exe,3
[Taskbar]
Command=ToggleDesktop
then, quit and save it as a .scf file.
run it by double clicking. You have done!
自制简易垃圾清理器
开文本文档,写入:
@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统LJ完成!
echo. & pause
保存为.bat文档,运行即可.
============================
sometimes, your computer become slower and slower,
What should you do? Here is a tip to make a cleaner by yourself.
Follow me:
open notepad and write:
@echo off
echo Cleaning the system, Please wait...
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo Cleaning has finished!
echo. & pause
then quit and save it as a .bat file.
run it by double clicking.
Ubuntu8.04之dell d630实战
主要是无线网卡,声卡和显卡这3个。
具体过程:
##CONTINUE##
1,显卡,8。04已经很好了,可以直接勾选启用受限驱动。
首选项-受限驱动。
2,声卡。
sudo aptitude install linux-backports-modules-generic
sudo gedit /etc/modprobe.d/alsa-base
options snd-hda-intel model=dell-m42
3,无线网卡,这个最头疼。
需要b43-fwcutter加载ipw3945,具体google一下吧。
也有人说更新新立得用windows驱动。
去这里下载http://ipw3945.sourceforge.net/
apt-get install ipw3945-modules-2.6-686 ipw3945d
apt-get install wpasupplicant
firefox3支持旧版本插件
2. 右键点击页面,New->Boolean,名称为 extensions.checkCompatibility 值为 false
3. 右键点击页面,New->Boolean,名称为 extensions.checkUpdateSecurity 值为 false
================
use old version plugin for firefox 3
1, open about:config
2, right click, new-boolean, name: extensions.checkCompatibility and value is false
3, right click, new-boolean, name: extensions.checkUpdateSecurity and value is false
Done!
stardict的几个重要词典
单词数量: 405719
特点:简明,词多。用做取词词典最好。
http://prdownloads.sourceforge.net/star ... 2?download
2 牛津高阶英汉双解词典
单词数量: 22642
特点:专门为外语学习者设计的词典,英汉双解,释意丰富,准确,有黑白配图。
http://jaist.dl.sourceforge.net/sourcef ... .2.tar.bz2
3 Longman Dictionary of Contemporary English (4th Ed)
单词数量: 47625
特点:英文字典,有彩色配图。本词典是一部学习型词典,信息量大,内容新,时代特色鲜明,注重培养读者的书面语和口语的准确表达以及语言技能的恰当运用。适用于中高级水平的英语学习者。
http://jaist.dl.sourceforge.net/sourcef ... .2.tar.bz2
更多的词典可在这里这里或这里找
scim自定义短语设置
加入自定义短语,这个功能好像word中的自动替换,好使。
方法:切换到中文,输入i,然后输你的自定义短语。
解决 Megaupload 及 RapidShare 空间不能下载的方法
1.如遇不能下载时,请把欲下载的网址加上 http://anonymouse.org/cgi-bin/anon-www.cgi/
再贴到网址列下载,(例如.. http://anonymouse.org/cgi-bin/anon-www.cgi/http://www.megaupload.com/?d=ITLXDK3S)
2.等倒数完后,在【Click here to download】处按鼠标右键,选择内容,复制http://anonymouse.org/anonwww.html之后的网址
例如:出现的网址为>>>>>>>>>>>
【http://anonymouse.org/cgi-bin/anon-www.cgi/http://www05.megaupload.com/files/441348cfb2e76401ca7af6149962e226/Notre%20Dame%20De%20Paris-钟楼怪人%20-%20Francais.rar】则只复制:红颜色部分
3.最后将复制的网址贴到网址列即可正常下载。
第二种方法:(适用于RapidShare 及sexuploader空间 )
1.进入【http://babelfish.altavista.com/tr】 翻译网页
2.在【Translate a Web page】 下面空格内贴上欲下载的网址..(例如.. http://rapidshare.de/files/6341390/Craig_David-The_Story_Goes_2005.rar.html)
3.在【Translate】左边的箭头拉下选择【CHINESE SIMP TO ENGLISH】再点一下【Translate】键,接着就会出现原本的下载画面….依照之前的下载方式就能成功了。
Octave-matlab的轻量级兄弟
http://www.gnu.org/software/octave/
GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language.
For more information, see the page about Octave.