This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In the latest version(12.0) of guava there will be a class named FluentIterable. | |
// This class provides the missing fluent API for this kind of stuff. | |
final Collection<String> filtered = FluentIterable | |
.from(tokens) | |
.transform(new Function<String, String>() { | |
@Override | |
public String apply(final String input) { | |
return input == null ? "" : input.trim(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This config file was created for myself (@dan). | |
# You may want to add or remove some rules to make efficient use of the Internet. | |
# This file depends on the proxy.conf which defines your own proxy. | |
# Your proxy.conf will look like this: | |
# ---- START ---- | |
# #!PROXY-OVERRIDE:rules.conf | |
# [Proxy] | |
# Proxy = https,server.address,port,username,password | |
# ---- END ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
int all = 1000000; | |
Map<Integer, Integer> results = Maps.newHashMap(); | |
for (int i = 0; i < all; i++) { | |
int id = chanceSelect(couponProbability); | |
if (!results.containsKey(id)) { | |
results.put(id, 0); | |
} | |
results.put(id, results.get(id) + 1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* {@inheritDoc} | |
*/ | |
public void action(LdapMessageContainer<ModifyDnRequestDecorator> container){ | |
ModifyDnRequest internalModifyDnRequest=new ModifyDnRequestImpl(); | |
internalModifyDnRequest.setMessageId(container.getMessageId()); | |
ModifyDnRequestDecorator modifyDnRequest=new ModifyDnRequestDecorator(container.getLdapCodecService(),internalModifyDnRequest); | |
container.setMessage(modifyDnRequest); | |
LOG.debug("ModifyDn request"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Phoenix | |
* doc: https://github.com/jasonm23/phoenix/wiki/JavaScript-API-documentation | |
* | |
* Global Settings | |
*/ | |
var mash = ["alt"]; | |
var mashShift = ["alt", "shift"]; | |
var mashCtrl = ["alt", "ctrl"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-- base --# | |
set -g prefix C-a | |
unbind C-b | |
set -g default-terminal "screen-256color" | |
set -g display-time 3000 | |
set -g history-limit 10000 | |
set -g base-index 1 | |
set -g pane-base-index 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#pushd . >/dev/null | |
# Find base of git directory | |
while [ ! -d .git ] && [ ! `pwd` = "/" ]; do cd ..; done | |
# Show various information about this git directory | |
if [ -d .git ]; then | |
echo "== Remote URL: `git remote -v`" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.shanhh.md5tools; | |
import java.io.UnsupportedEncodingException; | |
//实现MD5算法的类,提供一个静态的函数toMD5()供调用; | |
//还提供一个getMD5ofStr()函数生成一个MD5加密串; | |
public class MD5Digest { | |
static final int S11 = 7; | |
static final int S12 = 12; | |
static final int S13 = 17; | |
static final int S14 = 22; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var el; | |
var settings = {}; | |
var methods = { | |
init: function(options) { | |
el = this; | |
settings = { | |
token: false, | |
query_param: 'query' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1, | |
h2, | |
h3, | |
h4, | |
h5, | |
h6, | |
p, | |
blockquote { | |
margin: 0; | |
padding: 0; |
OlderNewer