杰拉斯的博客

谈谈CSS Sprites技术及其优化

杰拉斯 杰拉斯 | 时间:2012-05-17, Thu | 12,083 views
前端开发 

很久之前就想具体地研究一下CSS Sprites了,今儿个看到微博UDC的这篇文章,赶紧转来,已经很晚了,留待有空研究= =。。

CSS Sprites 技术对于广大的前端工程师来说应该是一点也不陌生。这个被国内开发者昵称为CSS精灵 CSS雪碧的家伙到底解决了什么问题,我们又怎样合理使用这个技术呢?下面让我们详细的聊聊。

谈谈CSS Sprites技术及其优化

在大家还在拨号上网的“远古时期”,由于网速的限制,页面开发者都喜欢把网页里面的图片字节数控制的非常小,往往在一个图片文件夹里散落着n多的小碎图。随着网络技术的发展,网速的提升,大家越来越重视页面的加载速度,页面效率问题,过去的那些小图便成为了前端开发者的眼中钉,因为每加载一张图片都会产生一次浏览器请求数,发起的请求数越多那么页面加载的速度也越慢。还有当页面加载时,图片一个个的零星显示,鼠标经过时候背景闪白等也都是我们不能忍受的。于是乎将页面中的背景图整合到一起,利用“background-image”,“background- repeat”,“background-position”的组合进行背景定位的技术被广泛使用与了页面构建中,这就是CSS Sprites。当然CSS Sprites技术也存在着维护不便,内存占用大等等的缺点。

好了,如果我只说这些,那么这篇文章就有点太水了。前面那些只是对CSS Sprites技术的一个普及。作为一个开发者我们应该对它有一个更全面的认识,挖掘深度内容,这样才能有利于我们效率开发,团队协作。

(阅读全文…)

[日记一篇]无名思绪

杰拉斯 杰拉斯 | 时间:2012-05-11, Fri | 39,904 views
心路历程 

明天要去当一个小小颁奖仪式的主持人,其实本身没有多少做主持人的经验,似乎唯一的一次就是部门第一次面试通过见面会了,虽不感觉紧张,心里还是有些小小的忐忑,但无论如何,这未尝不是一次很好的锻炼机会,也未尝不是对我的一种肯定,从高三一个认识班里同学不超过五个的人到现在,不到两年的时间,其中付出的努力绝对不少,但这一切我想都是值得的,因为我看到了我的进步,我想要变的优秀,我会做到的。

——于2012-5-11凌晨2:41

[ACM实验五]ACM程序设计基础(3)

杰拉斯 杰拉斯 | 时间:2012-05-09, Wed | 10,418 views
编程算法 

实验项目:ACM程序设计基础(3)
实验目的:掌握C++程序设计基础。
实验要求:使用VC++6.0实现实验要求。
实验内容:

1.为了对信件保密,需要对信件进行加密,加密方法是每个字母加5,如A写成F,B写成G。输入一行加密的英文句子,输出其解密英文句子,例如:
输入:NS BFW, JAJSYX TK NRUTWYFSHJ FWJ YMJ WJXZQY TK YWNANFQ HFZXJX
输出:IN WAR, EVENTS OF IMPORTANCE ARE THE RESULT OF TRIVIAL CAUSES
(提示:getline 是一个函数,它可以接受用户的输入的字符,直到已达指定个数,或者用户输入了特定的字符。它的函数声明形式(函数原型)如下:
istream& getline(char line[], int size, char endchar = '\n');
char line[]: 就是一个字符数组,用户输入的内容将存入在该数组内。
int size : 最多接受几个字符?用户超过size的输入都将不被接受。
char endchar :当用户输入endchar指定的字符时,自动结束。默认是回车符。
例如用string buf;来保存:getline( cin , buf ); 如果用char buf[ 255 ]; 来保存:cin.getline( buf, 255 )。)

2. 某售货员要到若干城市去推销商品,一直各城市之间的路程,他要选定一条从驻地出发,经过每个城市一遍,最后回到住地的路线,使总的路程最短。

最短路径

3. Anagrams by Stack问题,见Anagrams by Stack

(阅读全文…)

[ACM_HDU_1515]Anagrams by Stack

杰拉斯 杰拉斯 | 时间:2012-05-09, Wed | 10,756 views
编程算法 

Anagrams by Stack

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 614 Accepted Submission(s): 311

Description

How can anagrams result from sequences of stack operations? There are two sequences of stack operators which can convert TROT to TORT:

[
i i i i o o o o
i o i i o o i o
]

where i stands for Push and o stands for Pop. Your program should, given pairs of words produce sequences of stack operations which convert the first word to the second.

A stack is a data storage and retrieval structure permitting two operations:

Push - to insert an item and
Pop - to retrieve the most recently pushed item
We will use the symbol i (in) for push and o (out) for pop operations for an initially empty stack of characters. Given an input word, some sequences of push and pop operations are valid in that every character of the word is both pushed and popped, and furthermore, no attempt is ever made to pop the empty stack. For example, if the word FOO is input, then the sequence:

i i o i o o is valid, but
i i o is not (it's too short), neither is
i i o o o i (there's an illegal pop of an empty stack)

Valid sequences yield rearrangements of the letters in an input word. For example, the input word FOO and the sequence i i o i o o produce the anagram OOF. So also would the sequence i i i o o o. You are to write a program to input pairs of words and output all the valid sequences of i and o which will produce the second member of each pair from the first.

Input

The input will consist of several lines of input. The first line of each pair of input lines is to be considered as a source word (which does not include the end-of-line character). The second line (again, not including the end-of-line character) of each pair is a target word. The end of input is marked by end of file.

Output

For each input pair, your program should produce a sorted list of valid sequences of i and o which produce the target word from the source word. Each list should be delimited by

[
]

and the sequences should be printed in "dictionary order". Within each sequence, each i and o is followed by a single space and each sequence is terminated by a new line.

(阅读全文…)

[WordPress插件]代码高亮插件CodeColorer汉化升级版

杰拉斯 杰拉斯 | 时间:2012-05-07, Mon | 25,594 views
后台技术 

写在前面

WordPress以来,本站一直是用CodeColorer来实现代码高亮,但原版的汉化不够完全,且与不少主题都冲突,因此本人将原版修改过后使用,并加入了可视化代码插入功能,之前也想发布出来,但因为懒,一直推迟到现在才把它打包出来提供给大家。

CodeColorer

CodeColorer是一款基于GeSHi库的WordPress代码语法高亮插件,功能简单,使用方便,是一款比较轻量的插件。

(阅读全文…)