与 Oleg的聊天记录 结果出来了。

上周二晚上,对comodo的面试,持续了2个半小时,MSN, 18点到 20点30.

今天(这周二晚上收到了拒信),还是自己的Rails基础不牢固。啥也不说了。

Johnson 还是很够意思的,当时就说要我了。不过看来。。。帮不上他了。:)

慢慢来吧。 身体好了,什么都有。我坚信。


2009-12-1 18:33:18 收到拒信了 :) 还是我自己的问题,Oleg问的几个问题我答得不好
2009-12-1 18:33:38 谢谢你对我的看重 :) 祝你工作一切顺利~
2009-12-1 18:35:14   啊?!Oleg给你发的吗?
2009-12-1 18:35:26   啊? 你不知道吗?
2009-12-1 18:35:39    申思维,您好! 我们是美国科摩多安全方案公司。非常感谢您来参加我公司的

面试。 经过面试觉得ROR工程师这个职位和您不是很合适,我们已经将您的简历存入简历库,希望下次可

以合作。 感谢您对我公司的关注! 祝, 好! HR Dep. COMODO China Email:[email protected]

COMODO Creating Trust Online www.comodo.com
2009-12-1 18:35:44    这两天忙,没顾上问
2009-12-1 18:36:02 没关系了。 呵呵。。。。 非常感激你的那句“希望你过来帮忙”
2009-12-1 18:36:23    siwei (L) China    以后如果有健康方面的问题,欢迎找我。我这半年在养生

治病方面有小成。
2009-12-1 18:36:49    johnson    呵呵,行,保持联系。那也只好先这样了,我回头问问我们HR情况
2009-12-1 18:37:05    你的眼睛只要晚上注意早睡觉,平时注意补肾,就没有大问题。 现在可以说了


2009-12-1 18:37:37    既然结果已定也没什么了,非常感谢了! 希望没打扰到你,祝你工作顺利:P
2009-12-1 18:37:54    行,我一定注意。也祝你好运,我先回家
2009-12-1 18:38:00    88
2009-12-1 18:38:03    好的。谢谢!!! bye~~

siwei   China 说:
Nice to meet you , Oleg,
[email protected] (电子邮件地址未验证) 说:
Hi Siwei
siwei   China 说:
I am ready for the interview.
[email protected] (电子邮件地址未验证) 说:
Could you a little introduce your self?
siwei   China 说:
Of course. I was graduated from South China University which is a top20 university in china 4 years ago.
and my major is Computer Science.
after my graduation, I have been working on the web application , using J2EE for 3 years ,and Ruby on Rails for 1 year
I am good at English, fast learning, fast debugging and optimzing,
[email protected] (电子邮件地址未验证) 说:
where was your previous work places?
siwei   China 说:
also including the agile methodoloy such as TDD, refactoring, and continue integration.
Well, my previous job was also in Beijing, a company that works on the web application.
[email protected] (电子邮件地址未验证) 说:
could you show a few your web applications?
siwei   China 说:
sorry, most of them are used in the internal network. we can't acess them throw the internet unless you are sitting in their office
but I can show you some of the screenshots if you want to , maybe later
[email protected] (电子邮件地址未验证) 说:
maybe you can tell something about these applications?
siwei   China 说:
the people using my web applications includes "CHINA MOBILE" and "SHANGHAI VOLKSWAGEN"
yes of course.
My web applications includes: weblog, bidding system, customer management system, bbs, and similiar ones.
some of them were written in J2EE, and some in ruby on rails.
In my opinion, all of them looks like the same:
[email protected] (电子邮件地址未验证) 说:
ok, which of them was created on Ruby?
siwei   China 说:
ok.
a weblog, and a bbs .
I finished them in the spring of this year.
they are designed to be a web application that can be easily modified and added to new features.
[email protected] (电子邮件地址未验证) 说:
Ruby applications were created for some company or it was your project?
siwei   China 说:
mine
I want to upload them to the www.sourceforge.net and let other people use them
they will be open-sourced in 10 days, if possible.
[email protected] (电子邮件地址未验证) 说:
what features are in your weblog?
siwei   China 说:
Well, it has the most commonly used features.
such as : post, comment, add tags, add photos, flashes, musics, and upload files.
It is easy to maintain and add new feature.
and about 2 weeks ago, I was working on it to add a new feature: changing the skin.
[email protected] (电子邮件地址未验证) 说:
which plugins / gems did you use for your weblog?
siwei   China 说:
but, you know, now I am busy for the job, so my work stoped.
yeah,
I used several plugins in during my development.
such as : willing pagination, a plugin for paginating the results queried from the database.
and "nested_params ","attribute_fu" plugin for the complex forms.
and another plugin named "??Hill" plugin which can easily profile and optimize the ruby performance
   sorry I am not sure about this plugin
[email protected] (电子邮件地址未验证) 说:
why not sure?
siwei   China 说:
because its name is strange for chinese people
wait a moment.
[email protected] (电子邮件地址未验证) 说:
ok, I see, I do not know this plugin
siwei   China 说:
if you have time to wait, I can search its name for you.
[email protected] (电子邮件地址未验证) 说:
do not worried about it
siwei   China 说:
hehe.... okay
[email protected] (电子邮件地址未验证) 说:
why you decided create a blog on Ruby?
As I understand it was a first your project on Ruby?
siwei   China 说:
yes, my first project on Ruby.
the reason is , if I told others I was a ruby on rails programmer, but using a PHP blog,
what will others think?
[email protected] (电子邮件地址未验证) 说:
have you any other application on RoR?
siwei   China 说:
and it is the web application that the rails is good at, better than other language.
yes, a bbs, which was finished shortly after my ruby blog.
[email protected] (电子邮件地址未验证) 说:
please describe what was done in the bbs
siwei   China 说:
it has the most commonly used features as other bbs has.
such as:to create a thread,to post comments, upload files, supporting html content,
and security sub-system(login & logout),
and user's register.
[email protected] (电子邮件地址未验证) 说:
was any authentication for users?
siwei   China 说:
yeah of course. but I didn't use any authentication plugins for this,
[email protected] (电子邮件地址未验证) 说:
how you did it?
siwei   China 说:
cause I don't want it to be a heavily component.
just implement it as rail's guide
[email protected] (电子邮件地址未验证) 说:
all registered users have the same permissions?
siwei   China 说:
oh no. there are surely several different roles
such as : admin, who can manage all the thread, do CRUD operations to users and so on.
general user: who has less permissions, e.g.: create threads, post comments, manage his information.
[email protected] (电子邮件地址未验证) 说:
how you check permissions and when?
siwei   China 说:
I used filters in actions.
filter is a useful feature that the Controller supplier.
[email protected] (电子邮件地址未验证) 说:
could you describe models for users/permissions ?
siwei   China 说:
Because my bbs is not a complex and hug one, I just implement it in a simply way
yes.
there are models as below:
user's attributes: username, password, other necessary informations.
(of course user model has "id")
role's attributes: name, id.
and there is a 3rd model: url_map : user_id, role_id, url
these three models consists of the authentication feature.
   am I clear?
[email protected] (电子邮件地址未验证) 说:
ok, what happened in Controller's filter?
siwei   China 说:
I borrowed the idea from a famouse java lib: acegi.
[email protected] (电子邮件地址未验证) 说:
How do you check a roles?
siwei   China 说:
in the before_filter of an action.
when a request comes in, the filter will check it,
and so that it will tell Rails whether to process it in action, or not(render a login page)
[email protected] (电子邮件地址未验证) 说:
Did you investigate a logs? How many SQL requests were for database during checking roles?
siwei   China 说:
not so much SQL requests , because I used the CACHE,
both on the side of db and rails.
[email protected] (电子邮件地址未验证) 说:
great, please explain it in details, how did you use cache for roles
siwei   China 说:
yes, cache is really important in the applications.
this idea comes from another famous 3rd lib: OSCACHE.
by this idea I used a HASH in ruby.
this HASH is contains the username as the key , and its password as the value.
when the filter works, it firstly check this role-HASH,
if there's no record, it secondly check the database.
simple, but effecitve.


[email protected] (电子邮件地址未验证) 说:
but how did you keep and check data in cache?
siwei   China 说:
I like cache and tried to use it in all my applications.
[email protected] (电子邮件地址未验证) 说:
you told you checked a key in HASH
siwei   China 说:
okay, let me explain it.
for example, if there is a username "apple" and its password is"123456"
they will be cache in the HASH and ["apple","123456"]
so the filter just need to see whether the username and password can match the record in the HASH
[email protected] (电子邮件地址未验证) 说:
ok, could admin add new roles for registered user?
siwei   China 说:
this feature is not yet added ,
for now, it just a simple bbs .   keep it simple, keep it easy to use
but this need is easy to implement
[email protected] (电子邮件地址未验证) 说:
lets imagine that this feature exists
siwei   China 说:
I do have a role's management(CRUD operation)
[email protected] (电子邮件地址未验证) 说:
in such case admin will be able add new role to user "apple"
siwei   China 说:
okay, please go on
[email protected] (电子邮件地址未验证) 说:
for example: "apple" should have access to controller 'CRUD for comments'
siwei   China 说:
yeah,
[email protected] (电子邮件地址未验证) 说:
how it has to be implemented, and what changes have to be for caching ?
siwei   China 说:
it
is easy to do that.
to give this permission to "apple" ,
first: change apple's role to be a new one which can CRUD the comments.
second: add this new role to the url_map which I mentioned just now
there is no need to change the "cache" code. because the cache will smart enough
to know which record is not cached before and which is cached already.
(the cache system caches all of the 3 models: user, role, url_map)
need I give a example?
[email protected] (电子邮件地址未验证) 说:
no, thanks
siwei   China 说:

[email protected] (电子邮件地址未验证) 说:
how did you keep password in the database?
siwei   China 说:
in hex encoded format, not the plain text of course.
[email protected] (电子邮件地址未验证) 说:
ok, what do you know about partial rendering?
siwei   China 说:
its a important part of rails' layout.
partial can reduce the adundent codes of the view.
when rendering the "edit" and "new"page,
[email protected] (电子邮件地址未验证) 说:
ok, lets take list of comments from weblog as example
siwei   China 说:
we can use partial to generate the two forms.
okay, please go on
[email protected] (电子邮件地址未验证) 说:
where can we use partial rendering in our example? and could we use caching for VIEW in such case?
siwei   China 说:
I didn't use partial rendering in this example.   sorry
of course rails has its own caching strategy for the VIEWs.
there are two way I used "partial"
1.to render the new and edit forms of the same model.
2.to render the buttons.
if it is indeed needed, I would use this feature as possible as I can.
[email protected] (电子邮件地址未验证) 说:
ok
what about routes.rb?
siwei   China 说:
I prefer the RESTful style.
[email protected] (电子邮件地址未验证) 说:
have you modify it?
siwei   China 说:
yes, I modified it, but not too many.
[email protected] (电子邮件地址未验证) 说:
could you describe named routing?
siwei   China 说:
yes
named routing is a more readable and flex
when using this feature, we can change one url to the specific action.
for e.g. , we can point a url like "adminpost/1/edit" to "admin"controller's edit action,
by adding this route to route.rb:
map.adminpost_edit '/adminpost/:id/edit' ,:controller=>'admin',:action=>'edit'
(I am not sure about the code I wrote,   maybe there is a small spell mistake)
[email protected] (电子邮件地址未验证) 说:
what about resources ?
siwei   China 说:
can you repeat it in detail?
[email protected] (电子邮件地址未验证) 说:
you prefer RESTful style, so I think you used resource in routes.rb
siwei   China 说:
oh yeah,
[email protected] (电子邮件地址未验证) 说:
I mean , the situation, when you need not describe path for every CRUD actions
siwei   China 说:
you mean the resource in routing.
[email protected] (电子邮件地址未验证) 说:
yes
siwei   China 说:
map.resource :comments
[email protected] (电子邮件地址未验证) 说:
give me an example, please
ok
siwei   China 说:
this will let rails' routing system know that there is a RESTful routing for the book's CRUD
[email protected] (电子邮件地址未验证) 说:
I would like to extend this resource in routing
I want to create a URL http://localhost:3000/my_comment , this controller has to show all my comments
how can you implement it?
siwei   China 说:
If I was permissed to change this url to : ..../my/comments   the answer will be very easy
If this url can not be changed,
[email protected] (电子邮件地址未验证) 说:
http://localhost:3000/my_comment will be ok also
siwei   China 说:
well, it will take a bit more time to resovle.
[email protected] (电子邮件地址未验证) 说:
ok, you told you allow to upload images/audio/video to your web application
did you use any gem for that?
siwei   China 说:
the question above... I don't need to resovle?    okay
[email protected] (电子邮件地址未验证) 说:
if it will takenot to much time you can
siwei   China 说:
I used the "FCK"editor, but not any gems or plugins.
thanks, let me get into that question and will give you the answer step by step.
If not using the RESTful style but the regular one, my answer is:
step1. create a route that mapping "my_comments" to a list_all action of a user controller
step2. make sure the associations between the User model and Comment model is correct.
step3. finish the action and the view.
that's all.
[email protected] (电子邮件地址未验证) 说:
sorry Siwei, but I need not all steps
I need only step 1 in details
siwei   China 说:
hehe ... okay , please
you mean you want to use the regular routing?
map.connect '..../my_comments',:controller=>'user',:action=>'list_all'

am I right? omunt?
[email protected] (电子邮件地址未验证) 说:
do you know something about member/collection for resources?
BTW: my name is Oleg   and your Siwei, am I correct?
siwei   China 说:
yeah, sorry for my mistake.
member and collections are the options for customizing the routing.
[email protected] (电子邮件地址未验证) 说:
I know, but how we can use it for creating this routing?
siwei   China 说:
okay ,let me try
[email protected] (电子邮件地址未验证) 说:
BTW: sometime it is difficult for me also understand where is first name/last name in China
siwei   China 说:
hehe .... siwei is my first name, my last name is not written in MSN nickname.
map.resource :comments , :member =>{:index=>:get}, :collection =>{:index=>:get}
[email protected] (电子邮件地址未验证) 说:
part from http://api.rubyonrails.org/ ?
siwei   China 说:
I didn't use these options so much,   maybe not correct
[email protected] (电子邮件地址未验证) 说:
ok
siwei   China 说:
no. I typed there word by word.
[email protected] (电子邮件地址未验证) 说:
what can you say about this string
has_one :trustconnect_account,
    :include => [:trustconnect_traffic_hours, :trustconnect_traffic_days, :trustconnect_traffic_months]

what does it mean?
siwei   China 说:
chinese's network is not so good to visit that website in the interview    hehe
this is a segment of code from a model file.
this model has a one to one relation to trustconnect_account
[email protected] (电子邮件地址未验证) 说:
of course, but most important why there is iclude
include
siwei   China 说:
this is about a concept :
"preload"? or named as "immediately load" when querying data
and the included things are the second level of the association.
that's all.
[email protected] (电子邮件地址未验证) 说:
could you tell what SQL request must include in such case?
siwei   China 说:
yes
in such case, the database will execute the SQL as below:
select * from THIS_MODEL_NAME join trustconnect_account account on id=account.THIS_MODEL_NAME_ID
trustconnect_traffic_hours, :trustconnect_traffic_days, :trustconnect_traffic_months]

[email protected] (电子邮件地址未验证) 说:
ok
siwei   China 说:
sorry sended wrong text
and there also has queries for ....days, ...months
[email protected] (电子邮件地址未验证) 说:
ok, I just need JOIN in request
siwei   China 说:
ok
[email protected] (电子邮件地址未验证) 说:
what difference between delete_all and destroy_all?
siwei   China 说:
one will delete the data in the db and another won't,just destroy the class instance.
[email protected] (电子邮件地址未验证) 说:
are you sure?
records in the database will be saved?
siwei   China 说:
I think so.   
[email protected] (电子邮件地址未验证) 说:
you are wrong
siwei   China 说:
if not, I will return to check the rails document
hehe .... sorry... I will check the doc later.
[email protected] (电子邮件地址未验证) 说:
did you use find_by_sql?
siwei   China 说:
no
I always use rails' query interface
[email protected] (电子邮件地址未验证) 说:
ok
siwei   China 说:
but not use the plain SQL
[email protected] (电子邮件地址未验证) 说:
what about transactions? did you use them?
siwei   China 说:
no, a blog and a bbs is not need to used this feature.
but I did read this section of doc.
[email protected] (电子邮件地址未验证) 说:
ok, when we need it?
siwei   China 说:
for the condition that is very strict ,allow no operation mistakes
[email protected] (电子邮件地址未验证) 说:
an example please
siwei   China 说:
e.g. in a application used by a bank
if a customer want to tansfer money from his account to another account,
there are 2 even will occur:
1. his account's money will reduce ,
2. the target's account's money will increase.
if the step1 failed, this transacation should rollback
otherwise ,..... you know    the customer surely will got angry that his money has gone
oh, sorry,
my mistake.   if the step2 failed,
typing mistake.
[email protected] (电子邮件地址未验证) 说:
ok, what can you tell about: skip_before_filter
filter_parameter_logging
siwei   China 说:
as their name described,
[email protected] (电子邮件地址未验证) 说:
when we need them?
siwei   China 说:
skip_before_filter allows the request to skip the before filter.
and the filter_parameter_logging checks the parameter in a coming in request, to see whether all the needed parameters are ready
we can use filter_parameter_logging when in the user authentication situation.
and the "skip_before_filter" we can use in this case:
if you allow someone who is not the user to visit some url.
you don't need to use this before_filter,just give him the content to view ,and a url for rigistion.
my answer is done
[email protected] (电子邮件地址未验证) 说:
ok, what about exceptions, how did you used them?
siwei   China 说:
I didn't use too much "rescue" for the exceptions in actions,
but to configure the exception-page for all the exceptions.
[email protected] (电子邮件地址未验证) 说:
what can you tell about Ajax?
siwei   China 说:
yes, I do have something to say about Ajax./
[email protected] (电子邮件地址未验证) 说:
when it is necessary use it?
siwei   China 说:
in one side, Ajax is a very good technology for the website that has hug visitors.
for example, google'map is used Ajax and saved many bandwidth
but in another side, Ajax is based on the browser and javascript. this caused a problem that it's not easy to write the competable code for all the browsers.
I think this is its weakpoint: there is not so many good javascript programmers ,
[email protected] (电子邮件地址未验证) 说:
ok, you told you like TDD
siwei   China 说:
so there are many bad javascript codes , which makes user's experience too bad(slow speed, let your browser shut down with no reason )
yes, TDD is the most useful methodoly during my past works.
[email protected] (电子邮件地址未验证) 说:
can you tell me about your experience in TDD?
siwei   China 说:
It makes my code optimized and easy to maintain.
yes, my experience is: use TDD all the time.
[email protected] (电子邮件地址未验证) 说:
does it mean, that you start write a weblog from tests?
siwei   China 说:
yes, starts from the tests generated by Rails.
[email protected] (电子邮件地址未验证) 说:
which kind of test do you know in Rails?
siwei   China 说:
I write some code, and run the test, then add more code , and then test again and so on ...

controllers' test as the functional test, model's test as the unit test,
and also has the helper's test.
[email protected] (电子邮件地址未验证) 说:
what did you test in functional tests?
siwei   China 说:
I can't imagine a rails' project without the controllers' and the models' test.
[email protected] (电子邮件地址未验证) 说:
I mean , how did you separated this part I should test in unit test, this part in fuctional test should be
siwei   China 说:
I write the testcases which asserts if the render result is correct, if request is correct
very easy. unit test is to test the models, you can just write the asserts about the CRUD operation
and functional test is to test the controllers, I described just now.
[email protected] (电子邮件地址未验证) 说:
what about integration tests?
siwei   China 说:
continues integration is another important part of the Agile methodology.
it run all the tests all the time and all the days,
if someone submit new tests to the project on the CVS/SVN server.
[email protected] (电子邮件地址未验证) 说:
did you write rspec / stories?
siwei   China 说:
It let the manager or the leader immediately know somewhere got wrong when there is a bug was submitted.
stories card of Agile ?
[email protected] (电子邮件地址未验证) 说:
no, stories for rspec tests
siwei   China 说:
rspec is short for?
[email protected] (电子邮件地址未验证) 说:
at the last time developers start to use Cucumber for that
rspec - other type of tests
siwei   China 说:
oh, I see. I ever wrote the html-tests which is for the front-end pages.
but not too much, as a programmer there is always not enought time for the front-end side.
there are functional-testers and web-designers to do this kind of job.
  
[email protected] (电子邮件地址未验证) 说:
ok, thanks a lot for spending time
siwei   China 说:
hehe ..... thanks for your time very much.
[email protected] (电子邮件地址未验证) 说:
the last: could you prepare a few parts from your code
and send it by email
siwei   China 说:
no problem.
[email protected] (电子邮件地址未验证) 说:
my email: [email protected]
I will inform Johnson and Yama, about result and they will connect with you
but, please try to include your code, not generated
siwei   China 说:
I sent it in 2 days, okay?
[email protected] (电子邮件地址未验证) 说:
ok
siwei   China 说:
haha .... got it. my code ,but not the rails'.
[email protected] (电子邮件地址未验证) 说:
yeah, thank you again, bye
siwei   China 说:
thanks and good night~ /bye