A lifelong thinker
keating · 共 67 篇文章
如何取现美元?
现在,几乎无法通过信用卡、paypal购买数字货币。大额美元提现到国好的方法还是paypal,电汇的时间稍长,固定的35$+银行收取8$左右,如果取2万,相当于1.25%的手续费。 Payoneer可以通过ATM直接取现,但手续费较高,2.3%或2.5%(不固定,肯定低于3%)的手续费+固定的3.15$。 Payoneer新增的取现到当地银行政策略不错,比ATM取现低1%(不固定,肯定低于2%),当然还会有固定的3.15$。对于小额资金,没有paypal固定的35$,相当省钱! 下面是个小广告,通过我的推荐连接注册Payoneer,送25$,大家互惠:) http://share.payon…
2014-01-11 15:44 · 评论(0)
rvm,使用thin
1 .使用rvm,安装gem,不要sudo gem install ...要用rvmsudo代替, rvmsudo gem intall thin 2 .thin不需要rvm wrapper生成一个脚本 3 .可以使用which thin查看thin是否安装在了正确的gemset 运行thin,若出现“bundler/setup”无法找到的类似错误,可以参考以上三条 若出现下面的错误, undefined methodassociate_callback_target' for # Thin::Connection:0xa3402c8 (NoMethodError) 4 .则需要重新安装一下…
2012-04-24 12:19 · Ruby || Rails · 评论(0)
安装完rvm,配置.bashrc及解决通过系统服务运行gem
上一次使用rvm,做各种事情都比较顺利;这次在笔记本上装了ubuntu11.10,然后继续使用rvm,做事情就各种不顺利了。 遇到的问题有三个: 1.rvm use无法使用 2.sudo rvm无法使用 3.装上starling后,不能通过系统服务运行 通过google,stackoverflow一一解决之,特别是第三个问题纠结好几天,最后以为是系统服务的问题时,却无意在stackoverflow上找到答案 解决问题1,是在~/.bashrc中添加 PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting [[ -s "$home/.…
2012-03-25 08:48 · Ruby || Rails · 评论(0)
lombok的canEqual/equals
public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof PayType)) return false; PayType other = (PayType)o; return other.canEqual(this); } public boolean canEqual(Object other) { return other instanceof PayType; } 要是一个类没有属性,那么equals方法就悲剧了。 恰巧,我在一个子类总使用了@Data,覆盖了父类的equlas,然后…
2011-11-22 17:22 · Java · 评论(0)
getReference
Get an instance, whose state may be lazily fetched. If the requested instance does not exist in the database, throws EntityNotFoundException when the instance state is first accessed. (The persistence provider runtime is permitted to throw EntityNotFoundException when getReference(java.lang.Class, …
2011-08-16 10:55 · Java · 评论(0)
简短的UML课
我们今天上了一堂简短的UML课程,讲师是我们技术老大。这堂课上,他用四种颜色来表示四类对象,据说叫做彩色建模。红色——最重要的对象,与时间或时间段有关,比如在某个过程中产生的重要单据;黄色,role,角色,比如说领料人(当一个员工参与到出库过程中时,他的角色可能就是领料人);绿色,thing,比如公司;蓝色,description,描述,公司类型。公司和公司类型之间的关系如同对象与类之间的关系,而thing和role有时候并不需要严格区分。 然后开始分析我们的项目,首先选择一个简单的部门——分拨库,我们开始集体头脑风暴。由分拨库可以想到什么东西?分拨库管理员,库位,出库单,入库单……由一个人…
2011-04-08 22:49 · 记事 · 评论(0)
怎么写,程序才能死锁?
若不了解线程,事务,死锁相关的基础知识,请先去了解一下,一点点儿基础知识就okay啦. 第一部分,线程死锁 利用synchronized模拟一下线程死锁 public class Synchron { public void begin() { Thread t1 = new Thread(new Thread1()); Thread t2 = new Thread(new Thread2()); t1.start(); t2.start(); } public static void main(String[] args) { new Synchron().begin(); } publi…
2011-04-05 17:03 · Java · 评论(0)
附注 OF 《怎么写,程序才能死锁?》
这只是一篇 附注 ,请看博客文章 怎么写,程序才能死锁? http://keating.iteye.com/blog/983365 参考1,线程死锁 ||Thread1|Thread2| |目的|获取i|获取j| |步骤|获取i|获取j| ||等待j被释放,获取j|等待i被释放,获取i ||释放i|释放j| public class NewClass { boolean i = false; boolean j = false; public void begin() { Thread t1 = new Thread(new Thread1()); Thread t2 = new Threa…
2011-04-05 17:03 · Java · 评论(0)
以is作为名称开头的属性,它的Getter方法名应该是什么样的?
--> private String isAbc; when use eclipse, we can generate getter for the attribute isAbc: public String getIsAbc() { return isAbc; } --> private @Getter String isAbc; when use lombok, I get the getter public String isAbc() { return isAbc; } The two getters have different names. I think eclipse is…
2011-03-21 22:47 · Java · 评论(0)
总结2010,憧憬2011
又到了年终写总结的时候了,我把总结拖到今天来写,2011年的第二天。因为,我昨天打了一天牌。保皇,与两个新手,两个老手,各种娱乐。 2010年,是我逐渐适应这个社会的一年,从学校中出来半年到一年半的时间。从一个公司到另一个公司,平生第一次正儿八经地跳槽。从新公司学到了很多,从五月开始的需求调研,到十月份的详细设计,从四月份学习使用May框架,到十一月份纠结于Primefaces完成了外网端的开发。 在2010年末的一段时间,使用JPA2.O,JSF2.0,Primefaces开发一套系统。似乎是比09年中旬更加忙碌的一个月,从几乎一无所知到系统出炉,基本没有时间看体育新闻,一点睡七点起。 看…
2011-01-02 16:32 · 记事 · 评论(1)
当使用 display:inline之后
使用了 style 的 display:inline 之后的效果...果然很危险...不是说默认就是inline么..
2010-12-29 21:53 · 前端 · 评论(0)
Eclipse新建类中自动添加author.
缘起,我改不了win 7滴user name了,所以只能曲线救国. window -> preference -> java -> code typle -> code template -> Comments -> Types /** * @author ${user} * * ${tags} */ 发现这样可以直接替换掉 ${user} 把author写死. 然后又发现, window -> preference -> java -> code typle -> code template -> Code -> New Java files -> Edit ${filecomment} …
2010-10-17 11:52 · Java · 评论(1)
<effective java>讲for的笔记
先是说for比while更安全,因为for是把一推东西都写在括号中的嘛. 而while需要现在外部定义一个对象, 所以,while中可能出现如此代码, Iterator<Element> i = c.iterator(); while(i.hasNext()){ doSomething(i.next()); } //... Iterator<Element> i2 = c2.iterator(); while(i.hasNext()){//这里有bug doSomething(i2.next()); } for循环就不可能出现. 然后,就是一个比较有意思的,可能你知道,算俺少见多怪吧... …
2010-09-25 10:14 · Java · 评论(0)
字符串加法与StringBuilder.append()
public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int times = 1000;// 次数 long beginBuilder = System.currentTimeMillis(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < times; i++) { buil…
2010-09-24 13:21 · Java · 评论(0)
JPA 2 Inheritance
父类Super, @Entity public class Super { @GeneratedValue(strategy = GenerationType.AUTO) @Id private int id; private String name; //getters and setters... } 然后,两个子类, @Entity public class M extends Super { private String mName; //getters and setters... } @Entity public class N extends Super { private S…
2010-09-23 21:41 · Java · 评论(0)