This file contains 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
/* | |
* Copyright (C) 2012 tamtam180 | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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
[tamtam@tamsvr20 tmp]$ curl --data @- -X POST --dump - "http://127.0.0.1:8529/document?collection=unit_test_issue35" | |
{"xx": "xx\""} | |
HTTP/1.1 202 Accepted | |
etag: "1811904640" | |
connection: Keep-Alive | |
content-type: application/json; charset=utf-8 | |
server: triagens GmbH High-Performance HTTP Server | |
location: /document/1809181757/1811904640 | |
content-length: 63 |
This file contains 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 class StringUtils { | |
private static final char NO_BREAK_SPACE = '\u00A0'; | |
private static final char NARROW_NOBREAK_SPACE = '\u202F'; | |
private static final char ZERO_WIDTH_NOBREAK_SPACE = '\uFEFF'; | |
private static final char WORD_JOINER = '\u2060'; | |
private static final char FIGURE_SPACE = '\u2007'; | |
public static boolean isSpace(char c) { | |
This file contains 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 List<String> tokenize(String str) { | |
if (str == null || str.isEmpty()) { | |
return Collections.emptyList(); | |
} | |
ArrayList<String> tokens = new ArrayList<String>(); | |
int i = 0; | |
char[] chars = str.toCharArray(); | |
while (i < chars.length) { |
This file contains 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 format(template, param) { | |
param = param || []; | |
return template.replace(/#{(\w+?)}/g, function(matcher, key) { | |
var data = param[key] || ''; | |
return (typeof data === "function") ? data() : data; | |
}); | |
} |
This file contains 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 Hoge() { | |
} | |
Hoge.ptototype = { | |
kwd : [], | |
doFuga : function() { | |
var jqxhr = this.fetchKwd(); // 何かしらのajax | |
jqxhr.success(function(){ | |
// ここで kwdにアクセスしたい... | |
}); | |
} |
This file contains 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 class Leak { | |
public static void main(String[] args) throws Exception { | |
File tmpDir = new File("mytmp"); | |
if (!tmpDir.exists()) { | |
tmpDir.mkdirs(); | |
} | |
// 無理やりPIDを取得。Linuxのみ。 |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<classpath> | |
<classpathentry kind="src" output="target/classes" path="src/main/java"> | |
<attributes> | |
<attribute name="optional" value="true"/> | |
<attribute name="maven.pomderived" value="true"/> | |
</attributes> | |
</classpathentry> | |
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | |
<attributes> |
This file contains 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 class MySample1 { | |
public static void main(String[] args) throws Exception { | |
final AtomicInteger cnt1 = new AtomicInteger(); | |
int[] array = new int[1000]; // ここはDBからとってくる | |
for (int i = 0; i < array.length; i++) { | |
array[i] = i; | |
} |
This file contains 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 class PrototypeScopeMetadataResolver implements ScopeMetadataResolver { | |
private ScopeMetadata protoMetaData; | |
public PrototypeScopeMetadataResolver() { | |
protoMetaData = new ScopeMetadata(); | |
protoMetaData.setScopeName(BeanDefinition.SCOPE_PROTOTYPE); | |
} | |
@Override | |
public ScopeMetadata resolveScopeMetadata(BeanDefinition definition) { |