03 2012 档案

Learning SQL3
摘要:CASE WHEN employee.title='Head Teller' THEN 'Head Teller' WHEN employee.title='Teller' AND YEAR(employee.start_date)>2007 THEN 'Teller TRAINEE' WHEN employee.title='Teller' AND YEAR(employee.start_date)<2006 THEN 'Experienced Teller' WHEN employe 阅读全文

posted @ 2012-03-27 20:54 X.P.Chen 阅读(143) 评论(0) 推荐(0)

Learning SQL2
摘要:Learning SQL2一 分组与聚集聚集函数--GROUNP BYmysql> SELECT gender,COUNT(*) how_many -> FROM student_list -> GROUP BY gender;+--------+----------+| gender | how_many |+--------+----------+| F | 2 || M | 2 |+--------+----------+聚集函数MAX() 返回集合中的最大值MIN() 返回集合中的最小值AVG() 返回集合中的平均值SUM() 返回集合中所... 阅读全文

posted @ 2012-03-27 20:08 X.P.Chen 阅读(259) 评论(0) 推荐(0)

Learning SQL --集合操作
摘要:Learning SQL --集合操作A+B A union BAB A intersect BA-B A except B1.union intersect exceptSELECT id,genderFROM student_listUNION ALLSELECT id,foodFROM favorite_food;UNION 去除重复项,union保留重复项 阅读全文

posted @ 2012-03-27 14:48 X.P.Chen 阅读(117) 评论(0) 推荐(0)

Learning SQL--多表查询
摘要:Learning SQL --多表查询1.笛卡尔积SELECT e.fname,e.lname,d.nameFROM employee e JOIN department d;2.内连接SELECT e.fname,e.lname,d.nameFROM employee e JOIN department dON e.dept_id=d.dept_id;==SELECT e.fname,e.lname,d.nameFROM employee e INNER JOIN department dON e.dept_id=d.dept_id;==SELECT e.fname,e.lname,d.na 阅读全文

posted @ 2012-03-27 14:14 X.P.Chen 阅读(151) 评论(0) 推荐(0)

Learning SQL
摘要:在学习SQL中在LEARNING SQL中摘录的笔记Learning SQL1.去除重复的行SELECT DISTINCT cust_idFROM account;2.子查询根据其他查询再设置查询SELECT e.emp_id,e.name,e.lnameFROM (SELECT emp_id,fname,lname,start_date,titleFROM employee) e;3.升序或降序排列关键字:asc(升) desc(降)ORDER BY student_id DESC;4.根据表达式排序RIGHT LEFTORDER BY RIGHT(fed_id,3) 按最后三位数字排序5. 阅读全文

posted @ 2012-03-27 13:55 X.P.Chen 阅读(174) 评论(0) 推荐(0)

Windows7环境下如何安装PHP 5.2.17?
摘要:Windows7环境下如何安装PHP 5.2.17?网上找到的教程大多数都是针对Zip压缩包的安装,笔者打算在这里研究下为什么大家都不用Installer。可能是Installer自由度太高,不是很好进行后续的手工配置吧。1.下载PHP安装包a.www.php.net点击downloadsb.选择windows版本的php下载c.选择合适的版本,这里需要注意的是VC9是IIS用的,VC6是给Apache用的d.选择安装版程序2.安装PHP5.2.17网上找到的教程大多数都是针对Zip压缩包的安装,洒家打算在这里研究下为什么大家都不用Installer。可能是Installer自由度太高,不是很 阅读全文

posted @ 2012-03-25 21:10 X.P.Chen 阅读(140) 评论(0) 推荐(0)

学习的一点小感悟
摘要:最近几个礼拜一直在想,自己该学什么好,虽然C++ Primer都还没看完就想学VC,Qt 来做项目。。然后一直纠结了一个礼拜,最终还是没能够确定。学习C++的方法好多人都说要通过做项目来学习,比如说做一个某某管理系统。。但最终我发现基础还是最重要的,把基础打扎实才能有发展。先把语言 学好再去管怎么应用开发,如果你连语言都还没搞明白就想跃跃欲试,只能是碰一鼻子灰。现在大部分的企业来学校招聘主要看的就是你的编程能力也就是解决问题的能力以及解决的好坏,他们不会强求你有多少开发的经验。因此我做了以下决定:把经典的专业书籍都至少看三遍以上,包括教材以及部分名著 。经常上论坛交流,多问问题,多回答问题,每 阅读全文

posted @ 2012-03-24 17:59 X.P.Chen 阅读(141) 评论(0) 推荐(0)

windows下的txt文件传到Linux下中文乱码问题
摘要:之所以出现乱码是因为所压缩的文件中,有的文件是以中文命名。而在windows下中文的编码一般为gbk,而linux下中文的编码一般为utf8,所以在windows下正常打开的文件,到linux下很可能会出现乱码。解决办法为:使用命令iconv对文件内容编码进行转换。例如我有一个文件"linux常用命令"在windows下打开正常,而在linux下打开则会乱码,办法为在终端输入:iconv -f gbk -t utf8 linux常用命令.txt > linux常用命令.txt.utf8之后再打开"linux常用命令.txt.utf8"这个文件,该文 阅读全文

posted @ 2012-03-20 10:14 X.P.Chen 阅读(637) 评论(0) 推荐(0)

MATLAB安装问题解决方案大集锦
摘要:我的安装后的两个问题第一个:“Microsoft Visual C++ Runtime LibraryRuntime Error!Program:C:\Matlab7\Rin\Win32\Matlab.exeThis application has requested the runtime to terminate it in an unusual way.Please contact the application's support team for more information.”第二个:“Error starting desktopjavax.swing.rorder.e 阅读全文

posted @ 2012-03-19 19:40 X.P.Chen 阅读(1643) 评论(0) 推荐(0)

error: expected identifier before numeric constant
摘要:当有下列语句时将出现此状况 printf("\n\t\tSales as percentage of inventory:\t\t%f".\ 100*((float)total_cars_sold[brand]/(float) cars_in_stock[brand]));57:7: error: expected identifier before numeric constant原因是\前的不是, 误写成了.网上查了下还有相关 的也出现了此类问题:http://hi.baidu.com/yesbaba/blog/item/a8df963613c96c350a55a95b 阅读全文

posted @ 2012-03-14 08:43 X.P.Chen 阅读(1236) 评论(0) 推荐(0)

提示错误“expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token“
摘要:以下程序是Ansi C 应用编程中的一道题#include<stdio.h> #include<stdlib.h> void mystery(void) main() { mystery(); } void mystery(void) { int c; if((c=getchar())!=EOF) { mystery(); putchar(c); } } 但用gcc编译后发现错误。怎么也没发现错在了哪里,在网上查了一下可能有以下错误:1.include 前忘记了加上“#”2.某些关键字书写错误,如“v... 阅读全文

posted @ 2012-03-11 12:23 X.P.Chen 阅读(2337) 评论(0) 推荐(0)

C语言的一些预处理指令和系统头文件
摘要:预处理指令:1.#include 包含一个文本文件的内容2.#define 定义宏3.#undef 取消先前定义的某个宏4.#if 如果条件满足执行指定动作5.#ifdef 如果已经定义了某个宏,执行指定动作6.#ifndef 与#ifdef相反,如果没有定义某个宏,执行指定动作7.#else 如果先前的#if、#ifdef或ifndef不成立,执行指定动作8.#endif 作为#if、#ifdef或#ifndef的结束标志9.#elif 也就是else-if的意思,用于#if-#else的嵌套10.#line 设置当编译器发出警告或错误信息时所使... 阅读全文

posted @ 2012-03-10 21:18 X.P.Chen 阅读(428) 评论(0) 推荐(0)

只需输入年份的打印日历
摘要:这是对程序-->一个日历C程序的改进,没有了day_code &leap_year code的限制可以直接输入年份打印出年历/*Calendar1 打印出某年的日历,由用户只需输入年份 @author Jeff Chen @version 1.1 date:2012-03-09 */ #include<stdio.h> int main() { int day_code; int leap_year; int year; printf("Enter the year you want to print:\n"); scanf("%d&qu 阅读全文

posted @ 2012-03-09 22:16 X.P.Chen 阅读(316) 评论(0) 推荐(0)

喜欢上了Emacs
摘要:早就听说Emacs是编辑器之神,功能强大确实让人折服。我也是这个礼拜才开始学习emacs的,先花一晚上看完了Learning Gnu Emacs ,感觉基本的文本上下左右等的操作没问题了。但感觉emacs的皮毛都还没有学到,于是又看了Emacs Tutorial中文指南这才发现用惯了windows的我们用起这些命令编辑器确实很难(以前我都是用EditPlusPlus写写代码的)。用emacs多写了几天的代码感觉确实方便,C mode 也会帮我们自动控制代码格式,命令模式也很好用,可以随便查找一行(goto-line),改起代码来也方便多了。而且文件的新建打开完全只需启动emacs就可以了。在w 阅读全文

posted @ 2012-03-09 18:59 X.P.Chen 阅读(163) 评论(0) 推荐(0)

一个日历C程序
摘要:由于C语言当初没学好,像C的结构体,文件流,指针等都还弄不明白。现在又捡起来再看一本C语言的书--Application Programming in Ansi C下面是最近的一个代码,关于打印日历的。/*Calendar 打印出某年的日历,由用户指出1月1日是星期几以及该年是否为闰年。 表示1月1日是星期几的编码: 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thuray 5 Friday 6 Saturday 表示是否为闰年的编码: 0 不是 1 是 @author Jeff Chen @version 1.0 date:2012-03-08 ... 阅读全文

posted @ 2012-03-09 18:43 X.P.Chen 阅读(197) 评论(0) 推荐(0)

Emacs编辑命令速查4【摘自Learning Gnu Emacs】
摘要:Table E-19. Lisp commands (Chapter 9)KeystrokesCommand nameActionC-M-bbackward-sexpMove backward by one S-expression.C-M-fforward-sexpMove forward by one S-expression.C-M-ttranspose-sexpsTranspose the two S-expressions around the cursor.C-M-@mark-sexpSet mark to the end of the current S-expression; 阅读全文

posted @ 2012-03-06 14:42 X.P.Chen 阅读(166) 评论(0) 推荐(0)

Emacs编辑命令速查3【摘自Learning Gnu Emacs 】
摘要:Table E-13. Macro commands (Chapter 6)KeystrokesCommand nameActionC-x (kmacro-start-macroStart macro definition.F3kmacro-start-macro-or-insert-counterStart macro definition. If pressed while defining a macro, insert a counter.C-x )kmacro-end-macroEnd macro definition.F4kmacro-end-or-call-macroEnd ma 阅读全文

posted @ 2012-03-06 14:41 X.P.Chen 阅读(155) 评论(0) 推荐(0)

Emacs编辑命令速查2【摘自Learning Gnu Emacs】
摘要:Table E-7. Regular expression search commands (Chapter 3)KeystrokesCommand nameActionC-M-s EnterEditSearchRegexp Forwardre-search-forwardSearch for a regular expression forward.C-M-r EnterEditSearchRegexp Backwardsre-search-backwardSearch for a regular expression backward.C-M-sEditSearchIncremental 阅读全文

posted @ 2012-03-06 14:39 X.P.Chen 阅读(133) 评论(0) 推荐(0)

Emacs编辑命令速查表1【摘自Learning Gnu Emacs】
摘要:Table E-1. File-handling commands (Chapter 1)KeystrokesCommand nameActionC-x C-fFileOpen Filefind-fileFind file and read it in a new buffer.C-x C-vfind-alternate-fileRead an alternate file, replacing the one read withC-x C-f.C-x iFileInsert Fileinsert-fileInsert file at cursor position.C-x C-sFileSa 阅读全文

posted @ 2012-03-06 14:37 X.P.Chen 阅读(166) 评论(0) 推荐(0)

Emacs编辑命令速查
摘要:Emacs编辑命令速查Emacs 启动:$ emacs 如果有X-windows就会以视窗方式启动$ emacs -nw 不开视窗启动一些按键的约定:C- Control-(即 Ctrl-),按住 Ctrl 键再按其他键M- Meta-(或 Alt-),按住 Alt 键再按其他键;或按一下 ESC,再按其他键C-M- Control-Alt-,按住 Ctrl 和 Alt 两个键再按其他键point 位点。文档中的一个位置,一般是光标的左下角mark 标记。由命令设置,用来定义/保存文档中的位置信息region 区域。在 mark 和 point 之间部分,称为一个 regionRET 回... 阅读全文

posted @ 2012-03-06 14:15 X.P.Chen 阅读(232) 评论(0) 推荐(0)

My first Python class
摘要:""" This is a student class, it has functions:study(),Getage,Getname,Getschool and ageSet, nameSet,schoolSet. @author Jeff Chen @date:2012-3-3 """ #a student class class student: #study function def study(self): print '%s read and study'%self.name #set name def 阅读全文

posted @ 2012-03-03 21:45 X.P.Chen 阅读(169) 评论(0) 推荐(0)

导航