一劳永逸设置最大文件打开数

大家知道Linux下可以通过ulimit -n查看或者设置最大文件打开数,由于Linux下一切皆是文件,包括网络连接数,因此默认值1024在运行web app的服务器上是个瓶颈。但是通过ulimit -n设置的值只对当前登录session有效,所以很多人选择将该命令加到~/.bashrc或者/etc/profile,这里提供一个一劳永逸的办法:修改/etc/security/limits.conf,加入:

 Bash |  copy code |? 
1
*    hard    nofile    102400
2
*    soft    nofile    102400

《2012湖南卫视成人礼盛典》韩寒演讲《远行》

10年前,19岁,我也是从上海踏上了北上的火车,从此开始了一段完全出乎我意料的人生旅程。如果回到19岁再选择一次,亦如韩少,我会说“yesterday once more”……

Gitosis Repository Alternative

今天Ubuntu放出了12.04更新,下午和刚才把linode和公司的11.10升了。升级过程很智能,基本不用怎么干预。本以为可以放心去睡了,谁知道公司服务器上的gitosis掉了链子,/usr/bin/gitosis-serve等三个gitosis的文件丢了,无法pull或push代码。于是按照这里的方法安装gitosis,谁知道host gitosis的eagain.net拒绝访问,难道是全世界的程序员都在用gitosis把网站clone爆了?又google了很久,95%以上的结果用的都是eagain.net,这时才觉得云是多么的重要,这么重要的repository整个互联网上竟然只有一份……又过了20分钟,最终找打了一个替代网址:

 Bash |  copy code |? 
1
git clone https://github.com/tv42/gitosis.git

然后一切就OK了~

p.s. 马上五一了,抽空配个只读权限,把这个repository在我服务器上布一份

p.s.2 Ubuntu 12.04终于升级MySQL至5.5,Maven至3.0,赞一个

记第一次成为BT大军的先头部队

这两天掐指一算,按照mac一个月出一个DP的习惯,Mountain Lion DP 3应该快出来了。DP 2的自动注销把我折磨得欲死欲仙,于是这两天晚上没事就google一下“mountain lion developer preview 3”。功夫不负有心人,今天终于放出了BT,于是第一时间开挂。一开始速度在400+K,感觉睡一觉明天应该就能把该死的DP 2给升了,谁知道不一会儿速度便降到了10K以下。在翻墙速度未提升而排除了tracker被墙的可能性后,仔细看了下peer列表,发现大家进度都在11%左右,才恍然大悟原来自己第一次成为了BT大军的先头部队……

发博配图以记之

补:昨天晚上在linode服务器上装了transmission一起下,刚才在peer列表里看见了……

珍爱生命,远离天朝论坛

今天xoom到手,晚上做完unlock、root、recovery,打算下从xda下个rom刷了,谁知道file host挂了,无法访问,只能求助国内的坛子,于是便开始杯具了:Google搜索 -> 结果导向至论坛页面 -> 游客不能看附件 -> 注册 -> 回复才能看附件 -> 回复 -> 不做论坛任务不能回复 -> 做任务 -> 换头像 -> Chrome下无法换头像 -> 换个论坛 -> 游客不能看附件 -> 注册 -> 终于看见附件 -> 是个rar -> 下载  -> 后缀名却是php -> 改后缀 -> 解压缩 -> 一个包含下载地址的txt -> rom在该死的RayFile上 -> 游客不能下载 -> 又注册 -> 文件太大,必须使用更该死的RayFile下载器下载 -> 下载器只有Windows版本 -> #%$&%*#*^!

于是,我浪费了一晚上注册了三个论坛外加一个RayFile账号,却什么都没下载到⋯⋯

结论:国内的论坛(至少是智能手机、PAD的论坛)为了增加流量、增加注册用户、增加PV而牺牲用户的体验、时间甚至生命已经到了令人发指的程度!除非哪天真的闲得蛋疼,不然劝诸位珍爱生命,远离天朝论坛

Spring LDAP Transaction – Unofficial yet Working Config Manual

之前的一篇文章介绍了Spring的LDAP子项目和ODM框架,其中提到了LDAP事务,但没有深入,而且那个配置中的事务也是不work的。上个周末在和JTA斗智斗勇的同时把项目中的LDAP事务也搞定了,现在可以做到将LDAP和Hibernate的session factory放在同一个事务上下文中进行ACID管理,即LDAP和数据库操作实现“all or none”(虽然是伪事务,具体下文会提到)。当然,对于Spring LDAP事务配置官方和Google上同样没有任何可参考或操作的文档说明,不然我也不用连着两个晚上码字造福大众了。另外,为了造福资本主义国家的程序猿们,同时向他们展示社会主义国家的制度优越性,以下将切换至英文

Spring LDAP is a amazing framework esp. for its LdapTemplate and ODM, providing a consistent point of view of developing LDAP code with the well-known and document-friendly techniques – JdbcTemplate and ORM. Unfortunately, Spring LDAP is not that widely-used, for its sluggish development progress (1.3.1 so far) and lacking of document/samples. This post will focus on a even rare yet important topic of Spring LDAP – transaction. For other information like O-D mapping or LDAP context source, pls refer to the official document, and some tips here if you can read Chinese.

Environment

  • Spring LDAP 1.3.1
  • Spring * 3.1.1
  • Hibernate 4.1.1
Goal
  • Implement a method annotated with @Transactional, which demonstrates a business service
  • The service invokes two persist DAOs, one uses Hibernate’s session factory and the other uses Spring’s ODM
  • The two persist actions should follow “all or none” rule, that is, if JDBC action fails after LDAP action, LDAP action should rollback, vice versa

IMPORTANT

As described in the official document, TX in Spring LDAP is “not real”

it should be noted that the provided support is all client side. The wrapped transaction is not an XA transaction. No two-phase as such commit is performed, as the LDAP server will be unable to vote on its outcome. Once again, however, for the majority of cases the supplied support will be sufficient.

Show time!

Spring configuration

 XML |  copy code |? 
01
<!-- define LDAP connection -->
02
<bean id="contextSourceTarget" class="org.springframework.ldap.core.support.LdapContextSource">
03
	<property name="url" value="..." />
04
	<property name="base" value="dc=jayxu,dc=com" />
05
	<property name="userDn" value="cn=admin,dc=jayxu,dc=com" />
06
	<property name="password" value="..." />
07
</bean>
08
 
09
<!-- enable pooling -->
10
<bean id="pooledContextSource" class="org.springframework.ldap.pool.factory.PoolingContextSource">
11
	<property name="contextSource" ref="contextSourceTarget" />
12
	<property name="testOnBorrow" value="true" />
13
	<property name="dirContextValidator" ref="dirContextValidator" />
14
</bean>
15
<!-- for pooled connection validation -->
16
<bean id="dirContextValidator" class="org.springframework.ldap.pool.validation.DefaultDirContextValidator" />
17
 
18
<!-- define LdapTemplate -->
19
<bean class="org.springframework.ldap.core.LdapTemplate">
20
	<property name="contextSource" ref="contextSource" />
21
</bean>
22
 
23
<!-- wrap underlying context source with TX aware proxy -->  
24
<bean id="contextSource" class="org.springframework.ldap.transaction.compensating.manager.TransactionAwareContextSourceProxy">
25
	<constructor-arg ref="pooledContextSource" />
26
</bean>
27
 
28
<!--
29
define TX manager
30
* if no JDBC resource is mixed in, choose org.springframework.ldap.transaction.compensating.manager.ContextSourceTransactionManager
31
* if dataSource is mixed in, choose org.springframework.ldap.transaction.compensating.manager.ContextSourceAndDataSourceTransactionManager
32
* if Hibernate 3 sessionFactory is mixed in, choose org.springframework.ldap.transaction.compensating.manager.ContextSourceAndHibernateTransactionManager
33
* since Spring LDAP doesn't support Hibernate 4, you need to create your own class, extending org.springframework.orm.hibernate4.HibernateTransactionManager, then copy the rest code from org.springframework.ldap.transaction.compensating.manager.ContextSourceAndHibernateTransactionManager, just as I did
34
 
35
here you SHOULD make a trade-off: since so far there is no support for JTA, you can only mix LDAP tx with Hibernate tx manager
36
I have raised two tickets to Spring LDAP:
37
https://jira.springsource.org/browse/LDAP-242
38
https://jira.springsource.org/browse/LDAP-243
39
-->
40
<bean id="ldapTransactionManager" class="com.jayxu.common.ldap.ContextSourceAndHibernate4TransactionManager">
41
	<property name="contextSource" ref="contextSource" />
42
	<property name="sessionFactory" ref="sessionFactory" />
43
</bean>
44
 
45
<!-- define ODM -->
46
<bean id="odmManager" class="org.springframework.ldap.odm.core.impl.OdmManagerImplFactoryBean">
47
	<property name="contextSource" ref="contextSource" />
48
	<property name="managedClasses">
49
		<set>
50
			<value>...</value>
51
		</set>
52
	</property>
53
	...
54
</bean>
55
 
56
<!--
57
This part is KEY, wrap your service object with TransactionProxyFactoryBean
58
-->
59
<bean class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
60
	<property name="transactionManager" ref="ldapTransactionManager" />
61
	<property name="target" ref="myService" />
62
	<property name="transactionAttributes">
63
		<props>
64
			<prop key="*">PROPAGATION_REQUIRES_NEW</prop>
65
		</props>
66
	</property>
67
</bean>
68
<bean id="myService" class="com.jayxu.service.MyService" />
69
 
70
<!-- enable @Transactional support -->
71
<tx:annotation-driven />

This diagram gives a overview of the beans’ references

In your service class, you should annotate your transactional methods or the whole class with

 Java |  copy code |? 
1
@Transactional(value = "ldapTransactionManager")

here “value” refers to the tx manager name above. My test code looks like

 Java |  copy code |? 
1
@Transactional(value = "ldapTransactionManager")
2
public void ldapTx() {
3
	odm.create(...);
4
	sessionFactory.getCurrentSession().persist(...);
5
 
6
	throw new RuntimeException();
7
}

then config logger level of org.springframework.ldap and org.springframework.transaction to DEBUG, if everything works well, you can find something in the output like

 Java |  copy code |? 
01
[DEBUG] org.springframework.ldap.transaction.compensating.LdapCompensatingTransactionOperationFactory:59 - Bind operation recorded
02
[DEBUG] org.springframework.ldap.transaction.compensating.BindOperationExecutor:97 - Performing bind operation
03
[DEBUG] org.springframework.transaction.support.TransactionSynchronizationManager:140 - Retrieved value [org.springframework.ldap.transaction.compensating.manager.DirContextHolder@3ed024df] for key [org.springframework.ldap.pool.factory.PoolingContextSource@165b3858] bound to thread [main]
04
[DEBUG] org.springframework.ldap.transaction.compensating.manager.TransactionAwareDirContextInvocationHandler:120 - Leaving transactional context open
05
[DEBUG] org.springframework.transaction.support.TransactionSynchronizationManager:140 - Retrieved value [org.springframework.orm.hibernate4.SessionHolder@55661f7b] for key [org.hibernate.internal.SessionFactoryImpl@7fb5438d] bound to thread [main]
06
[DEBUG] org.springframework.transaction.interceptor.TransactionInterceptor:406 - Completing transaction for [com.jayxu.service.UserLdapService.addUserTx] after exception: java.lang.RuntimeException
07
[DEBUG] org.springframework.transaction.interceptor.RuleBasedTransactionAttribute:130 - Applying rules to determine whether transaction should rollback on java.lang.RuntimeException
08
[DEBUG] org.springframework.transaction.interceptor.RuleBasedTransactionAttribute:147 - Winning rollback rule is: null
09
[DEBUG] org.springframework.transaction.interceptor.RuleBasedTransactionAttribute:152 - No relevant rollback rule found: applying default rules
10
[DEBUG] org.springframework.transaction.compensating.support.DefaultCompensatingTransactionOperationManager:79 - Performing rollback
11
[DEBUG] org.springframework.transaction.support.TransactionSynchronizationManager:331 - Clearing transaction synchronization
12
[DEBUG] org.springframework.transaction.support.TransactionSynchronizationManager:243 - Removed value [org.springframework.orm.hibernate4.SessionHolder@55661f7b] for key [org.hibernate.internal.SessionFactoryImpl@7fb5438d] from thread [main]
13
[DEBUG] org.springframework.transaction.support.TransactionSynchronizationManager:243 - Removed value [org.springframework.jdbc.datasource.ConnectionHolder@22013e9b] for key [org.springframework.jdbc.datasource.DriverManagerDataSource@c20e54a] from thread [main]
14
[DEBUG] org.springframework.transaction.compensating.support.AbstractCompensatingTransactionManagerDelegate:121 - Cleaning stored transaction synchronization
15
[DEBUG] org.springframework.transaction.support.TransactionSynchronizationManager:243 - Removed value [org.springframework.ldap.transaction.compensating.manager.DirContextHolder@3ed024df] for key [org.springframework.ldap.pool.factory.PoolingContextSource@165b3858] from thread [main]
16
[DEBUG] org.springframework.ldap.transaction.compensating.manager.ContextSourceTransactionManagerDelegate:103 - Closing target context

Line 1 indicates save point being created while line 10 indicates the rollback

走自己的路,让别人写博客去吧

06年大学毕业之前,数不清的散伙饭、叙旧酒,每天只有下午醒来时是清醒的。记得有一次饭局上老七、老八、小强和我总结了一下,我们四个基本占全了当年大学毕业生的四条出路:自己考上研的——老八,保研的——老七,没考上研找工作的——小强,不考研直接找工作的——我(当时还差出国一条路,而如果要在当下,出路应该还有一条不怕死出去创业的)

6年后,我们四个的情况是:结了婚的——老八,誓与单身携手向前的——老七,感情稳定但是老被别人问起何时结婚的——我,去另一个世界把妹泡妞的——小强。如果要枚举大学这一帮货们的其它情况的,结了的——不少了,有了娃的——大波,准备要娃的——老五,准备结了的——吉吉,可能准备结了的——韬子,准妈妈——刘姐姐,依然跟学位死磕的——老四。看样子就差离了的,谁来点卯?

反观上海那帮货们,基本都老婆孩子热炕头了,单着的、没结的一只手就能数过来了,这直接导致了将来我很会为伴郎的问题苦恼一把。到底是从北京空降一个过去,还是抓一个壮丁当着心知肚明的大伙的面儿冒充未婚处男,还把自己儿子或女儿一块儿买一赠一陪嫁做花童?

见天还有当年的各样金童玉女在开心、微博上晒着自己当爹做妈的幸福照片。岁月啊,果然是把杀猪刀,当年这群意气风发的小屁孩儿们就这么带着自己的孩子们集体奔三了。看着这些SNS上交织着的幸福的消息和瞬间,真心为大家感到欣慰。不是我们不想回去,而是,为了我们将来的家,我们想用现在的努力去建造一个更坚实稳固的基础和港湾。而且,争强好胜追逐梦想的野心还未在我心中熄灭,反而越烧越旺

于是大家,幸福地去走自己的路吧,且让我借博客羡慕嫉妒恨

Spring+Hibernate 4+Glassfish之使用JTA Transaction

今天下午开始尝试将项目的transaction交给Glassfish的JTA管理,因为之后会使用到JMS,需要与JDBC组成跨data source的事务。但是不知道是没人这么干过还是大家不屑于将完整的配置过程就下来,JBoss的官方文档、Spring的官方文档、SOF都没有可用的配置建议。经过差不多半天时间的Google和尝试,终于配置成功,在此分享

环境:

  • Spring 3.1.1
  • Hibernate 4.1.1
  • Glassfish 3.1.2

应该都是最新的版本,Spring配置文件如下:

 XML |  copy code |? 
01
...
02
<tx:annotation-driven /><!-- 打开Spring的@Transaction声明式事务支持 -->
03
<tx:jta-transaction-manager /><!-- 配置Spring使用JTA事务 -->
04
 
05
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
06
	...
07
	<property name="hibernateProperties">
08
		<value>
09
			...
10
			hibernate.current_session_context_class=jta<!-- 1 -->
11
			hibernate.transaction.manager_lookup_class=org.hibernate.transaction.SunONETransactionManagerLookup<!-- 2 -->
12
		</value>
13
	</property>
14
</bean>
15
...

关键配置在1和2处:

根据Hibernate官方文档此处此处的描述:

When configuring Hibernate’s transaction factory, chooseorg.hibernate.transaction.JTATransactionFactory if you use JTA directly (BMT), and org.hibernate.transaction.CMTTransactionFactory in a CMT session bean. Remember to also set hibernate.transaction.manager_lookup_class. Ensure that your hibernate.current_session_context_class is either unset (backwards compatibility), or is set to "jta".

⋯⋯

See the Javadocs for the org.hibernate.context.spi.CurrentSessionContext interface for a detailed discussion of its contract. It defines a single method, currentSession(), by which the implementation is responsible for tracking the current contextual session. Out-of-the-box, Hibernate comes with three implementations of this interface:

  • org.hibernate.context.internal.JTASessionContext: current sessions are tracked and scoped by a JTAtransaction. The processing here is exactly the same as in the older JTA-only approach. See the Javadocs for details.
  • org.hibernate.context.internal.ThreadLocalSessionContext:current sessions are tracked by thread of execution. See the Javadocs for details.
  • org.hibernate.context.internal.ManagedSessionContext: current sessions are tracked by thread of execution. However, you are responsible to bind and unbind a Session instance with static methods on this class: it does not open, flush, or close a Session.

即需要设置hibernate.current_session_context_class为jta,同时设置hibernate.transaction.manager_lookup_class。但是这里耽误了我半天的就是hibernate.transaction.manager_lookup_class的设置,这里只说“需要设置”,但是没有给出具体的值,虽然文档中给出了一个TransactionManagerLookup接口的实现类列表,但是其中没有Glassfish⋯⋯

又经过了N久的Google,在这里这里找到了一个神奇的实现类:org.hibernate.transaction.SunONETransactionManagerLookup。根据Javadoc,此类实现了“for Sun ONE Application Server 7 and above”的查找策略,想想GF的前身即是Sun AS,应该可以使用。试了一下,终于work~

这里遗留的一个问题是,我并没有在Hibernate 4.1.1的源代码里找到org.hibernate.transaction.SunONETransactionManagerLookup(上面的Javadoc也是3.6的Javadoc),甚至整个org.hibernate.transaction包下面只有TransactionManagerLookup接口的定义。因此究竟是怎么work的我没有找到最终答案,如果有人知道,希望可以在这里留下答案

2012-4-16补:今天启动服务器时偶然间发现抛出个warning,hibernate.transaction.manager_lookup_class在Hibernate 4中已被deprecated掉,需要使用

 Java |  copy code |? 
1
hibernate.transaction.jta.platform=org.hibernate.service.jta.platform.internal.SunOneJtaPlatform

替换

2012-4-17补:今天发现Hibernate的自动flush失效,查看GF启动日志后发现一个新的warning:

JTASessionContext being used with JDBCTransactionFactory; auto-flush will not operate correctly with getCurrentSession()

查文档后发现上面的1、2处需要指定TransactionFactory,否则Hibernate将默认使用JDBCTransactionFactory:

 Java |  copy code |? 
1
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory

问题解决。这次的经验同样是,虽然app server启动时一般会输出大量log,但是要让自己养成从中发现warning级别及以上信息的洞察力,这样解决问题将事半功倍

2012-4-22补:今天又遇到了问题,在使用Query.iterate()方法时,Hibernate抛出异常:

org.hibernate.HibernateException: proxy handle is no longer valid

根据这里的讨论,把JTATransactionFactory换成了CMTTransactionFactory,问题解决:

 Java |  copy code |? 
1
hibernate.transaction.factory_class=org.hibernate.transaction.CMTTransactionFactory

分别真假大地

今年情人节老婆从淘宝买了Hermes的大地给我做礼物,但是用了几次之后觉得有问题,前调倒是很像,但是很不持久,上午喷了到中午基本就没味了,更别说中调和尾调了。清明节老婆去巴厘岛,回来在樟宜机场转机的时候在免税店又带了一瓶回来,终于找回了熟悉的味道。以下是真假大地的包装对比,帮助大家识别。左边为正品,右边为假冒。另外,以后香水这种东西还是别在淘宝上买了

包装盒正面:

包装盒背面:

包装盒底部:

包装盒顶部:

瓶身正面,注意颜色正品略浅,肩部的银色装饰片也略薄:

瓶身顶部:

瓶身底部:

评论:创业团队成员的「挑战」以及「成长」的问题

今天看了@Fenng两周前的一篇文章:创业团队成员的「挑战」以及「成长」的问题,加上这半年来第一次站在“O”级别的位置来接触开发人员、培养团队,感触颇多,遂写下了下面的评论:

文章的观点和我的想法很契合,但是评论里的声音却出现了很大的反差,为什么?我觉得原因有三个:

1、站在不同高度所看到的问题和所要发出的声音是不一样的。做为一个团队、部门甚至公司主管级的人物,着眼点自然应该在对团队整体的心态的引导和控制上,说白了就是像文章中一样向下面的员工灌输团队的价值观

2、作为多混了几年的老人,我心里的想法(不知道Fenng是不是也这样想)会是:“这儿么多年我就是这么过来的,为什么你们不行?”而刚进入这个行当的新人,心里的想法是:“我的朋友们没有这样也都过来了,为什么我不行?”这可能就是行业中的心理代沟

3、现在这个行业环境是风投拿钱和传奇故事砸出来的,太浮躁。新人们从学生时代就浸淫在这浮躁的氛围中,难免会迷失,很难踏实下来。对于这点的,我的看法是,路是自己挑的,老人们只是路边每隔一段距离提着灯笼照路的人,而不是告诉你该怎么走的人,如果自己觉得走偏了,那就自己调整,没有人有权利和义务把你强摁在所谓“正确”的路上。当然,各条路能走多远,5年、10年之后自然就明了了,不必争论

原文转帖如下,值得一读:

回想从最初开始负责丁香园技术团队到现在,团队规模已经增加了几倍,有人离职,也有更多的人加入。团队一大,自然有些问题会浮现出来。比如最近在和团队同事聊天或是面试面谈的时候,经常会听到类似的话「觉得现在的工作没什么挑战」或是「感觉学不到东西」,以前偶尔听到团队同事这样的反馈,还是挺让我着急的,我第一直觉是很惭愧,公司或是团队给同事提供的资源和机会太少了,于是,不停的争取资源或是尽量改进,但是最后我逐渐发现,这样还是不能完全解决问题,这并非是问题的根源,因为一方面有人说没挑战 ,一方面是一堆老大难问题很久得不到解决。觉得「没挑战」和「没成长」其实是很多人会有的心态,尤其是刚参加工作没几年的容易形成这样习惯上的认知。

我以前写过一篇 工程师在创业团队的技术挑战 ,说了一下我对技术上的「挑战」的看法,现在趁着有点空闲,再谈谈谈创业团队中的成员的「挑战」以及「成长」的问题。{请注意,这只是一篇随笔,我无意去讨论什么管理之类的废话,也不奢望就这么几个字能解决所有问题,对少数人起到一个提醒的作用就足够了}

一般觉得工作没什么挑战的,原因可能无外乎几个: 要么认为自己的能力足够高了,不屑于再做「简单」的事情; 要么认为自己是在做「重复」的工作;要么,觉得没接触到新东西;也很有可能只是各种借口或是「心态」的体现。

实际上,任何团队中都没有「简单」的事情,只有做得好或是做不好的事情。什么是简单? 给产品写一段文字说明够简单么?写一封 EDM 够简单么? 如果仔细推敲的话,会看到绝大多数文案都是糟糕的一塌糊涂,那么为什么不用更高的标准要求以下自己呢?既然能力够高了,为什么你说的「简单」的事情还做不好呢?所谓眼高手低,不就是说这种情况么? 如果小事情做到比别人好,那么大一点的事情团队就会更加放心的给你去做。否则的话,换了是你,你也不会将重要的任务交给连小事情都做不好的人吧?

任何团队中也没有「重复」的事情。任何事情,如果不针对反馈做任何改进的话,做第二遍你就会觉得是重复;而如果每次都能根据反馈不停的修正,那么做成千上万次可能还会找到乐趣。比如说我们网站经常要给用户设计一些广告图片,有的同事说,总让我做广告图片,枯燥、乏味,我的设计能力如何得到提高? 的确,如果每次都用最低的标准要求自己,怎么提高呢?客户或是同事给你的反馈,比如,图片上的文字都是毛边的,无论怎么说你都无动于衷,那么怎么可能真的提高呢? 所以,面对「重复」的事情,必须不断的给自己设立新标准,然后努力去突破,重复的事情里面依然大有文章,想想如何提高质量,再想想如何提升效率。

至于说接触不到新技术,其实问一句话就好: 你业余时间为什么不学呢? 大部分回答是: 没时间。这是无解的问题。一般听到「没时间」,有时间整天逛淘宝难道没时间学习么? 其实潜台词都是「这是不重要的事情」,任何事情,你不投入比别人更多的精力,怎么做到比别人更好么? 正所谓,「以大多数人的努力程度之低,根本轮不到去拼天赋」,同样,不做好准备,也等不来机会。

至于心态,我引用丁香园 CEO 张进的一句话:两个都是新入职的同事,也都是第一份工作,交给他们差不多的事情做,一个想「他奶奶的,就这么点工资,让干这么多活?」,另一个则想「没想到新人都给这么多机会锻炼」,你说过几年谁的成就更大? 这或许可以回答某些人的疑问「为什么我和同学毕业的时候都差不多,怎么过几年不见,人家都做到某公司总监乃至副总了,我还是在不停的换工作?」,就是心态导致的差异。

有些人觉得创业团队或是小型公司里面,资源少,「学不到什么东西」,其实,是你没仔细去学习应该学的东西。前几天给几个好友的新创业项目提建议,我说你们某个地方做的不及格,他们说要我给讲讲,我说这个应该不用讲的,你们团队中的某某,以前看过我做同样的事情,按理说,他也能做一下的。遗憾的是,没去做,也做不来。为什么? 别人做他熟悉的那一点领域之外的事情,他是漠不关心的,意识不到学习更多东西是有价值的。有人说,问题就是机会,团队的问题,就是每个人的机会,谁能解决掉,就会给团队带来更大的价值,相应的,他也会得到更大的回报。而在创业团队里面,恰恰是需要解决问题的人,不欢迎那些不动脑筋的螺丝钉。创业团队中,可接触的问题不可谓不多,公司的方方面面都需要有人动手来做,如果平时多用点心思,学到的东西早晚在将来还会用到。很多人不都是有创业的想法么?但是你连基本的积累都不够,创业? 怕是要撞墙。

那么是不是在大公司里面才能让人得到锻炼呢? 曾经遇到过不少工程师当面告诉我,想去某某大型互联网公司去工作几年,提高一下技术,遗憾的是,几乎没看到一个人在几年后能力真的得到提升,有的甚至退步,为什么?一个很大的原因是,大公司里面多数的事情都已经固定下来了,而很多牛人之所以牛,是因为他们遇到公司从小到大的过程,在这个过程中他们得到了难得的成长机遇,不停的学习充实自己,解决各种问题,才成为牛人,牛人也多是苦日子熬过来的。等到天下皆定,哪还有那么多硬仗好打呢? 另外,「想锻炼技术」并不是一个很好的出发点,单纯的想锻炼技术实际上并不利于「解决问题」,培养能力和意识更为关键。

我在微博上调侃过:很多人都希望找到一个完美的公司,比如,办公室要无比舒适;用最好的设备;完备的培训机制,还别占用休息时间;弹性工作制;别他妈太累;也别让老子加班;公司前台要好看;没有刻板的工作流程;工作要有创造性不是重复劳动,别管我是否有创造性;队友不是猪而且都是天才,遇到困难他们就会出手解决;做的事必须是最潮的,但别管赚钱与否… 还有,最重要的,薪水要高。遗憾的是,这样的工作估计是做公务员也不一定完全具备,只会让自己更加痛苦,甚至增加无谓的抱怨。

提起抱怨来,也有必要说一下对队友的抱怨这个事情。曾经见过有人对一起合作项目同事的抱怨,比如设计师抱怨合作的产品经理有问题,总要不停的修改,时间长了,认为产品团队都很烂,经常打扰你,那么有没有想过,你是否可以给产品设计提出更好的建议呢? 甚至,有些产品设计你是否可以进行改进呢? 什么?「那不是我的工作!」 可是,为什么要给自己的能力设定一个边界? 这是多么可悲的事情,你完全可以无限制的突破边界,突破个人的局限。或许再过几年你会成为一个更好的产品设计师的啊。Zynga 的核心价值观有一条是「Level up」,不断升级,这恰恰是我们普遍缺少的心态。

的确,这是个浮躁的时代。大家容易听到各种各样的声音,每当心存困惑的时候不妨静下心来,加强对自身的认知。别幻想着走捷径,也尽量少去问别人如何成功,那些没有用,只要你别总在错误的路上越绕越远,将一些看似细微的事情做到更好,最后的成就依然惊人。

看清无处不在的「挑战」,让自己真正有所「成长」,毕竟,以后每个人都要承担更多的责任,只要你愿意。

EOF

最后补充一句话:「一个真正聪明的人,应该去发现别人话语中合理的部分,并且加以吸收利用,改正自己不正确的地方。而不是一发现别人言语中有漏洞或是有疑议就全盘否定。」

Switch to our mobile site

无觅相关文章插件,快速提升流量