`
mrjeye
  • 浏览: 174209 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论
文章列表
修改/etc/sudoers文件,修改命令必须为visudo才行   #/usr/sbin/visudo -f /etc/sudoers   在root ALL=(ALL) ALL 之后增加   yourusername ALL=(ALL) ALL   普通用户的.bash_profile文件在PATH变量中增加   /sbin;/usr/sbin;/usr/local/sbin;/usr/kerberos/sbin
'激活指定的窗口 SetActiveWindow '获取声音音量 waveOutGetVolume '设置输出音量 waveOutSetVolume '将指针限制到指定区域。 ClipCursor '决定是否互换鼠标左右键的功能 SwapMouseButton '排列一个父窗口的最小化子窗口(在vb里使用:用于在桌面 ...
<?xml version="1.0" encoding="UTF-8"?> <project name="ANT" basedir="."> <property name="build.src" value=".\src" /> <property name="build.dest" value=".\~!mrjeye$`" /> <property environ ...

类示例

class Cat(object): __name = '' __age =0 def __init__(self,name,age): self.__name = name self.__age = age print 'init cat , name is %s;age is %d' %(name,age) def getName(self): return self.__name def getAge(self): return self.__age def setName(self,name): self.__name = ...
import os,os.path path = os.path class VersionOper(object): 'The version appendor class .' __dir ='' __appendStr='mrjeye' __isDebug =False __doType =() def debug(self,msg): 'prints the msg if debug mode .' if not self.__isDebug: r ...

列表和元组

序列:包含一些顺序排列的对象的一个结构 #和并两个列表 >>> l1=[1,2] >>> l2=[3,4] >>> l1.extend(l2) >>> l1,l2 ([1, 2, 3, 4], [3, 4]) >>> l1+l2 [1, 2, 3, 4, 3, 4] >>> zip([1,2,3]) [(1,), (2,), (3,)] >>> sorted([1,3,2]) [1, 2, 3]

访问模型

分类                          Python 类型 直接访问                       数字 顺序访问                       字符串、列表、元组 映射访问                       字典 数据类型  存储模型  更新模型  访问模型 数字       Scalar   不可更改  直接访问  字符串     Scalar   不可更改  顺序访问    列表     Container   可更改   顺序访问    元组     Container  不可更改  顺序访问    字典     Co ...
sys >>> import sys >>> dir(sys) ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__package__', '__s tderr__', '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', '_g etframe', 'api_version', 'argv', 'builtin_module_names', 'byteorder', 'call_trac in ...
is,is not = id(...)==id(...) #比较对象引用是否相同 >>> import cat >>> c1 = cat.Cat('c',4) init cat , name is c;age is 4 >>> c2=c1 >>> c3=cat.Cat('c',4) init cat , name is c;age is 4 >>> c1 is c2 True >>> c1 is c3 False >>> c2 is not c3 ...
python,怎么说呢,感觉很好玩,以下说明几点笔者感兴趣的东西:     它抛弃了包裹代码块的花括号,而只依据缩进对代码块进行理解(语句有代码块的要以:结束)     注释用#,若一行以#开头,则不会被解释         FOR循环的用法不同,Python的FOR和java中的for in功能一样,具体可以参照后续代码     for语法:     for iter in iter:     ...     else:    #当且仅当在FOR循环结束时没遇到BREAK标签时执行     ...     对象的比较有些时髦:     >>> 2>1<3    ...
gcc中的预编译宏     * 预定义的宏     * __NASE_FILE__ 源文件的完整路径名,和 __FILE__ 不同,被引用的文件仍然是原来文件名     * __CHAR_UNSIGNED__ 用于指定该机器上 char 是无符号类型     * __cplusplus 使用 C++ 编译器编译     * __DATE__ 编译时的日期     * __FILE__ 编译文件名     * __func__ 同 __FUNCTION__     * __GNUC__ GCC 的主版本号     * __GNUC_MINOR__ GCC 的次版本号     * __GNUC_P ...
使用SwetakeQRCode在Java项目中生成二维码 首先将SwetakeQRCode拷贝在项目lib中,加入Build Path,然后: byte[] buff = "http://www.mrjeye.org".getBytes("utf-8"); Qrcode qrcode = new Qrcode(); qrcode.setQrcodeVersion(3); qrcode.setQrcodeErrorCorrect('M'); qrcode.setQrcodeEncodeMode('B'); bo ...
UIBarButtonItem *takeGoods = [[[UIBarButtonItem alloc] init] autorelease]; [takeGoods setAction:@selector(takeGoods:)]; [takeGoods setTarget:self]; takeGoods.title = @"購買"; [self.navigationItem setRightBarButtonItem:takeGoods];

鍵盤隱藏

[self.txtNameField resignFirstResponder]; 說明:常規做法是將VIEW最下層加入一個UIButton,將其類型設爲Custom(不會顯示邊框),然後綁定其ACTION事件,當該按鈕被點擊時,調用VIEW上所有INPUT的resignFirstResponder方法.
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { // 列寬 CGFloat contentWidth = self.tableView.frame.size.width; // 用何種字體進行顯示 UIFont *font = [UIFont systemFontOfSize:13]; // 該行要顯示的內容 NSString *content = [data objectAtIndex:indexPath.row ...
Global site tag (gtag.js) - Google Analytics