Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,| import android.os.Environment; | |
| import android.support.annotation.NonNull; | |
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.util.concurrent.TimeUnit; |
| ==>sudo xcode-select -switch /Applications/Xcode.app | |
| ==>cd ~/.cocoapods/repos | |
| ==>git clone https://github.com/CocoaPods/Specs.git master | |
| ==>it must show: | |
| Cloning into 'master'... | |
| remote: Counting objects: 855220, done. | |
| remote: Compressing objects: 100% (3211/3211), done. | |
| remote: Total 855220 (delta 1424), reused 0 (delta 0), pack-reused 851785 | |
| Receiving objects: 100% (855220/855220), 342.79 MiB | 1.04 MiB/s, done. |
| > cd ~/.ssh | |
| > sudo wget http://curl.haxx.se/ca/cacert.pem | |
| > export CURL_CA_BUNDLE=~/.ssh/cacert.pem |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,| class MethodInLowSdk{ | |
| public static void aMethod(); | |
| }; | |
| class MethodInHighSdk{ | |
| public static void aMethod(); | |
| } | |
| void CallAMethodByVersion(){ | |
| if(android.os.Build.VERSION.SDK_INT > low_sdk){ |
| on run {targetBuddyPhone, targetMessage, repeatCount} | |
| tell application "Messages" | |
| set targetService to 1st service whose service type = iMessage | |
| set targetBuddy to buddy targetBuddyPhone of targetService | |
| set myCount to repeatCount as integer | |
| repeat myCount times | |
| send targetMessage to targetBuddy | |
| end repeat | |
| end tell | |
| end run |
| public class FizzTest { | |
| public static void main(String[] args) { | |
| String string = ""; | |
| String[] nums = new Scanner(System.in).next().split(","); | |
| for (int i = 1; i <= 100; i++) { | |
| if (String.valueOf(i).indexOf(nums[0]) != -1) { | |
| string += "Fizz"; | |
| } else { | |
| if (i % Integer.parseInt(nums[0]) == 0) { | |
| string += "Fizz"; |
| var a = 'hello'; | |
| var b = new String('hello'); | |
| a + b; // 'hello hello' | |
| typeof a; // 'string' | |
| typeof b; // 'object' | |
| a instanceof String; //false | |
| b instanceof String; // true | |
| a.substr == b.substr; //true |
| ExecutorService service=Executors.newFixedThreadPool(Integer.valueOf(poolThreadNum.toString())); | |
| CountDownLatch downlatch= new CountDownLatch(Integer.valueOf(poolThreadNum.toString())); | |
| CountDownLatch sucess_downlatch=new CountDownLatch(Integer.valueOf(poolThreadNum.toString())); |
| #!/bin/ruby | |
| if __FILE__ == $0 | |
| vars = {} | |
| Dir.glob("**/*") do |name| | |
| if File.file? name and name =~ /\.clj$/ | |
| File.open(name,"r") do |f| | |
| content = f.read | |
| if content =~ /environ.core/ | |
| content.scan(/\(env :([a-zA-Z\-]+) ("([^\)]+)")?\)/).each do |matches| |