2009年3月25日 星期三

memcached性能测试

找了一台机器测试了一下memcached的效果,测试数据共30000条,大概是100m左右,设置的memcache内存为300m,在实际运行过程中占用了200m左右,也就是说每1m数据用memcached放在内存中后就会变成2m,这应该是包括建立索引等等需要的空间。

程序是随机访问数据库,对于non-memcache,循环100w次需要3000秒,而对于memcache,循环1000w次才需要3000秒,所以对于内存大于数据库两倍的情况下,这时候如果把所有数据都放在内存中而且设置成不失效的话,那么使用memcache的速度可以是non-memcache的速度的10倍,但是在实际情况下,因为硬盘数据远远大于内存数据,而且设置的失效时间可能会影响hit的成功率,特别是当访问量很小的时候,使用memcached反而会使程序整体速度变慢。

在使用windows下的memcached的时候,发现不管怎么设置memcached,给予memcached都是固定的64m(也就是memcached的默认值),很奇怪,不知道有什么解决办法,后来就放在Mac OS X 10.5.6上进行的测试(硬件是:AMD 3000+ ,2G DDR667内存,500G SATA2 7200硬盘)。

所以,对于小型网站,最好不要使用memcached, 特别是内存远小于频繁数据(这些数据都会被用户频繁读取)的时候。当然,对于日访问量上千万我觉得使用memcached确实可以达到很好的效果,而且加上采用分布式的话,这样共享的内存可以更大,效果会更好,还有一点,当内存小于硬盘数据的时候,CPU的占用率会突然变高,可能是因为要执行LRU算法(也就是替换原来内存中的数据)。很多东西都要在实际中才能知道,我也是通过了这次测试才发现原来memcached并不适合我先改进的一个小型网站(日访问量也就100w)。

2009年3月16日 星期一

memcached介绍

今天翻译了一小段,接下来会慢慢翻译完的。。。

protocol
-----------
协议

Clients of memcached communicate with server through TCP connections.
(A UDP interface is also available; details are below under "UDP
protocol.") A given running memcached server listens on some
(configurable) port; clients connect to that port, send commands to
the server, read responses, and eventually close the connection.
Memcached的客户端通过TCP连接和服务端进行通信(UDP接口也是可用的,具体可以参考UDP协议)。已经运行memcached的server会 监听(配置的)端口;客户端连接那个端口,发送命令,读取回复,最终关闭连接。

There is no need to send any command to end the session. A client may
just close the connection at any moment it no longer needs it. Note,
however, that clients are encouraged to cache their connections rather
than reopen them every time they need to store or retrieve data. This
is because memcached is especially designed to work very efficiently
with a very large number (many hundreds, more than a thousand if
necessary) of open connections. Caching connections will eliminate the
overhead associated with establishing a TCP connection (the overhead
of preparing for a new connection on the server side is insignificant
compared to this).
要终结一个对话,并不需要客户端发送任何的命令。客户端可以在它不再需要通信的时候关闭这个连接。当然,我们鼓励客户端将他们的连接缓存起来而不是当他们每次需要存储或者取数据的时候都重新打开一个连接,因为memcached设计的初衷就是为了提供一个高效的、支持大量连接的东东^_^。连接缓存化(caching connections)可以使得因为建立TCP连接而出现的过载现象消失。

There are two kinds of data sent in the memcache protocol: text lines
and unstructured data. Text lines are used for commands from clients
and responses from servers. Unstructured data is sent when a client
wants to store or retrieve data. The server will transmit back
unstructured data in exactly the same way it received it, as a byte
stream. The server doesn't care about byte order issues in
unstructured data and isn't aware of them. There are no limitations on
characters that may appear in unstructured data; however, the reader
of such data (either a client or a server) will always know, from a
preceding text line, the exact length of the data block being
transmitted.
Memcache协议里面存在这两种可以被传输(发送)的数据:文本行(text lines)和未结构化数据(unstructure data)。文本行主要用于客户端向服务器发送命令和服务器返回信息给客户端。未结构化数据则是在客户端想要存取数据的时候才被使用(发送)。服务器会将未结构化数据以一种比特流的方式传输给客户端(这种方式和它从客户端接受数据的方式是一样的)。服务器并不关心比特流的所导致的未结构化数据,也不会意识到他未结构化的数据,未结构化数据中的字符也没有任何限制。当然,不管是客户端还是服务器来的数据,读者(reader)总是可以通过预先处理的文本行(可能例如client发送一个get_length(object)来获得这个数据块的长度,然后server处理以后直接返回长度,再传输数据)来得知被传输的数据块的长度。

Text lines are always terminated by \r\n. Unstructured data is _also_
terminated by \r\n, even though \r, \n or any other 8-bit characters
may also appear inside the data. Therefore, when a client retrieves
data from a server, it must use the length of the data block (which it
will be provided with) to determine where the data block ends, and not
the fact that \r\n follows the end of the data block, even though it
does.
文本行总是由\r\n作为结尾。未结构化数据也可以使用\r\n,即使是是\r,\n甚至是任何8bit长的字符都能出现在未结构化数据中。所以当客户端从服务器获得数据的同时,它必须使用服务器返回的数据块长度来确定什么时候数据块结束了,而不是用\r\n来决定数据块的完结,虽然事实上我们就使用\r\n来作为数据块的末尾的。

Keys
----
键值
Data stored by memcached is identified with the help of a key. A key
is a text string which should uniquely identify the data for clients
that are interested in storing and retrieving it. Currently the
length limit of a key is set at 250 characters (of course, normally
clients wouldn't need to use such long keys); the key must not include
control characters or whitespace.
存储在memcached中的数据是通过键值来识别的。所谓的键值就是唯一的文本字符串,这个字符串必须在用户存取数据的时候能唯一的确定数据。当前键值的长度被限制在250个字符,键值不能包括控制符和空格。


Commands
--------
命令行

There are three types of commands.
总共有三种命令
Storage commands (there are six: "set", "add", "replace", "append"
"prepend" and "cas") ask the server to store some data identified by a key. The client sends a command line, and then a data block; after that the client expects one line of response, which will indicate success or
faulure.

存储命令(总共有6个:set,add,replace,append,prepend和cas)是让服务器根据某个键值去存储数据。客户端首先发送一个命令,然后数据块;接着服务器会返回信息,告诉客户端时不时成功了。

Retrieval commands (there are two: "get" and "gets") ask the server to
retrieve data corresponding to a set of keys (one or more keys in one
request). The client sends a command line, which includes all the
requested keys; after that for each item the server finds it sends to
the client one response line with information about the item, and one
data block with the item's data; this continues until the server
finished with the "END" response line.
读取命令(总共有两个:get和gets)让服务器根据一系列的键值去获得数据。客户端首先发送一个包含键值(可以有多个)的命令,之后对于服务器所找个的每个item,服务器会返回给客户端这个item的信息,然后是item的数据库,知道服务器返回END这个命令,说明数据已经传输完毕。

All other commands don't involve unstructured data. In all of them,
the client sends one command line, and expects (depending on the
command) either one line of response, or several lines of response
ending with "END" on the last line.
其他所有的命令都不包括未结构化数据。客户端先发送命令,然后期望获得一个或者多个回应,这些回应会以END作为结尾。

A command line always starts with the name of the command, followed by
parameters (if any) delimited by whitespace. Command names are
lower-case and are case-sensitive.
命令行通常是以命令作为开头,后面跟着各种的参素。命令都是小写字母而且是大消息敏感的。

Expiration times
----------------
过期时间

Some commands involve a client sending some kind of expiration time
(relative to an item or to an operation requested by the client) to
the server. In all such cases, the actual value sent may either be
Unix time (number of seconds since January 1, 1970, as a 32-bit
value), or a number of seconds starting from current time. In the
latter case, this number of seconds may not exceed 60*60*24*30 (number
of seconds in 30 days); if the number sent by a client is larger than
that, the server will consider it to be real Unix time value rather
than an offset from current time.


Error strings
-------------

Each command sent by a client may be answered with an error string
from the server. These error strings come in three types:

- "ERROR\r\n"

means the client sent a nonexistent command name.

- "CLIENT_ERROR \r\n"

means some sort of client error in the input line, i.e. the input
doesn't conform to the protocol in some way. is a
human-readable error string.
意味着客户端在输入命令的时候出现了错误,例如输入没有在某些地方没有遵从协议。

- "SERVER_ERROR \r\n"

means some sort of server error prevents the server from carrying
out the command. is a human-readable error string. In cases
of severe server errors, which make it impossible to continue
serving the client (this shouldn't normally happen), the server will
close the connection after sending the error line. This is the only
case in which the server closes a connection to a client.
意味着服务器方面的错误使得这个命令没有被执行。对于一些非常严重的错误,这些错误使得服务器没法在为客户端提供服务了,这时候服务器就会先发送错误信息,然后关闭它和客户端的连接,这也是服务器唯一会主动关闭连接的情况

In the descriptions of individual commands below, these error lines
are not again specifically mentioned, but clients must allow for their
possibility.
在下面对每个单独命令的描述,这些错误提示不会再被详细的体积,但是客户端必须考虑到他们出现的可能。

Storage commands
----------------
存储命令
First, the client sends a command line which looks like this:
首先,客户端发送一个类似于下面的命令
[noreply]\r\n
cas [noreply]\r\n

- is "set", "add", "replace", "append" or "prepend"
命令名称可以使set,add,replace,append或者prepend

"set" means "store this data".
Set是存储数据
"add" means "store this data, but only if the server *doesn't* already
hold data for this key".
Add是如果是这个键值没有对应的数据,那么可以存储这个数据

"replace" means "store this data, but only if the server *does*
already hold data for this key".
Replace是如果这个键值有对应的数据,那么可以替换这个数据

"append" means "add this data to an existing key after existing data".
Append是指在原有的数据后面添加

"prepend" means "add this data to an existing key before existing data".
Prepend是指在原有的数据前面添加

The append and prepend commands do not accept flags or exptime.
They update existing data portions, and ignore new flag and exptime
settings.
Append和prepend这两个命令都不接受标记(flasg)和过期时间(exptime)。
他们会更新现存数据,同时忽略新的标记和过期时间。

"cas" is a check and set operation which means "store this data but
only if no one else has updated since I last fetched it."
Cas是一个检查和设置操作,这个命令仅仅在数据被我取出以后,没有人更新过这个数据的时候,才可以存储数据,也就是说如果A取了这个数据,B更新了,A就不能存储了。

- is the key under which the client asks to store the data
是客户端要求存储数据时用的键值

- is an arbitrary 16-bit unsigned integer (written out in
decimal) that the server stores along with the data and sends back
when the item is retrieved. Clients may use this as a bit field to
store data-specific information; this field is opaque to the server.
Note that in memcached 1.2.1 and higher, flags may be 32-bits, instead
of 16, but you might want to restrict yourself to 16 bits for
compatibility with older versions.
是一个任意的16位的无符号整数(用10进制表示),当客户端取数据的时候,服务器会将这个flag和数据一起传输给客户端。客户端也许会用这个作为1bit的字段来存储数据的特定信息,这个字段对服务器是不可见的。在1.2.1以后的版本,flags可能会是32位的,为了兼容,可能还是要使用16位的flags

- is expiration time. If it's 0, the item never expires
(although it may be deleted from the cache to make place for other
items). If it's non-zero (either Unix time or offset in seconds from
current time), it is guaranteed that clients will not be able to
retrieve this item after the expiration time arrives (measured by
server time).
就是过期时间。如果它的值是0,那么永不过期(当然可能因为内存没有空间导致这个item被删除)。如果不是0而且过期了,客户端就不能在获得这个数据了。

- is the number of bytes in the data block to follow, *not*
including the delimiting \r\n. may be zero (in which case
it's followed by an empty data block).

- is a unique 64-bit value of an existing entry.
Clients should use the value returned from the "gets" command
when issuing "cas" updates.

- "noreply" optional parameter instructs the server to not send the
reply. NOTE: if the request line is malformed, the server can't
parse "noreply" option reliably. In this case it may send the error
to the client, and not reading it on the client side will break
things. Client should construct only valid requests.
Noreply选项可以上服务器不返回任何消息。

After this line, the client sends the data block:
命令行过后,客户端就开始发送数据块了:

\r\n

- is a chunk of arbitrary 8-bit data of length
from the previous line.
数据块是长度为8bit的数据

After sending the command line and the data blockm the client awaits
the reply, which may be:

- "STORED\r\n", to indicate success.

- "NOT_STORED\r\n" to indicate the data was not stored, but not
because of an error. This normally means that either that the
condition for an "add" or a "replace" command wasn't met, or that the
item is in a delete queue (see the "delete" command below).

- "EXISTS\r\n" to indicate that the item you are trying to store with
a "cas" command has been modified since you last fetched it.
数据自从被你取出来以后被其他人修改过了,所以不能在更新了。

- "NOT_FOUND\r\n" to indicate that the item you are trying to store
with a "cas" command did not exist or has been deleted.
数据不存在了,可能被删掉了。

Retrieval command:
------------------

The retrieval commands "get" and "gets" operates like this:

get *\r\n
gets *\r\n

- * means one or more key strings separated by whitespace.

After this command, the client expects zero or more items, each of
which is received as a text line followed by a data block. After all
the items have been transmitted, the server sends the string

"END\r\n"

to indicate the end of response.

Each item sent by the server looks like this:
这个是item的表现形式:

VALUE []\r\n
\r\n

- is the key for the item being sent

- is the flags value set by the storage command

- is the length of the data block to follow, *not* including
its delimiting \r\n

- is a unique 64-bit integer that uniquely identifies
this specific item.
一个64位长度的整型来唯一标示item

- is the data for this item.

If some of the keys appearing in a retrieval request are not sent back
by the server in the item list this means that the server does not
hold items with such keys (because they were never stored, or stored
but deleted to make space for more items, or expired, or explicitly
deleted by a client).


Deletion
--------

The command "delete" allows for explicit deletion of items:

delete [

2009年3月15日 星期日

Cassandra安装搞定

放几张截图上来:



整体和部分,宏观和微观

很难想象我怎么会去考虑这么一个抽象的问题,其实这也是在最近,我越发的觉得自己的整体感太差。。。
很多事情,我太纠结于细节,例如给我一个item,我会研究怎么去安装怎么去使用,甚至研究它的源代码(如果是开源的话)。但很多时候我却很难理解他们为什么这样写,为什么要用RandomAcessRead而不用顺序读取,依据在哪,原理在哪?看一个东西却只懂一个东西,而不能触类旁通,无法从小事中知大意,不能把握问题的关键,应该是我现在亟需解决的"bug"了吧。
好好思考,不仅仅是人生的每一步,而是应该整体上知道我需要什么,然后才去关注怎么做。

2009年3月14日 星期六

cassandra配置的我很郁闷

弄了好久,和mailist上面的几个作者聊了一上午才配置完成,也不知道算不算已经搞定了,这是运行的日志。。。应该没有问题。。。需要两台电脑,一台作为master server,另一台作为seed,然后master向seed发packet,所以现在还需要用java在seed上面写一个程序来接包。。。先吃了午饭,回来在写程序。。。

DEBUG - Submitting a major compaction task ...
DEBUG - Started compaction ...RecycleColumnFamily
DEBUG - Submitting a major compaction task ...
DEBUG - Finished compaction ...RecycleColumnFamily
DEBUG - Submitting a major compaction task ...
DEBUG - Started compaction ...Test
DEBUG - Finished compaction ...Test
DEBUG - Started compaction ...Test2
DEBUG - Finished compaction ...Test2
DEBUG - Submitting a major compaction task ...
DEBUG - Started compaction ...LocationInfo
DEBUG - Finished compaction ...LocationInfo
DEBUG - Submitting a major compaction task ...
DEBUG - Started compaction ...TableMetadata
DEBUG - Finished compaction ...TableMetadata
DEBUG - Submitting a major compaction task ...
DEBUG - Started compaction ...HintsColumnFamily
DEBUG - Finished compaction ...HintsColumnFamily
DEBUG - Starting to listen on lizhenyu-PC:6001
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:2
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 62
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:3
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 62
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:4
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 62
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:5
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 62
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:6
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 62
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:7
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 62
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:8
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 62
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:9
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 62
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:10
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 62
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:11
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 63
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:12
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 63
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:13
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 63
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:14
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 63
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:15
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 63
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:16
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 63
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:17
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 63
DEBUG - Performing status check ...
DEBUG - Gossip Digests are : lizhenyu-PC:6001:4:18
INFO - Sending a GossipDigestSynMessage to 192.168.0.108:6001 ...
DEBUG - Size of Gossip packet 63
DEBUG - Performing status check ...

2009年3月12日 星期四

Cassandra的数据模型

1,每一row都由一个唯一的key标实,key是个string类型
2,每个Cassandra实例含有一个table,这个table由一个或者多个column families组成
3,column families的数量和名称在这个集群启动的时候必须是固定的了,虽然对于column families的数量没有限制,但是最好不要太多
4,每个column families可以包含supercolumns 和 columns这两个架构中的任何一个。它们都是动态建立的,并且对于每个column families中,他们的数量是没有限制的。
5,columns是由一个名字,一个值和一个用户自定义的timestamp,columns的数量可以很大
6,supercolumns是由一个名字和无数个columns组成的。

Distribution, Replication and Fault Tolerance
1,数据是分布放在集群上的,使用的是Consistent Hashing和Order Preserving Hashing Function。使用Order Preserving Hash function使得我们可以在今后对某个区域的数据进行扫描,从而进行分析
2,集群中的每个membership都说通过Gossip方式的membership算法来维护的。这个集群中的每个节点如果fail了,那么就会有一个叫做Accrual Style Failure Detector的东东监控它
3...

2009年3月11日 星期三

公司不解决北京户口,比较麻烦...

转一篇相关的文章:

首先,要明确一下三方协议的用途,可是这么来形容,三方协议只是在你毕业前和公司达成工作意向的一种文书,注意,这只是一种意向,在法律意义上,三方协议的作用要远小于劳动合同。
它的作用主要是用来办理户口迁移和档案寄送的。
而三方协议在你到公司报到后会自行失效,此时你要同公司签订劳动合同来保障各自的权益。

下面说一下档案、户口和派遣证的关系:
1、档案代表的是人事关系,户口代表的是户籍关系,档案是随着户口走的,所以如果单位解决了户口就意味着同时给解决档案,但如果单位只接受档案不解决户口,户口就要挂靠或者打回原籍。
2、户口挂靠有两种方式,一种是挂靠在人才市场,一种是挂在本地的亲戚家里。这些都是针对户口不在天津市的外地人而言。户口在本市的无需再办理户口挂靠。
3、派遣证是一种证明文件。它的作用有三:一是证明你的毕业生身份,二是去单位报到的必须文件,三是落下户籍关系的必备文件。派遣证是与户籍关系紧密相连的,每人只有一张,就是说户籍落在哪派遣证就发到哪,如果单位给解决户后那派遣证上就署名单位,如果单位不解决户口户口挂靠在人才市场派遣证上就署名人才市场指定的单位,如户口打回原籍派遣证就署名原籍所在地的相关部门。
而派遣证是根据三方协议来定的。这也就是为什么三方协议的作用主要是用来办理落户和档案寄送的。

了解了上面三者的关系,你就应该清楚,如果单位不能为你解决户口,那就不要签三方协议。这一点就我所知北京的部分单位做的很好,他们公司没有进京指标的话,公司会提出不与你签三方而是签劳动合同。但是上海的有些公司却在这方面难为我们,对于本科生,公司明知道不能为你落户,但仍要求跟你签三方,可能这是上海市不成文的惯例,但不是说绝大部分上海公司都不通情达理。即使当时不得已签了三方,也还是有办法办理天津挂靠的。后面有说明。

如果已经与外地单位签了三方协议但不解决户口,那还能挂靠么?回答是:能。
如果是外地人想把户口留在天津就一定要挂靠,这需要去已签的外地单位开个证明,证明不能给你解决户口(也就是退函,具体格式附在下面),同意你另行择业。拿到证明,然后到就业指导中心再领一份三方协议,然后拿到人才市场办理挂靠,相当于跟人才市场再签一份协议,到时派遣证发放到人才市场而非原单位。再强调一下派遣证随户口走。
但此时牵涉到一个问题,公司给你出具退函后,你们所签的三方协议就失效了,在法律上你们就不再有关系。作为处于弱势的学生,就要提前跟单位协商好,如果此时可以先签一个劳动协议那最好,如果不能,也要确认好,毕业时去单位,单位仍然愿意接收你。虽然有一定风险,但协调好后,也没问题。我个人的经历是让单位出具退函时,同时再出具一份接收的证明,相当于录取通知书,将来去公司报到前劳动合同后再退给公司。但这个难度就更大了,这需要单位有很好的包容性和理解性。因为不是多数单位都愿意这么做的。此时就要看你的情商了。

退函
兹有天津大学07届毕业生***同学,已于*年*月与我单位签订就业三方协议。根据**市户籍政策有关规定,我单位不能为其申请办理上海落户,故已签三方协议失效,同意其另行择业。

签字盖章
2007年 月 日

接收函
兹有天津大学07届毕业生***同学,于*年*月与我单位签订就业三方协议,根据***市户籍政策有关规定,我单位不能为其申请办理**市落户,已同意其向学校领取新的三方协议办理天津挂靠落户时宜。
我单位同意接收***同学。
此函只做该同学毕业后来单位报到证明之用。

签字盖章
2007年月 日


这里我要强调一下,退函最好在学校上报就业计划到天津教委之前拿到,然后尽快办理挂靠。如果七月十号派遣后,再想通过学校改派手续到天津的单位,也无法再办理天津户口。
因为天津市规定,对已迁出天津的外地生源一律不准再迁回。这个要切记,是不是要办天津挂靠,提前想清楚。

学校截止签三方协议的时间:
5月20号是学校统计就业数据的期限,就业指导中心的老师虽然没有明确说明,但学校一般会给出一定的宽限,大概可以推迟到5月底6月初,然后学校根据统计数据和资料制作派遣证。所以只要在5月底6月初确定下自己的去向,想挂靠的挂靠不挂靠的就等着打回原籍。
但目前就业指导中心对外的截止日期是20号,而我们学院是15号。所以请同学们还是尽可能在这个期限前完成三方协议。
本科生的派遣证的发放今年大概是在7月10号毕业典礼后。


最后在具体说明一下,人才挂靠和落户亲友家的程序:
这两种挂靠的前提都是你手里要有空白的三方协议。
1.人才中心挂靠
我本人是挂靠在北方人才广开分部(做859,到南头窑下车,大概20分钟就到了)。
带新的三方协议,如果是挂靠户口和档案,500元,以后每年大概是500左右的管理费,这个各个人才中心收费标准大致相同。
但有一个问题需要告诉大家,挂靠人才后,户口和档案是不能分离的,因为此时你的户口为集体户口,依照天津市规定,两者不能分离。
如果你所签的外地公司,要求你把档案调到公司去,那此时你只能把该集体户口转成个人户口后,档案才可以跟户口分离。办理途径是,把此时你的集体户口转到亲友或同学家。或者本身买房,户口转到房产下,但是这个可能性很小。原因是我们多数买不起房。
2.落户亲友家
如果你所签的单位不是天津的,那么你就得跟人才中心签约,这样在名义上你也是在天津就业了。依照天津市规定,你可以要求亲友家所在地派出所给你落户,但是规定上可以,不代表你实际办理时就会一帆风顺,这需要多和派出所民警套套近乎。具体就不说了。

落户亲友家需要的手续如下
本人:身份证,报到证(原件以及复印件),就业协议(原件,以及第一页和第二页的复印件),单位接收证明,毕业证原件。
单位接收证明格式如下:
接收证明:
某某同志是我单位接收的2007届应届毕业生,现为我单位正式职工,因我单位无集体户口,故同意该同志投靠亲友户籍。
单位名称,公章

朋友:户口本、身份证、房本,同意接收的证明
同意接收的证明格式如下:
申请:
我叫某某,出生年月日,现住址,现同意同学或朋友某某(括弧内介绍某某情况,生日、住址、单位、学历)落户于现住址(详细写现住址)

本人签字盖章

最后,对于党组织关系,这个可以直接让学院开介绍信到你要去工作的单位,然后就可提组织档案到公司。不需要走人才中心转一圈。

2009年3月10日 星期二

facebook和iphoto'09的完美结合

这两个东西真不错,在iphoto里面命名后的照片,直接可以在iphoto的facebook接口传到facebook上面去,而且两者是互通的,也就是说在iphoto修改的tags可以用在facebook上面,在facebook上面修改的tags也可以应用在iphoto中。在iphoto里面给人物命名以后,上传到facebook的照片也可以显示人名(当鼠标放在头像上),很强大呵呵。。。

facebook的这个iphoto插件是这个人开发的,看看他是怎么写的。

Behind the scenes with the new Facebook features in Apple’s iPhoto ’09

Srinivas Narayanan 的博文 2009年1月30日 9:43
Apple recently announced that the new Faces feature converts iPhoto '09 name tags to Facebook name tags. Then they and their friends can view those photos in Facebook, and if other friends are tagged in Facebook, those tags will sync back to iPhoto ’09. This integration makes it really easy for Mac users to share and connect with others, which is central to what Facebook is all about as well.

Engineers crave to work on things that are impactful and touch a lot of people. I joined Facebook three months ago knowing that I’d have such opportunities. Little did I know that my first project, helping bring Facebook features to Apple’s iPhoto ’09, would allow me to make an impact for Facebook so soon. To see my work at Macworld was a nice bonus!

Technically speaking, this feature is a part of Facebook Connect and the APIs it provides. An interesting aspect of this particular feature is that it is designed to be bi-directional. This means one can modify photos in iPhoto ’09 or on Facebook and the changes will be reflected in both places. To support this bi-directional integration, we enhanced the photos APIs to help iPhoto ’09 determine when name tags are added on Facebook, keep them in sync with the iPhoto ’09 application, and provide familiar Facebook privacy controls to allow users to share these photos with the appropriate set of people.

As a new engineer working on this project, I quickly experienced first-hand what many people told me about Facebook – it’s a place that has extremely smart and passionate people who are given the freedom to make the right decisions. The project had a great start thanks to Tracy Chou and the Connect team. It was an amazing experience to build on what they started and have my first project be something so substantive and prominent. It helped me realize the incredible opportunity one has at Facebook to help make the world more open and connected.

Srinivas, a new engineer at Facebook, can’t wait to have pictures of his New Year revelry be shared to Facebook using iPhoto ’09.

facebook里面的人都是天才阿,呵呵,好好向他们学习。。。

附一张facebook办公室的照片,都是Mac Book:

什么是Thrift

Thrift是一个为了扩展跨语言服务的一个开源项目,它允许你在一个文件里面进行简单的定义,从而定义你自己的数据类型和服务接口。编译器用刚才的那个文件,产生的代码可以很容易的就构建一个RPC客户端或者服务器,用来使不同语言之间无缝得进行沟通。

Thrift支持的语言:C++,C#,Cocoa,Erlang,Haskell,Java,OCaml,Perl,PHP,Python,Ruby,Smalltalk。

Thrift支持和不支持的特性:
支持:namespaces,constants,enumerations,structs,container(set,map,list),asyn invocation,exception...
不支持:循环structs,struct继承,多态,继承,null return

最近的事情比较多~

工作前个星期终于定下来了,回头有空写写找工作的历程吧。解决了这块心病,发现接下来反而更忙了。。。
一方面每天都要去评测中心做毕业设计,貌似我做的是一个安全等级评测系统。。。每天早上7点起床,晚上7点回到寝室,经常在公车上睡着,发现自己的睡觉水平提高了不少。。。
庆祥给我布置了挺多任务了,也算是为我将来进公司后就能立马上手打好基础吧,列一下最紧要学习的一些东西:
1,Google BigTable...一种新的数据结构
2,Google MapReduce 分布式的东东
3,Facebook的Thrift和Cassandra,貌似现在已经是Apache的开源项目了。
4,python和perl,最近看了一下python的语法,很喜欢,有看一定要学学python,听说美国用的比较多,对python最直观的感觉就是一个开源项目,叫做Chandler,大家可以搜搜,而且还出了一本书,专门讲这个软件的。。。
还有就是对Cacoa相当的感兴趣,弄了一本《Cocoa 入门-使用Objective-c》在学呢。开始的时候挺不习惯objective-c的语法习惯,相信以后会慢慢熟练起来,然后就可以在可爱的苹果下面写有趣的程序了~
最近在看几本书:《国富论》、《龙行天下》、《纸变钱的游戏》、《我们相信变革》、《唐骏正传》、《挑战百万年薪》~挺有意思的几本书,大家有时间可以看看。。。
有个朋友找我去学车,不知道有没有时间,回头和导师商量一下。还有公司现在正在做的项目网址www.iqwer.com,还在开发中,有兴趣测试和使用的和我说一声,我会发邀请~,挺好的一个项目,不过还需要好好完善~

2009年3月9日 星期一

机器中毒了。。。

今天在食堂吃完午饭回公司,发现刚刚还好好的机器突然慢的要死,查看了一下进程,发现多了SafeSys这样的莫名进程,直接杀掉,不过机器还是很慢,重启,无果。。。
用浏览器搜索,只要搜索关键字时卡巴斯基或者SafeSys,浏览器直接被关掉,shit。。。
然后只好进入安全模式,把每个盘符下面的SafeSys.exe和AutoRun.inf删掉,然后新建同名的文件夹,设置成隐藏,重启,然后就可以用浏览器搜索杀毒软件了,下了个“微点”,重查杀了一遍,搞定。。

估计是U盘中毒了,哎。。。我已经很注意了专门弄了一个不外借的U盘了,没想到就借出去了一次,结果就栽了。。。以后大家要注意,装杀毒软件还是比较保险的。。。

还有就是对那些写病毒的人,丫的不要以为自己能编个病毒很强,有空多做做正事。。。

2009年3月7日 星期六

2009年3月6日 星期五

开篇。。。

一直找不到一家好的免费blog提供商,不是速度太慢就是是不是的出现404问题,或者是可用性太差。。。不知道这个怎么样,如果好的话,会一直用下去。。。

为什么不自己弄个域名?以前弄过,现在貌似比较麻烦,还要申请什么的,我本来就是比较懒的人,有人帮我维护最好了,自己动动手,打打字,就ok咯。。~