|
|
June 26 当初很期待地寄了简历过去........ 这几天等他们邮件等的泪流满面.收到后很兴奋的打开,说叫我去面试啦!!!! 仔细阅读完邮件我彻底被雷住了....和预期的不一样.培训介绍的时候也根本没说起这些条款,我有点小失望 还一开始声称是[挖掘和培养国内UI人才] 其实就是无工资在那里干3个月吗.... 作品自然没自己版权的 其实他们在杭州我还考虑下...可是在西安...我倒,那么内陆..搞p啊 我只是想去学习的....才大二啊,万一被录用了就回不了家了啊...而且学校的学业... 这样的话那暑假就搞同人本咯~ ==============邮件正文================= 你好, 如果方便的话,下周二下午三点来公司面试一下吧。(这个,...时间太紧了吧! 另外,选定接受培训的学员是要和公司签署协议的。 附件中是合同样本,请根据自身情况考虑。 谢谢:) =============邮件附件,doc文档============= SKYUI 超人科技培训生合同 甲 方:西安超人科技有限公司 乙 方:__________
甲乙双方本着友好合作的目的,在自愿平等和相互信任的基础上,签定本合同,以便共同遵守。 第一条 甲方以培养设计师人才为目的,向乙方提供为期三个月的培训;在培训后有权选择是否录用乙方为正式员工。 第二条 乙方自愿接受甲方的培训,并可以申请到甲方从事设计工作。 第三条 甲方的权利和义务 -
甲方向乙方提供场所,设备,以及设计培训内容,为乙方安排设计工作; -
甲方有权监督检查乙方学习工作情况; -
甲方有权对乙方的学习和工作进行评价,并以此作为乙方是否继续培训的依据;甲方有权随时终止对乙方的培训; -
对乙方学习工作中发生有害甲方利益的行为,予以处罚; -
在公众场合,媒体,网络,将乙方作为甲方团队成员的身份进行宣传; -
甲方有权使用乙方的所有设计作品,作为宣传内容; -
为乙方更新知识、进修深造提供便利和创造条件。 -
在培训结束后,甲方有权对乙方的设计能力进行评估,并有权决定是否录用乙方为正式员工; 第四条 乙方的权利和义务 -
乙方在培训期间有权使用甲方指定提供的办公设备,场地以及其他相关设施。 -
乙方需按照甲方提出的时间和要求完成设计工作,服从工作安排; -
乙方对甲方的设计任务必须由乙方个人独立完成,不得转包他人; -
乙方不得抄袭,盗用他人作品;否则由此产生的对甲方的利益损害,完全有乙方承担; -
不断提高自己的实际工作能力和业务素质。 -
乙方在任何场合,包括但不仅限于媒体,网络,公众活动等场合,必须以甲方( SKYUI ,超人科技)成员的名义进行; -
乙方在合同期内为甲方设计的所有作品,不得在任何场合、以任何形式使用;如要使用,必须经过甲方的许可,在甲方监督下,按照甲方指定的形式进行使用;否则,一切法律和经济责任由乙方承担; -
乙方在合同期内,不得发生有损甲方形象,利益的行为,否则甲方有权向乙方提出赔偿;由于乙方擅自泄漏,使用设计作品而引起的法律责任,所产生的所有经济费用,由乙方承担; 第五条 违约责任: 1. 乙方在培训期间不得擅自退出培训;一旦乙方擅自退出培训,须向甲方支付培训费用陆仟元整; 原来这份培训价值6000??!!
2. 乙方在培训结束后,甲方可选择是否与乙方签订劳动合同;如甲方提出,则乙方须与甲方签订为期两年的劳动工作合同,如乙方不同意与甲方签订劳动合同,则乙方须向甲方支付违约金伍万元整; 5w...你去死吧...
3. 签订劳动合同后,乙方承诺至少履行劳动合同一年( 即乙方至少在甲方处工作一年) ; 4. 若乙方自劳动合同签订日起,一年内从甲方处主动离职, 则乙方须向甲方支付违约金伍万元整 ; 第六条 合同期限 本合同有效期,从合同签字之日起为期两年 。 第七条 合同的变更和解除 在下列情况下,甲方有权单方解除合同: -
乙方不积极履行义务,经劝阻不改时; -
乙方违背职业道德; -
甲方公司经营策略发生变化时; -
乙方发生有损甲方利益的行为时; -
乙方违反国家法律规定的; 第八条 本合同一式两份,甲乙双方各持一份,具有同等效力。 第九条 本合同自双方签字之日起生效。 June 19 The_Face_Of_Eva___Step_By_Step_by_WarrenLouw 摘自DA  系统分析与设计 由指导书的代码部分修改完成。非指导书上的部分全部为自己编写 全局变量有:需编码的项目的个数n,权信息w,项目名字info,树结构HT,最终编码结果HC,以及我自己追加的一些文件名。 InitialConfig用来读取配置文件config.ini来确定需要操作的文件名。最初我想直接用windows.h里的GetPrivateProfilString函数来读取配置文件的,但是不知道为什么无法正确读取,只好直接写了这个简陋的配置文件读取函数。 Select函数用来选择出当前已经写入的结点中parent==0的最小的两项。在整理树结构时被反复用到。我的算法是先判断parent值,再比较是否比已扫描过的最小2项要小,然后将之前两项中较大那项用新发现的值替换。 HuffmanCoding函数是核心函数,功能包括了初始化树结构HT,整理HT成为最有二叉树,将哈弗曼树结构写入文件,得到每个项目的哈弗曼编码值(从叶子往根走)。相当一部分直接可以参考课本,关键在于充分理解,以写出其他相关函数。 CheckCoding函数根据已获得的哈弗曼编码来编码文件并保存为指定文件。 HuffmanTranslate函数和CheckCoding相反,根据已获得的哈弗曼编码解码文件并保存为指定文件。解码部分课本没有给出,由自己编写,我从根向叶子行走,遇0左走,遇1右走,走到叶子节点把获得的内容(info)写入文件。因为在哈弗曼树中,左右孩子要么都有要么都没有,所以判断是否为叶子节点时只需检查其中一个孩子即可。另外,在HT中,最后一项肯定是根节点,所以每次开始一轮新的解码时将root=2*n-1。 FileCompare函数用来比较两个文件是否一致,因为按照要求,一个文本文件被编码后又解码,为了验证系统是否有效,检验两个文件是否相同是有效的方法之一。将该功能直接写入程序,方便了用户。 主界面操作部分用do…while循环来实现。选项比较少就直接用了几个if来选择操作了。其实我觉得创建树和编码的操作不应该像指导书里那样做成操作选项,而是应该设计成自动执行的一步,因为编码和解码的操作都以已经建立了编码为前提的。 很多函数的返回形式改成了自定义的status,主函数中用if (!function_name) exit(0);形势来使用函数,保证了程序的安全性。每一个函数或者出错都输出信息让用户知道执行情况。 代码部分,一些涉及到数据结构操作的部分都先输出在屏幕上检查,确定无误后再加入文件的操作,屏幕输出部分的代码注释掉以保留,供今后调试用。 代码#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fstream.h>
using namespace std;
typedef int status;
typedef struct
{
char info;
unsigned int weight;
unsigned int parent, lchild, rchild;
}HTNode,*HuffmanTree;
typedef char **HuffmanCode;
/////////////////////
// GLOBAL VAR //
/////////////////////
int n=27;
int w[] = {186,64,13,22,32,103,21,15,47,57,1,5,32,20,57,63,15,1,48,51,80,23,8,18,1,16,1}; //weight
char info[] = {' ','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
HuffmanTree HT;
HuffmanCode HC;
/*
char *hfmtree_tar = "hfmTree.txt";
char *code_src = "ToBeTra.txt";
char *code_tar = "CodeFile.txt";
char *decode_src = "CodeFile.txt";
char *decode_tar = "Textfile.txt";
*/
char *config = "config.ini";
char hfmtree_tar[255] = "hfmTree.txt";
char code_src[255] = "ToBeTra.txt";
char code_tar[255] = "CodeFile.txt";
char decode_src[255] = "CodeFile.txt";
char decode_tar[255] = "Textfile.txt";
/////////////////////////////////////////
/// FUNCTIONS PART ///
/////////////////////////////////////////
void InitialConfig()
{
ifstream config_file;
config_file.open(config);
if (!config_file)
{
cout<<"cannot open"<<config<<endl<<"program will use default settings"<<endl;
return;
}
config_file>>hfmtree_tar>>code_src>>code_tar>>decode_src>>decode_tar;
config_file.close();
cout<<"settings loaded from "<<config<<endl;
}
//===================================//
//choose two smallest nodes whose parent==0
void Select(HuffmanTree HT, int j,int &s1,int &s2)
{
int i,min1=0,min2=0;
for (i=1;i<=j;i++)
{
if (HT[i].parent==0)
{
if (min1==0) {min1=HT[i].weight,s1=i;continue;} //continue => for
if (min2==0) {min2=HT[i].weight,s2=i;continue;} //continue => for
if (HT[i].weight<min1)
{
if (min1<min2) s2=i,min2=HT[i].weight;
else s1=i,min1=HT[i].weight;
}
else if (HT[i].weight<min2) s2=i,min2=HT[i].weight;
}
} //for
}
//===================================//
status HuffmanCoding(HuffmanTree &HT, HuffmanCode &HC, int *w, int n,char *info)
{
int i, j, m, s1, s2, start;
char *cd; //code's temp storage
unsigned int c, f;
if (n<=1) return 0;
m = 2 * n - 1; //combined nodes need more room, so 2*n
HT = (HuffmanTree)malloc((m+1) * sizeof(HTNode)); //HT[0] is not used
for (i=1; i<=n; i++) //initial nodes' data
{
HT[i].weight=w[i-1];
HT[i].info=info[i-1];
HT[i].parent=0;
HT[i].lchild=0;
HT[i].rchild=0;
}
for (i=n+1; i<=m; i++) //initial combined nodes
{
HT[i].weight=0;
HT[i].parent=0;
HT[i].lchild=0;
HT[i].rchild=0;
}
//show the initialed list
/*
cout<<"HT initialed:"<<endl<<"Node\tWeight\tParent\tLchild\tRchild"<<endl;
for (i=1; i<=m; i++)
cout<<i<<"\t"<<HT[i].weight<<"\t"<<HT[i].parent<<"\t"<<HT[i].lchild<<"\t"<<HT[i].rchild<<endl;
*/
for (i=n+1; i<=m; i++) //fill in combined nodes' data
{
Select(HT, i-1, s1, s2);
HT[s1].parent = i;
HT[s2].parent = i;
HT[i].lchild = s1;
HT[i].rchild = s2;
HT[i].weight = HT[s1].weight + HT[s2].weight;
//show nodes' combinationg steps
/*
cout<<endl<<"combine nodes: s1="<<s1<<" s2="<<s2<<endl;
cout<<"Node\tWeight\tParent\tLchild\tRchild"<<endl;
for (j=1; j<=i; j++)
cout<<j<<"\t"<<HT[j].weight<<"\t"<<HT[j].parent<<"\t"<<HT[j].lchild<<"\t"<<HT[j].rchild<<endl;
*/
}
//write tree in hfmTree.txt
ofstream save_hfm;
save_hfm.open(hfmtree_tar);
if (!save_hfm)
{
cout<<"cannot open"<<hfmtree_tar<<endl;
return 0;
}
save_hfm<<"Node\tWeight\tParent\tLchild\tRchild\tInfo"<<endl;
for (i=1; i<=m; i++)
{
save_hfm<<i<<"\t"<<HT[i].weight<<"\t"<<HT[i].parent<<"\t"<<HT[i].lchild<<"\t"<<HT[i].rchild;
if (i<=n) save_hfm<<"\t"<<info[i-1];
save_hfm<<endl;
}
//get huff code from leaf to root
HC = (HuffmanCode)malloc((n+1)*sizeof(char *));
cd = (char *)malloc(n*sizeof(char));
cd[n-1] = '\0';
//show code list's colume
//cout<<endl<<"Node\tInfo\tWeight\tCode"<<endl;
for (i=1; i<=n; ++i)
{
start = n-1;
for (c=i, f=HT[i].parent; f!=0; c=f, f=HT[f].parent)
if (HT[f].lchild==c) cd[--start] = '0';
else cd[--start] = '1';
HC[i] = (char *)malloc((n-start)*sizeof(char));
strcpy(HC[i], &cd[start]); //HC[0] is not used
//show code list, info[] starts from [0], so [i-1]
//cout<<i<<"\t"<<info[i-1]<<"\t"<<HT[i].weight<<"\t"<<HC[i]<<endl;
}
cout<<"huffman tree saved in "<<hfmtree_tar<<endl;
free(cd);
save_hfm.close();
return 1;
}
//===================================//
//code_src -----code----> code_tar
//return 0 == error occured
status CheckCoding()
{
char ch;
int i;
//open file to be read
ifstream code_input;
code_input.open(code_src);
if (!code_input)
{
cout<<"cannot open"<<code_src<<endl;
return 0;
}
//open file to be written
ofstream code_output;
code_output.open(code_tar);
if (!code_output)
{
cout<<"cannot open"<<code_tar<<endl;
return 0;
}
//start coding
cout<<endl;
while( code_input.get(ch) )
{
if (ch==' ') i=1;
else if ((ch>='A')&&(ch<='Z')) i=(int)ch-63;
code_output<<HC[i];
//show in screen, for test
//cout<<HC[i];
}
cout<<code_src<<" ----[coded]----> "<<code_tar<<endl;
code_output.close();
code_input.close();
return 1;
}
//===================================//
//decode_src -------decode-----> decode_tar
//return 0 == error occured
status HuffmanTranslate()
{
char ch;
int i,root=2*n-1; //2*n-1 is the top root node
//open file to be read
ifstream decode_input;
decode_input.open(decode_src);
if (!decode_input)
{
cout<<"cannot open"<<decode_src<<endl;
return 0;
}
//open file to be written
ofstream decode_output;
decode_output.open(decode_tar);
if (!decode_output)
{
cout<<"cannot open"<<decode_tar<<endl;
return 0;
}
//
cout<<endl;
while( decode_input.get(ch))
{
if (ch=='0')
if (HT[root].lchild!=0) i=HT[root].lchild;
else {cout<<"wrong code inputed!"<<endl;return 0;}
else if (ch=='1')
if (HT[root].rchild!=0) i=HT[root].rchild;
else {cout<<"wrong code inputed!"<<endl;return 0;}
else {cout<<"wrong code inputed!"<<endl;return 0;} //ch != 0 or 1
if (HT[i].lchild==0) //leaf node
{
decode_output<<info[i-1];
//show in screen, for test
//cout<<info[i-1];
root=2*n-1;
}
else root=i;
}
cout<<decode_src<<" ----[decoded]----> "<<decode_tar<<endl;
decode_output.close();
decode_input.close();
return 1;
}
//===================================//
//check 2 files if they have the same content
status FileCompare()
{
char ch1,ch2;
//open original text file
ifstream code_input;
code_input.open(code_src);
if (!code_input)
{
cout<<"cannot open"<<code_src<<endl;
return 0;
}
//open code-decoded text file
ifstream decode_output;
decode_output.open(decode_tar);
if (!decode_output)
{
cout<<"cannot open"<<decode_tar<<endl;
return 0;
}
//start comparing
while ((code_input.get(ch1))&&(decode_output.get(ch2)))
{
if (ch1!=ch2)
{
cout<<endl<<code_src<<" and "<<decode_tar<<" are different"<<endl;
return 1;
}
}
cout<<endl<<code_src<<" and "<<decode_tar<<" are the same"<<endl;
return 1;
}
///////////////////////////////////
/// MAIN ///
///////////////////////////////////
main()
{
int op,coded=0;
cout<<"============================"<<endl;
cout<<"== JZL's Huffman system =="<<endl;
cout<<"============================"<<endl<<endl;
cout<<"NOTE:file operation controled by "<<config<<endl;
cout<<"please rewrite the config as you wish"<<endl<<endl;
InitialConfig();
do
{
cout<<endl;
cout<<"=======================MENU====================="<<endl;
cout<<"1.CREATE HUFFMAN TREE and save to "<<hfmtree_tar<<endl;
cout<<"2.CODE "<<code_src<<" and save to "<<code_tar<<endl;
cout<<"3.DECODE "<<decode_src<<" and save to "<<decode_tar<<endl;
cout<<"4.COMPARE "<<code_src<<" and "<<decode_tar<<endl;
cout<<"0.EXIT"<<endl<<endl;
cout<<"please type your operation number:"<<endl;
cin>>op;
if (op==1) if (!HuffmanCoding(HT,HC,w,n,info)) exit(0); else coded=1;
if (op==2) {
if (coded==0) cout<<"WARNING:please execute option 1 BEFORE 2"<<endl;
else if (!CheckCoding()) exit(0);
}
if (op==3) {
if (coded==0) cout<<"WARNING:please execute option 1 BEFORE 3"<<endl;
else if (!HuffmanTranslate()) exit(0);
}
if (op==4) if (!FileCompare()) exit(0);
}while (op!=0);
}
测试
配置文件config.ini直接用了实验要求的默认值,如图
程序运行初
输入1,并回车
打开hfmTree.txt查看,因为完整文本太长,截图只放一部分
刚才1号操作完成后就已经回到主菜单了,输入2,回车
分别查看2个文件

输入3,回车
检查输出文件,和被编码的文件内容相同
输入4,回车,用程序自带的文件比较功能来核实
重新运行程序,如果没有执行1直接2和3操作的话
 如期得到了警告消息
体会
一开始用指针数组存文件名的,后来发现c++流的“>>”不能给这个类型赋值,就改成了标准的字符数组,虽然浪费了一点内存空间。配置文件是不会变的,所以保留了char *config形式的申明。
Select函数的正确与否是一个重点。我一开始少了两个continue导致最后一次select时s2结果不对(如下部分)。 if (min1==0) {min1=HT[i].weight,s1=i;continue;} //continue => for if (min2==0) {min2=HT[i].weight,s2=i;continue;} //continue => for
要注意w和info是从[0]开始的,而HT和HC是从[1]开始的,相关操作要注意,当然也可以在w和info前头塞一个空内容来使一致。
CheckCoding函数里要获得字符在HC中对应的位置(也就是HC[i]的i值),对字符直接进行加减操作,参考ascii表
在设计部分我也总结了一些,在此再复述一下:
我觉得创建树和编码的操作不应该像指导书里那样做成操作选项,而是应该设计成自动执行的一步,因为编码和解码的操作都以已经建立了编码为前提的。
在哈弗曼树中,左右孩子要么都有要么都没有,所以判断是否为叶子节点时只需检查其中一个孩子即可。
在HT中,最后一项(即HT[2*n-1])肯定是根节点 June 18 http://godling-studio.deviantart.com/art/firefly-PSD-126318476 带psd下载 too buzy to make it a ture pointer, so just provide PSD here. any skinner would like to make it usable??? it will be really appreciated! my 1st try on mouse pointer design. hope you like it 谢谢花花同学的取名,第一次设计鼠标指针,人懒,只做了比较常用的部分.依然没实装....只提供psd(群众纷纷表示此人已经懒到一定境界了!!).感觉动画指针的话还是用3d作比较好呢....做动画方便啊....基于2d设计的东西做动画太辛苦了...我比较懒就只是做了一些位置和发光度变化的动画....  http://godling-studio.deviantart.com/art/CHOAS-BOX-psd-incl-126314748 带psd源文件下载 WP made by [link] you can click [link] to view the WP it has been a long time since my previous UI work. i was buzy handling lover,study and ACG things. i made a small part of this skin every week, and after almost a half year, i think i've finished it. the final appearance of this design is far different from my 1st imagination. i mean, i spent lots of time adjust the whole style and details.though still some parts of this work seems awkward from other parts...XD anyway, HOPE YOU LIKE IT but i'm so sorry that i don't have time to make it a real skin, say WB,VS,etc. HOWEVER, I provide PSD file here, if you like choas box, and you know how to make a skin, just download it and make one for yourself! of course, if you submit some related works, please credit me. i probably will go to SKYUI studio for a 3-month training soon. i'm always hoping to make better job! 每周零零散散地做一点点...经过半年终于设计完成了....很早就说了没时间实装WB之类的,所以各位抱歉了....搜狗皮肤么倒是可以做下....因为比较方便.... 下个月可能去著名的skyui培训,将长达3个月,希望可以顺利学成归来 June 09 又抽了点时间做了toolbar和colume....很久没做了......因为前一段时间我在忙其他的事.....基本上主题完成的差不多了吧??? 之前的鼠标做的不好,还要重新画一个....整体风格的协调和细节也依然需要调整.其实很想早早发布了,但是还是觉得做的尽量内容多点(鼠标啊图标啊壁纸全部做进去)比较华丽呢....不过壁纸应该会单独发布的.  June 08 上周一度无法访问的bing.com,hotmail.com,flickr,微博客twitter等都恢复了访问,访问故障的持续时间恰好为一周 这一周无法更新内容,大家也无法查看,对于这次的时间我感到很遗憾 thanks to 5.28 ComicCup4, thanks to god’s arrangement, now i have a girlfriend. eh…. i still have to handle lots of new problems, hope everything will be fine. big changes already took place in my life (mostly positive). i hope i can be a good boyfriend for her, and i’ll make my effort to be. how long will this relation last is unknown, but one thing i know is that i have to treasure this girl and make her happy as much as i can. er…that’s all…… May 20 基于popup menu 改的start menu.....还好吧....几个图标直接从mera中拉过来了.....懒得重新设计了.考虑给popup menu也加蓝色点斑纹了  相当难得的像素艺术教程,很有帮助的说,务必点击放大 from pixiv, illu id = 4204822  
|
|
|
|