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 class MeaningOfThis { | |
| public final int value = 4; | |
| public void doIt() { | |
| int value = 6; | |
| Runnable r = new Runnable() { | |
| public final int value = 5; | |
| public void run() { | |
| int value = 10; | |
| System.out.println(this.value); | |
| } |
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 class Db { | |
| public static void main(String[] args) { | |
| Object a = (true ? new Integer(1) : new Double(1.0)); | |
| System.out.println(a); | |
| if (a instanceof Integer) { | |
| System.out.println("Integer"); | |
| } else if (a instanceof Double) { | |
| System.out.println("Double"); | |
| } |
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 void prime() { | |
| long startAt = System.currentTimeMillis(); | |
| long max = 100000L; | |
| SortedSet<Long> arr = new TreeSet<>(); | |
| for (long i = 2 ; i < max ; i++) { | |
| arr.add(new Long(i)); | |
| } | |
| long last = 0L; | |
| do { |
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
| #!/usr/bin/python | |
| import sys | |
| import socket | |
| HOST = '192.168.161.117' | |
| PORT = 4333 | |
| s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| s.connect((HOST, PORT)) | |
| for line in sys.stdin: |
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/bash | |
| while read LINE; do | |
| echo "$1:{${LINE}}" | nc 192.168.161.117 3333 | |
| done |
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
| # Analyze text: "the <b>quick</b> bröwn <img src="fox"/> "jumped"" | |
| curl -XPUT 'http://127.0.0.1:9200/foo/' -d ' | |
| { | |
| "index" : { | |
| "analysis" : { | |
| "analyzer" : { | |
| "test_1" : { | |
| "char_filter" : [ | |
| "html_strip" |