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 time,os | |
import matplotlib.pyplot as plt | |
import matplotlib.ticker as ticker | |
import matplotlib.dates as mdates | |
from datetime import datetime | |
import matplotlib | |
import locale | |
def plotter(x,y,path,y_text,title,unit): | |
locale.setlocale(locale.LC_TIME, "fr_FR.UTF-8")#Édite la locale vers le français pour avoir des jours de la semaines français |
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
package fr.redblaze.theredcite; | |
import java.io.File; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.logging.Logger; | |
import org.bukkit.Location; | |
import org.bukkit.World; | |
import org.bukkit.command.Command; |
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
#!/usr/bin/env python | |
from stat import S_ISREG, ST_CTIME, ST_MODE | |
import os, sys, time | |
def digit(input,nb): | |
output=str(input) | |
while(len(output)<nb): | |
output="0"+output | |
return output |
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
"start": { | |
"prefix": "startC", | |
"scope": "c", | |
"body": [ | |
"#include<stdlib.h>", | |
"#include<stdio.h>", | |
"", | |
"int main(){", | |
" $1", | |
"}" |
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 os | |
import random | |
path="music/" | |
files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))] | |
print("Nombre de musiques: {}".format(len(files))) | |
random.shuffle(files) | |
data="\n".join(["file '{}{}'".format(path,file) for file in files]) | |
with open("list.txt","w") as concat_file: |
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 cv2, imutils | |
from imutils.video import VideoStream | |
from os import path | |
import os | |
from shutil import copy | |
import time, tqdm | |
import pickle | |
def digit(input,nb): | |
output=str(input) |
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
class JsonConfig(): | |
def __init__(self, filepath): | |
self.last_timestamp_loaded = None | |
self.file = None | |
if not os.path.exists(filepath): | |
with open(filepath, "w") as f: json.dump({}, f) | |
print(filepath, os.path.exists(filepath)) | |
self.filepath = filepath | |
self.lockpath = f"{filepath}.lock" |
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 plotly.graph_objects as go | |
import dash | |
from dash import dcc | |
from dash.dependencies import Input, Output | |
from dash import html | |
from functools import partial | |
import serial | |
class LiveGraph(): |
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 plotly.express as px | |
from datetime import datetime | |
dates_str = ["21/07/1998", "21/08/1998", "21/09/1998", "21/10/1998", "21/11/1998", "21/12/1998"] # X | |
valeurs = [1, 2, 3, 3, 2, 1] # Y | |
# %d = jour du mois 00-31 | |
# %m = mois de l'année 00-12 | |
# %Y = année en 4 chiffres 0000-9999 | |
format_date = "%d/%m/%Y" |
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
std::atomic_bool revoxelizing = false; | |
void revoxelize(LBM* lbm, Mesh* mesh) { // voxelize new frames in detached thread in parallel while LBM is running | |
for(uint n=0u; n<lbm->get_N(); n++) lbm->flags[n] &= ~TYPE_S; // clear flags | |
const float3x3 rotation = float3x3(float3(0.0f, 1.0f, 0.0f), radians(0.8f)); // create rotation matrix to rotate mesh | |
mesh->rotate(rotation); // rotate mesh | |
voxelize_mesh_hull(*lbm, mesh, TYPE_S); // voxelize rotated mesh in lbm.flags | |
revoxelizing = false; // indicate new voxelizer thread has finished | |
} | |
void main_setup() { // Rotating rocket | |
// ######################################################### define simulation box size, viscosity and volume force ############################################################################ |
OlderNewer