孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 26 下一页

2011年5月4日

摘要: C#可用interface IDrivable实现接口: 阅读全文
posted @ 2011-05-04 22:03 孤独的猫 阅读(328) 评论(0) 推荐(0) 编辑

摘要: 使用unset -v来取消变量,unset -f取消函数,下面会提示找不到show_name函数的错误 1 #!/bin/sh 2 function show_name 3 { 4 echo "今天是$1,你$2大大,来自$3" 5 } 6 7 unset -f show_name 阅读全文
posted @ 2011-05-04 21:08 孤独的猫 阅读(184) 评论(0) 推荐(0) 编辑

摘要: 基本sed编辑命令 p 打印匹配行 = 显示文本行号 a\ 在定位行后附加新文本信息 i\ 在定位行后插入新文本信息 d 删除定位行 c\ 用文本替换定位文本 阅读全文
posted @ 2011-05-04 20:30 孤独的猫 阅读(393) 评论(0) 推荐(0) 编辑

2011年5月3日

摘要: /* Example7_6.cs illustrates some of the System.Object class methods*/ using System; class Example7_6{ class Program { static void Main(string[] args) { MyStruct st = new MyStruct(); st.X = 50; Console.WriteLine(st.X); Console.ReadLine(); } 阅读全文
posted @ 2011-05-03 20:42 孤独的猫 阅读(296) 评论(0) 推荐(0) 编辑

摘要: /* Example7_6.cs illustrates some of the System.Object class methods */ using System; // declare the Car class 阅读全文
posted @ 2011-05-03 20:36 孤独的猫 阅读(341) 评论(0) 推荐(0) 编辑

摘要: /* Example6_3.cs illustrates the use of readonly fields */ // declare the Car class public class Car { // declare a readonly field public readonly string make; // declare a static readonly field public static readonly int wheels = 4; // define a constructor public Car(string make) { System.Console.WriteLine("Creating a Car object"); this.make = make; } } 阅读全文
posted @ 2011-05-03 20:32 孤独的猫 阅读(161) 评论(0) 推荐(0) 编辑

摘要: 要改变参数的值,可以用引用传值方式(使用ref关键字) /* Example5_7.cs illustrates passing parameters by reference */ // declare the Swapper class public class Swapper 阅读全文
posted @ 2011-05-03 20:30 孤独的猫 阅读(190) 评论(0) 推荐(0) 编辑

摘要: /* Example4_17.cs illustrates the use of the #undef, #elif, and #else preprocessor directives */ #define DEBUG #undef DEBUG #define PRODUCTION 阅读全文
posted @ 2011-05-03 20:26 孤独的猫 阅读(140) 评论(0) 推荐(0) 编辑

摘要: C#中枚举类型用Enum表示 class Example2_10 { enum Planets { Mercury = 1, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto } 阅读全文
posted @ 2011-05-03 20:25 孤独的猫 阅读(120) 评论(0) 推荐(0) 编辑

摘要: 格式化字符 格式化字符          描述 f或F            格式化浮点数 e或E            用指数计数法格式化数字 p或P            格式化百分数 n或N            用逗号分隔符格式化数字 c或C            格式化本地货币值 阅读全文
posted @ 2011-05-03 20:23 孤独的猫 阅读(241) 评论(0) 推荐(0) 编辑

摘要: C#中也有类似于C++的运算符重载,如下例中Rectangel中的+操作 using System; using System.Collections.Generic; using System.Linq; using System.Text; 阅读全文
posted @ 2011-05-03 20:10 孤独的猫 阅读(182) 评论(0) 推荐(0) 编辑

摘要: 密封类和方法对继承和多态进行限制。在希望别人不能改变代码又希望自己使用时,可以在代码中使用密封的类和方法:使用sealed关键字来表示类或方法为密封 using System; 阅读全文
posted @ 2011-05-03 19:50 孤独的猫 阅读(237) 评论(0) 推荐(0) 编辑

摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; 阅读全文
posted @ 2011-05-03 19:45 孤独的猫 阅读(131) 评论(0) 推荐(0) 编辑

摘要: int变量可以用ToString方法隐式的转换为一个System.Object对象,这个过程叫包装;一个System.Object也可以转换为一个值变量,这个过程叫解包 阅读全文
posted @ 2011-05-03 19:01 孤独的猫 阅读(149) 评论(0) 推荐(0) 编辑

摘要: #!/usr/bin/env python # Simple Gopher Client - Chapter 1 - gopherclient.py 阅读全文
posted @ 2011-05-03 13:03 孤独的猫 阅读(189) 评论(0) 推荐(0) 编辑

摘要: 通常使服务器连续运行的办法是小心的设计一个无限循环.下面是一个基本服务器的例子 阅读全文
posted @ 2011-05-03 13:02 孤独的猫 阅读(122) 评论(0) 推荐(0) 编辑

摘要: #!/usr/bin/env python # Get list of available socket options -- Chapter 3 -- sockopts.py 阅读全文
posted @ 2011-05-03 13:02 孤独的猫 阅读(337) 评论(0) 推荐(0) 编辑

摘要: PyDNS并不是作为标准的Python发行版本的一部分而随Python一起发行的.因此,必须单独安装,可以从http://pydns.sourceforge.net/下载,然后按照安装指南来安装.在Debian或Ubuntu中 阅读全文
posted @ 2011-05-03 13:01 孤独的猫 阅读(806) 评论(0) 推荐(0) 编辑

摘要: #!/usr/bin/env python # DNS query program - Example 4 - DNSquery.py 阅读全文
posted @ 2011-05-03 13:00 孤独的猫 阅读(218) 评论(0) 推荐(0) 编辑

摘要: 在互联网公共可访问领域内,关于Python/C interface的介绍,手册都是比较多的。Py直接支持C编写扩展,对于Delphi程序员,P4D是一个很好的选择。 不幸的是,通过P4D[2]编写PyExtention,并没有一个很好的入门文档,本文试图填写这个空白。 阅读全文
posted @ 2011-05-03 12:59 孤独的猫 阅读(852) 评论(0) 推荐(0) 编辑

摘要: Python 支持一种有趣的语法,它允许你快速定义单行的最小函数。这些叫做 lambda 的函数,是从 Lisp 借用来的,可以用在任何需要函数的地方。 阅读全文
posted @ 2011-05-03 12:59 孤独的猫 阅读(280) 评论(0) 推荐(0) 编辑

摘要: 最近用Python For Delphi有了一段时间,感觉这么好的东西不与大家分享简直是暴敛天物了,而且前一段看大家讨论GUI的问题相当多,为 了让大家少走点弯路,所以萌发了写此文的念头。 阅读全文
posted @ 2011-05-03 12:58 孤独的猫 阅读(4527) 评论(0) 推荐(0) 编辑

摘要: import win32con key=win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,'Software',0,win32con.KEY_READ) print key 阅读全文
posted @ 2011-05-03 12:57 孤独的猫 阅读(284) 评论(0) 推荐(0) 编辑

摘要: 一般的try语句形式如下: try: except : except : else: 阅读全文
posted @ 2011-05-03 12:57 孤独的猫 阅读(129) 评论(0) 推荐(0) 编辑

摘要: SQLite是一种轻型的嵌入式数据库,相对于其他的庞大的数据库,SQLite显得十分小巧。SQLite不需要安装,只需到http://www.sqlite.org下载一个Windows版的可执行文件即可。然后从命令行运行sqlite 阅读全文
posted @ 2011-05-03 12:56 孤独的猫 阅读(519) 评论(0) 推荐(0) 编辑

摘要: >>> import win32process 阅读全文
posted @ 2011-05-03 12:56 孤独的猫 阅读(889) 评论(0) 推荐(0) 编辑

摘要: import win32com.client # 导入win32com.client adoCon = win32com.client.Dispatch('ADODB.Connection') # 创建连接对象 阅读全文
posted @ 2011-05-03 12:55 孤独的猫 阅读(340) 评论(0) 推荐(0) 编辑

摘要: 基本UDP客户端 #!/usr/bin/env python # UDP Example - Chapter 2 阅读全文
posted @ 2011-05-03 12:55 孤独的猫 阅读(247) 评论(0) 推荐(0) 编辑

摘要: 使用socket类的connect方法 #!/usr/bin/env python 阅读全文
posted @ 2011-05-03 12:54 孤独的猫 阅读(179) 评论(0) 推荐(0) 编辑

摘要: #include #include 阅读全文
posted @ 2011-05-03 12:52 孤独的猫 阅读(308) 评论(0) 推荐(0) 编辑

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 26 下一页