Skip to content

Instantly share code, notes, and snippets.

View renaudfv's full-sized avatar
☀️

Renaud Vincent renaudfv

☀️
View GitHub Profile
@renaudfv
renaudfv / ConfigLoaderUI.pde
Last active September 27, 2022 16:18
Processing config file loader and UI
import controlP5.*;
SettingsManager sm;
ControlP5 cp5;
boolean visible;
float speed;
void setup() {
size(400, 400);
@renaudfv
renaudfv / ProcessingLogging.pde
Last active October 6, 2022 15:16
Simple Processing logging setup
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);
@renaudfv
renaudfv / ProcessingHttp.pde
Created February 7, 2023 18:46
Processing sketch to send HTTP Get Requests
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();
@renaudfv
renaudfv / ProcessingPing
Created February 7, 2023 19:11
Processing sketch on how to synchronously ping devices
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());
@renaudfv
renaudfv / LoggingExemple.pde
Created February 22, 2023 15:08
Processing logger using java util logging lib
import java.util.logging.*;
import java.util.Date;
// Main logger
Logger LOGGER = Logger.getLogger("");
MyCustomClass customInstance;
void setupLogging() {