摘要:
BASH 的基本语法 最简单的例子 —— Hello World!关于输入、输出和错误输出BASH 中对变量的规定(与 C 语言的异同)BASH 中的基本流程控制语法函数的使用 2.1 最简单的例子 —— Hello World! 几乎所有的讲解编程的书给读者的第一个例子都是 Hello World 程序,那么我们今天也就从这个例子出发,来逐步了解 BASH。 用 vi 编辑器编辑一个hello 文件如下: #!/bin/bash # This is a very simple example echo Hello World 这样最简单的一个 BASH 程序就编写完了。这里有几个问题需要说. 阅读全文
posted @ 2012-05-17 23:54
ChaunceyHao
阅读(396)
评论(0)
推荐(1)
摘要:
为了使用FVWM的需要,Super键,或者说Windows键是必不可少的,可是自己的T43上面只有两 个Alt键,所以比较可行的选择就是把右边那个变成Windows键。本来很久之前就已经搞定了,只是最近的一次升级之后,不知道为什么以前的修改失效 了,花了点时间改好之后特意记录下来。以前的修改是靠xkeycaps自动完成的,但是估计这个程序是很久以前的,里面有的键盘种类比较少,这次我怎么改 都没有成功,所以才开始动手自己寻找解决办法。 需要的工具: 只需要xev以及xmodmap就可以搞定,我不确定是不是系统自带的,如果没有的话,使用pacman或者yaourt自己装一下就好了。 ... 阅读全文
posted @ 2012-05-17 23:49
ChaunceyHao
阅读(666)
评论(0)
推荐(0)
摘要:
不知道是Thinkpad的问题,还是Archlinux的问题,自从由Ubuntu换到了Archlinux之后,我的T43就没有成功搞定过 Thinkpad的这些功能键,所以Fn这个键就成了个摆设,每次需要开启蓝牙或者关闭屏幕的时候,我能做的事情就是敲一些命令,实在有点烦。今天在网上 找了一些,确实是有解决办法的,而且并不复杂,我们需要做的事情就是修改/etc/acpi/handler.sh这个问题,在这里面配置下功能键对应的 命令。 开始之前,先确定你已经在/etc/rc.conf里面加载了ibm_acpi这个Module。这是我们进行修改和配置的先决条件,接下里将原本的 /etc/ac... 阅读全文
posted @ 2012-05-17 23:48
ChaunceyHao
阅读(613)
评论(0)
推荐(0)
摘要:
using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Net;using System.Text;using System.IO;namespace ToHtml{ //51 阅读全文
posted @ 2012-05-17 22:13
ChaunceyHao
阅读(225)
评论(0)
推荐(0)
摘要:
using System;using System.Collections.Generic;using System.Text;using System.Collections;using System.Net;using System.IO;using System.Data;using System.Data.SqlClient;using CnBlogCollector.Properties;namespace CnBlogCollector{ /// <summary> /// 数据采集类 /// </summary> public class Collecto 阅读全文
posted @ 2012-05-17 22:11
ChaunceyHao
阅读(157)
评论(0)
推荐(0)
摘要:
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Drawing; using System.Threading; namespace Strategy { // Strategy Pattern by Judith Bishop and D-J Miller Sept 2007 // Gives a choice of sort routines to display // Algorithms and GUI adapte.. 阅读全文
posted @ 2012-05-17 21:05
ChaunceyHao
阅读(203)
评论(0)
推荐(0)
摘要:
using System; // Strategy Pattern by Judith Bishop Oct 2007 // Shows two strategies and a random switch between them // The Context class Context { // Context state public const int start = 5; public int Counter = 5; // Strategy aggregation IStrategy strategy = new Strategy1(); // Algorithm invo... 阅读全文
posted @ 2012-05-17 21:04
ChaunceyHao
阅读(169)
评论(0)
推荐(0)
摘要:
using System;using System.IO;using System.Runtime.Serialization;using System.Runtime.Serialization.Formatters.Binary;using System.Collections;// Memento Pattern Judith Bishop September 2007// Simulates TicTacToe, where the game can roll back any// specified number of moves. Mementos are kept at each 阅读全文
posted @ 2012-05-17 20:31
ChaunceyHao
阅读(186)
评论(0)
推荐(0)
摘要:
using System; using System.Collections.Generic; // State Pattern Judith Bishop Oct 2007 // Simple game where the context changes the state based on user input // Has four states, each with 6 operations interface IState { int MoveUp(Context context); int MoveDown(Context context); } // State 1 cla... 阅读全文
posted @ 2012-05-17 19:59
ChaunceyHao
阅读(143)
评论(0)
推荐(0)
摘要:
using System; using System.Collections.Generic; namespace StatePattern { // State Pattern D-J Miller and Judith Bishop Sept 2007 // Simple game where the context changes the state based on user input // Has four states, each with 6 operations abstract class IState { public virtual string Move(Con... 阅读全文
posted @ 2012-05-17 19:57
ChaunceyHao
阅读(194)
评论(0)
推荐(0)
摘要:
using System; using System.Collections.Generic; // Builder Pattern judith Bishop November 2007 // Simple theory code with one director and two builders class Director { // Builder uses a complex series of steps public void Construct(IBuilder builder) { builder.BuildPartA(); builder.BuildPartB(); bu. 阅读全文
posted @ 2012-05-17 19:53
ChaunceyHao
阅读(157)
评论(0)
推荐(0)
摘要:
using System; using System.Diagnostics; using System.IO; using System.Threading; namespace BuilderPattern { // Builder Pattern D-J Miller and Judith Bishop Sept 2007 // Abstract Factory : Builder Implementation interface IBuilder<Brand> where Brand : IBrand { IBag CreateBag(); } // Abstract Fa 阅读全文
posted @ 2012-05-17 19:52
ChaunceyHao
阅读(179)
评论(0)
推荐(0)
摘要:
DECLARE @dt datetimeSET @dt=GETDATE()--1.短日期格式:yyyy-m-dSELECT REPLACE(CONVERT(varchar(10),@dt,120),N'-0','-')--2.长日期格式:yyyy年mm月dd日 --A. 方法1 SELECT STUFF(STUFF(CONVERT(char(8),@dt,112),5,0,N'年'),8,0,N'月')+N'日'--B. 方法2 SELECT DATENAME(Year,@dt)+N'年'+DATE 阅读全文
posted @ 2012-05-17 17:05
ChaunceyHao
阅读(183)
评论(0)
推荐(0)
摘要:
--交叉表,根据优先级取数据,日期处理create table tb(qid int,rid nvarchar(4),tagname nvarchar(10),starttime smalldatetime,endtime smalldatetime,startweekday int,endweekday int,startdate smalldatetime,enddate smalldatetime,d int)insert tb select 1,'A1','未订','08:00','09:00',1 ,5 ,null ,n 阅读全文
posted @ 2012-05-17 17:02
ChaunceyHao
阅读(195)
评论(0)
推荐(0)
摘要:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_weekdaycount]') and xtype in (N'FN', N'IF', N'TF'))drop function [dbo].[f_weekdaycount]GO/*--计算任意两个时间之间的星期几的次数(纵向显示) 本方法直接判断 @@datefirst 做对应处理 不受 sp_language 及 set datefirst 的影响 --邹建 2004.08(引用请保留 阅读全文
posted @ 2012-05-17 17:01
ChaunceyHao
阅读(195)
评论(0)
推荐(0)
摘要:
--示例--示例数据create table tb(ID int,Time datetime)insert tb select 1,'2005/01/24 16:20'union all select 2,'2005/01/23 22:45'union all select 3,'2005/01/23 0:30'union all select 4,'2005/01/21 4:28'union all select 5,'2005/01/20 13:22'union all select 6,'2005/0 阅读全文
posted @ 2012-05-17 16:59
ChaunceyHao
阅读(132)
评论(0)
推荐(0)
摘要:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_weekdaycount]') and xtype in (N'FN', N'IF', N'TF'))drop function [dbo].[f_weekdaycount]GO/*--计算任意两个时间之间的星期几的次数(横向显示) 本方法直接判断 @@datefirst 做对应处理 不受 sp_language 及 set datefirst 的影响 --邹建 2004.08(引用请保留 阅读全文
posted @ 2012-05-17 16:59
ChaunceyHao
阅读(193)
评论(0)
推荐(0)
摘要:
--定义基本数字表declare @T1 table(代码 int,名称 varchar(10),参加时间 datetime,终止时间 datetime)insert into @T1 select 12,'单位1','2003/04/01','2004/05/01' union all select 22,'单位2','2001/02/01','2003/02/01' union all select 42,'单位3','2000/04/01','2003/ 阅读全文
posted @ 2012-05-17 16:58
ChaunceyHao
阅读(150)
评论(0)
推荐(0)
摘要:
原代码: DECLARE @E_ID VARCHAR(20) DECLARE @AFFECT INT SELECT @E_ID=TB_USER.E_ID FROM TB_EMPLOYEE INNER JOIN TB_USER ON TB_USER.E_ID=TB_EMPLOYEE.E_ID WHERE U_USERNAME='LL' UPDATE TB_EMPLOYEE SET E_NAME='张三',E_MAIL='zhangsan163@163.COM',E_TEL='12345667' WHERE E_ID=@E_ID IF 阅读全文
posted @ 2012-05-17 16:57
ChaunceyHao
阅读(109)
评论(0)
推荐(0)
摘要:
using System;using Wrox.ProCSharp;using Wrox.ProCSharp.VenusBank;using Wrox.ProCSharp.JupiterBank;namespace Wrox.ProCSharp{ class MainEntryPoint { static void Main() { IBankAccount venusAccount = new SaverAccount(); ITransferBankAccount jupiterAccount = new CurrentAccount(); venusAccount.PayIn... 阅读全文
posted @ 2012-05-17 15:47
ChaunceyHao
阅读(148)
评论(0)
推荐(0)
浙公网安备 33010602011771号