short_open_tag = On就可以使用如下語法了
Reference :
PHP: Description of core php.ini directives - Manual
short_open_tag = On就可以使用如下語法了
$ vi *.py
:tab all
:qa
"auto remove whitespace when open the file
autocmd FileType c,cpp,python,php autocmd BufWritePre:%s/\s\+$//e
from distutils.core import setup
import py2exe
setup(console=['main.py']) # main.py 為你的主程式名稱
dist | +-Microsoft.VC90.CRT | | | +-Microsoft.VC90.CRT.manifest | +-msvcm90.dll | +-msvcp90.dll | +-msvcr90.dll | |-etc
$ cd ~/Notebooks
$ vi .gitignore.zim.cache$ git add .gitignore
.zim.history.cache
Notes/.zim/index.db
Notes/.zim/state.conf
$ git commit -m 'add .gitignore'
$ git push origin master
# easy_install -U clonedigger
$ svn co https://clonedigger.svn.sourceforge.net/svnroot/clonedigger/trunk clonedigger$ cd clonedigger# python setup.py install
$ cd MyProj
$ clonedigger .
Parsing ./wx_tools.py ... done
Parsing ./main.py ... done
Parsing ./nt_api.py ... done
19 sequences
average sequence length: 4.842105
maximum sequence length: 14
Number of statements: 92
Calculating size for each statement... done
Building statement hash... done
Number of different hash values: 49
Building patterns... 58 patterns were discovered
Choosing pattern for each statement... done
Finding similar sequences of statements... 3 sequences were found
Refining candidates... 2 clones were found
Removing dominated clones... -1 clones were removed
$ firefox output.html # 觀看報表
如 BIOS 出現 SLIC table 或出現下列訊息 BIOS VAILD FOR OA 2.0: YES, but no windows marker Windows marker version: N/A 就不能通過認證
self.Bind(wx.EVT_KEY_DOWN, self.on_key_down)
def on_key_down(self, event):
"""Key down event handler."""
key = event.KeyCode()
controlDown = event.ControlDown()
altDown = event.AltDown()
shiftDown = event.ShiftDown()
# Cut to the clipboard.
if (controlDown and key in (ord('C'), ord('c'))):
copy()
# Insert the next command from the history buffer.
else:
event.Skip()
wx_tools
classimport wx_tools
class Frame(wx.Frame):
def
__init__(
self
,
*
args,
*
*
keywords):
self
.__init_key_handlers()
def
__init_key_handlers(
self
):
'''Initialize key shortcuts.'''
self
.Bind(wx.EVT_KEY_DOWN,
self
.on_key_down)
def
copy():
print 'copy'
self
.key_handlers
=
{
Key(ord('C'), cmd=True): copy,
}
def
on_key_down(
self
, event):
'''wx.EVT_KEY_DOWN handler.'''
key
=
Key.get_from_key_event(event)
handler
=
self
.key_handlers.get(key,
None
)
if
handler:
handler()
else
:
event.Skip()
self.frame.Bind(wx.EVT_CLOSE, self.OnClose)
def OnClose(self, evt):
print 'cannot close'
# dlg = wx.MessageDialog(None, "Is this explanation OK?",
# 'A Message Box',
# wx.YES_NO | wx.ICON_QUESTION)
# retCode = dlg.ShowModal()
# if (retCode == wx.ID_YES):
# self.frame.Destroy()
# print "yes"
# else:
# print "no"
import win32con #for the VK keycodes
def regHotKey(self):
self.hotKeyId = 100
self.frame.RegisterHotKey(
self.hotKeyId, #a unique ID for this hotkey
win32con.MOD_CONTROL + win32con.MOD_SHIFT , #the modifier key
win32con.VK_DELETE) #the key to watch for
self.regHotKey()
self.Bind(wx.EVT_HOTKEY, self.OnClose, id=self.hotKeyId)
class Key(object):
'''A key combination.'''
def __init__(self, key_code, cmd=False, alt=False, shift=False):
self.key_code = key_code
'''The numerical code of the pressed key.'''
self.cmd = cmd
'''Flag saying whether the ctrl/cmd key was pressed.'''
self.alt = alt
'''Flag saying whether the alt key was pressed.'''
self.shift = shift
'''Flag saying whether the shift key was pressed.'''
@staticmethod
def get_from_key_event(event):
'''Construct a Key from a wx.EVT_KEY_DOWN event.'''
return Key(event.GetKeyCode(), event.CmdDown(),
event.AltDown(), event.ShiftDown())
def __hash__(self):
return hash(tuple(sorted(tuple(vars(self)))))
def __eq__(self, other):
if not isinstance(other, Key):
return NotImplemented
return self.key_code == other.key_code and \
self.cmd == other.cmd and \
self.shift == other.shift and \
self.alt == other.alt
from wx_tools import Key
class MyApp(wx.App):
def __init_key_handlers(self):
'''Initialize key shortcuts.'''
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
# Now you define handlers for various keys:
def bypass_key():
print 'key bypassed'
# This is the big dict that maps keys to their handlers:
self.key_handlers = {
Key(wx.WXK_ESCAPE): bypass_key,
Key(wx.WXK_DELETE): bypass_key,
}
def init_frame(self):
self.res = xrc.XmlResource('login.xrc')
self.frame = self.res.LoadFrame(None, 'mainFrame')
# bind key event
self.__init_key_handlers()
self.frame.Show()
def OnKeyDown(self, event):
'''wx.EVT_KEY_DOWN handler.'''
key = Key.get_from_key_event(event)
handler = self.key_handlers.get(key, None)
if handler:
handler()
else:
event.Skip()
class MyApp(wx.App):
def init_frame(self):
self.res = xrc.XmlResource('login.xrc')
self.frame = self.res.LoadFrame(None, 'mainFrame')
# 在此 frame 下監聽所有按鍵反應
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
# 或綁定單一原件
wx.EVT_KEY_DOWN(xrc.XRCCTRL(self.frame, 'userTxt'), self.OnKeyDown)
self.frame.Show()
def OnKeyDown(self, e):
key = e.GetKeyCode()
if key == wx.WXK_ESCAPE:
print 'Event!'
else:
e.Skip()
from _winreg import *
keyVal = r'SOFTWARE\Microsoft\Windows\CurrentVersion\policies\System'
try:
key = OpenKey(HKEY_CURRENT_USER, keyVal, 0, KEY_ALL_ACCESS)
except:
key = CreateKey(HKEY_CURRENT_USER, keyVal)
SetValueEx(key, "DisableTaskMgr", 0, REG_DWORD, 1)
CloseKey(key)
import ctypes
whnd = ctypes.windll.kernel32.GetConsoleWindow()
if whnd != 0:
ctypes.windll.user32.ShowWindow(whnd, 0)
ctypes.windll.kernel32.CloseHandle(whnd)
import ctypes
whnd = ctypes.windll.kernel32.GetConsoleWindow()
if whnd != 0:
ctypes.windll.user32.ShowWindow(whnd, 0)
ctypes.windll.kernel32.CloseHandle(whnd)
regsvr32 wiadefui.dll
regsvr32 wiadss.dll
regsvr32 wiavusd.dll
regsvr32 wiascr.dll
regsvr32 wiaservc.dll
regsvr32 wiashext.dll
regsvr32 wiavideo.dll
regsvr32 camocx.dll
regsvr32 wiadefui.dll
regsvr32 wiadss.dll
regsvr32 wiavusd.dll
regsvr32 wiascr.dll
regsvr32 wiaservc.dll
regsvr32 wiashext.dll
regsvr32 wiavideo.dll
regsvr32 camocx.dll
php.exe (php-5.4.3)
wampmanager.exe (Wampserver (32 bits & PHP 5.3) 2.2E)
在開始 -> 執行 輸入
control userpasswords2
或
rundll32 netplwiz.dll,UsersRunDll
將 "必須輸入使用者名稱和密碼,才能使用這台電腦" 取消選取
Reference : 怎样让xp自动进入桌面
zoom=yes
# apt-get install php5-curl php5-xmlrpc php5-gd php5-intl
# wget http://download.moodle.org/download.php/stable22/moodle-latest-22.tgz
# tar zxf moodle-latest-22.tgz
# mv moodle /var/www/
# chown -R www-data:www-data /var/www/moodle/
Parent directory (/var) is not writeable. Data directory (/var/moodledata) cannot be created by the installer.
# mkdir /var/moodledata
# chown www-data:www-data /var/moodledata
在 Database settings 之前
mysql> CREATE DATABASE moodle;mysql> ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES, DROP,INDEX,ALTER ON moodle.* TO moodle@localhost IDENTIFIED BY 'yourpassword';mysql> QUIT
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then
TextBox2.SetFocus
End If
End Sub
# apt-get install sun-java6-jdk sun-java6-jre
下載 Eclipse IDE for Java Developers 版本
開啟 eclipse -> Help -> Install New Softare -> Add -> 輸入 Name 「ADT」 與 URL 「http://dl-ssl.google.com/android/eclipse/site.xml 」-> OK -> Eclipse 會搜尋一下 -> 選擇 Developer Tools 含底下項目後 -> 一直 Next 後 Install -> 完成後重新啟動 eclipse
從 http://developer.android.com/sdk/index.html 下載 android-sdk_r18-linux.tgz 解壓至 ~/
開啟 eclipse -> Window -> Android SDK Manager
回報錯誤訊息
Fetching https://dl-ssl.google.com/android/repository/addons_list-1.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: peer not authenticated
Fetching URL: https://dl-ssl.google.com/android/repository/repository-6.xml
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository-6.xml, reason: peer not authenticated
在 Android SDK Manager -> Tools -> Manage Add-on Sites, 新增
http://dl-ssl.google.com/android/repository/addons_list-1.xml
http://dl-ssl.google.com/android/repository/repository-6.xml
可以安裝 API 15、14、....
安裝 API 時出現
This package depends on 'Missing SDK Platform Android, API 15'.
要手動從 https://dl-ssl.google.com/android/repository/repository-6.xml 下載 Platform 檔案, 解壓至 ~/android-sdk-linux/platforms
https://dl-ssl.google.com/android/repository/android-15_r03.zip
開啟 eclipse -> Window -> AVD Manager
新增完後開啟 AVD 出現
Unable to find a 'userdata.img' file for ABI armeabi to copy into the AVD folder.
要手動從 https://dl-ssl.google.com/android/repository/repository-6.xml 下載 image 檔案, 解壓至 ~/android-sdk-linux/system-images
https://dl-ssl.google.com/android/repository/sysimg_armv7a-15_r02.zip
$ chmod 744 gerrit-2.2.1.war$ java -jar gerrit-2.2.1.war init -d review_sites
$ ssh -p 29418 yan@your_domain
**** Welcome to Gerrit Code Review **** Hi yan, you have successfully connected over SSH. Unfortunately, interactive shells are disabled. To clone a hosted Git repository, use: git clone ssh://yan@localhost:29418/REPOSITORY_NAME.git Connection to localhost closed.
$ ssh -p 29418 yan@localhost gerrit create-project -n sandbox
$ git clone ssh://yan@localhost:29418/sandbox.gitCloning into 'sandbox'...