Skip to content

Instantly share code, notes, and snippets.

View Gregwar's full-sized avatar

Grégoire Passault Gregwar

View GitHub Profile
@Gregwar
Gregwar / mjx_benchmark.py
Last active March 15, 2024 20:37
MJX XLA Benchmark script
import mujoco
import time
import jax
from mujoco import mjx
import argparse
argparser = argparse.ArgumentParser()
argparser.add_argument("--xml", help="Path to scene", type=str, required=True)
argparser.add_argument("--n", help="Parallel GPU instances", type=int, default=1024)
argparser.add_argument(
@Gregwar
Gregwar / send_to_kodi.py
Created January 21, 2024 17:51
Play URL to Kodi
# Can be use to send an url (e.g: http://.../movie.mp4) to your Kodi media center
# You have to enable HTTP control (without password)
# This can be used on an Android Phone with pyDroid (don't forget to pip install requests)
import requests
# Kodi IP address
kodi = "192.168.1.34"
url = input("Enter URL: ")
@Gregwar
Gregwar / frames.py
Last active November 9, 2022 15:46
import time
import numpy as np
import meshcat
import meshcat.geometry as g
import meshcat.transformations as tf
vis = meshcat.Visualizer()
cylinders: dict = {}
Test
@Gregwar
Gregwar / ivp.py
Last active April 26, 2020 19:13
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import solve_ivp
a, y0, g0 = 3, 100, 100
T = np.linspace(0, 30, 30)
gs = []
for t in T:
# G depends on Y
def f(x):
return 123
@Gregwar
Gregwar / exemple.java
Created January 29, 2019 10:34
Exemple base de données PT2
static void listerLesFilms()
{
String requete = "SELECT nom, annee FROM movies";
try {
Statement stmt = connexion.createStatement();
ResultSet results = stmt.executeQuery(requete);
while (results.next()) {
System.out.println("* Film, nom: "+results.getString("nom")+", année: "+results.getString("annee"));
}
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
class Program
{
public static void Main()
{
@Gregwar
Gregwar / Program.cs
Last active September 5, 2017 15:14
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Text;
class Program
{
public static void Main()
{
<?php
class A {
private $x;
public function __sleep() {
return ['x'];
}
}
class B extends A {