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
import sys | |
import cv2 | |
import numpy as np | |
""" | |
Convert image to Gimp gradient. | |
Usage: python image2gradient.py input_image | |
Output gradient in stdout. Place it in something like | |
~/.config/GIMP/2.x/gradients or |
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
# Example of use of Afanasy's API to generate a summary of the state of the | |
# render farm. | |
# Copyright (c) 2016 rise|fx (Elie Michel) - Released under MIT License | |
import af | |
cmd = af.Cmd() | |
def isSysJob(job): | |
return job['st'] == 0 |
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
# ########################################################################### # | |
# MVA -- Reinforcement Learning -- TP2 | |
# ########################################################################### # | |
# | |
# Code base for the TP2 of the MVA lecture Reinforcement Learning, by | |
# Alessandro Lazaric. This is a Python port of the MATLAB base provided by the | |
# TP advisor Émilie Kaufmann: | |
# http://chercheurs.lille.inria.fr/ekaufman/teaching.html | |
# | |
# Do not hesitate to report any suggestion or bugfix to |
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
def getNearestUCDpulse(azimuth, elevation, h3D): | |
""" | |
retrieves the impulse response from h3D that is closest to the specified | |
azimuth and elevation (in degrees) | |
h3D is the array containing all HRTFs for a given subject (left or right) | |
""" | |
elmax = 50 | |
elindices = np.arange(elmax) | |
elevations = -45 + 5.625 * elindices |
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
/** | |
* Extrait de code à exécuter dans la console du navigateur pour ajouter | |
* sous les prix le prix au mètre-carré et le prix par chambre dans les | |
* résultats de logement sur seloger.com | |
* Fonctionne au 17/04/2017, mais puisque le code est très ad-hoc il faudra | |
* sûrement le mettre à jour à chaque màj de seloger.com | |
* | |
* Existe aussi pour pap.fr : | |
* https://gist.github.com/eliemichel/e292bae7b439e15cf7da37ae518f08dc | |
* |
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
/** | |
* Extrait de code à exécuter dans la console du navigateur pour ajouter | |
* sous les prix le prix au mètre-carré et le prix par chambre dans les | |
* résultats de logement sur pap.fr | |
* Fonctionne au 17/04/2017, mais puisque le code est très ad-hoc il faudra | |
* sûrement le mettre à jour à chaque màj de pap.fr | |
* | |
* Existe aussi pour seloger.com : | |
* https://gist.github.com/eliemichel/1c6f27be406a22a0d5114020c616d3e8 | |
* |
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
Qless server API | |
================ | |
The first argument is always `now`, the current timestamp. It is not precised for each method in the documentation because bindings usually automatically prepend it to the argument list. But if you are calling the server directly in lua, you will need it. | |
The best way to have more information about the methods documented here is to look at `api.lua`. The commands available in the API are the members of the `QlessAPI` table, which are easily readable and point to methods provided in other files. For instance, if the body of the method looks like `return Qless.Job(jid):foobar(...)`, then it is likely that the function is defined and documented in `job.lua` because it's getting a `Job` object. If you cannot say at first because it's not using an object, it must be in `base.lua`. | |
# Config | |
## config.get([key]) |
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
// Author: Élie Michel | |
// License: CC BY 3.0 | |
// July 2017 | |
void mainImage( out vec4 f, in vec2 c ) | |
{ | |
vec2 u = c / iResolution.xy, | |
n = texture(iChannel1, u * .1).rg; // Displacement | |
f = textureLod(iChannel0, u, 2.5); |
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
#define a(p) textureLod(iChannel0, p, 2.5) | |
#define t texture(iChannel1, | |
void mainImage( out vec4 c, vec2 g ) | |
{ | |
c = a(g /= iResolution.xy); | |
vec2 x = vec2(20); | |
vec4 n = t round(g*x - .3) / x); | |
vec2 z = g*x * 6.3 + (t g * .1).rg - .5) * 2.; | |
x = sin(z) - fract(iTime * (n.b + .1) + n.g) * .5; |
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
// Copyright (c) 2017 - Élie Michel | |
// License: CC BY 3.0 | |
// Please credit even if you are just re-using the particle system. | |
// Sync with 'Image' buffer | |
const float dt = 0.001; | |
mat3 particleSpaceMatrix(vec2 origin, vec2 velocity) { | |
vec3 O = vec3(origin, 1.); | |
vec3 X = normalize(vec3(velocity, 0.)); |
OlderNewer