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
import java.util.logging.*; | |
import java.util.Date; | |
// Main logger | |
Logger LOGGER = Logger.getLogger(""); | |
MyCustomClass customInstance; | |
void setupLogging() { |
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
import java.net.*; | |
void setup() {} | |
void draw() { | |
if(frameCount % 100 == 0) { | |
try { | |
println("Is online " + InetAddress.getByName("192.168.0.128").isReachable(1000)); | |
} catch(Exception e) { | |
println(e.toString()); |
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
import java.net.http.*; | |
import java.net.URI; | |
import java.net.http.HttpResponse.BodyHandlers; | |
void sendReq() { | |
HttpClient client = HttpClient.newHttpClient(); | |
HttpRequest request = HttpRequest.newBuilder() | |
.uri(URI.create("http://google.com/")) | |
.build(); |
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
import java.io.PrintStream; | |
import java.io.FileOutputStream; | |
import java.sql.Timestamp; | |
void setup() { | |
try{ | |
PrintStream outStream = new PrintStream(new FileOutputStream(dataPath("out.log"))); | |
PrintStream errStream = new PrintStream(new FileOutputStream(dataPath("err.log"))); | |
System.setOut(outStream); | |
System.setErr(errStream); |
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
import controlP5.*; | |
SettingsManager sm; | |
ControlP5 cp5; | |
boolean visible; | |
float speed; | |
void setup() { | |
size(400, 400); |