Skip to content

Instantly share code, notes, and snippets.

View ndzj081221130's full-sized avatar

zhangjieinnjucs ndzj081221130

View GitHub Profile
@ndzj081221130
ndzj081221130 / node_js
Created February 12, 2014 02:11
nodejs
nodejs也npm错误,compile中设置 registry ? 有时也不行
还是nodejs对我好啊。。。虽然会挂,但偶尔也会正常运行。。。
test-log是用python写了一个服务器而已。。。
下面呢?
关于组件的varz
@ndzj081221130
ndzj081221130 / vagrant_test
Created February 12, 2014 02:12
cf-vagrant-test
> 在test/cf-vagrant-installer中执行
> vagrant destroy,删除虚拟机重新vagrant up
> health manager启动失败
> 部署nodejs时,150001: The app package is invalid: failed repacking application
@ndzj081221130
ndzj081221130 / tuscany_problem
Created February 12, 2014 02:12
现在的问题
试图在CF上运行tuscany应用
但自定义的tuscany-buildpack,无法成功启动tuscany应用
java进程在启动后,会被kill,无论是调内存参数,还是别的,都无法解决这个问题
java-console是可以部署的,虽然没有绑定url、
@ndzj081221130
ndzj081221130 / 14_2_12_tuscany
Created February 12, 2014 04:23
现在的问题
试图在CF上运行tuscany应用
但自定义的tuscany-buildpack,无法成功启动tuscany应用
java进程在启动后,会被kill,无论是调内存参数,还是别的,都无法解决这个问题
java-console是可以部署的,虽然没有绑定url、
@ndzj081221130
ndzj081221130 / 2014_2_13修改tuscnay
Created February 14, 2014 08:08
2014_2_13_warden
> Written with [StackEdit](https://stackedit.io/).
错误日志dea.log:
droplet.healthy
start instance
@ndzj081221130
ndzj081221130 / 2014_2_14
Created February 14, 2014 11:23
2014_2_14_研究tuscany
-
> Written with [StackEdit](https://stackedit.io/).
编译tuscany2.0.1源码,mvn install
生成的jar包,拷贝到可运行版本的具体的目录下。
或者使用一个插件maven-antrun-plugin,自动拷贝到相应的目录下
修改日志等级:INFO改为FINE,再次CF push,看一下更全的日志。
@ndzj081221130
ndzj081221130 / 发帖水王
Created February 17, 2014 10:57
发帖水王
> Written with [StackEdit](https://stackedit.io/).
排序,扫描一遍
排序,N / 2肯定是发帖水王
两两PK,剩下的一定是水王
@ndzj081221130
ndzj081221130 / 求二进制中1的个数
Created February 17, 2014 10:58
求二进制中1的个数
> Written with [StackEdit](https://stackedit.io/).
右移,与0x1比较
除2,比较余数
编程之美p121,解法三
@ndzj081221130
ndzj081221130 / 求N!中0的个数
Created February 17, 2014 10:59
N!中0的个数
> Written with [StackEdit](https://stackedit.io/).
其实就是求质数分解中,5的指数k
N! = 2^i * 3^j * 5^k * ...
变体:N!中二进制表示中最低位1的位置
@ndzj081221130
ndzj081221130 / 2014_2_17部署2个dea
Created February 18, 2014 01:28
2014_2_17部署2个dea
> Written with [StackEdit](https://stackedit.io/).
下面开始验证router,确实可以做到负载均衡,就是将一个应用的两个不同的实例,分别部署到2个dea节点上。
首先,一个dea对应于一个warden容器?。
**上层DEA通过warden client来调用warden server提供的api创建并控制container,container可以添加诸多限制,且container之间互相隔离**
dea启动时,会向router去注册自己。