杰拉斯的博客

[大二课程设计开源]KTV管理系统(Swing界面,含源码)

杰拉斯 杰拉斯 | 时间:2012-04-05, Thu | 48,698 views
编程算法 

一些体会:

可能不少人对Java界面的印象就是两个字——难看,曾经我也不例外。刚开始接触Java开发的界面是高三头脑发热想用Flash做MMORPG网游时,因为自己美工不咋地,所以用了游戏资源提取器:

梦想世界提取器界面

当时就想,Java做的界面怎么那么难看,又因为听说C++效率比Java高,Java基本上不可能用来开发大型的3D网游,因此一直对Java兴趣缺缺,直到大一的时候看到了这篇文章:《Swing是一把刀》,才发现,Swing原来也可以这么华丽当时立马豪情万丈,废寝忘食地做出了人生中第一个Java作品畅之茗Java新浪微博客户端,不过因为代码在现在看来实在是幼稚的很,所以就不贴出来贻笑大方了。

好吧,回到正题,偷偷地引用一段话:“无论哪个UI技术,说到底都是在屏幕上画图,本质上都是画点、划线而已,只是有的用起来复杂,有的简单,有的功能强,有的功能弱。不过对于技艺高超者来说,给个邮票大的地方也能跳出激动人心的舞蹈,Flex不就是在Flash这块邮票上面不停的折腾么?这又和脚下的空间有多少关系呢?相比Flash/Flex这张小邮票,Swing则给了我们一个巨大的足球场。如果我们还是不能在这个舞台上吸引更多的观众,还是多反思一下自己的舞技吧,就算脚下的场地有点湿滑不平,我们也没必要喋喋不休。”

  • 如果用一个工具做不出好的作品,与其埋怨它差劲,不如反思一下为什么自己做不出好的作品。

大一的时候很喜欢用setLayout(null),然后用绝对定位来进行布局,因为觉得自带的布局管理器只能适应特定的几种模式,不能够随心所欲,可后来才意识到一个问题:绝对定位的布局在某些分辨率下正常,但换个屏幕分辨率可能就惨不忍睹了,后来才发现,其实布局管理器如果懂得怎么去用,怎么组合,也可以做出随心所欲的界面,更重要的一点是:自动适应不同分辨率。

  • 善用布局管理器。

虽说没有最好,只有更好,但我们就是需要一种吹毛求疵的态度去看待自己的作品,注重每一个细节,每一个用户体验,才能够做出超越自我的作品。

  • 追求完美。
虽然这体会一条比一条短,但其实最后一条才是我体会最深,让我自己都感到又爱又恨的特质,因为追求完美,才会有那些点点滴滴的提高,但也是因为追求完美,所以经常一个作品总是改了又改,还经常熬夜。。熬夜这习惯不好,一定要改掉!!(虽然已经说了很久了= =)

(阅读全文…)

[ACM_NYOJ_37]回文字符串

杰拉斯 杰拉斯 | 时间:2012-04-04, Wed | 17,775 views
编程算法 

回文字符串

时间限制:3000 ms | 内存限制:65535 KB
难度:4

描述

所谓回文字符串,就是一个字符串,从左到右读和从右到左读是完全一样的,比如"aba"。当然,我们给你的问题不会再简单到判断一个字符串是不是回文字符串。现在要求你,给你一个字符串,可在任意位置添加字符,最少再添加几个字符,可以使这个字符串成为回文字符串。

输入

第一行给出整数N(0 接下来的N行,每行一个字符串,每个字符串长度不超过1000.

输出

每行输出所需添加的最少字符数

样例输入

1
Ab3bd

样例输出

2

(阅读全文…)

[ACM_ZOJ_1733]Longest Common Subsequence

杰拉斯 杰拉斯 | 时间:2012-04-04, Wed | 40,720 views
编程算法 

Common Subsequence
(最长公共子序列)

Time Limit: 2 Seconds Memory Limit: 65536 KB

Description

A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists a strictly increasing sequence of indices of X such that for all j = 1,2,...,k, xij = zj. For example, Z = is a subsequence of X = with index sequence . Given two sequences X and Y the problem is to find the length of the maximum-length common subsequence of X and Y.

The program input is from a text file. Each data set in the file contains two strings representing the given sequences. The sequences are separated by any number of white spaces. The input data are correct. For each set of data the program prints on the standard output the length of the maximum-length common subsequence from the beginning of a separate line.

(阅读全文…)

[ACM_POJ_2533]Longest Ordered Subsequence

杰拉斯 杰拉斯 | 时间:2012-04-03, Tue | 20,066 views
编程算法 

Longest Ordered Subsequence
(最长有序子序列)

Time Limit: 2000MS Memory Limit: 65536K
Total Submissions: 21942 Accepted: 9441

Description

A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), where 1

Your program, when given the numeric sequence, must find the length of its longest ordered subsequence.

Input

The first line of input file contains the length of sequence N. The second line contains the elements of sequence - N integers in the range from 0 to 10000 each, separated by spaces. 1 <= N <= 1000

Output

Output file must contain a single integer - the length of the longest ordered subsequence of the given sequence.

(阅读全文…)