Skip to content

Instantly share code, notes, and snippets.

View sylvchev's full-sized avatar

Sylvain Chevallier sylvchev

View GitHub Profile
@nguigs
nguigs / Grassmann_Kmeans.py
Created December 2, 2022 10:50
Toy example for online kmeans on the Grassmann manifold
"""Riemannian k-means on the Grassmann Manifold.
Nicolas Guigui, 29/11/2022
"""
import geomstats.backend as gs
from geomstats.geometry.grassmannian import Grassmannian
from geomstats.learning.online_kmeans import OnlineKMeans
n_samples = 10
@robertoostenveld
robertoostenveld / unicorn2lsl.py
Created October 9, 2022 16:15
This is a native python implementation to stream data from a Unicorn EEG system to LSL. It works on macOS, Linux and Windows.
#!/usr/bin/env python
# Unicorn2lsl streams data from a Unicorn Hybrid Black EEG system to LSL
#
# Copyright (C) 2022 Robert Oostenveld
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@gemeinl
gemeinl / to_scikit_learn_API.ipynb
Last active June 15, 2021 11:21
Braindecode with sci-kit learn pipeline chaining
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hichamjanati
hichamjanati / plot_optim.py
Last active November 12, 2021 18:19
Optimization visualization with pyvista
import pyvista as pv
import numpy as np
make_gif = True
# increase n_points for a higher resolution
n_points = 100
xmin, xmax = -1.2, 1.2
bounds = 1.25 * np.array([xmin, xmax, xmin, xmax, 0., 0.])
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Chaser324
Chaser324 / GitHub-Forking.md
Last active June 16, 2024 07:13
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@dan-blanchard
dan-blanchard / .1.miniconda.md
Last active December 11, 2019 22:38
Quicker Travis builds that rely on numpy and scipy using Miniconda

For ETS's SKLL project, we found out the hard way that Travis-CI's support for numpy and scipy is pretty abysmal. There are pre-installed versions of numpy for some versions of Python, but those are seriously out of date, and scipy is not there are at all. The two most popular approaches for working around this are to (1) build everything from scratch, or (2) use apt-get to install more recent (but still out of date) versions of numpy and scipy. Both of these approaches lead to longer build times, and with the second approach, you still don't have the most recent versions of anything. To circumvent these issues, we've switched to using Miniconda (Anaconda's lightweight cousin) to install everything.

A template for installing a simple Python package that relies on numpy and scipy using Miniconda is provided below. Since it's a common s

@leandrosilva
leandrosilva / README
Last active March 17, 2023 19:05
Parsing Syslog files with Python and PyParsing
$ python xlog.py sample.log
{'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68898', 'priority': '132', 'message': 'bla bla bla warn'}
{'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68902', 'priority': '131', 'message': 'bla bla bla error'}
{'appname': 'Dock', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '154', 'priority': '11', 'message': 'CGSReleaseWindowList: called with 5 invalid window(s)'}
{'appname': 'WindowServer', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '79', 'priority': '11', 'message': 'CGXSetWindowListAlpha: Invalid window 0'}
$ python xlog.py sample.log | grep test.app
{'priority': '132', 'timestamp': '2020-03-04 12:42:40', 'hostname': 'codezone.local', 'appname': 'test.app', 'pid': '68898', 'message': 'bla bla bla warn'}