CSS样式库

What?

一般由专业前端设计人员编写的可复用CSS样式,涵盖常用的布局、元素、组件配置。

Why?

DRY & DRW。流行的样式库能保证不同浏览器之间的兼容性,复用性高,有人维护(升级空间)。如果不是做专业项目,使用CSS样式库可以大幅减少相关代码的书写,可以使更多的时间花在核心业务上。

Where?

99Lime: http://www.99lime.com/

Skeleton: http://getskeleton.com/

Bootstrap: http://twitter.github.com/bootstrap/

还有一些基于Bootstrap的mod:

fbstrap: http://ckrack.github.com/fbootstrapp/

boots watch: http://bootswatch.com/

style bootstrap: http://stylebootstrap.info/

期末考试的shell script题

要求:

  1. 当前用户在字符界面下
  2. 进入用户的主目录
  3. 显示菜单,让用户选择,包括:1. 启动vi 2. 启动X Window 3.检查主目录下是否有.conf结尾的文件,如果有则使用at在23:00进行后台备份

 

> #!/bin/bash
> #author: kavinyao@gmail.com
> 
> #user=`whoami`
> #if [ $user = "root" ]
> #then
> #    home_dir="/root"
> #else
> #    home_dir="/home/$user"
> #fi
> #
> #cd $home_dir
> 
> cd ~
> 
> goodChoice=false
> until $goodChoice
> do
>     echo "what do you want to do? (enter number)"
>     echo "1. start vi"
>     echo "2. start x windows"
>     echo "3. backup *.conf"
> 
>     read option
> 
>     case $option in
>     "1")
>         goodChoice=true
>         vi;;
>     "2")
>         goodChoice=true
>         startx;;
>     "3")
>         goodChoice=true
>         
>         if [ -e *.conf ]
>         then
>             #echo "tar cvf backup.tar $home_dir/*.conf &" > job
>             echo "tar cvf backup.tar $HOME/*.conf &" > job
>             at -f job 23:00 
>             echo "back up set successfully"
>         else
>             echo "no *.conf found, will not backup"
>         fi
>         ;;
>     *)
>         echo "bad choice, please try again"
>     esac
> done

期中考试题2:BigInteger的部分实现

Java中long类型可以表示 -9,223,372,036,854,775,808(即-2^64)到9,223,372,036,854,775,807(即2^64-1)范围内的整数。有的时候我们希望能够处理在此范围之外的整数。
为此,我们设计了一个BigInteger类。它可以支持大整数的加、减、乘操作。请根据提供的代码框架,完成整个程序。

> 注:
> 1) 请仔细阅读代码中的注释,并在标有// YOU FILL THIS IN 的位置添加你的代码。你可以添加自己的方法、变量,但是请不要修改已有的代码。
> 2) 程序中的main函数只是一个示例测试。在批改作业时,我们会用更多的用例来测试你的程序。所以请保证你的程序的正确性。
> 3) 我们在测试你的程序时,将使用合法的输入值,因此你无需考虑输入不合法的情况。输入值可能有两种形式:"343839939" 或者
  "-394939399390343",输入的数字位数不固定,但一定是合法的整数。
> 4)  不允许使用java.math包。
> 5) 请将你的项目打包成rar或者zip格式提交。请注意提交的格式:打开你的压缩包,应该可以看到BigInteger文件夹,这个文件夹里面包含了src和bin两个文件夹。
  如果提交作业格式错误,将不能通过测试,没有得分。

继续阅读

期中考试题1:MyDate的部分实现

题目:根据提供的代码,实现一个简单的日期类。将你的代码实现在标示有YOU FILL THIS IN的位置。你可以添加新的类或者新的方法,但请不要改动已有的代码。

注:
1. 根据格里高利历法(Gregorian calendar,即公历) 实现这个类
2. year参数是大于或等于1970,小于2050的正整数,month是大于等于1,小于等于12的正整数,day是大于等于 1,小于等于31的正整数。
3. 你无需考虑输入值是否合法的问题。测试时我们总会输入合法的日期。但是我们鼓励你在实现中考虑到非法输入的情况,比如 2010-02-29。
4. 闰年的规则是:
  # 逢400的倍数为闰年,如2000年;
  # 若非400的倍数,而是100的倍数,为平年,如1900年;
  # 若非100的倍数,而是4的倍数,为闰年,如1996年;
  # 非以上情况的年份均为平年。
5. 不允许使用java.util包

继续阅读

convert int to string in C

就是栋gg上课提到的那个,觉得自己做得好烦哪~

代码如下:

继续阅读

MineSweeperGame powered by Java Swing

During this winter vacation, I got addicted to the MineSweeper, one of the Games shipped with Windows. Since I am learning Java SE at present, I kept wondering if I could build my own MineSweeper Game with Java Swing. I was not sure though the internal logic of this game is really simple. It was not until the senior told us that there is never a goal that high at the annual Awards of Software Innovation Competitive that I made up my mind to build that. I really appreciate the senior who inspired me, and after a day’s work, beta1 was released, though there was only one tester, me.

继续阅读

First Entry on is-programmer.com

My first semester in college ended a month ago and the next is just a few days ahead. As a student of software engineering department, programming is definitely a skill you must acquire. This blog serves as a place to share my studies, findings and essays of programming, maybe a few other topics included.

 

I love programming. Teacher not covering much, I learned C mostly by myself last semester and find it a powerful and elegant language. Many say that so old a language C is that it is out of fashion. I'm not an expert for the time being, but I can say that after learning C, I found learning Java easier. I just skipped the syntax style part as Java inherited that mostly from C. That doesn’t mean syntax style is not important. On the contrary, it’s rather important because it helps people who read the code understand what it is and how it works. A program can be excellent when the style is horrible at the same time. Just take the example of winners of IOOOC, look at one and your first impression must (oh, will probably) be “damn, I can’t believe this is a piece of code!” But all of them worked out well, some being tiny but powerful! Back to main topic, C is still an important language. Just take a peek at the Tiobe Index , C is still a popular language with strong power. Generally known, C is a free style language and a language so free that the compiler may think different about the code from you. It has various kinds of traps and pitfalls and makes beginners confused. Sometimes even a senior programmer makes mistakes. But once you can produce a clear-style, high-quality C code, you will take a much fast step forward whether to other languages or deeper into C, just because languages born after C are more abstract, which means they have more and more restrictions and make things that difficult to deal with in C easier to handle at the same time.

 

继续阅读