Skip to content

Instantly share code, notes, and snippets.

View yelcat's full-sized avatar
🎯
Focusing

ycat yelcat

🎯
Focusing
View GitHub Profile
@yelcat
yelcat / gist:9e3f669ed413c61f4416004f961437b5
Created August 20, 2016 18:51
Verifying that "xiaofeng.id" is my Blockstack ID. https://onename.com/xiaofeng
Verifying that "xiaofeng.id" is my Blockstack ID. https://onename.com/xiaofeng
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
body {
margin:0px;
padding: 0px;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
}
div.logo {
position: relative;
height: 94px;
padding: 0px;
function addJqplotImageButton() {
if (!$.jqplot.use_excanvas) {
var targets = $('div.jqplot-target');
if (targets.length < 1) {
setTimeout(addJqplotImageButton, 2000)
return;
}
targets.each(function(){
var outerDiv = $(document.createElement('div'));
HostListHolder hostListHolder = HostListHolder.getInstance();
Collection<String> hostList = hostListHolder.getHostList(HostListHolder.PRODUCTION);
if (hostList.size() > 0) {
addKeys(keys, hostList);
Result<List<DataEntry>> result = tairManager.mget(NAMESPACE, keys);
if ((ResultCode.PARTSUCC.equals(result.getRc()) || ResultCode.SUCCESS.equals(result.getRc()))
&& null != result.getValue()) {
doMerge(result.getValue(), unsortedHashmap);
}
public class Top10Lister {
private static final Splitter SPLITTER1 = Splitter.on(';');
private static final Splitter SPLITTER2 = Splitter.on(':');
private static final int MAX_SIZE = 30;
private Top10Item[] items;
private String hostName;
public volatile int preMinute;
public class DuplicatedOrderFilter {
// 位图1,表示上一个周期的位图
private BitSet firstBitSet;
// 位图2,表示当前周期的位图
private BitSet secondBitSet;
// 位图1的偏移量
private long firstOffset;
// 位图2的偏移量
private long secondOffset;
1840 [Thread-11] INFO backtype.storm.daemon.worker - Worker has topology config {"storm.id" "regional-1-1326979790", "topology.fall.back.on.java.serialization" true, "zmq.linger.millis" 0, "topology.skip.missing.kryo.registrations" true, "storm.zookeeper.session.timeout" 20000, "nimbus.reassign" true, "nimbus.monitor.freq.secs" 10, "java.library.path" "/usr/local/lib:/opt/local/lib:/usr/lib", "storm.local.dir" "/var/folders/ns/xv7hfgxd36d_7081d8jf_mxh0000gn/T//3c58931c-c943-4959-91d1-111ef2e5f963", "supervisor.worker.start.timeout.secs" 240, "storm.zookeeper.port" 2181, "storm.zookeeper.root" "/storm", "supervisor.enable" true, "worker.childopts" "-Xmx768m", "supervisor.heartbeat.frequency.secs" 5, "drpc.port" 3772, "supervisor.monitor.frequency.secs" 3, "task.heartbeat.frequency.secs" 3, "topology.max.spout.pending" nil, "supervisor.slots.ports" (4 5 6), "topology.debug" true, "nimbus.task.launch.secs" 120, "nimbus.supervisor.timeout.secs" 60, "topology.kryo.register" nil, "topology.message.timeout.secs" 3
public class RegionalStatisticsBolt implements IBasicBolt {
private Map<String, AtomicLong> regionalCounterMapping = new HashMap<String, AtomicLong>();
@Override
public void prepare(Map map, TopologyContext topologyContext) {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
private final static String[] ipAddress = new String[]
{"10.13.43.154", "10.112.43.12", "10.13.45.123", "10.113.43.4"};
public void nextTuple() {
Utils.sleep(4000);
final Random rand = new Random();
collector.emit(new Values(ipAddress[rand.nextInt(ipAddress.length)], Math.abs(rand.nextLong())));
}