-
几篇转载 (七) - Must see! - [Ph.D life]
2009-08-08
http://www.daniel-lemire.com/blog/advice-for-graduate-students/
- Choosing a topic is one of the most difficult and important parts of thesis work.
- The hardest part is figuring out how to cut your problem down to a solvable size while keeping it big enough to be interesting.
-The ``further work'' sections of papers are good sources of thesis topics. Whatever you do, it has to have not been done before. Also, it's not a good idea to work on something that someone else is doing simultaneously.
-
很多人关心自己花5年甚至更长时间拿到一个博士学位,能干什么,能找到什么样的工作。
你的将来,要看你自己的实力和一些外部因素。phd之后的出路,主要有四种(有的专业实际上远小于四种)。此外,我说的是刚毕业的博士找工作的问题。
《一》Professor
读完博士最典型的出路就是去学校做老师,尤其是tenure track assistant professor。如果做的好的话,一般六年之后,就是associate professor,也就是终身教授,拿到铁饭碗了,不会失业,这辈子不用担心养家糊口。有的人牛,去牛校做牛活出牛成果,虽然成不了顶级富翁,但是可以过上富裕的生活了。
作老师,就意味着要教书,同时也很可能要做科研。大家平常看得有排名的学校,基本都是要求老师teaching, research and service同时都要做好,这里面,teaching + research就是最累人的了。有的小学校,没什么科研要求,教授们可能就是一辈子教书,不做什么科研。
小学校一般工资比较低,但是没有做科研的压力,所以有的人也很喜欢;牛校标准高,要求科研出成果,压力大,很辛苦,当然相应的工资待遇好,事业成就高。
成为tenure之前不容易。要上很多课,要应付一些难缠的小本科生的疑问甚至是无理纠缠,每天光是中国人的陶瓷信估计都够删除一会儿的 J, 同时还要写proposal申请funding带学生做科研写paper;极少数很变态的学校,tenure可能跟难拿,比如说招3个assistant professor,但是6年以后只留一个,这种一般是顶尖牛校,会累死。但是绝大部分学校会根据feedback帮你改进,最终的目的是留住你,而不是6年以后赶你走。
如果你很ambitious,要去很好的学校,那肯定累,otherwise,其实没那么恐怖,主要就是第一年刚开始的时候会累一些,熟悉了以后就好多了。此外,每年暑假有3个月的假期,比较ambitious的老师自然是利用这段时间好好做科研,否则出去旅游或者回国短期混混,会过的很爽的。过了6年,你的铁饭碗就到手了,以后不怎么作research也可以。tenure以后,每个第七年是sabbatical,也就是一年的假期,你可以不工作,工资照拿。
助理教授(AP)工资根据专业和学校性质(公立私立,学校声誉)在6-9万之间的居多,正教授一般有个11-12万就到顶了。当然,如果有哪个公司愿意招你当顾问,或者你在全国各地给别人training上课,也可以另收钱。此外,sabbatical期间,如果可以在公司干一年活,等于是双份收入。
斯坦福哈佛MIT等牛校的有些牛老师,学校给的工资反而不是收入的主要来源。
《二》Industry
有的人念完博士以后不想留在学术界,或者是自身背景不强,找不到好的professor的职位,所以就选择去公司。
博士毕业生在就业上不如硕士容易,但是只要找到了工作,工资一般都会比硕士高。博士生都有自己很深入研究的小方向,一般过了最初的1-2年之后,往往是全身心地投入到小方向的研究里,所以很多博士生过于“专”了,少数人的理论研究在industry的人看来,甚至是屠龙之技,毫无用处。硕士生主要就是广泛的选课,有的人还作个thesis,短时间深入了解一个领域或者锻炼解决问题的技巧。从需求来说,工业界最需要的是本科,其次是硕士,最后是博士。
是否应该读博,是个人选择。读完博士也不一定就不好。专业不同,行业不同,情况也不一样。比如说制药公司和生物技术公司都需要很多博士生;technology行业,我认识的人里面去google的,还是以读完博士的人居多;我的几个朋友,同样的去oracle,博士生去的都是核心研发部门,但是硕士生们很难进这样的部门。也有的博士生,对某项领域很精通,正好是某个公司很需要的,非常的match,公司会给很高的工资。
In summary,我认识的人里面,博士生基本都去了很著名的大公司,硕士生去的公司就五花八门什么都有了。
公司工资一般比较高,上不封顶。sorry, Oracle的CEO的工资好像是世界第一,也就是“顶”了。中国人挣到20多万一年的很少很少,大多数人到了15万就到头了,因为作不了manager或者其他管理层的职位。
在公司工作最大的问题就是被裁员的风险大,尤其是在拿到绿卡以前,选择稳定和有发展前途的公司很重要。
《三》科研机构
在公司一般是做应用开发,而不是科研。但是少数公司里,也有很牛的research lab,比如IBM TJ Watson,Microsoft, HP等等都有,他们雇佣一帮科研牛人专门做科研,提高公司技术和研发水平,微软就有若干个ACM Turing Award(图灵奖)得主。这样的地方非常难进去。我也知道一些小学校毕业的,自身实力强也去了research lab,不过公司要差一些,比如去NEC或者三菱。其他理工科专业,有的也有类似的公司。
有些这样的科研机构,不隶属于任何公司,自己独立经营,靠各种军方资助,民间捐款,NSF或者风险投资生存;Harvard也有DFCI这样的科研机构, 哈佛周围还有children’s hospital or Brigham and Woman’s hospital这些医院,里面有以作research为主的职位,我这里说的不是年薪最多4-5万美元的博士后post-doc or research associate,而是怎么地也是7-8万一年的职位,这样职位的名称比较杂乱,我就不细谈了。
总的来说,拿着博士学位找个高薪工作,继续作博士应该做的事情,也就是做科研发paper,是很多博士们的梦想,但是要实现起来,难度还是很大的。
博士后也是一种工作,很多专业都可以选择作post doc,生物类专业最典型,绝大多数phd毕业以后都要到学校或者科研机构做几年post doctor再说。
《四》政府部门和科研机关
这种地方很少招外国人,但是的确有少数中国人在政府部门里找到accounting之类或者IT方面的工作。这种工作的最大好处,就是福利待遇好,有退休金,假期非常多,赶得上教授了,工作也很轻松很稳定。
我的一个朋友,Public Health相关专业的,毕业之后去了FDA(Food & Drug Administration,食品药物管理局),这个也是美国的要害部门了,也是一个规模庞大的雇主。FDA绝大多数职位原则上说是不招没有绿卡的人,但是这个朋友是牛校phd,背景很强,又善于交流,最终还是去了。
很多政府部门工作要求security clearance,军工性质的单位更是如此。要取得security clearance,你得是背景清白的美国公民。
这条路子,大多数人行不通。
《五》Summary
很明显,EE/CS或者其他Engineering专业的博士们可以至少有上面第一和第二两种选择,行业越好,第二种机会就越多。公司职位多,需要的人多,这也意味着学校需要数量众多的老师教学生,也就是第一种机会多。工程类专业的,去第三种地方,非常难。
做老师的,一旦tenure以后,就无所畏惧了,生活有保障,做什么事情,也可以按照自己的兴趣来;做老师,也比较有荣誉感和成就感。在公司工作,公司的success & development永远是最重要的,你的兴趣是次要的,你永远都要服从公司/老板的安排,否则就得走人,如果不能做到管理层,很多人慢慢的沦为等工资混日子。
去第三类地方的,大多是跟医药沾边的专业比如生物,医学,生物统计,或者传染病等公共卫生专业的居多;如果你学政府部门可能需要的专业,也可以考虑第四种,尽管这种机会很少。
如果是学的是纯理论的东西,比如数学,人类学,应用语言等等,第一类就是主要出路了。比如说读个比较文学之类的专业,如果找不到学校当老师,基本就得改行或者饿死了 J。不过这种专业的就业问题,不在于博士学位,而是整个专业都很差,包括本科和硕士。有的美国人读完文科博士找不到工作,只要去做小秘书或者去美国北京驻华使馆当签证官,看到未来的富有中产阶级,就给来个check为难一下出出气~~~
本文出自新托福IBT考试网,版权所有,转载请注明出处。如涉及版权问题请联系我们! -
A Guide to PhD Research- by Prof Sean Gong
Click here for a PDF of this article
This guide is aimed at those involved in PhD research into computing, but much of what is said here applies to all PhDs.1. What are the aims?
Although a successful PhD is commonly judged by one having (1) completed a written PhD dissertation (the thesis) , and (2) successfully defended it in ones oral examination (the viva) , it is usually not clear how these two objectives can be achieved within a given time (typically 3 years). Where to start?
The path to a successful PhD is necessarily a hard but rewarding process of conscientiously developing and mastering the skills for independent research and leadership . It is important that one must pay attention to the following basic skills:- Formulate plans to meet short-term and long-term goals, learn to meet deadlines under difficult circumstances (nothing is absolute, timing is the essence).
- Be able to identify the underlying reasons for changing plans and goals of research. One must learn to tell the difference between goals and approaches taken and not to be easily distracted by the latter.
- Learn to communicate by formulating "a message" through presentations and publications to which peers are interested in listening and reading.
- Have initiatives to make a novel contribution to existing work.
- Be able to draw conclusions from what one sets out to achieve (even from apparently negative results)!
- Keen to learn the skills to evaluate peers work through reading groups, literature search, and publication reviews.
- Keen and be able to demonstrate the importance of ones research to both expert and non-expert audience.
- Help a student to define a small project in the first year with a definite deadline, say before April of the second year (for September start). This will highlight problems in approach and if conducted to conclusion can lead to a conference paper.
- Establish a supervision committee (typically the supervisor plus another two academic staff) at the beginning of first year in order to advise and review the student's progress throughout the following three years.
- Make sure the student is familiar with the professional standards of published work by suggesting at least one good PhD dissertation to read and regular reading groups to attend.
- Ensure that the student understands that original research can only come about after extensive review and analysis of existing work (published or otherwise), and requires dedicating time!
- Help the student to write concisely and logically. Graphical illustrations can lead to dramatic improvements in the effectiveness of writing.
- Ensure the student has a professional attitude to research :
- Present legible written work at mutually convenient deadlines.
- Attend weekly supervision meetings and research reading groups with notes on research in progress, methods attempted, and papers read.
- Treat research like a job and maintain average though flexible working hours (minimum 8hrs per working day).
Encourage the student to give informal seminars and "dry-runs" of conference presentations. Help the student to learn how to face criticism and acquire presentational skills. - Arrange first year progress review for the student with the supervision committee to make sure that the student who fails to make adequate progress by time of first year report (June-July) is encouraged to resubmit by September. Failure again will lead to termination of the PhD program.
- Encourage independence after the first year and make sure a student is able to set ones own goals and meet deadlines . Help the student to understand underlying problems when one fails to meet deadlines.
- Ensure that second and third year students help in the training of first year freshmen and that a student makes active contributions to research group activities, such as organising seminars and reading groups.
- Encourage final year students to give group seminars before writing dissertation and to help organise story line and the structure of ones thesis .
- Encourage a student to read as widely as possible outside ones discipline and to discuss ones research with friends and non-experts.
- PhD dissertation of quality on time (3 years) and successfully defending the dissertation in the oral exam.
- Average 1 publication in journals (e.g. IJCV, PAMI, IVC , CVIU or PR for computer vision) and 2-3 at conferences (e.g. ICCV, ECCV, BMVC, ACCV, FG or ICPR for computer vision).
- Actively seek to meet and express ones views to experts in the field at workshops, seminars and visits.
- Be able to stimulate the supervisor with novel findings and directions of new research.
- Be resourceful and be able to benefit from peers in ideas, implementations, proposals or demonstrations (do not try to reinvent the wheels all the time)!
- Keen and can pass on the research and knowledge to the next generation of research students.
A PhD dissertation must not be merely a record of all the work one has carried out over three years! It is essential to appreciate that a PhD thesis isnot a report of everything one has attempted and experimented . It is about formulating "a story" to convey a message(s) that presents novel contribution(s) to the chosen field (no matter how small the contributions may appear to be) . The dissertation should be structured to include:
- Problem statement - Identification of unsolved problem and reason for solving it:
- The nature, purpose and motivation for the investigation should be clearly stated.
- The thesis approach and whether the aim(s) was substantially achieved should be made clear.
- Background review (the context) - Status of research in direction of solution:
- The relevant background material and limitations of existing methods. The candidate must show that one has adequate knowledge of the subject and of the literature and can critically place ones work in a wider context.
- The literature survey should not be encyclopaedic and be more critical.
- Find solutions - Development of ones own ideas and theoretical framework supported by mathematical analysis.
- Demonstration of the solutions - Implementations, justifications for assumptions, evaluation and analysis of results.
- Assess the suitability and limitation of ones solutions, evaluate the importance of the contribution (comparative evaluation against other methods, both analytical and experimental).
- Directions and summary of future work.
- Appendices (if any).
- Bibliography.
Reproduced by kind permission of Professor Sean Gong
Professor of Visual Computation
Department of Computer Science
Queen Mary University of London -
几篇转载 (五)
2009-08-06
Graduate School Survival Guide
This guide provides concise suggestions for:
- Getting the most out of the relationship with your reseach advisor or boss
- Getting the most out of what you read
- Making continual progress on your research
- Finding a thesis topic or formulating a research plan
- Characteristics to look for in a good advisor, mentor, boss, or committee member
- Avoiding the research blues
Other sources of information:
Getting the most out of the relationship with your reseach advisor or boss- Meet regularly - you should insist on meeting once a week or at least every other week because it gives you motivation to make regular progress and it keeps your advisor aware of your work.
- Prepare for your meetings - come to each meeting with:
- List of topics to discuss
- Plan for what you hope to get out of the meeting
- Summary of you have done since your last meeting
- List of any upcoming deadlines
- Notes from your previous meeting
- Email him/her a brief summary of EVERY meeting - this helps avoid misunderstandings and provides a great record of your research progress. Include (where applicable):
- Time and plan for next meeting
- New summary of what you think you are doing
- To do list for yourself
- To do list for your advisor
- List of related work to read
- List of major topics discussed
- List of what you agreed on
- List of advice that you may not follow
- Show your advisor the results of your work as soon as possible - this will help your advisor understand your research and identify potential points of conflict early in the process.
- Summaries of related work
- Anything you write about your research
- Experimental results
- Communicate clearly - if you disagree with your advisor, state your objections or concerns clearly and calmly. If you feel something about your relationship is not working well, discuss it with him or her. Whenever possible, suggest steps they could take to address your concerns.
- Take the initiative - you do not need to clear every activity with your advisor. He/she has a lot of work to do too. You must be responsible for your own research ideas and progress.
Getting the most out of what you read- Be organized
- Keep an electronic bibliography with notes & pointers to the paper files
- Keep and file all the papers you have read or skimmed
- Be efficient - only read what you need to
- Start by reading only the conclusion, scanning figures & tables, and looking at their references
- Read the other sections only if the paper seems relevant or you think it may help you get a different perspective
- Skip the sections that you already understand (often the background and motivation sections)
- Take notes on every paper you find worth reading
- What problem are they trying to solve?
- What is their approach?
- How is it different from other approaches?
- Summarize what you have read on each topic - after you have read several papers covering some topic, note the:
- key problems
- various formulations of the problem they are addressing
- relationship among the various approaches
- alternative approaches
- Read PhD theses - even though they are long they can be very helpful in quickly learning about what has been done is some field. Especially focus on:
- Background sections
- Method sections
- Your advisor's thesis - this will give you an idea for what he/she expects from you.
Making continual progress on your research- Keep a journal of your ideas - write down everything you are thinking about even if you think it is stupid. It will help you keep track of your progress and keep you from going in circles. Do not plan to share it with anyone, so you can write freely.
- Set some reasonable goals with deadlines
- Identify key tasks that need to be completed
- Set a reseasonable date for completing them (on the order of weeks or months).
- Share this with your advisor or enlist your advisors help in creating the goals and deadlines.
- Set some deadlines that you must keep (e.g., volunteer to give a student seminar on your research, work toward a conference paper submission deadline, etc.)
- Keep a to do list - Checking off things on a to do list can feel very rewarding when you are working on a long-term project.
- List the small tasks that can be done in about an hour
- Pick at least one that has to be completed each day
- Continually update your:
- Problem statement
- Goals
- Approach (or a list of possible approaches)
- One-minute version of your research (aka the elevator ride summary)
- Five-minute version of your research
- Discuss your research with anyone who will listen - use your fellow students, friends, family, etc. to practice discussing your research on various levels. They may have useful insights or you may find that verbalizing your ideas clarifies them for yourself.
- Write about your work
- Early stage: Write short idea papers and share them with your advisor and colleagues.
- Intermediate stage: Find workshops and conferences for submitting preliminary results. This can also help you set deadlines.
- Advanced stage: Target relevant journals.
- Avoid distractions - it is easy to ignore your research in favor of more structured tasks such as taking classes, teaching classes, organizing student activities, creating web pages like this, etc. Minimize these kinds of activities or committments.
- Confront your fears and weaknesses
- If you are afraid of public speaking, volunteer to give lots of talks.
- If you are afraid your ideas are stupid, discuss them with someone.
- If you are afraid of writing, write something about your research every day.
- Balance reading, thinking, writing and hacking - often research needs to be an iterative process across all of those tasks.
Finding a thesis topic or formulating a research plan- Pick something you find interesting - if you work on something solely because your advisor wants you to, it will be difficult to stay motivated.
- Pick something your advisor finds interesting - if your advisor doesn't find it interesting he/she is unlikely to devote much time to your research. He/she will be even more motivated to help you if your project is on their critical path (although this has down sides too!).
- Pick something the research community will find interesting -if you want to make yourself marketable.
- Make sure it addresses a real problem
- Remember that your topic will evolve as work on it
- Pick something that is narrow enough that it can be done in a reasonable time frame
- Have realistic expectations (i.e. Don't expect the Nobel Prize)
- Don't worry that you will be stuck in this area for the rest of your career. It is very likely that you will be doing very different research after you graduate.
Characteristics to look for in a good advisor, mentor, boss, or committee memberIt is unreasonable to expect one person to have all of the qualities you desire. You should choose thesis committee members who are strong in the areas where your advisor is weak.
- Willing to meet with you regularly (about 1 hour every week or every other week)
- You can trust him/her to
- Give you credit for the work you do
- Defend your work when you are not around
- Speak well of you and your capabilities
- Tell you when your work is or is not good enough
- Help you graduate in a reasonable time frame
- Look out for you professionally and personally
- Is interested in your topic
- Has good personal and communication skills
- You can talk freely and easily about research ideas
- Tells you when you are doing something stupid
- Patient
- Never feels threatened by your capabilities
- Helps motivate you and keep you unstuck
- Has good technical skills
- Can provide constructive criticism of papers you write or talks you give
- Knows if what you are doing is good enough for a good thesis
- Can help you figure out what you are not doing well
- Can help you improve your skills
- Can suggest related articles to read or people to talk to
- Can tell you or help you discover if what you are doing has already been done
- Can help you set and obtain reasonable goals
- Will be around until you finish
- Is well respected in his/her field
- Has good connections for the type of job you would want when you graduate
- Willing and able to provide financial and computing support
Avoiding the research blues- When you meet your goals, reward yourself
- Don't compare yourself to senior researchers who have many more years of work and publications
- Don't be afraid to leave part of your research problem for future work
- Exercise
- Use the student counseling services
- Occassionally, do something fun without feeling guilty!
-
几篇转载 (四)
2009-08-06
Life after PhD?
The ISG has over 70 PhD research students, working on a wide variety of
information security research topics. A PhD degree often appears to be a long
lonely road. So why are they doing it? And what are the benefits? We spoke to
Caroline Belrose, who completed her PhD in 2006, about life before, and after, a
PhD.
Why did you choose to do a PhD?
Good question! I'm not someone who always wanted to do a PhD, but I was
always interested in Cryptography, and after my MSc Information Security I
worked for six months with HP Labs in Bristol. I ended up publishing a research
paper with one of my HP colleagues and I got a real kick from that. So I started
to consider the idea of doing a PhD. My main problem was funding, so when
HP generously agreed to sponsor my PhD, I decided to go ahead with it.
Why did you choose to study with the ISG?
It is the largest and most well-known UK academic group working on information
security. I think that's a good thing for students because it means that there is a
wealth of experience to draw on and learn from. There is also more variety in the
kind of research going on, which is inspirational and gives students more
options.
Dare we ask what your PhD was about?
To provide a short answer I’ll discuss my thesis, but a PhD is about far more than
the thesis! The first part was about special kinds of signature schemes which
involve multiple parties and where you can't determine who from a group of
people actually produced the signature. The second part was about key
agreement protocols, an area which seems pretty simple, but isn't. In both parts
of the thesis I examined how to formulate good security models for the primitives
I was working with, and also looked at how to prove that a given signature
scheme or protocol was secure within these security models.
What are you doing now?
After completing my PhD I was offered a job with Vodafone in their R&D security
team, and I took it because it offered a good balance between research and
industry. I have a lot of variety in my role and a lot of interaction with all sorts of
people both inside and outside of Vodafone, which I like. I am involved in
managing the security requirements for the phones Vodafone purchases and sells
on to customers, security work in industry fora and standards bodies,
investigating new mobile security technologies for phones in the future, and a lot
of other small things that crop up that require security expertise.
You could have pursued an academic career, why have you joined
industry?
I realised during my PhD that I wouldn't be happy in academia. I enjoy working
on problems and coming up with solutions, but everyday academic work is
seldom about that. It’s also about lecturing, marking and reviewing, none of
which particularly appealed to me. Academia offers you a great deal of freedom
in what you study, but a lot of academic research can be very far removed from
current reality, and this became even clearer to me through my regular contact
with HP. I wanted to work on things that people other than cryptographers felt
was important and that mattered now (patience is not something I'm known for).
So although the world of industry did look a little scary from the safety of
academia, I felt that I needed a change and a new challenge.
Are there any skills that you acquired during your PhD that are useful in
your current role?
I learnt to question things and keep an open mind to new ideas. I learnt to
reason about problems in order to develop logical solutions, and then to present
my findings. And very importantly, I also learnt to trust my own abilities. I
discovered that if you just sit down and give yourself the time to think things
through properly, you can often come up with some surprising results. The thing
is, most of us don't usually bother to try, or don't have the time, so we never
really explore what we're capable of doing. A PhD gives you a unique opportunity
to learn these skills, and they'll be useful wherever you go.
Any advice for anyone contemplating starting a PhD?
Firstly, I would say be honest with yourself about why you want to do it. If you
like the sound of the title "Doctor", or you want to impress your friends, or you
just don't know what to do next, then I would recommending finding something
else. A PhD takes a lot of self motivation, and if your heart's not in it, you may
not make it, and even if you do, you probably won't enjoy it. If you want to make
loads of money, a PhD is unlikely to put you ahead either, because experience
usually counts for more than academic qualifications. If however you have a
genuine interest in your chosen topic, you enjoy the freedom of being able to
explore your own ideas, and you think you may want to go into academia or just
experience what research is like for a few years, then go for it. I think a lot of
people worry about not knowing exactly what they want to actually study, or that
they don't know if they'll be able to come up with original new ideas. But these
are things that you work out as you go along with the help of you supervisor and
fellow students. To me, this is part of the PhD experience.
I would also recommend speaking to someone who has completed a PhD to
clarify any questions you may have. It's a three-year commitment, so be as
informed as possible beforehand.
Is there life after a PhD?
There seems to plenty of PhD graduates about who don't require Prozac to make
it through the day, so there must be life after a PhD! I miss the "flexitime" of PhD
life, but it's great to finally have that thesis done and dusted and not to have
to think about it again (until someone starts asking you questions about it)!
-
几篇转载 (三)
2009-08-06
UIUC周源源教授在北大的精彩语录
“Berkeley已经不太行了,看看他们的young faculty才多少,我们UIUC才从他们
那里挖了两个正教授过来……”
“一流Ph.D.的毕业生都是去美国Top 50的名校当faculty,default的去IBM,微
软这些公司的研究院,那种比较差的就只能去搞Develop,最差的几个,找不到工
作,只能做Postdoc,给人当廉价劳力……”
“研究生选校不能看综合排名,而要看专业。耶鲁够强吧,可你看看他们的毕业
生,有几个能找到工作,只能去作Postdoc……”
“我们的学生,最差也能去IBM这些公司的研究院,我一个学生想去佛罗里达大学
当faculty,我拒绝给他写推荐信,我跟他说你去这种学校是丢我的脸……”
“我告诉学生,你这个文章只能投二流的会议,他就很伤心……什么是二流会议
?就像数据库中SIGMOD是顶级会议,像ICDE这样的就只能称为二流了……”(第一次听说ICDE被扫为二流,一些老师和高年级学生的脸色要多难看有多难看……)
“最近滑铁卢大学(加拿大CS第一)的系主任抱怨给了我学生Offer,但那个学生
没有去,我能有什么办法?我那位学生的老公在加拿大找不到工作,她也只能留
在美国陪他老公了……”
“有学生问我,什么时候能拿学位。我跟他说,我现在就可以给你学位,但你现
在能找到工作嘛?学位又不能当饭吃,关键是Beyond Ph.D之后的发展。一两年给
你一个Ph.D.学位,连篇好点的Paper都没有,你就只能回中国来招摇撞骗……”
(很多人的脸色更难看了……)
“DB Group把我列在他们的faculty里面,但我根本就不是搞数据库的,有的学生
连这点都不清楚,就来跟我套磁,我当然不理了。”(我的心碎了……)
“很多的套磁信我都没有回,一看就是群发的email,一点个性都没有。不过,XX
同学的email就写的很好,虽然不是北大的,他事先咨询了我的学生,又看了我的
文章,邮件写的很有特点”(手指向前排的一个家伙,在场所有的PKU Flyer的心
都碎了……) -
几篇转载 (二)
2009-08-06
How to do research?
今天同Prof. Shao就research和phd life聊了一下,下面写一些摘要
对于每一个方向和问题和别人的工作,你应该不断追问:你为什么要做这个?这个问题有什么价值?同样,对于自己的工作,也必须能够回答这个问题。即使对于导师布置的问题,这个为什么也要弄得明明白白。因为以后是你去找工作,不是你的导师,而你的导师很可能根本不需要回答这个问题。
不要为了论文而论文。找工作的时候你的publication list长度不起作用,重要的是你能说明你的结果的重要性。不要短视,做你该做的事清。
不要被问题和别人的方法牵着鼻子走。研究一个问题的时候,应该先try to solve it alone,找出问题的难点所在,再去找相关文献,这样读起来容易把握问题的整体结构,不会陷入paper海的困挠。不提倡遇到一个问题,马上去查找和阅读相关文献。
推荐阅读: You and Your Research,中文译文见做大事,成大业。
顺便贴出以前看到过的一篇文章,是跟Andrew Yao的圆桌讨论的摘要。
Round Table Meeting with Andrew Yao
1、与人交流脸皮厚。
2、做研究要学会自己找资料,然后与导师讨论,而不是倒是告诉你研究方向。
3、对学生的要求:
很聪明,要有主动性。学会发现自己的研究兴趣,主动去发掘问题,然后去解决。4、CS研究:
学生越早接触研究越好,要学会创新的精神。
你的研究并不重要,重要的是要有天不怕,地不怕的创新精神。
不能等读完天下所有的书才开始做研究,那时候已经晚了。
不能好高骛远。5、对博士的期望:
一个博士生读完后,就应该具备独立工作的能力。即使把他扔到一个荒岛,他也能够自己展开研究。
不但能够解决technical的问题,而且能够开创一个领域让别人来follow。6、研究选择
对自己的能力有个公正的衡量,然后去做稍高于自己能力的问题。7、不断push yourself
搞研究就是要一天工作十三四个小时,不许balance!
年轻时就是要好勇斗狠,要揪着人家脑袋往墙上撞(Harry 语)8、要知道怎样去close a work, 而不是give up it.
结束了现在的工作可能有更多有意思的task。
一个问题想了几个星期,可以停下来,过一段时间再想。9、Decision with experience
Be brave to try!10、最好的物理学家不是因为数学,而是因为能够推理预测出一个结果。
11、科学就是用最好的方法去解决一个问题。
12、如何评判自己:
过二十年回头看看自己的成就是不是很骄傲?13、Accept failures! learn from error
14、不要isolate。
15、TCS是最有活力的数学分支,要建立一个conceptual framework to solve problems
TSC应该open to all areas, 与实际相结合。 -
几篇转载 (一)
2009-08-06
在计算机领域做研究的一些想法 by Xi Tan
# 前言 #
1. 讨论一下计算机领域的牛圈和‘带头大哥’;
2. 讨论一下科研方法;
3. 讨论一下计算机领域的学术论文(会议、期刊);
# 第一章 #
计算机的大牛90%以上都在美国,所以只讲讲美国的CS。别的国家没什么太大的参考意义(英国、法国、匈牙利、日本、香港、新加坡、大陆、加拿大),不过还是说两句:第一句是,美国以外的地方CS和美国有差距,主要是没钱;第二句是,搞科研也讲‘近亲繁殖’,美国以外的其他地方很明显‘人手不够’。没钱的问题看大陆就知道,高性能计算、硬件、网络。。统统没办法干。当年人家Stanford跑一个粒子加速器就几百万美金,中国哪个高校有这资金。人手问题也很明显,像Stanford的Dan同学,以前在Cololado Boulder,后来不也被挖走了?像以前呆在加拿大一个人闷做研究的Han Jiawei老大,不也被UIUC挖走了?为什么呢。说白了还是资源。Han Jiawei 02年被UIUC从加拿大的SFU拎到UIUC,转年就成了IEEE的FELLOW。为什么。说白了就是‘近亲繁殖’。直到现在美国相当数量的大学(就不说全部了)都非常认可同行的推荐。学校要各个同行评分,发paper也是同行review,nominate也要同行,甚至PhD的 application也相当依赖reference letter。另外呢,就是这些资源相当丰富的地方容易产‘奶牛’。当年吴健雄也才第九名考进的中央大学,可是人家一跑美国去就成了实验物理大牛,还当了美国协会的会长。物以类聚,人以群分。你说90%的老大都在美国,你呆在印度做CS,有啥意思。不管是Science还是Engineering,还得靠 inspiration。Inspiration靠什么?显然是要以Group为研究的基本单位,像Dan Jurafsky和Jiawei Han那样的人毕竟是少数。最好不还是被几个牛棚给挖走了?这玩意真没办法,是趋势。不说废话了,来扯美国的CS。
美国CS首当其冲的就是“五大牛棚”:MIT,Stanford,Berkeley,UIUC,和CMU。其他的牛校像 Washington,Princeton,Cornell,Wisconsin等等都是非常不错的,只不过可能光芒还不够。而且还有很重要的一点,就是这些学校的faculty好多都是‘五大牛棚’出来的,自然地位也就低一些。尤其是Princeton和Cornell这类学校(其他还包括 JHU,Maryland,Duke,甚至综合排名非常靠后的Amhest),好多Professor都是牛棚混出来然后过来独当一面的。特殊点的就是 Washington和Wisconsin,还有诸如Caltech这类学校,他们的Alumni也出过不少人才。
首先是MIT。我脑子里(或者说几乎所有工科学生的脑子里)可能下意识地定死了MIT是工科最牛查查的学校。甚至我一直认为(至今仍然),MIT的脑袋都是畸形,整个MIT不是牛棚,而是一个ZOO。MIT简直就是发了战争财。开始做雷达,整的它的无线电啊,EE什么的巨牛无比。然后就是冷战,国防部投了好多美金做乱七八糟的东西。CSAIL还没有合并的时候,MIT的计算机实验室叫AI实验室。就是这个实验室,早期做了很多开拓性的工作。主要是冷战的时候(90年代以前),美国国防部投资了无数的资金,狂搞AI的项目。很多学校在那个时候得到了很大的发展,譬如Texas Austin,譬如UMass Amherst,他们的CS系便是那个时代的产物。可是后来AI的投入没有打到预期的产出,糟蹋了好多国防部美好的愿景,项目一个接一个的流产,大师也一个接一个的归隐。看看MIT那些早年毕业的大牛(50-60年代左右),基本都有深厚的物理背景,这就意味着他们不仅数学知识扎实,而且具有深厚的电子电气的背景。这些“牛群”在冷战后奔向各个其他的institution,自然就成了领军人物。好多人说,MIT虽然没有做什么牛哄哄的东西,可是任何一个人都可以证明,其他institution都是他在学术上的孙子的孙子。Orz. (麻教主千秋万代,一统江湖!! o(∩_∩)o...)事实上的确,比较一下MIT的PHD毕业生,在学术上是其他学校无法超越的。至少去年我在港中文‘打杂工’的时候,我们组的‘带头大哥’Professor Helen M. Meng就是在MIT拿的BS,MS和PHD;然后中大做Vision的老大Professor Xiaoou Tang,也是MIT的PHD。这两人明显带有MIT培养出来的严谨风格,而且学术嗅觉非常之好。记得我给Helen做presentation的时候,她问过我好些问题,都是一语中的的。而且她还鼓励我做Vision和Speech的数据融合,事实证明也是很好的思路。Helen在MIT是 Stephanie和Victor的学生,Stephanie又和我们剑桥的Steve有很好的合作项目和官方渠道(例如CAM-MIT)。这两个组一直都在联合做Spoken Language Dialog System的项目。又一次雄伟而彪悍无比地证明了我说的‘近亲繁殖’理论。。。娃哈哈~ MIT的老师我只接触过CSAIL的老大Professor Victor Zue,语音组的老大Professor Stephanie和Vision组的几个Professor。首先感觉是都很NICE,说话都很客气。尤其是Victor,记得去年在上海参加MIT面试的时候和Victor聊天,他老是笑呵呵的,想来脾气应该很好。虽然去年没有去成MIT的Vision组,可是总能感觉到MIT那种技术的金属质感给我带来的吸引和震撼。希望今年能去MIT念Stephanie的PHD啊~~ Bless...
然后扯一下Stanford。其实我原来对Stanford感觉蛮好的(现在感觉也不错),我在LA认识的朋友也应该是最多的(最多又是 Stanford,然后才是Berkeley,UCLA和Caltech。SYF小朋友啊~ 嗯,我在Stanford最好的几个朋友之一了。SYF,看到这个帖子给师傅留个Message哈。嘿嘿)。可是因为种种原因,以前就压根没有打算过去斯坦福念书(主要是MWJ小朋友不让我去。我又乖又听话,所以就没申请了)。Stanford给我的感觉就是超级大,而且几乎没有什么软肋。历数美国诸多 CS高校中,唯一能在AI方面和MIT抗衡的就数斯坦福了。而MIT现在AI仿佛有走下坡路的趋势,而斯坦福倚其地理优势和财政强势,迅速崛起。 Sorry,不应该是崛起,是第二波浪潮~~ 斯坦福的AI,诸如视觉,语音和自然语言,机器人等等,都有大牛撑腰。然后在体系结构和数据库方面又依赖硅谷的强大应用平台,有着得天独厚的发展资源。 AI作为CS的灵魂,斯坦福已经有了;体系结构和数据库这些应用背景很强的领域,硅谷也给斯坦福与生俱来的优势。当然,那帮学生也不是省油的灯,好多 PHD没念完就跑了。什么GOOGLE啊,YAHOO啊,通通都迅速崛起了。另一方面也反应了斯坦福的学生商业头脑很好,很灵活,不像书呆子(譬如 MIT,譬如Caltech。哈哈)。真没什么说的,牛哄哄的。对了,补充一点,斯坦福坐拥硅谷的土地,真是巨有钱啊。。。望尘莫及。
第三头大牛要数Berkeley。好多人和我讨论,和我争辩,到底是Berkeley厉害还是MIT厉害。我觉得没什么好比较的。因为每个学校发展的方向都不太一样,CS和CS没法比,可以比的只是某个组,譬如MIT的AI就比Berkeley的好,Berkeley的网络就比MIT好。Berkeley 的传统优势就是网络,操作系统等等。早期Berkeley的CS毕业生好多去各个高校当教授,大多也做的是网络和操作系统这一块的东西。现在 Berkeley的AI也发展了起来,诸如图形图像,语音语言都有了很大的发展。Berkeley作为公立学校的老大,收费低,又地处LA,开个什么国际会议啊,养个老啊,都挺好的。UC系统又联系广泛,而且Berkeley还和诸如Stanford,UCLA和Caltech这样的牛校贴得这么近,不做点东西出来真是对不起这地理位置。想想我本科毕业的学校‘西北工业大学’,其实计算机在中西部应该是最强的,在全国我觉得某些领域也能在前五(譬如计算机应用)。可是相比起同是国防科工委的北航,就没有了地理优势。西安显然没有北京有钱,地理位置显然没有北京好,而且显然也没有清华北大这样的学校和他交流,甚至连北邮北理北工大这样的学校在西安都没有。哦,对了,有个西电。Sorry,西电也是巨牛无比的。我甚至觉得在很多领域西电比西工大牛多了。记得我在CUHK的时候,看过几篇文章都是西电的老师和港中文的老师一起写的(譬如那篇影响我很大的Xiaou文章,就是和西电的老大一起写的)。然而,西工大的老师是和蔼可亲的。以前给予我诸多帮助的WQ老师,ZYN老师我感觉在学术上都是可以独树一帜的人。事实上也的确给了我很多启发和思考的灵感。当然还有我们更加和蔼可亲的XL老师。真是又是老师又是朋友。想起在清华-港中文做RA的那段日子,的确教会了我很多东西。北航的老师我只和LW校长聊过天。 LW老师做的好像是软件理论,也是英国毕业的(好像是爱丁堡)。虽然LW老师都是校长了,可是那时候和我聊天一点都没有什么架子(5年前了),和蔼可亲的很。哎,大凡大牛都是和蔼可亲型的啊。扯着这么远,无非就是要说Berkeley有多么好的地理优势,把UC其他几个学校远远抛在了脑后(至少CS是这样)。譬如UCSD,譬如UCI,甚至UCLA也远不及Berkeley。去年我给UCSD的Alon做presentation,人家好像才40岁,就已经是IEEE的FELLOW了,这样下去怎么得了。Alon虽然是做Information Theory的,但是却为我的project提了一个非常好的建议,取得了很大的突破。这才让我感觉到IEEE Fellow的威力。我那时就想,要是Alon也跑到berkeley去,那该有多猛啊。。。。(插播广告:英语语法)'Had Professor Alon joined Berkeley, he would have already made far greater contribution to the information industry.' EAP没白来。。o(∩_∩)o...哈哈~ Berkeley的教授我就不认识几个,不过有几位朋友在那,传说没有Stanford漂亮。呵呵~
第四头大牛是UIUC。我对UIUC的印象最开始来自高我几级的SZ。SZ和我一样都是做OI出身,然后保送到了清华。据说在清华学习十分猛,老是系里前 5名,后来又考了老高的GT,结果就去UIUC了。我当时十分郁闷,因为我那时候不是很清楚UIUC在CS领域里是个什么地位。我说怎么这么好一孩子不去 Stanford和Berkeley,非跑到‘玉米地’去了?不过这以后UIUC这个名字我就记下来了,这是第一印象。然后一个比较深刻的印象就是 Jiawei han。我当年读Jiawei Han的书时,他还在加拿大。我也纳闷,我说怎么写了这么牛哄哄的书的人,倒喜欢做武林蒙面大侠了?莫非又是一‘隐藏关卡的BOSS'?没想到Han老爷子02年的时候果真就被UIUC挖走了。这时候我才念起UIUC的好,觉得实属牛棚一个了。以前那些虚幻的带有主观臆断的想法通通成了幼稚的偏见。 UIUC是干嘛的?回答其实很明确,如果说MIT是为AI而生的话,UIUC就是为硬件和超级计算机而生的。It is UIUC that 当年改良了计算机中的晶体管、集成电路和ALU的好多东西。Intel和AMD,还有早期做chip的Motorola等等,我想都大多受惠于UICU的 faculty。自然,这些老faculty拿这些技术继续做硬件和超级计算机便有如鱼得水之势了。所以,包括硬件逻辑电路设计、计算机算术、机器结构和数值分析领域,UIUC都是独执牛耳的领军人物。UIUC的CS相来比较扎实,生源和师资都非常好,自然声誉也很高。尤其是硬件。早期的超级计算机大多出自UIUC之手,譬如ILLIAC的1、2、3、4代以及后来的一些超级计算机,都是这一领域的大手笔。UIUC的这些理论和工业成果和成功,对并行计算机的发展历程做出了不可磨灭的贡献。UIUC的老教授David Kuck就是并行处理的先驱,原来是NASA第一部超级计算机的首席设计师。属于在并行处理这个领域挖了一个坑然后等着后人来’建设社会主义美好家园式‘ 的人物。UIUC早期的发展有很多历史佐证,譬如美国国家超级计算及应用中心(NCSA)在UICU的建立,譬如Marc Andreessen在UIUC读本科大四的时候在NCSA主持编写的Mosaic。无一不是一个又一个翔实的历史介绍。可惜,后来(85年-2000年左右),UIUC的硬件学术队伍老化,没有形成良好的学术梯队,硬件队伍失去了很多元老级的人物,新的professor呢,又无心做这些东西,大多又开始弄软件去了。把UIUC的传统和家业整个换了个门面。不过,正式由于这个原因,UIUC的CS系以拥有众多充满活力的世界级青年学者。例如Josep Torrellas (其弟子有在Cornell ECE,Georgia Tech CS任教的),Klara Nahrstedt (其弟子有在Cornell ECE,Purdue CS,Toronto ECE任教的),还有稍老一些的Gerald DeJong (其弟子有在UW-Madison,UT-Austin任教的)等等。前几年刚被Duke挖走的Herbert Edelsbrunner,由于对计算几何的根本性贡献,1991年拿了个Waterman Award,成为历史上第一位获此殊荣的计算机科学家。UIUC的校友也有很多有名的,譬如写了Mosaic并成立了netscape的marc Andreessen,譬如David Kuck的学生陈世卿(Steve Chen),譬如Lotus Notes的老大Ray Ozzie等等。UIUC CS 的学生毕业后去学术界的不少,Stanford,Princeton,Cornell,UT-Austin。。。都有UIUC的博士挑大梁。在U Michigan CS和UCLA CS,UIUC CS出身的教授更随处可见。在仅有的18名华裔ACM Fellow中,就有6名是UIUC的。另外一个不得不讲得人当然是我们可亲可爱的‘刘爷爷’。当年我拿到‘蒋震海外研究生奖学金’的时候,还是刘爷爷给我面试的,还要我背唐诗宋词。吓得我当时很紧张,竟然把沁园春雪给背错了几句,刘爷爷还很机敏地当即纠正了我的错误。哎,仍然记忆犹新啊。刘爷爷的确是个非常(N次幂,N > 3)的人,至少一点架子都没有,和蔼可亲得很。连我当年去MIT的推荐信也是刘爷爷亲手执笔的。可恨的是当年没有申Princeton,要不然panel 一看是刘爷爷的亲笔推荐信,肯定就把我给收了。。。哈哈哈~ Professor C.L.Liu是属于桃李满天下的那种人。在国内最有名的当然要数Professor Andrew Yao了,人家在哈佛念完物理就跑到UIUC去念计算机了,当年的导师就是我们可爱的‘刘爷爷’。后来姚老大成了世界上第一位拿过图灵奖的华人,当然,现在还是唯一一人。可以想象,当时我和图灵奖的导师聊天的时候有多紧张。。。可惜本人实在愚钝,在CS领域也毫无建树,刘爷爷把Victor从美国请过来给我面试去MIT我最后都没有如他老爷子的愿,跑到剑桥这地方天天骑自行车看康河来了。。。哎~ 真是惭愧。另外关于UIUC不得不说当然是他的发展‘现象’。为什么说是‘现象’呢?因为UIUC是有名的‘玉米地’,常年面临加州等地名校的“挖人”威胁。尽管不少教授在成名以后离开,UIUC计算机系仍然凭借着为中青年人才的成长营造最好氛围,在小地方办成了世界一流的研究重镇。我想,UIUC可能是惟一几个不靠地理位置发财的CS牛棚吧。这个‘现象’值得很多学校借鉴,譬如西工大,西电,譬如中科大等等。
最后呢,当然是牛哄哄的CMU了。事实上,CMU的CS应该比UIUC要稍微好一些。因为CMU貌似就只有一个CS在撑门面,所以它的CS硕大无比,几乎没有弱项。尤其厉害的是它的vision和robotics,当然还有software。CMU的Robotics实在是名气太响了,‘附送’的 Vision也沾了很大的光,导致CMU在AI领域的大哥地位也无人能撼。我的本科学校去年就走了一个师兄去CMU,貌似就是做ROBOTICS的。什么 FIFA CUP之类的足球机器人啦,CMU最喜欢招这些人了。其实我当年准备去CMU的VISION组的,可惜我当年实在是迷恋MIT,就没有申请CMU,现在想起来,如果当年能去CMU也是个不错的选择。对了,我一位很好的朋友现在就在CMU。可爱的CX小朋友。这哥们是少年班的天才,在CMU跟随图灵奖大师做 ‘玄学’(他自己如是说的),哈哈哈。CX绝对属于天才型的,几十位图灵奖的逸闻趣事他都知道。引用我们JK同学的话叫‘简直太神奇了’。我们漂亮的JK 小同学如今在MIT做EE,所以高智商夸赞高智商总是很有分量。CX做事很踏实,也很有目的性,他就只跟图灵奖做理论计算机的研究。当时把我佩服得直咂舌。不过,现在终于如愿以偿了,人家以后可是图灵奖的弟子啊。。。哎~~ 和我的Professor Steve Young不是一个级别的。可爱的Steve,您啥时候也拿个图灵奖让俺们沾沾光啊。CX同学,过几年回西安的时候记得再吃饭聚一聚~(看到这个给我留言哈)。CMU不仅Robotics好,Software也是技术一流。据说现在微软招得最多的软件开发员工都是CMU毕业的。某种程度上说,CMU的老大们挣了我们不少钱。哼哼~ 另据CX小朋友介绍,CMU的CS系实在是过于庞大了。。。巨多教授。哥们,这还真够挤的~~ 好了,牛棚都介绍完了。都是我印象中的东西,肯定有很多不准确的数据和理解。不过应该大致差不多。够了~
# 第二章 #
我思考后的结果告诉我,其实做科研的步骤,或者说写科技文献的步骤,不是很复杂(当年我做了4年的数模果真没白费,哈)。我总结了一下,大概就一下几点:
1.Introduction
选好一个学术方向后,对此方向上的已有成果进行阅读,分析,分类, 搞清楚已解决的问题是什么,现存的难点是什么,热点是什么, 写出综述报告。其实就是literature review啦。在CUHK LAB的时候,XL老师和Helen老师老是和我提这个词,我已经比较熟悉了。另外呢,刚入门的人应该看看Journal上的东西,毕竟那是沉淀了之后的东西。然后才可以慢慢看看conference的东西练内功。
2. Problem formulation
把所要研究的具有实际工程背景的学术问题进行描述,并转化成数学问题。数学一直都是最强有力的描述工具,当然,也是最正统的科学工具。
3. Main contributions
找到适当的数学工具,给出上述问题的理论上的解决方案,得到理论上的结果, 并用定理的形式进行阐述。还是数学,科学家和工程师只相信数学和事实。
4. Simulations or experiments
通过计算机仿真或实验研究进行上述理论成果的验证。CS,计算机科学与技术,首先是科学,是理论;可是最后终归要转化成实际的产品,不像做Pure mathematics的人,整天只要YY就可以了。。。-_-
5. Conclusions
给出一般性的结论,以及需要进一步研究的问题。有头有尾的事情。一次不可能把问题都解决好,总有可以瞻望的地方,可以改进的嘎吱角落弯。
# 第三章 #
哎,扯期刊和会议。其实这是最没意思的东西了。想当年,我刚了解SCI和EI,整天琢磨着怎么在线看Nature和Science等等。其实,CS 里面根本不是这么回事。CS是一个日新月异的领域,各种技术都在以不可预测的速度在发展和变化。这和基础科学有着太大的不同了。所以,什么物理化学生物一个实验做好多年,最后发到Nature和Science上面,真正上conference上发表的东西其实没有什么特别大的价值,都是只言片语,远远没有期刊的威力来得大。所以无聊的美国人加菲猫同学(哈哈~ Garfield有一个多好记的名字),弄了个SCI来做索引。弄了个IF把整个学术界搞得乌烟瘴气,尤其是大陆还有亚洲一些国家,整天就想着弄几篇高 IF的牛paper。可是,CS压根就不是这个形式。CS的publication最大特点在于:极度重视会议,而期刊则通常只用来做re- publication。大部分期刊文章都是会议论文的扩展版,首发就在期刊上的相对较少。也正因为如此,计算机期刊的影响因子都低到惊人的程度,顶级刊物往往也只有1到2左右—-被引的通常都是会议版论文,而不是很久以后才出版的期刊版。因此,要讨论计算机科学的publication,首先就压根和 IF无关。另外一个现象就是CS的会议规模都很有限,有时候只登十来篇甚至三四篇论文,有的还是季刊或双月刊。很多好的会议每年只录用三四十篇甚至二十篇左右的论文。所以,CS的几乎每个领域都有好几种顶级刊物和好几个顶级会议。
最牛哄哄的当然是‘Journal of the ACM(JACM)’了,ACM的官方学刊。可是,这个鸟刊只刊登那些对计算机科学有长远影响的论文,因此其不可避免地具有理论歧视。事实上确实如此:尽管JACM征稿范围包括了计算机的绝大部分领域,然而其刊登的论文大部分都是算法、复杂度、图论、组合数学等纯粹理论的东西,其它领域的论文要想进入则难如登天。这让我想到了两件事情:一件是meritocracy;一件是GRE填空里面的一道讲专家如何鄙视layman的题目。哎~ 罢了。另外一个就是‘Communications of the ACM (CACM)’了。从某种意义上来说,CACM比JACM要像Nature/Science很多。JACM上登的全是长篇大论,满纸的定义、定理和证明,别说一般读者没法看,就连很相近的领域的专家都未必能看懂。而CACM则是magazine,既登高水平的学术论文和综述,也登各种科普性质的文章和新闻。即便是论文,CACM也要求文章必须通俗易懂,不追求数学上的严格证明,而追求易于理解的直觉描述。在十几二十年前,CACM的文章几乎都是经典。但最近几年,由于CACM进一步通俗化,其学术质量稍有下降。
除了ACM老大的东西外,就是IEEE的了。‘IEEE Transaction on Computers’是IEEE在计算机方面最好的刊物。但由于IEEE的特点,其更注重computer engineering而非computer science。换句话说,IEEE Transaction on Computers主要登载systems, architecture, hardware等领域的东西,尽管它的范围已经比大部分刊物要广泛。就刊物的质量而言,ACM Transactions系列总体来讲都高于IEEE Transactions系列,不过也不可一概而论。大部分ACM Transactions都是本领域最好的刊物或最好的刊物之一。大部分IEEE Transactions都是本领域很好的刊物,但也有最好的或者一般的。然而,非ACM/IEEE的刊物中,也有好的甚至最好的。例如,SIAM Journal on Computing被认为是理论方面最好的期刊之一。CS方面的会议论文事实上起着比刊物论文更大的作用。大部分会议都是每年一次,偶尔也有隔年一次的。正规的会议论文需要经过2-4个甚至更多个审稿人的双向或单向匿名评审,并且所有被接收的论文会被结集正式出版。大部分ACM的会议都是本领域顶级的或很好的会议。大部分IEEE的会议都是本领域很好的会议,但也有顶级的或者一般的。会议的档次通常可以通过论文录用率表现出来。顶级会议通常在20%左右或更低,有时能达到10%左右。我所知道的最低的录用率为7%。很好的会议通常在30%左右。达到40%以上时,会议的名声就很一般了。60%以上的会议通常很难受到尊敬。但也有例外。大名鼎鼎的STOC(ACM Symposium on Theory of Computing)录用率就达到30%以上,但它毫无疑问是理论方面最好的会议。造成这样的情形,主要是因为理论方面的工作者不多,而大部分人对 STOC又有一种又敬又怕的心理。
下面列一些CS的顶级会议和期刊,有些是网上查到的,有些是某些人用SCI的IF排序做出来的:
Network
Conf.:
ACM/SigCOMM
ACM Special Interest Group of Communication
ACM/SigMetric Info Com Globe Com
Jour.:
ToN (ACM/IEEE Transaction on Network)
OS,System
Conf.:
SOSP: The ACM Symposium on Operating Systems Principles
OSDI: USENIX Symposium on Operating Systems Design and Implementation
########################
呼呼呼~~ 终于写完了。弄了我1、2个小时~~ FT~ 以上言论大多为个人关于CS的一些不成熟想法,并不代表本台观点。通俗一点说就是:‘纯属扯淡’。不要当真。25岁以下的儿童须在女朋友的指导下完成阅读。钦此。 By Xi Tan. 2007.10.6 于英国剑桥大学三一学院 绿野猪楼 R10 ~ :-)
-
List
2009-03-16
uppsala:
http://www.personalavd.uu.se/ledigaplatser/461dorand_eng.html
TCD:
http://kdeg.cs.tcd.ie/vacancies
DCU:
http://www.computing.dcu.ie/~cpahl/
HKUST:
http://db.cse.ust.hk/
Karlsruhe:
http://www.aifb.uni-karlsruhe.de/Personen/viewPersonenglish?id_db=57
-
盖棺
2009-03-12
徐爱民同志生平
正军职离休干部、成都军区原后勤部顾问徐爱民同志,因病于2008年11月15日在成都军区总医院逝世,享年94岁。
徐爱民同志系安徽濉溪县人,1914年11月24日出生,1939年入伍,1938年10月加入中国共产党。历任指导员、连长、股长、教导员、团政治处主任、副政治委员、政治委员、西藏军区后勤部副政治委员、西藏军区副政治委员、成都军区后勤部顾问等职。1955年9月授予上校军衔,1964年3月晋升大校军衔,曾荣获独立功勋荣誉章、二级独立自由勋章、三级解放勋章。
徐爱民同志思想进步,积极参加革命,先后参加抗日战争、解放战争,熟悉地方武装工作,具有较强的偷袭、奇袭、伏击战等战术的工作能力和经验,为开辟根据地、建立新政权做出了积极的贡献。解放后进军西藏,为西藏的教育工作、维护民族团结和部队的建设做出了突出的贡献。
徐爱民同志入伍70年来,始终忠于党,忠于祖国,忠于人民。他政治立场坚定,旗帜鲜明,具有坚定的共产主义信念;他兢兢业业,埋头苦干,具有高度的革命事业心和责任感;他思想敏锐,勤奋好学,能创造性地开展工作;他平易近人,作风正派,密切联系群众;他艰苦奋斗,廉洁奉公,注重以自己的模范行为教育亲属和身边工作人员,始终保持了我党我军的优良传统和政治本色。
徐爱民同志的一生,是革命的一生,战斗的一生,是为共产主义事业鞠躬尽瘁的一生。徐爱民同志虽然离开了我们,但他为共产主义奋斗的革命精神和崇高品德将永远值得我们缅怀和学习。
成都军区

-
OWL-S API指南 - [TOppS]
2009-03-09
Maryland 大学计算机系的Evren Sirin 开发。OWL-S API的类库主要建立在Axis, Jena 以及Pellet上。
Apache Axis 是Apache Web Service项目中的子项目,其最初起源于IBM的"SOAP4J",应该属于最早的一批用于构造基于SOAP应用的Framework。它支持WSDL1.1,可自动由Java Object生成WSDL。
Jena主要用来处理RDF,主要使用Jena的推理能力从本体推断模型知识。
Pellet是一个开源的基于JAVA的OWL推理机。
包中还自带两个jar包形式的java类库,owl-s.jar和upnp.jar。
该OWL-S API的主要功能如下:
读/写服务描述:
OWL-S API中有两个重要的接口:OWLOntology和OWLKnowledgeBase。OWLOntology代表了存储在单个文件中的信息,而OWLKnowledgeBase是许多Ontology的集合。RDF数据可以加载到OWLOntology上,只有OWLOntology对象才能组合起来。OWLKnowledgeBase中只有一个Ontology是用来存储数据的(例如执行之后,新的实例会被加到这个 OWLOntology上。
函数OWLKnowledgeBase.read(URI)从给定的Ontology读取信息,并产生OWLOntology。函数 OWLOntology.getService()用来获取ontology中的服务实例。如果有许多服务,则用 OWLOntology.getServices()获取。然后,函数OWLKnowledgeBase.readService(URI)以及 OWLKnowledgeBase.readServices(URI)将会读取服务。如果函数调用发生错误将会产生null输出。
函数OWLOntology.write(Writer)可以使包含服务的ontology组合起来。
这是一个例子:
// create a URI for the service (note that this is a 0.9 version file)
URI uri = new URI("http://www.mindswap.org/2004/owl-s/0.9/ZipCodeFinder.owl");
// create a KB
OWLKnowledgeBase kb = OWLFactory.createKB();// create a generic reader and a 1.0 writer
OWLOntology ont = kb.read(uri);
// get the service
Service service = ont.getService();
// write the output to console (a file stream can also be used here)
ont.write(System.out);
将旧服务描述转换为新描述。
验证
缓存Ontology
执行服务:
执行服务意味着执行它的process。Process应该有有效的grounding说明,以便有效的调用服务。WSDL和UPnP的 grounding由API支持,函数ProcessExecutionEngine.execute(Process, ValueMap)可以执行一个process,ValueMap表示输入的值,这个函数返回输出值。
举例如下:
// create an execution engine
ProcessExecutionEngine exec = OWLSFactory.createExecutionEngine();
// load the service description
Service service = kb.readService("http://www.mindswap.org/2004/owl-s/1.0/Dictionary.owl");
// get the process of the service
Process process = service.getProcess();// create an empty value map
ValueMap values = new ValueMap();
// set the value of input parameter
values.setDataValue(process.getInput("InputString"), "computer");
// execute the process with the given input bindings
values = exec.execute(process, values);
// get the output value as a string
String outValue = values.getStringValue(process.getOutput());
// display the result
System.out.println("Output = " + outValue);执行跟踪功能:
当执行复杂的服务时,知道执行的过程是很有用的,ProcessExecutionListener就是为这一目的设计的。 ProcessExecutionEngine.addExecutionListener(ProcessExecutionListener)就可以为执行器添加这么一个监听器。
生成复合过程
可以用程序产生服务的descriptions, profile或者processes描述。OWLOntology接口实现了这个功能。
/**
*
* Create a new Sequence from the processes of the given services and put them in a new
* Service.
*
* @param services List of Services
* @param baseURI The base URI for the generated service
* @return The Service which is a Sequence of the given services
*/
Service createSequenceService(List services, String baseURI) {
// create an empty ontology
OWLOntology ont = OWLFactory.createOntology();
// create a new service
Service service = ont.createService(URI.create(baseURI + "Service"));
// create a new composite process
CompositeProcess process = ont.createCompositeProcess(URI.create(baseURI + "Process"));// create a new sequence construct
Sequence sequence = ont.createSequence();
// put the sequence into composite process
compositeProcess.setComposedOf(sequence);
for(int i = 0; i < services.size(); i++) {
// get the service from the list
Service s = (Service) services.get(i);
// get the process fron the service
Process p = s.getProcess();
// create a perform construct
Perform perform = ont.createPreform();
perform.setProcess(p);
// put the process into the sequence
sequence.addComponent(p);// create data flow if necessary...
}
// create profile...
// create grounding
return service;
}
支持功能。API中包含了org.mindswap.owls.wsdl这个包,可以用来读写WSDL描述的服务。执行OWL-S服务就是通过这个包实现的。这个功能是建立在AXIS包1.1上的。
其他应用:
类CreateSequence表明了如何将一系列服务串联起来,并自动产生一个描述新服务的profile,这个类假定每个服务都是单输入单输出的(除了第一个服务和最后一个服务),这样前面的服务的输出将作为后一个服务的输入。第一个服务不需要有输入,最后一个服务不需要有输出。组合服务的名字命名为 [Service1 + Service2 + ... + ServiceN]。最后在main函数中进行测试,将BookFinder.owl和 BNPrice.owl进行组合,输入"City of Glass",先查通过BookFinder.owl查到书号,然后将书号输入 BNPrice.owl,得到输出:
Executing...done
Book Price =
Price:
currency: USD
amount: 14.00
完整代码如下:
import java.net.URI;
import java.util.ArrayList;
import java.util.List;import org.mindswap.owl.EntityFactory;
import org.mindswap.owl.OWLFactory;
import org.mindswap.owl.OWLIndividual;
import org.mindswap.owl.OWLKnowledgeBase;
import org.mindswap.owl.OWLOntology;
import org.mindswap.owls.OWLSFactory;
import org.mindswap.owls.grounding.Grounding;
import org.mindswap.owls.process.AtomicProcess;
import org.mindswap.owls.process.CompositeProcess;
import org.mindswap.owls.process.Input;
import org.mindswap.owls.process.Output;
import org.mindswap.owls.process.Perform;
import org.mindswap.owls.process.Process;
import org.mindswap.owls.process.ProcessList;
import org.mindswap.owls.process.Result;
import org.mindswap.owls.process.Sequence;
import org.mindswap.owls.process.execution.ProcessExecutionEngine;
import org.mindswap.owls.profile.Profile;
import org.mindswap.owls.service.Service;
import org.mindswap.query.ValueMap;
import org.mindswap.utils.URIUtils;
import org.mindswap.utils.Utils;/**
* An example to show how service descriptions can be created on the fly, saved and executed.
*
* @author Evren Sirin
*/
public class CreateSequence {
public static final URI baseURI = URI.create("http://www.example.org/BookPrice.owl#");
OWLOntology ont;
public CreateSequence() {
}
/**
*
* Create a new Sequence from the processes of the given services and put them in a new
* Service object with a automatically generated Profile. This function assumes that
* each service in the list has exactly one input and one output (except the first and
* last one) such that in the resulting Service the output of each service will be fed
* as input to the next one. The first service does not have to have an input and the
* last one does not need to have an output. The resulting service will have an input
* (or an output) depending on this.
*
* @param services List of Service objects
* @param baseURI The base URI for the generated service
* @return The Service which is a Sequence of the given services
*/
Service createSequenceService(List services) {
Service service = ont.createService(URIUtils.createURI(baseURI, "TestService"));
CompositeProcess process = ont.createCompositeProcess(URIUtils.createURI(baseURI, "TestProcess"));
Profile profile = ont.createProfile(URIUtils.createURI(baseURI, "TestProfile"));
Grounding grounding = ont.createGrounding(URIUtils.createURI(baseURI, "TestGrounding"));
System.out.println(ont.getKB().getServices());
service.setProfile(profile);
service.setProcess(process);
service.setGrounding(grounding);
createSequenceProcess(process, services);
createProfile(profile, process);ProcessList list = process.getComposedOf().getAllProcesses();
for(int i = 0; i < list.size(); i++) {
Process pc = list.processAt(i);
if(pc instanceof AtomicProcess) {
grounding.addGrounding(((AtomicProcess)pc).getGrounding());
}
}
profile.setLabel(createLabel(services));
profile.setTextDescription(profile.getLabel());
service.setProfile(profile);
service.setProcess(process);
service.setGrounding(grounding);
return service;
}
/**
*
* Create a label for the composite service based on the labels of services. Basically
* return the string [Service1 + Service2 + ... + ServiceN] as the label
*
* @param services List of Servie objects
* @return
*/
String createLabel(List services) {
String label = "[";
for(int i = 0; i < services.size(); i++) {
Service s = (Service) services.get(i);
if(i > 0) label += " + ";label += s.getLabel();
}
label += "]";
return label;
}/**
*
* Create a Profile for the composite service. We only set the input and output of the profile
* based on the process.
*
* @param profile
* @param process
* @return
*/
Profile createProfile(Profile profile, Process process) {
for(int i = 0; i < process.getInputs().size(); i++) {
Input input = process.getInputs().inputAt(i);
profile.addInput(input);
}
for(int i = 0; i < process.getOutputs().size(); i++) {
Output output = process.getOutputs().outputAt(i);profile.addOutput(output);
}
return profile;
}/**
*
* Create a Sequence process for the processes of given services. Creates the DataFlow asssuming each
* service has one output and one intput (except first and last one).
*
* @param compositeProcess
* @param grounding
* @param services
* @return
*/
CompositeProcess createSequenceProcess(CompositeProcess compositeProcess, List services) {
Sequence sequence = ont.createSequence();
compositeProcess.setComposedOf(sequence);
Perform[] performs = new Perform[services.size()];
for(int i = 0; i < services.size(); i++) {
Service s = (Service) services.get(i);
Process p = s.getProcess();
performs[i] = ont.createPerform();
performs[i].setProcess(p);
sequence.addComponent(performs[i]);if(i > 0) {
Perform prevPerform = performs[i - 1];
Input input = p.getInputs().inputAt(0);
Output output = prevPerform.getProcess().getOutputs().outputAt(0);
// the value of 'input' is the value of 'output' from 'prevPerform'
performs[i].addBinding(input, prevPerform, output);
}
}Perform firstPerform = performs[0];
Perform lastPerform = performs[services.size()-1];
boolean createInput = firstPerform.getProcess().getInputs().size() > 0;
boolean createOutput = lastPerform.getProcess().getOutputs().size() > 0;if(createInput) {
Input input = firstPerform.getProcess().getInputs().inputAt(0);
Input newInput = ont.createInput(URIUtils.createURI(baseURI, "TestInput"));
newInput.setLabel(input.getLabel());
newInput.setParamType(input.getParamType());
newInput.setProcess(compositeProcess);
// input of the first perform is directly read from the input of the
// composite process
performs[0].addBinding(input, Perform.TheParentPerform, newInput);
}
if(createOutput) {
Output output = lastPerform.getProcess().getOutputs().outputAt(0);
Output newOutput = ont.createOutput(URIUtils.createURI(baseURI, "TestOutput"));
newOutput.setLabel(output.getLabel());
newOutput.setParamType(output.getParamType());
newOutput.setProcess(compositeProcess);// the output of the composite process is the output pf last process
Result result = ont.createResult();
result.addBinding(newOutput, lastPerform, output);
compositeProcess.setResult(result);
}
return compositeProcess;
}
public void runTest() throws Exception {
// create an OWL-S knowledge base
OWLKnowledgeBase kb = OWLFactory.createKB();// create an empty ontology in this KB
ont = kb.createOntology();
// create an execution engine
ProcessExecutionEngine exec = OWLSFactory.createExecutionEngine();
// load two services
Service s1 = kb.readService("http://www.mindswap.org/2004/owl-s/1.1/BookFinder.owl#");
Service s2 = kb.readService("http://www.mindswap.org/2004/owl-s/1.1/BNPrice.owl#");
// put the services in a list
List services = new ArrayList();
services.add(s1);
services.add(s2);
// create a new service as a sequence of the list
Service s = createSequenceService(services);
// print the description of new service to standard output
ont.write(System.out, baseURI);
System.out.println();
// get the process of the new service
Process process = s.getProcess();
// initialize the input values to be empty
ValueMap values = new ValueMap();
// get the parameter using the local name
values.setValue(process.getInputs().inputAt(0), EntityFactory.createDataValue("City of Glass"));
// execute the service
System.out.print("Executing...");
values = exec.execute(process, values);
System.out.println("done");
// get the output param using the index
OWLIndividual outValue = values.getIndividualValue(process.getOutput());
// display the result
System.out.println("Book Price = ");
System.out.println(Utils.formatRDF(outValue.toRDF()));
System.out.println();
}public static void main(String[] args) throws Exception {
CreateSequence test = new CreateSequence();
test.runTest();
}
}ForEachExample类是对多输入值进行操作的例子,例如,分别输入三个邮政编码,然后调用服务得到三个地区的纬度和经度。
完整代码如下:import impl.owls.process.execution.ProcessExecutionEngineImpl;
import java.net.URI;
import org.mindswap.owl.OWLClass;
import org.mindswap.owl.OWLDataProperty;
import org.mindswap.owl.OWLFactory;
import org.mindswap.owl.OWLIndividual;
import org.mindswap.owl.OWLKnowledgeBase;
import org.mindswap.owl.OWLOntology;
import org.mindswap.owl.list.RDFList;
import org.mindswap.owls.OWLSFactory;
import org.mindswap.owls.process.CompositeProcess;
import org.mindswap.owls.process.ForEach;
import org.mindswap.owls.process.Input;
import org.mindswap.owls.process.Local;
import org.mindswap.owls.process.Perform;
import org.mindswap.owls.process.Process;
import org.mindswap.owls.process.execution.ProcessExecutionEngine;
import org.mindswap.owls.service.Service;
import org.mindswap.owls.vocabulary.OWLS;
import org.mindswap.query.ValueMap;/**
*
* Example to show how to create and execute a forEach control construct.
*
* @author Evren Sirin
*/
public class ForEachExample {
public void run() throws Exception {
String ns = "http://www.example.org/test#";
// print the inputs and outputs during each iteration of the loop
ProcessExecutionEngineImpl.DEBUG = true;
ProcessExecutionEngine exec = OWLSFactory.createExecutionEngine();
OWLKnowledgeBase kb = OWLFactory.createKB();
Service service = kb.readService("http://www.mindswap.org/2004/owl-s/1.1/FindLatLong.owl");
Process process = service.getProcess();
OWLOntology ont = kb.createOntology();
CompositeProcess cp = ont.createCompositeProcess();
Input in = ont.createInput(URI.create( ns + "in" ));
in.setParamType(OWLS.ObjList.List());
cp.addInput(in);// create a ForEach construct
ForEach forEach = ont.createForEach();
Local loopVar = ont.createLocal( URI.create( ns + "loopVar") );
cp.setComposedOf(forEach);
forEach.setListValue( Perform.TheParentPerform, in );
forEach.setLoopVar( loopVar );// perform the process by passing the loop variable
Perform perform = ont.createPerform();
perform.setProcess(process);
perform.addBinding(process.getInput(), Perform.TheParentPerform, loopVar);
forEach.setComponent(perform);
// display how the construct looks like in RDF/XML
ont.write(System.out);
// create some zip code values
String zipcodeOnt = "http://www.daml.org/2001/10/html/zipcode-ont#";
OWLClass ZipCode = kb.getClass(URI.create(zipcodeOnt + "ZipCode"));
OWLDataProperty zip = kb.getDataProperty(URI.create(zipcodeOnt + "zip"));
OWLIndividual zip1 = ont.createInstance(ZipCode);
zip1.setProperty(zip, "20740");
OWLIndividual zip2 = ont.createInstance(ZipCode);
zip2.setProperty(zip, "11430");
OWLIndividual zip3 = ont.createInstance(ZipCode);
zip3.setProperty(zip, "94102");
// put them in a list
RDFList list = ont.createList(zip1).add(zip2).add(zip3);
ValueMap values = new ValueMap();
values.setValue(cp.getInput("in"), list);
exec.execute( cp , values );
}
public static void main(String[] args) throws Exception {
ForEachExample test = new ForEachExample();
test.run();
}
}
运行后得到输出:Executing AtomicProcess http://www.mindswap.org/2004/owl-s/1.1/FindLobjectatLong.owl#FindLatLongProcess
Inputs:
(http://www.mindswap.org/2004/owl-s/1.1/FindLobjectatLong.owl#ZipCode=
<j.0:ZipCode>
<j.0:zip>20740</j.0:zip>
</j.0:ZipCode>
)
Invoking http://cheeso.members.winisp.net/zips/ZipService.asmx?WSDL
Result:
(http://www.mindswap.org/2004/owl-s/1.1/FindLobjectatLong.owl#LatLong=
<j.0:LatLon>
<j.0:latitude>38.996303</j.0:latitude>
<j.0:longitude>-76.929891</j.0:longitude>
</j.0:LatLon>
)Executing AtomicProcess http://www.mindswap.org/2004/owl-s/1.1/FindLobjectatLong.owl#FindLatLongProcess
Inputs:
(http://www.mindswap.org/2004/owl-s/1.1/FindLobjectatLong.owl#ZipCode=
<rdf:Description>
<j.0:zip>11430</j.0:zip>
</rdf:Description>
)
Invoking http://cheeso.members.winisp.net/zips/ZipService.asmx?WSDL
Result:
(http://www.mindswap.org/2004/owl-s/1.1/FindLobjectatLong.owl#LatLong=
<j.0:LatLon>
<j.0:latitude>-0</j.0:latitude>
<j.0:longitude>-0</j.0:longitude>
</j.0:LatLon>
)Executing AtomicProcess http://www.mindswap.org/2004/owl-s/1.1/FindLobjectatLong.owl#FindLatLongProcess
Inputs:
(http://www.mindswap.org/2004/owl-s/1.1/FindLobjectatLong.owl#ZipCode=
<rdf:Description>
<j.0:zip>94102</j.0:zip>
</rdf:Description>
)
Invoking http://cheeso.members.winisp.net/zips/ZipService.asmx?WSDL
Result:
(http://www.mindswap.org/2004/owl-s/1.1/FindLobjectatLong.owl#LatLong=
<j.0:LatLon>
<j.0:latitude>-0</j.0:latitude>
<j.0:longitude>-0</j.0:longitude>
</j.0:LatLon>
)Matchmaker这个例子说明了如何对服务进行匹配,实现服务的组合。服务的输出与服务的输入进行匹配,分别运用"EXACT, SUBSUME以及RELAXED"作为匹配标准。这里应用了Pellet推理机。
对以下几个文件进行输入输出匹配:
http://www.mindswap.org/2004/owl-s/1.1/BNPrice.owl
http://www.mindswap.org/2004/owl-s/1.1/BookFinder.owl
http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl
http://www.mindswap.org/2004/owl-s/1.1/Dictionary.owl
http://www.mindswap.org/2004/owl-s/1.1/ZipCodeFinder.owl
http://www.mindswap.org/2004/owl-s/1.1/FindLatLong.owl
http://www.mindswap.org/2004/owl-s/1.1/BabelFishTranslator.owl得到运行结果:
Reading http://www.mindswap.org/2004/owl-s/1.1/BNPrice.owl
Reading http://www.mindswap.org/2004/owl-s/1.1/BookFinder.owl
Reading http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl
Reading http://www.mindswap.org/2004/owl-s/1.1/Dictionary.owl
Reading http://www.mindswap.org/2004/owl-s/1.1/ZipCodeFinder.owl
Reading http://www.mindswap.org/2004/owl-s/1.1/FindLatLong.owl
Reading http://www.mindswap.org/2004/owl-s/1.1/BabelFishTranslator.owl#
Computing matches...Matches:
EXACT BNPriceService.BookPrice -> CurrencyConverterService.InputPrice
EXACT BookFinderService.BookInfo -> BNPriceService.BookInfo
EXACT CurrencyConverterService.OutputPrice -> CurrencyConverterService.InputPrice
EXACT DictionaryService.OutputString -> BookFinderService.BookName
EXACT DictionaryService.OutputString -> DictionaryService.InputString
EXACT DictionaryService.OutputString -> ZipCodeFinderService.City
EXACT DictionaryService.OutputString -> ZipCodeFinderService.State
EXACT DictionaryService.OutputString -> BabelFishTranslatorService.InputString
EXACT ZipCodeFinderService.ZipCode -> FindLatLongService.ZipCode
EXACT BabelFishTranslatorService.OutputString -> BookFinderService.BookName
EXACT BabelFishTranslatorService.OutputString -> DictionaryService.InputString
EXACT BabelFishTranslatorService.OutputString -> ZipCodeFinderService.City
EXACT BabelFishTranslatorService.OutputString -> ZipCodeFinderService.State
EXACT BabelFishTranslatorService.OutputString -> BabelFishTranslatorService.InputString
完整代码如下:
import java.io.FileNotFoundException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;import org.mindswap.owl.OWLFactory;
import org.mindswap.owl.OWLIndividual;
import org.mindswap.owl.OWLKnowledgeBase;
import org.mindswap.owl.OWLType;
import org.mindswap.owls.process.Input;
import org.mindswap.owls.process.Output;
import org.mindswap.owls.service.Service;
import org.mindswap.query.ValueMap;/**
* An example that finds service matches for composition. The outputs of services are matched with
* the inputs of services using one of EXACT, SUBSUME and RELAXED match criteria. Pellet reasoner is
* used to find matches but can be replaced with any other reasoner.
*
* @author Evren Sirin
*/
public class Matchmaker {
OWLKnowledgeBase kb;
public static class Match {
public static String[] MATCHES = {"EXACT", "SUBSUME", "RELAXED", "FAIL"};
public static int EXACT = 0;
public static int SUBSUME = 1;
public static int RELAXED = 2;
public static int FAIL = 3;
int matchType;
boolean listMatch;
Service outputService;
Output output;
Service inputService;
Input input;
public Match(int matchType, Output output, Input input) {
this.matchType = matchType;
this.outputService = output.getService();
this.output = output;
this.inputService = input.getService();
this.input = input;
}
public String toString() {
String str = "";
str += MATCHES[matchType] + " ";
if(listMatch)
str += ".LIST";
str += outputService.getLocalName() + "." + output.getLocalName();
str += " -> ";
str += inputService.getLocalName() + "." + input.getLocalName();
return str;
}
}
public Matchmaker() {
kb = OWLFactory.createKB();
kb.setReasoner("Pellet");
}public void addOntology( String ont ) throws FileNotFoundException, URISyntaxException {
System.out.println( "Reading " + ont );
kb.read( new URI( ont ) );
}
public void addOntology( URI ont ) throws FileNotFoundException {
System.out.println( "Reading " + ont );
kb.read( ont );
}
public List findServices(boolean getProducers) {
String hasParameter = getProducers ? "process:hasOutput" : "process:hasInput";
String queryString =
"SELECT * " +
"WHERE " +
" (?process rdf:type process:Process)" +
" (?process " + hasParameter + " ?param)" +
"USING " +
" process FOR <http://www.daml.org/services/owl-s/1.1/Process.owl#>";
return kb.query( queryString );
}public List findOutputs() {
return findServices(true);
}
public List findInputs() {
return findServices(false);
}
public int getMatchType(OWLType outputType, OWLType inputType) {
if(outputType.isEquivalent(inputType))
return Match.EXACT;
else if(outputType.isSubTypeOf(inputType))
return Match.SUBSUME;
else if(inputType.isSubTypeOf(outputType))
return Match.RELAXED;
else
return Match.FAIL;
}public List displayAllMatches() {
List matches = new ArrayList();
System.out.println( "Computing matches..." );
List producers = findOutputs();
List consumers = findInputs();
Iterator i = producers.iterator();
while( i.hasNext() ) {
ValueMap binding = (ValueMap) i.next();
Output output = (Output) ((OWLIndividual) binding.getValue("param")).castTo(Output.class);
OWLType outputType = output.getParamType();
Iterator j = consumers.iterator();
while( j.hasNext() ) {
binding = (ValueMap) j.next() ;
Input input = (Input) ((OWLIndividual) binding.getValue("param")).castTo(Input.class);
OWLType inputType = input.getParamType();
// System.out.println("Trying " +
// URIUtils.getLocalName(outputType.getURI()) + " " +
// URIUtils.getLocalName(inputType.getURI()) + " " +
// producer.getLocalName() + " " +
// output.getLocalName() + " " +
// consumer.getLocalName() + " " +
// input.getLocalName()
// );
int matchType = getMatchType(outputType, inputType);
if(matchType != Match.FAIL)
matches.add(new Match(matchType, output, input));
}
}
return matches;
}public static void printIterator(Iterator i) {
if(i.hasNext()) {
while (i.hasNext())
System.out.println( i.next() );
}
else
System.out.println("<EMPTY>");
System.out.println();
}
public static void main(String[] args) throws FileNotFoundException, URISyntaxException {
Matchmaker matchmaker = new Matchmaker();
matchmaker.addOntology("http://www.mindswap.org/2004/owl-s/1.1/BNPrice.owl");
matchmaker.addOntology("http://www.mindswap.org/2004/owl-s/1.1/BookFinder.owl");
matchmaker.addOntology("http://www.mindswap.org/2004/owl-s/1.1/CurrencyConverter.owl");
matchmaker.addOntology("http://www.mindswap.org/2004/owl-s/1.1/Dictionary.owl");
matchmaker.addOntology("http://www.mindswap.org/2004/owl-s/1.1/ZipCodeFinder.owl");
matchmaker.addOntology("http://www.mindswap.org/2004/owl-s/1.1/FindLatLong.owl");
matchmaker.addOntology("http://www.mindswap.org/2004/owl-s/1.1/BabelFishTranslator.owl#");
List matches = matchmaker.displayAllMatches();
System.out.println();
System.out.println("Matches:");
printIterator(matches.iterator());
}
}
对其他几个类作简单介绍:OWLSValidator主要是对OWL-S文件的有效性进行检验。
PreconditionCheck说明了服务如何被执行。
OWLSExtensions说明了API包的可扩展性,显示了默认Profile的可以扩充为用户自定义的Profile。
Translator主要是对不同版本的service description进行转换,以保证兼容性。
WSDL2OWLS主要是将WDSL描述的服务自动转化为OWL-S描述。 -

-
WSDL EXAMPLES - [TOppS]
2009-03-07
http://www.xmethods.net/ve2/index.po
-
---------------------------------------------- human
natural language
Haskell
Lisp Prolog
Java
C
assembler
machine language
---------------------------------------------- machine
Lecture 1: Introduction
A compiler translates source language to assembly language.
An assembler translates assembly language to machine language.
But often the whole chain from source to machine is called compilation.
------------------------------------------------------------------------------------------
character stream-- --token list-- --syntax tree-- --annotated syntax tree-- --assembly code
lexer parser type checker code generator
-------------------------------------------------------------------------------------------
-
OWL-S Docs
2009-03-01
http://www.daml.org/services/owl-s/1.1/
-
Self-answer questions.. v.01 till 24/02/09 - [TOppS]
2009-02-26
1, data come from in ports
use what to get data?
- You ask a service registry for a service description which will provide you with the
types for the different messages (out and in ports)\
- The problem is not to be able to fetch data since:
- you are doing a system for service evolvement.
- you are more interrested in the port TYPE, i.e. is the data port delivering a
GIF or is it a OGG stream, we do not know.
- we need to connect ports of a given type to views of another type, the view type
should always be able to interpret the data
from the port type.
- other names for a 'view' think, portlet, think windows gadgets, and so forth
- another problem is to do a type checker, a small type system (is strong and static,
noteworthy is the haskell type system)
//如果一个语言强制实行类型规则(即通常只允许以不遗失资讯为前提的自动类型转换)就称此
//处理为强类型,反之称为弱类型
//A programming language is said to use static typing when type checking is performed
//during compile-time as opposed to run-time.
// Should be a type inference -> get data type
// JFileChooser -> get file type xxxx not for here.
- all types are described by some W3C complaint schema. So a type almost always
returns complex type from XMLSchema
- we remind ourselves that complexTypes always terminates in some simpleType
- so how do we do type checking?
- xml types might extend eachother but this is only at a data level.
struct myStruct
{
int ID;
char* str;
};
struct myStruct2 extends myStruct
{
float amount;
}
does this mean that myStruct is the father of myStruct2? Probably not.
We still need a way to describe their relationship.
- one way of doing this would be to describe everything in OWL-DL (perhaps
even OWL-Lite)
the types of input is predefined, so that the programme has knoweledge of all possible types?
what are they?
location + function for one sensor at least?
For the first box, the input must comes from sensor?
sent request-> get availiable service.( Does the response contains detail info about which
sensor provide what service? Or just a list
of service? Deal with sensor join/leave/dead or not? )
Where am I in the sensor network architecture? Sensors ---> Here or Sensors ---> Their
own base stations ---> Here ?
2, Represent the data(contain) and their relations with xml based markup languages (RDF/OWL)
---> make them "ontologies"??..
these code are generated by? programming language? like java(Jena-> library ; Protege ,
Swede (eclipse plugin(working?)) -> tool)?
different type of input data should have their own description? ----> do more reading
on sematic/ontology..
relations?? e.g: every time a new data gets in, relate it to all old one? -----|
- so what is an ontology?
- just like a database schema it defines the constraints upon your description
- e.g. Animal is a concept which has a sub class called Mammal
so even further we can define Mammal as a creature with mammaries
- this would be an ontology and it would allow us to create Animals with
mammaries ONLY IF that animal is a member of the Mammal sub class
- An ontology should (edwards opinion) not contain instances
note to self: OWL files get messy quickly, Naive approach is always to describe
stuff in a taxonomy (class hierarchy (this is typical for type classes))
//If the range of actual types that can be used is finite and the combinations
must be specified individually prior to use,
//it is called Ad-hoc polymorphism. If all code is written without mention of
any specific type and thus can be used transparently
//with any number of new types, it is called parametric polymorphism.
yefeng:myType can be referenced from a OWL file
------
5, box aggregates data (serveral input (from in ports or sensors) into one output)
- no, a box has a differential number of inputs and outputs.
- this can come from the fact that the box is representable by another (deeper) workspace
- we remind ourselves that we can add any number of inports and/or outports to a
workspace
- it might also be the case that the box is originating from a sensor which delivers one,
two, three... outports
are there "rules" for aggregates data, or any type of data can be aggregated into out port?
is there "rules" inside a box? one sensor input only?
- the rules are the contained connections and boxes (i.e. what we call a 'configuration')
what will happen if data from several audio sensor come to one out port?
- you are not allowed to do this then you will need to add outports to your service.
is box has "filter" or other functions? how?
+ we dont really know. we should be able to use ANY atomic service (i.e. described via WSDL)
6, the Structure of boxes should be like DAG, one direction, no circle.
7, one box stands for one configuration (created by end user.)
boxes A, B, C. A (definetly one or more views, at this level) -> B -> C (definetly one or more
atomic-services); if user want to have configuration C, the configreation A and B must be setted
up by him already?
//Atomic services do not rely on other services and are usually associated with
//straightforward business transactions or with executing data queries and data updates.
//Composite services use other services. In all other respects, composite services are
//just like any other service, in that they: Have a well-defined service contract.
// Are registered in the service registry, can be looked up via the service registry,
// and can be invoked like any other service provider.
// Are deployed, managed, and secured like other services.
// Can look up and use other services, including other composite services.
- no, if C provides with a view source then it should be able to operate in it self, since we
know C is at the lowest level and has a data producer.
8, different types within one output should be handled in proper way?
- not possible
how to deal with the out put data (play the video,audio, indicate the location of sensor on map)?
- not your concern
how to implement the UI part? Write code or use tool? Html, Javascript ,CSS,J2EE? (LATER)
- the frontend part (the part which draws boxes connects them, whatever, in javascript)
- the backend (any, suggestion use OSGi(module framework for Java) and provide a service (which
will be a java class) for type inferencing/checking)
=======================================================================================================
9, what is a type system...
- In a program, a variable can assume a range of values during the execution. The upper bound
of such a range is called a Type of the variable.
---> Languages where variables can be given types are typed languages
---> Type system is part of typed language that are used to determine whether programs are
well-behaved, means this program does not cause any forbidden error( a subset of potential
error, including all the untrapped errors at least) to occur.
- Type system makes bits meaningful to program/programmer, hardware does not distinguish this
collection of bits between another basically.
-It defines what are those "001010101" things stand for, and what are their abilities(what
operations this type can handle while other they cannot). In short, it specifies the type
rules for typed programs.
- objects , classes, types, ... are all "types". Object is something like the "value" of type.
Classes are those types defined by programmer.
10, why do we need it..
-Since the type rule will be checked by compiler to guarantee nothing illegal left and no forbidden
errors will occur. This can provide type safty of a program.
-Notice :type safty is not program correctness
- Type system optimizes the use of hardware, some useful compile-time information will get through
static type checking.
-Type system could document the programmer's intentions, it's better than comments since compiler
will involvoed and perform the checking.
-By having type system, programmer will not bothered by low-level implementation, they can simplely
consider String as character rather than array of bytes.
11, how does a type checker help us..
-Type checker is actually the algorithm perform type checking process.
-Type system is part of a language while Type checker is part of a compiler or interpreter that checking a program before execution.
-Type checker checks expressions of a program against type rules of the given type system, so that
prevents the ocurrence of forbidden errors.
-By doing that, accurate type information at compile time leads to the application of the appropriate
operations at run time without the need of fuether tests. In other words, numbers of program errors can occur easier for programmer to debug.
-The different compiler may have different typechecking algorithms for the same type system.
12, what is ontology...
-In our context, ontology is a model of how to represet a set of concepts within a domain( a part of the world ) as well as how to represent the relationships among them. This represetation is based on the truth we got from reality.
- Normally ontology components include individuals(instances)(?), classes(concepts), attributes, relations,restrictions, rules, and so on.
- There are domain ontology and upper ontology.
- domain ontology represents the particular meaning of concepts of one specific domain.
- upper ontology describes the general meaning of concepts that are shared by all domains.
-e.g. Dublin Core
13, why do we need ontology..
- One truth can be described by many ways in human language, e.g. half water glass v.s half empty galss. That's the reason computers can not understand natural language very well.
- Not like natural language, ontology provides a formalised description to avoid ambiguity. Moreover,
the format can be processed by computers.
- That mean the computer could have the ability to "read" and "understand" the knowledge, not just display the information and let human do the actual "reading". Furthermore, computers can then perform "reasoning" based on the ontology.
14, relationship between ontologies - RDF/OWL...
-OWL/RDF are the ontology languages, which are used to creat ontologies.
-These knowledge representation languages allow the encodeing( transfer information from one format to another) of knowledge about specific domains, and they also contains reasoning rules to support the further processing of knowledge. -
protege中GraphViz的DOT error - [TOppS]
2009-02-23
先到到此处下载GraphViz tool,然后安装。在OWLViz设置中指定正确的DOT application路径。默认情况下是(Linux和Unix下的/usr/local/bin ( Ubuntu 下直接 apt安装,默认路径 /usr/bin/dot ), 或者是windows下的C:\Program Files\ATT\GraphViz\bin\DOT.exe) Max OS X到此处下载graphviz 并指定DOTapplication路径:Graphviz软件的路径+/Graphviz.app/Contents/MacOS/dot
-
useful lecture notes - [TOppS]
2009-02-19
Programming languages course:
http://www.cs.chalmers.se/Cs/Grundutb/Kurser/e4fun/#toc5
<Type checker>
Functional Languages Course
http://www.cs.chalmers.se/Cs/Grundutb/Kurser/e4fun/#toc4
<Type system of haskell>
******************************************************************************
-
What is Ontology. - [TOppS]
2009-02-18
By Tom Gruber <gruber@ksl.stanford.edu>
In the context of computer and information sciences, an ontology defines a set of representational primitives with which to model a domain of knowledge or discourse. The representational primitives are typically classes (or sets), attributes (or properties), and relationships (or relations among class members). The definitions of the representational primitives include information about their meaning and constraints on their logically consistent application. In the context of database systems, ontology can be viewed as a level of abstraction of data models, analogous to hierarchical and relational models, but intended for modeling knowledge about individuals, their attributes, and their relationships to other individuals. Ontologies are typically specified in languages that allow abstraction away from data structures and implementation strategies; in practice, the languages of ontologies are closer in expressive power to first-order logic than languages used to model databases. For this reason, ontologies are said to be at the "semantic" level, whereas database schema are models of data at the "logical" or "physical" level. Due to their independence from lower level data models, ontologies are used for integrating heterogeneous databases, enabling interoperability among disparate systems, and specifying interfaces to independent, knowledge-based services. In the technology stack of the Semantic Web standards [1], ontologies are called out as an explicit layer. There are now standard languages and a variety of commercial and open source tools for creating and working with ontologies.
-------------------------------------------------------------------------------
- Short answer:
- An ontology is a specification of a conceptualization.
The word "ontology" seems to generate a lot of controversy in discussions about AI. It has a long history in philosophy, in which it refers to the subject of existence. It is also often confused with epistemology, which is about knowledge and knowing.
In the context of knowledge sharing, I use the term ontology to mean a specification of a conceptualization. That is, an ontology is a description (like a formal specification of a program) of the concepts and relationships that can exist for an agent or a community of agents. This definition is consistent with the usage of ontology as set-of-concept-definitions, but more general. And it is certainly a different sense of the word than its use in philosophy.
-------------------------------------------------------------------------
+废话:
Ontology 的概念最初起源于哲学领域,并在很长一段时期都是哲学研究的一个分支。古希腊哲学家亚里士多德(Aristotle)定义 Ontology 为“对世界客观存在物的系统的描述,即存在论”,也就是说 Ontology 是客观存在的一个系统的解释或说明,它关心的是客观现实的抽象本质。为研究客观世界的存在问题,亚里士多德、莱布尼茨(Leibniz)、康德 (Kant)、皮尔斯(Peirce)、怀特海德(Whitehead)等哲学家广泛讨论了用 Ontology 如何对现实世界进行分类、怎么描述其中的物理实体、如何定义客观世界的抽象,以及空间与时间的关系等问题。
-
Lecture notes: Type Checking - [TOppS]
2009-02-18
Book: 6.3, 6.5
The purpose of types
To define what the program should do.
- e.g. read an array of integers and return a double
To guarantee that the program is meaningful.
- that it does not add a string to an integer
- that variables are declared before they are used
To document the programmer's intentions.
- better than comments, which are not checked by the compiler
To optimize the use of hardware.
- reserve the minimal amount of memory, but not more
- use the most appropriate machine instructions
What belongs to type checking
Depending on language, the type checker can prevent
- application of a function to wrong number of arguments,
- application of integer functions to floats,
- use of undeclared variables in expressions,
- functions that do not return values,
- division by zero
- array indices out of bounds,
- nonterminating recursion,
- sorting algorithms that don't sort...
Languages differ greatly in how strict their static semantics is: none of the things above is checked by all programming languages!
In general, the more there is static checking in the compiler, the less need there is for manual debugging.
Description formats for different compiler phases
These formats are independent of implemantation language.
- Lexer: regular expressions
- Parser: BNF grammars
- Type checker: typing rules
- Interpreter: operational semantic rules
- Code generator: compilation schemes
Typing judgements and rules
Typing rules concern judgements of the form
E => e : T
where E is an environment, which contains e.g. typings of identifiers. The judgement says
- in the environment E, expression e has type T
Judgements are used in typing rules of the form
J1 J2 ... Jn
--------------- C
J(n >= 0) which says
- from the judgements J1, J2, ..., Jn you may conclude J, if condition C holds.
The judgements above the line in a rule are the premisses.
The judgement under the line is the conclusion.
The condition
Cbeside is a side condition, typically not expressible as a judgement, therefore not a premiss.The judgement are written in a formal language, whereas side conditions can be written in natural language.
Examples of typing rules and derivation
Typing rules for arithmetic expressions
E => e1 : int E => e2 : int E => e1 : int E => e2 : int
------------------------------- -------------------------------
E => e1 + e2 : int E => e1 * e2 : int
---------- x : T is in E ------------ i is an integer literal
E => x : T E => i : intDerivation of judgement
x : int, y : int => x + 12 * y : intx:int, y:int => 12 : int x:int, y:int => y : int
---------------------------------------------------
x:int, y:int => x : int x:int, y:int => 12 * y : int
-----------------------------------------------------------
x:int, y:int => x + 12 * y : intSignature vs. context
We generalize the type checking context to an environment with two parts:
- signature, which shows the types of functions
- context, which shows the types of variables.
In the course of type checking, the signature remains the same throughout a program module, whereas the context changes all the time.
Function types
No expression in the language of Lab 2 has function types, because functions are never returned as values or used as arguments.
However, the compiler needs internally a data structure for function types, to hold the types of the parameters and the return type. E.g. for a function
bool between (int x, double a, double b) {...}we write
between : (int, double, double) -> bool
to express this internal representation in typing rules.
Notation for signature and context
Dividing the environment to signature
Fand contextG,F,G => J
Example: typing rule for a variable expression
------------- x : T is in G
F,G => x : TExample: typing rule for one-place function application
F,G => e : A
--------------- f : (A) -> T is in F
F,G => f(e) : TThe validity of statements
Expressions have types, but statements do not.
However, also statements are checked in type checking.
We need a new judgement form, saying that a statement
Sis valid:F,G => S valid
Example: typing rule for an assignment
F,G => e : T
-------------------- x : T is in G
F,G => x = e ; validExample: typing rule for while loops
F,G => e : bool F,G => S valid
--------------------------------
F,G => while (e) S validVariable binding and context
Contexts can be extended with new variables. The notation we use is
(G, x : T)
This corresponds to variable binding constructs, e.g. declarations.
Example: typing rule for a declaration;
SSis a sequence of statementsF,(G, x:t) => SS valid
------------------------- x not in G
F,G => t x ; SS validThe rule says: if
SSis a valid sequence of statements in context(G, x : T), thent x ; SSis valid inG.Example of variable binding and context
We prove that
int x ; x = x + 5 ;is valid in the empty context().x : int => x : int x : int => 5 : int
-----------------------------------------
x : int => x + 5 : int
--------------------------
x : int => x = x + 5 ; valid
-------------------------------
() => int x ; x = x + 5 ; validThe signature is omitted for simplicity.
Function definitions and applications
The validity of a function definition.
F,(G, x1:a1,...,xn : an) => SS valid
--------------------------------------------- f not in F
F,G => T f (A1 x1,...,An xn) { SS } validMore conditions:
- that
x1 ... xnare distinct - that
A1 ... An, Tare types (can be guaranteed by syntax) - that there is a
return ewithe : T(not always checked)
The typing rule for function applications is the following
F,G => f : (A1,...,An) -> T F,G => e1 : A1,..., en : An
----------------------------------------------------------
F,G => f(e1,...,en) : TBlock structure
In C, C++, Java, Haskell, etc, variables on the same level must be distinct (e.g. in function parameter lists).
However, variables in an inner block are no longer on the same level and can hence overshadow outer variables
{
int x = 1 ;
bool b ;
x = x + 2 ; // x : int
{
double x = 2.0 ;
x = x + 1.0 ; // x : double
b = true ; // b : bool
}
x = x + 5 ; // x : int
b = b && b ; // b : bool
}Variables declared in a block are discarded at exit from the block.
There is no limit in the number of block levels.
Contexts for block structure
Implementation 1: with markers
x : int, b : bool, MARK, x : double
- entering a block: add a marker
- leaving a block: delete variables after last marker, and the marker itself
- update: after the last variable
- lookup: the latest occurrence of the variable
Implementation 2: with stacks of contexts
(x : int, b : bool).(x : double)
- entering a block: push an empty context on the stack
- leaving a block: pop the topmost context
- update: after the last variable in the topmost context
- lookup: the deepest surrounding occurrence of the variable
Implementation 2 can be done with lists of lists: the top of the stack is the head of the list.
Typing rules for variables
The rules are expressed as checking if a list of statements is valid. Instead of a single context, we have a stack of contexts
Gs.Gwhere we denote byGthe topmost context.-------------- x : T the closest entry for x in Gs.G
Gs.G => x : T
Gs.(G,x:t) => SS valid
-------------------------- x not in G
Gs.G => t x ; SS valid
Gs => e : t Gs => SS valid
------------------------------- x : t in Gs
Gs => x = e ; SS valid
Gs.() => SS valid Gs => SSS valid
-------------------------------------
Gs => { SS } SSS validType checking and type inference
Type checking: given a judgement
G => e : T, find out whether it can be derived by the typing rules. The derivation is a tree of rule application with the judgement as the last line.Type inference: given an expression
e, find a typeTin contextGsuch thatG => e : Tcan be derived by the typing rules.For Java, C, and C++, we can mostly do with just type checking, because types are marked explicitly.
Haskell has type inference as well: if you don't give the type, the compiler can usually find the most general type.
Different type checkers
We can classify checkers in terms of what they return:
- A rude checker, which only says
TrueorFalse, and may even crash (for instance, when variable lookup just gives anerroris the variable is not found). - An error-reporting checker, which returns
OKor a message saying where the error is. - An annotating checker, which returns a syntax tree annotated with more type information.
To build a compiler back end, we need the third.
In Lab 2, we build the second.
The passes of the type checker
Pass 1:
- start with empty signature
- for each function
f, update signature withf : T
Pass 2:
- for each
f, check the function body offwith respect to the typeT
The expression checker consists of functions:
check (Exp e, Type t) returns void
infer (Exp e) returns TypeThese functions are defined by mutual recursion, by cases on the expression.
We also need to check function definitions and sequences of statements.
check (Def d) returns void
check (Stms ss) returns voidAll functions use an environment (= signature and stack of contexts).
The method is syntax-directed translation.
Examples of type checking
We show syntax-directed translation in pseudocode.
infer x = // variable x
t := lookup(x)
return t
infer i = // integer literal i
return int
infer f(a1,..., an) =
T := lookup(f)
if T = (A1, ..., An) -> B
check a1 : A1
...
check an : An
return B
else failureWe return to the translation rules and their implementation in the next lecture.
From typing rules to type checking code
Basic idea: from rule
J1 ... Jn
---------- C
Jgenerate the code "upside down"
check J =
check J1
...
check Jn
check_condition CExample:
Env => exp1 : bool Env => exp2 : bool check Env => exp1 && exp2 : bool =
----------------------------------------- check Env => exp1 : bool
Env => exp1 && exp2 : bool check Env => exp1 : boolFrom typing rules to type checking code: more examples
Judgements are easy: recursive calls to check.
Env => exp : bool Env => stm valid check Env => while (exp) stm valid =
------------------------------------ check Env => exp : bool
Env => while (exp) stm valid check Env => stm validSide conditions are unlimited code, so you have to think harder.
---------------- var : typ is in Env check Env => var : typ =
Env => var : typ check_condition lookup(var,Env) == typIt is
lookupand such conditions that in the end generate the error messages.lookup(var,Env) = message ("variable " var "not found") // if var is not in Env
check_condition x == y = message ("expected " y " but found " x) // if not equalThe need of type inference
There is a grammar rule saying that expressions can be used as statements:
Stm ::= Exp ";"
How do we check that such statements are valid?
Env => exp : ?
------------------
Env => exp ; validThe problem is that we have no type
typto checkexp : typ.Solution 1: check
expwith each of the four typescheck Env => exp ; valid =
try each typ in [bool,double,int,void]:
check exp : typThis is inefficient, and does not scale up to infinitely many types.
Solution 2: do type inference with
exp. If it succeeds, the statement is valid - because expressions of any type can be used as statments.Type inference
The general scheme is a rule where the conclusion has a type depending in some way on the premises and the condition:
J1 ... Jn
--------------------------------- C
Env => exp : typ(J1, ..., Jn, C)We should then use recursive calls of
checkandinferso that- everything we need for constructing the type is inferred
- everything else is just checked
Often the type is independent of the premisses (which still have to be checked of course!):
Env => exp1 : bool Env => exp2 : bool infer Env (exp1 && exp2) =
------------------------------------------ check Env => exp1 : bool
Env => exp1 && exp2 : bool check Env => exp2 : bool
return boolIt can also come from the condition:
---------------- var : typ is in Env infer Env var =
Env => var : typ return lookup(var,Env)Type checking overloaded operations
Arithmetic operations in most languages are overloaded.
This means that they apply to many types.
The general rule for
+ - * /is: both operands have the same type as the value, which must beintordouble.Env => exp1 : typ Env => exp2 : typ
-------------------------------------- typ is int or double
Env => exp1 + exp2 : typWhat we do is infer the type of the first operand and check the second.
infer Env (exp1 + exp2) =
typ := infer Env exp1
check_condition typ == int or typ == double
check Env => exp2 : typ
return typAlso the comparison operators are overloaded, but the return type is of course
bool.Relating inference and checking
Now we can check expression statements:
check Env => exp ; valid =
infer Env expIf
inferfails, we get any error message it generates.If
infersucceeds, we discard the type.In the same way, we only need to write
inferfor expressions. Then we definecheckuniformly,check Env => exp : typ =
typ2 := infer Env exp
check_condition typ2 == typThe
check_conditioncall usually returns a message at failure, e.g.TYPE ERROR
type of exp: expected typ, inferred typ2The top-level checkers
To check the whole program,
- collect the types of each function into the signature
- check that function names are unique
- check each function definition using the signature
To check a function definition
- check that argument variables are unique
- initialize the topmost context with the argument variables
- check the body in this context
- check that there is a
return, with an expression that has the expected return type of the function (or just areturnif the type isvoid)
To check a sequence of statements
- check the validity of the first statement and update the environment if appropriate
- check the remaining sequence in the new environment
- an empty sequence is always valid
Type checker in Haskell
You can copy the contents of
laborations/lab2/haskell/:CPP.cf -- grammar
lab2.hs -- main module
Makefile
TypeChecker.hs -- type checking moduleYou only have to modify
CPP.cfandTypeChecker.hs.But you can already compile them: just type
make
and run the type checker with
./lab2 <File>
The rest is "debugging the empty file"!
The Main module
You don't have to write this - just copy the file
laborations/lab2/haskell/lab2.hs.This file shows how compiler phases are linked together.
check :: String -> IO ()
check s = case pProgram (myLexer s) of
Bad err -> do putStrLn "SYNTAX ERROR"
putStrLn err
exitFailure
Ok tree -> case typecheck tree of
Bad err -> do putStrLn "TYPE ERROR"
putStrLn err
exitFailure
Ok _ -> putStrLn "OK"In other words: call the parser; if it succeeds, call the type checker.
Notice the use of the error type,
data Err a = Ok a | Bad String
The value is either
Okof the expected type orBadwith an error message.The
Errtype is generated by BNFC. One could also use Haskell's standard typeEither String a.Using the Err type
The
Errtypedata Err a = Ok a | Bad String
is a monad - a type of actions returning
abut also doing other things (in this case: exceptions).Monad actions can be sequenced: if
inferExp :: Env -> Exp -> Err Type
then you can make several inferences one after the other by using
dodo inferExp env exp1
inferExp env exp2You can bind variables returned from actions, and return values.
do typ1 <- inferExp env exp1
typ2 <- inferExp env exp2
return TBoolIf you are only interested in side effects, use the dummy value type
()(corresponds tovoidin C and Java).Symbol tables
Environment type
type Env = (Sig,[Context]) -- signature and stack of contexts
type Sig = [(Id,([Type],Type))] -- or Map Id ([Type],Type)
type Context = [(Id,Type)] -- or Map Id TypeAuxiliary operations on the environment
lookVar :: Env -> Id -> Err Type
lookFun :: Env -> Id -> Err ([Type],Type)
updateVar :: Env -> Id -> Type -> Err Env
updateFun :: Env -> Id -> ([Type],Type) -> Err Env
newBlock :: Env -> Err Env
emptyEnv :: EnvKeep the datatypes abstract, i.e. use them only via these operations. Then you can switch to another implementation if needed (more efficient, more stuff in the environment).
The TypeCheck module
The environment datatypes and operations.
Type signatures of the checking methods
typecheck :: Program -> Err () -- required function in lab2
checkDef :: Env -> Def -> Err () -- check a function definition
checkStms :: Env -> Type -> [Stm] -> Err ()
checkStm :: Env -> Type -> Stm -> Err Env
checkExp :: Env -> Type -> Exp -> Err ()
inferExp :: Env -> Exp -> Err TypeSome other auxiliaries.
checkUnique :: (Ord a, Print a) => [a] -> Err ()
checkCondition :: Bool -> Err ()Some examples of checking
checkStm :: Env -> Type -> Stm -> Err Env
checkStm env val x = case x of
SExp exp -> do
inferExp env exp
return env
SDecl type' x ->
updateVar env id type' -- also check that x is not in context already
SWhile exp stm -> do
checkExp env Type_bool exp
checkStm env val stm
checkExp :: Env -> Type -> Exp -> Err ()
checkExp env typ exp = do
typ2 <- inferExp env exp
if (typ2 == typ) then
return ()
else
fail $ "type of " ++ printTree exp -- ...Some examples of type inference
inferExp :: Env -> Exp -> Err Type
inferExp env x = case x of
ETrue -> return Type_bool
EInt n -> return Type_int
EId id -> lookVar env id
EPIncr exp -> inferNumeric env exp
ETimes exp0 exp -> inferNumericBin env exp0 exp
inferNumeric :: Env -> Exp -> Err Type
inferNumeric env exp = do
typ <- inferExp env exp
if elem typ [Type_int, Type_double] then
return typ
else
fail $ "type of expression " ++ printTree exp -- ...
inferNumericBin :: Env -> Exp -> Exp -> Err TypeType checker in Java
You can copy the contents of
laborations/lab2/java/:CPP.cf -- grammar
lab2 -- script running the type checker
lab2.java -- main program
Makefile
TypeChecker.java -- type checker class
TypeException.java -- exceptions for type checkingYou only have to modify
CPP.cfandTypeChecker.java.But you can already compile them: just type
make
and run the type checker with
./lab2 <File>
The rest is "debugging the empty file"!
Before
make, you may have to set your class path so that it finds java_cup and JLex, as well as the current directory.export CLASSPATH=.:<path-to-JLex>:<path-to-CUP>:$CLASSPATH
The Main module
This is given in
laborations/lab2/java/lab2.java, hence you don't have to write this.It shows how compiler phases are linked together.
try {
l = new Yylex(new FileReader(args[0]));
parser p = new parser(l);
CPP.Absyn.Program parse_tree = p.pProgram();
new TypeChecker().typecheck(parse_tree);
} catch (TypeException e) {
System.out.println("TYPE ERROR");
System.err.println(e.toString());
System.exit(1);
} catch (IOException e) {
System.err.println(e.toString());
System.exit(1);
} catch (Throwable e) {
System.out.println("SYNTAX ERROR");
System.out.println("At line " + String.valueOf(l.line_num())
+ ", near \"" + l.buff() + "\" :");
System.out.println(" " + e.getMessage());
System.exit(1);
}Symbol tables
Environment types
public static class FunType {
public LinkedList<Type> args ;
public Type val ;
}
public static class Env {
public Map<String,FunType> signature ;
public LinkedList<Map<String,Type>> contexts ; -- stack of contexts
public static Type lookVar(String id) { ...} ;
public static FunType lookFun(String id) { ...} ;
public static void updateVar (String id, Type ty) {...} ;
// ...
}The TypeCheck module
The environment datatypes and operations.
An enumeration of codes for types.
public static enum TypeCode { CodeInt, CodeDouble, CodeBool, CodeVoid } ;Notice that
TypeCodeis not the same as the classType, which is the syntactic category of source-language types. We needTypeCodeto be able to compare types for equality, and this happens when we compare an expected type with an inferred type.Type signatures of the checking methods
public void typecheck(Program p) {
}
public static class CheckStm implements Stm.Visitor<Env,Env> {
public Env visit(SDecl p, Env env) {
}
public Env visit(SExp p, Env env) {
}
// ...
public static class InferExp implements Exp.Visitor<Type,Env> {
public Type visit(EInt p, Env env) {
}
public Type visit(EAdd p, Env env) {
}
// ...
}Some examples of checking
public static class CheckStm implements Stm.Visitor<Env,Env> {
public Env visit(SDecl p, Env env) {
env.updateVar(p.id_,p.type_) ;
return env ;
}
//...
}Some examples of type inference
public static class InferExpType implements Exp.Visitor<Type,Env> {
public Type visit(demo.Absyn.EPlus p, Env env) {
Type t1 = p.exp_1.accept(this, env);
Type t2 = p.exp_2.accept(this, env);
if (typeCode(t1) == TypeCode.CodeInt && typeCode(t2) == TypeCode.CodeInt)
return TInt;
else
if (typeCode(t1) == TypeCode.CodeDouble && typeCode(t2) == TypeCode.CodeDouble)
return TDouble;
else
throw new TypeException("Operands to + must be int or double.");
}
//...
}The function
typeCodeconverts source language types to their codes:public static TypeCode typeCode (Type ty) ...
It can be implemented by using a visitor or the
instanceofoperator.More help
You don't need to debug completely empty files:
- for the grammars, you can pick rules from your Lab 1 (as indicated in Lab 2 PM)
- for the type checker, you can start from the "mini" implementation, in
laborations/mini
Lab 2 overview
We will read through the Lab PM
Preparation and exercise: write typing rules for Lab PM constructs.
-
Thesis info - I - [TOppS]
2009-02-14
OWL-S
OWL
RDF-S
RDF | WSDL
XML/XSD ------>
-----------------------------------------
Directed Acyclic Graph
---------------------------------------
SOAP & REST
---------------------------------------
yahoo pipe*
-----------------------------------------------------------------------------------------------
(FOI)
Introduction(1-2w) --- related reaserch (1-2w) -- Design ( 3-4w) -- Implementation ( 7-8w )
--- Test & Evaluation (1-2w) --- Summary (1-2w)
|- Presentation
|- Report
|- Code + Docs
(CTH)
----------------------------------------------------------------------------------------------
Keep writing !
-
转 - 给Linux用户的一点忠告 - [ubuntu]
2009-02-06
1.不要当“传教士”
很多人在讨论区不断的引起 "Linux vs. Windows" 之类的讨论,甚至争的面红耳赤,这是没有必要的。
这种争论是浪费时间而没有任何用处的。对,你花了一下午,用许多事实“捍卫”了 “Linux 比 Windows 好” 这个说法。但是 Windows 的支持者并不会喜欢上 Linux,他们只是稍微退缩一下,然后找一些新的证据来跟你辩论。
世界上的人们都在利用Linux 研究最前沿的科学,我们还在这里讨论 “要不要用Linux” 这种无聊的问题,什么时候才能赶上时代前进的步伐?
什么叫做“Windows 支持者”,什么叫做“Linux 支持者”?我们为什么要支持某一个而反对另外一个?你不需要为 Linux “护法”,不需要成为“Linux 支持者”或者“GNU传教士”,GNU/Linux 已经用事实向世界证明了它们的威力,已经被大多数人接受。你只需要安安静静享受 GNU/Linux 给你的乐趣和自由。
你需要关心的不是你的工具是什么,而是你用它做了什么。精通 Linux 并不说明任何问题,因为它只是一个工具而已。如果你用 Windows 能很好的完成你的任务,那你就没有必要费时间去熟悉 Linux。直到有一天你发现一项任务只有 Linux 才能完成的时候再换也不迟,因为你身边的 Linux 的爱好者一定会很乐意的帮助你。
工具不是人,不应该对工具有感情。这是你在进行任何对工具的讨论前需要提醒自己的事情。面对一些容易引起争论的东西:Word 和 TeX;Emacs 和 VIM;MAXIMA,Mathematica 和 Maple;Gnome, FVWM 和 KDE;Mutt 和 Pine …… 一定要冷静的对自己说:“我不站在它们任何一边,因为它们不是人。”
各人的需要不同,生活的环境不同。对你来说好的东西,对别人来说不一定好,我们需要尊重别人的选择。如果你当面说别人正在用的程序不好,没有人会乐意接受你的意见。我从来没有建议过我爸爸不用 Windows + WPS,而用 Linux + LaTeX 来处理他的英语试卷。因为 WPS 是我爸爸的选择,他能用 WPS 编辑出很好的试题去测试他的学生,那就足够了。
我曾经帮我爸爸做了一个 perl 程序,能够自动从一种我自己设计的 markup 语言转化成 LaTeX 格式的英语试卷。可以自动对试题编号,乱序排版选择题的选项,自动生成答案表,生成老师用的显示答案的版本,自动对短文改错题进行优化分段,自动拼写检查,图形化的配置方式…… 我爸爸高兴的用了一段时间,可是后来他想用 WPS 里的一种标题样式,而我不在家,无法为他修改程序。所以他又换回了 WPS。这就像有人送爱因斯坦一罐剃须泡沫一样,刚开始几天,发现他神采飞扬,不断夸这个东西真舒服。过了几天,发现爱因斯坦又开始用白水剃胡子了,因为剃须泡沫用完了,他懒得自己去买那个东西。这只是习惯问题。
2.不要强迫自己
喜欢电脑的人总是有某些心理强迫倾向。有的人说:“键盘比鼠标快。我不要用鼠标。这样才有高效率。” 所以他在编辑器里无论什么时候总是用 20w, 10j 这样的命令到达目的点。他甚至觉得图形界面是多余的,干脆 Xwindow 都不装。
全部用键盘看起来的确比让手离开键盘去拿鼠标,再回来“快” 多了,但是快的击键频率不等于工作的高效率,对你的健康更没有什么好处。这只能把你变成打键盘的机器。
当你正在检查你的文章或者程序,思维正在随着字符的含义流动,突然 20w, 10j 这样的东西出现在你的脑子里,是不是会打断思路?不?那说明你当时思考的问题比较简单,这些干扰还不会起到副作用。
其实很多人用电脑的时候,思想都受到某种教条的束缚,上面这个只是众多教条中的一种。某些人制造了很多这种教条,用他的工作方式来要求别人,嘲笑方式跟他不一样的人。比如有的人嘲笑其它人写 C 程序不按 8 字符缩进,嘲笑别人在 vi 里用方向键,嘲笑别人不知道 PVM 是什么,嘲笑其它人用 JAVA, C# 这种由 GC 回收内存语言……
你不用管各种各样的教条,电脑只是你的奴隶,你想怎么用就怎么用。没有人能够约束你,没有人可以嘲笑你的工作方式。电脑明天就不再是这个样子,所以今天你不用完全了解它。你没有必要知道别人创造的一切,因为你需要留点时间自己创造些东西。Just have fun!
当你下次修改文章的时候,不妨试试悠闲的用鼠标在你眼睛看到的地方轻轻点一下。
3.不要“玩 Linux”
很多人用 Linux 的时候会感觉很迷茫,该用哪个发行版本呢?是不是我少装了什么?怎么升级这么快啊!怎么这么不稳定!每当遇到新的软件他就想试用,每当新的版本出现,他就更新,然后用鼠标在新的菜单里选择从来没见过的程序来用用。
其实你是为了Linux而使用Linux,而没有找到正确的理由来利用 Linux。你首先要明确用电脑的目的,你用它是为了解决你的实际问题,而不是为了学习安装操作系统,不是为了测试哪个版本好用,不是为了“赶上潮流”,更不是因为你硬盘太大了,你想多占点空间。
如果你启动了电脑之后不知道应该干什么,那么最好先不要用电脑,因为你可能有更重要的事情需要做。
4.不用挑剔发行版本
很多人刚开始用 Linux 的时候,总是在怀疑别的发行版本是否比自己正在用的这个好,总是怀疑自己以后时候会失去支持,不得不换用别的发行。所以很多人今天是 Red Hat,明天又换成了 Debian, 一会儿又是 Gentoo, …… 甚至有的人在一台机器上装了两个版本的 Linux,然后比较哪一个好。
其实你完全没有必要这样做,任何发行,只要你熟悉了,你在上面的工作方式几乎是不会受到任何影响的。我以前一直用的 Red Hat,当我有一天在我的一台新机器上安装 Debian 时,我发现使用 Red Hat 的经验完全没有浪费。我用了一个下午就配置好了 Debian,使它服服贴贴的听我的话,就跟没有换发行一样。
Debian, TurboLinux, SuSE, Red Hat, Gentoo, ... 任何一个版本都是不错的。很多人认为自己攒一个 LFS 是高水平黑客的象征,但是不是每个人都有精力去了解所有细节。
如果你是用于个人的日常事物和科研,可以试试 Debian。它是我见过的最方便的一个发行版本。
5.不要盲目升级
不知道这是心理作用还是什么,有的人看到比较大的版本号,就会很想换成那个。很多人的 Redhat 本来配置的很舒服了,可是一旦 Redhat 发行新的版本,他们就会尽快下载过来,然后选择升级安装。结果很多时候把自己原来修改得很好的配置文件给冲掉了。新的软件又带来了新的问题,比如有一次我的 rxvt 升级到 2.7.8 就跟 miniChinput 冲突了,升级到 Redhat 8.0,发现 xmms 居然缺省不能放mp3了,XFree86 的 xtt 模块在 I810 上有新的 bug,会导致 Mozilla 突然退出。
如果你已经配置好了一切,千万别再整体升级了,这会浪费你很多很多时间的,不值得。有句话说得好:"If it's not broken, don't fix it." 如果你的程序能够完成你需要做的事情,你何必升级呢?
6.不要配置你不需要的东西
如果你只想做一个像我这样的普通用户,主要目的是用 Linux 来完成自己的科研任务和日常工作,那就可以不用系统管理员或者网络管理员的标准来要求自己,因为当一个系统和网络管理员确实很辛苦。普通用户学习那些不经常用到的复杂的维护系统的工具,其实是浪费时间,学了不用是会很快忘记的!
我不是一个合格的网络管理员,我的服务器都只设置了我自己需要的功能,设置好 ssh, ftp 已经足够了,那样可以省去我很多麻烦。我从来不过度考虑“安全”,因为 Linux 缺省已经很安全了。我没有磁带机,就不用管 tar 的那些稀奇古怪的参数了,czf, xzf, ztf 已经可以满足我所有的需要。sed, awk, ... 我也只会几种常用的命令行。
7.不要习惯的使用 root 帐号。在需要的时候才 su!
这是很多刚接触 UNIX 类操作系统的人常见的现象,他们不喜欢在管理系统的时候才 su, 而是一直用 root 帐号干所有事情,配置系统,安装程序,浏览网页,玩游戏,编程 ……
结果有一天,他不小心在某个系统目录使用了 rm * ... 后果不堪设想……
8.不要用商业的眼光来看 Linux
Linux 不是商业软件,所以不要用要求 Solaris, Windows 那样的眼光来看 Linux. 自由软件的作者们从来不拉拢用户,他们对用户不负有任何责任。实际上在自由软件的世界里,“开发者”和“用户” 并没有明确的界限,大家是朋友。
自由软件很可能只是满足作者和他的朋友的需要,甚至是为了好玩而创造的。自由软件不是完美的,自由软件承认自己有缺点,它不会自吹自擂,蒙蔽“用户”的耳目。这种对作者责任的解脱激发了作者的创造力,他们不用过分考虑“向上兼容”,他们往往比背上重重包袱的商业软件结构更合理,技术更先进。
所以当你用某个自由软件遇到困难的时候,不应该埋怨软件的作者,因为他们对你并没有义务。你不应该把自己当成一个挑剔的顾客,而要把自己作为这个软件的顾问和一个和蔼的建议者,这样你才能理解作者写这个程序时的快乐,在遇到问题时向作者反映,帮助他完善这个软件,成为一个快乐的参与者。就像你的哥哥送你一个他用旧了的自行车,你应该珍惜这份友情,而不要在车坏了,或者骑车摔了一跤的时候大骂你的哥哥。如果你真的不能使用这种合作的心态,那么最好不要使用这个软件。
这是一种先进的文化,它包含了互相合作,科学创新的精神。理解这一点不是很容易,很多人往往是因为不能理解这种文化而离开自由软件。这对于作者来说并没有什么损失。
9.干你的正事去
很多人跟我说,你的网页浪费我好多时间来配置这配置那,一会儿是 FVWM,一会儿是 Mutt ……
嗯……那些东西都是我有空的时候一点一点积累的,如果你想一次性搞定所有那些东西,恐怕得花你几个星期甚至几个月的时间!并不是一定要搞定所有这些东西你才能正常工作的。除非你真的非得利用某个程序,或者你闲着没事,否则你可以不管这些东西。
上面几条仅供参考
以上只是个人意见,不一定适合所有人。取舍由你了!让我想起来以前还在打魔兽的时候练习过左手掌按Ctrl和shift, 双指点鼠标左键 等等操作,说起来跟用hjkl移动vi光
标的意思好像差不多. 从本质上并不能提高什么,更多的只是“看起来”和“感觉上”更厉害.
不过,没有经历过那一段,可能也到不了后来的程度.
-
Kernel 升级 2.6.27.11之后 aspire one 无法连接上网的问题. - [ubuntu]
2009-02-01
内核升级之后有线无线网都刮掉...
---------------------------------
wifi连接可以通过re compile驱动恢复
cd madwifi-hal-0.10.5.6*/
make
sudo make install
modprobe ath_pci重启搞定
--------------------------------
有线网还不知道怎么搞.....待续.....
当然你还可以用回27.9的kernel..一切正常....
-
ubuntu or fedora? - [ubuntu]
2008-12-16
新的小电脑...想试试fedora10...但是.....Eric大叔说:
Goodbye, Fedora
- From: esr thyrsus com (Eric S. Raymond)
- To: fedora-devel-list redhat com
- Cc: lwn lwn net, editors newsforge com, sjvn vna1 com, editors linuxtoday com
- Subject: Goodbye, Fedora
- Date: Wed, 21 Feb 2007 03:03:50 -0500 (EST)
After thirteen years as a loyal Red Hat and Fedora user, I reached my
limit today, when an attempt to upgrade one (1) package pitched me
into a four-hour marathon of dependency chasing, at the end of which
an attempt to get around a trivial file conflict rendered my system
unusable.
The proximate causes of this failure were (1) incompetent repository
maintenance, making any nontrivial upgrade certain to founder on a
failed dependency, and (2) the fact that rpm is not statically linked
-- so it's possible to inadvertently remove a shared library it
depends on and be unrecoverably screwed. But the underlying problems
run much deeper.
Over the last five years, I've watched Red Hat/Fedora throw away what
was at one time a near-unassailable lead in technical prowess, market
share and community prestige. The blunders have been legion on both
technical and political levels. They have included, but were not
limited to:
* Chronic governance problems.
* Persistent failure to maintain key repositories in a sane,
consistent state from which upgrades might actually be possible.
* A murky, poorly-documented, over-complex submission process.
* Allowing RPM development to drift and stagnate -- then adding
another layer of complexity, bugs, and wretched performance with yum.
* Effectively abandoning the struggle for desktop market share.
* Failure to address the problem of proprietary multimedia formats with
any attitude other than blank denial.
In retrospect, I should probably have cut my losses years ago. But I
had so much history with Red-Hat/Fedora, and had invested so much effort in
trying to fix the problems, that it was hard to even imagine
breaking away.
If I thought the state of Fedora were actually improving, I might hang
in there. But it isn't. I've been on the fedora-devel list for
years, and the trend is clear. The culture of the project's core
group has become steadily more unhealthy, more inward-looking, more
insistent on narrow "free software" ideological purity, and more
disconnected from the technical and evangelical challenges that must
be met to make Linux a world-changing success that liberates a
majority of computer users.
I have watched Ubuntu rise to these challenges as Fedora fell away
from them. Canonical's recent deal with Linspire, which will give
Linux users legal access to WMF and other key proprietary codecs, is
precisely the sort of thing Red-Hat/Fedora could and should have taken
the lead in. Not having done so bespeaks a failure of vision which I
now believe will condemn Fedora to a shrinking niche in the future.
This afternoon, I installed Edgy Eft on my main development machine --
from one CD, not five. In less than three hours' work I was able to
recreate the key features of my day-to-day toolkit. The
after-installation mass upgrade to current packages, always a
frightening prospect under Fedora, went off without a hitch.
I'm not expecting Ubuntu to be perfect, but I am now certain it will
be enough better to compensate me for the fact that I need to learn
a new set of administration tools.
Fedora, you had every advantage, and you had my loyalty, and you blew it.
And that is a damn, dirty shame.
--
Eric S. Raymond-------------------------------------------
另外存:
Eric S. Raymond “五部曲”:《黑客道简史》、《大教堂和集市》、《如何成为一名黑客》、
《开拓智域》、《魔法大锅炉》,
《Eric S. Raymond 五部曲》资源:
1. PDF 文档下载:http://master-zhdoc.googlecode.com/files/eric_raymond_five-0.8.0.pdf
2. TeX 文档下载:http://master-zhdoc.googlecode.com/files/eric_raymond_five-src.0.8.0.tar.gz
3. 项目 master-zhdoc 主页:http://code.google.com/p/master-zhdoc/
4. 项目 master-zhdoc 论坛:http://groups.google.com/group/master-zhdoc?hl=zh-CN -
Traditional IT application systems, either centralized or distributed, do not meet the requirements of dynamically changing social and economic situations.Centralized systems lack reliability. If the centralized controller is broken down, the overall system will be disabled
Kinji Mori proposed a concept of ADS A system composed of subsystems is called a autonomous decentralized system, if it has the following two properties:
· Autonomous controllability. Each subsystem manages itself to achieve its own goal. If any subsystem fails, is repaired and/or newly added, other subsystems can continue running.
· Autonomous coordination. Subsystems can coordinate their individual objectives, and work in a
coordination fashion to optimize their own goals.Subsystems are required to have the following characteristics:
· Equality. The relationship among subsystems is equal, in that no master-slave relation exists among subsystems.
· Locality. Each subsystem decides its behavior by its own controller based on local information. This includes information from the subsystem itself and its neighboring subsystems.
· Self-Containment. Each subsystem has at least the basic control and decision function to manage itself and coordinate with the others.An ADS must meet system requirements such as on-line expansion, fault tolerance and on-line maintenance.
· On-line expansion means that new components or subsystems can join the existing system without suspending the operation of other subsystems.
· Fault tolerance means that even if some subsystems fail, the system can continue running, and its
major performance can still be retained as normal or with a reasonable degradation.
· On-line maintenance means that repairing and testing failed subsystems will not suspend the system operation. -
Bothering meven plug-in warnings - [Maven2]
2008-11-28
Some error that happens when importing Maven projects or when invoking "Update Sources" action.
6/25/07 1:15:44 PM CDT: ERROR mojo-execute : compiler:compile : Compilation failure Unable to locate the Javac Compiler in: C:\Program Files\Java\j2re1.4.2_14\..\lib\tools.jar Please ensure you are using JDK 1.4 or above and not a JRE (the com.sun.tools.javac.Main class is required). In most cases you can change the location of your Java installation by setting the JAVA_HOME environment variable.
-------------------------------------------------------------------------------------
To workaround this you can add -vm argument to Eclipse command line or eclipse.ini. For Eclipse 3.3 it would look something like this:
-showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -vm C:\jdk1.6.0\bin\javaw.exe -vmargs -Xms40m -Xmx256m
-
Plan till 11/08 - [plan]
2008-11-16
-
Embed an Axis2 based Web Service in your Webapp - [Maven2]
2008-11-16
Q: How to Embed an Axis2 based Web Service in your Webapp?
A: Let's try and deploy an Axis2 based simple web service in our own custom webapp. The first thing we need is an entry for the Axis2 Servlet in our web.xml. See snippet below for such an entry and a mapping for the url as well.
<web-app>
Next, We need a simple web service. Let's pick a Book service with 2 operations findBook and getBooks Snippet from BookService.java:
<servlet>
<servlet-name>AxisServlet</servlet-name>
<display-name>Apache-Axis Servlet</display-name>
<servlet-class>
org.apache.axis2.transport.http.AxisServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
</web-app>public Book[] getBooks() {Next we need a deployment descriptor for the BookService. As you can see, you can deploy a POJO using RPCMessageReceiver and you can specify a namespace for the schema as well as for the web service itself.
return new Book[]{onlyBook};
}
public Book findBook(String isbn) {
if (isbn.equals(onlyBook.getIsbn()))
return onlyBook;
return null;
}<serviceGroup>
Next, do we really need to create an aar? An aar is useful for hot deployment and service isolation, but this is an embedded scenario, so we go with the "Exploded deployment option" which means that we create a directory structure inside our WEB-INF as follows:
<service name="BookService"
targetNamespace="http://ws.apache.org/axis2/samples/book/">
<description>Book sample service</description>
<schema schemaNamespace="http://ws.apache.org/axis2/samples/book/xsd/"/>
<parameter name="ServiceClass" locked="false">samples.demo.BookService</parameter>
<operation name="getBooks">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
<operation name="findBook">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
</service>
</serviceGroup>\---WEB-INF
Usually we would have dropped a BookService.aar in the services directory, here we create a directory named BookService and drop the deployment descriptor (services.xml) inside the META-INF directory under it. Hmm, did we forget something? Yes, how about an easy build environment using maven2? Here's the layout of our files for maven2.
| web.xml
|
\---services
\---BookService
\---META-INF
services.xml\---book
All the jars needed as dependencies are automatically downloaded by maven2 from the Apache and Ibiblio respositories. So you don't even have to download Axis2 dist to build and deploy this sample. All you need to do is unzip the zip below and run
| pom.xml
| README
|
\---src
+---main
| | log4j.properties
| |
| \---samples
| \---demo
| Book.java
| BookService.java
|
+---test
\---webapp
\---WEB-INF
| web.xml
|
\---services
\---BookService
\---META-INF
services.xml$ mvn install war:war
then rename the resultant war as axis2.war and drop it into any servlet engine. Once your servlet engine starts, you can view the wsdl for your service at:http://yourhost:port/axis2/services/BookService?wsdl
Enjoy! Please drop an email to axis-dev@ws.apache.org if you run into problems or have comments.
Please download the entire zip here: book.zip
-
log4j in Axis2 - [Axis2]
2008-11-16
Re: Axis2 1.3 Log4J WARNS
JaviMetal
Mon, 15 Oct 2007 06:06:08 -0700The option of copying the file into the src file didn't work (despite it was
copied automatically into the classes' directory) but doing the Add external
folder solution has been enough fortunately, and the WARN messages don't
appear now.
Thank you very much Upul!!
Upul Godage wrote:
>
> Or the best option, copy the log4j.properties file to the projects src
> directory. Then it will be copied to the classes directory automatically
> and available in the classpath.
>
> These are all solutions to client-side.
>
> Upul
>
>
> On 10/15/07, Upul Godage <[EMAIL PROTECTED]> wrote:
>>
>> In run dialog, classpath tab, click advanced button.
>> Select Add external folder and add the folder where log4j.properties is
>> in
>> (folder should not contain unwanted classes)
>>
>> Or
>>
>> Make a jar out of log4j.properties file and add it as a jar.
>> jar cf log4jprops.jar log4j.properties
>>
>> Upul
>>
>>
>> On 10/15/07, JaviMetal < [EMAIL PROTECTED]> wrote:
>> >
>> >
>> > Hello everybody:
>> >
>> > First of all, I know that already exist some post about this problem,
>> > but I
>> > can't solve it.
>> >
>> > I have implement a client and when I run it I get the following
>> messages
>> > ...
>> >
>> > log4j:WARN No appenders could be found for logger
>> > (org.apache.axis2.description.AxisService).
>> > log4j:WARN Please initialize the log4j system properly.
>> >
>> > ... followed by my service response. I mean that the service works
>> > properly,
>> > but according with what I've read in other posts, I need to include a
>> > file
>> > called log4j.properties in the classpath. And my question is: how? I'm
>> > using
>> > Eclipse and it only lets me include .jar files to the classpath.
>> >
>> > Any help will be welcome. Thank you very much
>> > --
>> > View this message in context:
>> > http://www.nabble.com/Axis2-1.3-Log4J-WARNS-tf4626262.html#a13210291
>> > Sent from the Axis - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>
>
--
View this message in context:
http://www.nabble.com/Axis2-1.3-Log4J-WARNS-tf4626262.html#a13212327
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED -
[转] axis2 的问题.. - [Axis2]
2008-11-14
在网上看到了三种不同的做法.一种是首先编写服务器端的类.然后写.services.xml 打包打包发布,接着在cmd下面输入命令,就可以自动生成客户端的代码."我打包成.aar发布成功.通过http://localhost:8080/axis2/services/HWS?wsdl可以看到他的 WSDL文件信息.用CMD命令 进入到 axis2-std-1.0-bin.zip 解压包中执行:wsdl2java.bat -uri http://localhost:8080/axis2/services/HWS?wsdl -o F:\ -p Stub但是我出现的有六个文件
HWSHWSHttpport1CallbackHandler.java
HWSHWSHttpport1Stub.java
HWSHWSSOAP11Port_httpCallbackHandler.java
HWSHWSSOAP11Port_httpStub.java
HWSHWSSOAP12Port_httpCallbackHandler.java
HWSHWSSOAP12Port_httpStub.java只有两个才对HWSCallbackHandler.javaHWSStub.java"二种是用eclipse中的插件自动的生成.“很显然这篇文章被抄了N遍了.我也照着做了.打包发布都成功了.但是我在运行的时候有错 ,他推荐用junitl测试.但是我把测试的写成了main方法仍然还有人说是找不到main 方法.写一个.显然是有撒.我最后又用aixs2-1.0和axis2-1.2分别测试.还是没有成功, 不解”三种是是直接写客户端和服务器端的代码.--------------------------------------------------------------------------------------------Actually there are two ways here:Bottom-up ( java code first) or Top-down(schema/wsdl first).Either one can be done with eclipse axis2 plug-in.It is so true that there are much better developer communities inwestern countries than china. There're just too much copy&pastearticles with confusing/wrong sentences and not working examplesin CSDN blogs or other similar place( perfectly looks like here? -p-).I feel like those example codes are never verified even by posters themselves.More important , posters are never response comments ,well, just looks asthey totally have no idea what they have posted. This probably part of thereason why open source are in such far away from china.We need to realizenormal geek sucks, real gurus and hackers cool.








