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
| $ cd / | |
| oreyes:/ $ java -cp /Users/oscarryz/code/Java/stuff/ Hello | |
| Hello world! |
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
| $cat Hello.java | |
| class Hello { | |
| public static void main(String ... args) { | |
| runIt( () -> System.out.println("Hello") ); | |
| } | |
| public static void runIt( Runnable r ) { | |
| r.run(); | |
| } | |
| } | |
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
| cat Hello.java | |
| class Hello { | |
| public static void main(String ... args) { | |
| Hello hello = new Hello(); | |
| hello.test(); | |
| } | |
| public void test() { | |
| runIt(() -> this.something()); | |
| } | |
| public void runIt(Runnable r) { |
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
| body := ioutil.NopCloser(strings.NewReader(v.Encode())) | |
| postRequest , _ := http.NewRequest("POST", "http://httpbin.org/post", body) | |
| postRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded") | |
| postRequest.ParseForm() | |
| postRequest.Body = body |
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
| class Sum { | |
| public static void main( String ... args ) { | |
| int result = 0; | |
| for ( char c : "10110".toCharArray() ) { | |
| result += c - '0'; | |
| } | |
| System.out.println(result); | |
| } | |
| } |
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
| class Some class Some { | |
| public static void main( String ... args ) throws InterruptedException { | |
| Thread.sleep(1000); | |
| new Thread( () -> { | |
| try { | |
| Some.main(); | |
| } catch ( InterruptedException e ) { | |
| throw new RuntimeException(); | |
| } | |
| }).start(); |
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
| tomcat 17314 1 94 03:39 ? 00:43:33 /usr/local/java/bin/java -Dnop -Dfile.encoding=UTF-8 -Dhttp.proxyHost=proxy.corp.blizzard.net -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.corp.blizzard.net -Dhttps.proxyPort=3128 -Dftp.proxyHost=proxy.corp.blizzard.net -Dftp.proxyPort=3128 -Dfile.encoding=UTF-8 -Dhttp.proxyHost=proxy.corp.blizzard.net -Dhttp.proxyPort=3128 -Dhttps.proxyHost=proxy.corp.blizzard.net -Dhttps.proxyPort=3128 -Dftp.proxyHost=proxy.corp.blizzard.net -Dftp.proxyPort=3128 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -Xmx1235426k -XX:MaxPermSize=256m -Djava.awt.headless=true -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8078 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -Djava.endorsed.dirs=/usr/local/web_tools/apps/tomcat/apache-tomcat-7.0.26/endorsed -classpath /usr/local/web_tools/apps/tomcat/apache-tomcat-7.0.26/bin/bootstr |
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
| //C://{user}/src/main/tu/paquete/aqui/Importante.java | |
| package tu.paquete.aqui; | |
| class Importante { | |
| public int foo( int a ) { | |
| return a * 10; | |
| } | |
| } | |
| // C://{user}/src/text/tu/paqeute/aqui/ImportanteTest.java |
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
| var http = require('http') | |
| var server = http.createServer(function(req,res){ | |
| console.log( req.url ) | |
| var helloRE = new RegExp("^/hello/(\\d)$") | |
| if ( helloRE.test(req.url) ) { | |
| var groups = helloRE.exec(req.url) | |
| var id = groups[1] | |
| var options = { | |
| hostname: 'jsonplaceholder.typicode.com', |
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 main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| "regexp" | |
| "strings" | |
| ) |
OlderNewer