Skip to content

Instantly share code, notes, and snippets.

Renaud Richardet renaud

  • EPFL
  • Lausanne, Switzerland
Block or report user

Report or block renaud

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View RegexCheatsheet.md

Regular Expression Cheat Sheet - PCRE

Anchor Description Example Valid match Invalid
^ start of string or line ^foam foam is fun bath foam
$ end of string or line ish$ finish finishing
\b word boundary; position between a word character (\w), and a nonword character (\W) \bis\b This island is beautiful This island isn't beautiful
\B not-word-boundary. \Bland island peninsula

|Char class|Description|Example|Valid match|Invalid|

@renaud
renaud / beerfiller_v2.ino
Created Jan 2, 2018
Arduino beerfiller
View beerfiller_v2.ino
// dec 2017
// max 2 open at the same time
// oct 2017, works well
// compact for-loop
// same threshold everywhere
// improved debugging output
const int STOP_BUTTON = 12;
const int START_BUTTON = 2;
const int ALL_OFF_LED = 1;
@renaud
renaud / .block
Last active Oct 24, 2017
Visualizing PageRank
View .block
license: apache-2.0
height: 650
scrolling: no
border: no
@renaud
renaud / acronyms.py
Created Aug 22, 2016
Link abbreviations to their full names Based on A Simple Algorithm for Identifying Abbreviations Definitions in Biomedical Text A. Schwartz and M. Hearst Biocomputing, 2003, pp 451-462.
View acronyms.py
#!/usr/bin/env python
'''Link abbreviations to their full names
Based on
A Simple Algorithm for Identifying Abbreviations Definitions in Biomedical Text
A. Schwartz and M. Hearst
Biocomputing, 2003, pp 451-462.
@renaud
renaud / tornado_rest_server.py
Created Feb 16, 2016
Tornado REST server base template
View tornado_rest_server.py
'''
REST endpoint
'''
import os, json
from datetime import date
from tornado import ioloop, web, autoreload
''' serves index.html'''
View fakePom.diff
diff --git a/src/main/resources/fakePom.ftl b/src/main/resources/fakePom.ftl
index 8885fd6..12ca17e 100644
--- a/src/main/resources/fakePom.ftl
+++ b/src/main/resources/fakePom.ftl
@@ -16,6 +16,13 @@
<version>2.6.1-json</version>
<scope>provided</scope>
</dependency>
+ <!-- TODO workaround https://gist.githubusercontent.com/mantognini/2fbeec6fb86aa5290b89/raw/651009b68e72163141f24e982d0bf3bfaddce3ea/stack1 -->
+ <dependency>
@renaud
renaud / diff
Created Mar 13, 2015
log level
View diff
diff --git a/src/main/java/org/sherlok/PipelineLoader.java b/src/main/java/org/sherlok/PipelineLoader.java
index 74a42cf..c057421 100644
--- a/src/main/java/org/sherlok/PipelineLoader.java
+++ b/src/main/java/org/sherlok/PipelineLoader.java
@@ -263,6 +263,14 @@ public class PipelineLoader {
resolvedArtifact);
}
}
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("CLASSPATH at end of solveDependencies():");
@renaud
renaud / gist:a025fb10d66575412355
Created Mar 13, 2015
http://localhost:9600/annotate/bluima.token?text=Text
View gist:a025fb10d66575412355
{
"cause" : {
"arguments" : [ "org.apache.uima.ruta.engine.RutaEngine", "<unknown>" ],
"cause" : {
"arguments" : [ "file:/Volumes/HDD2/ren_data/dev_hdd/uima/sherlok/sherlok_core/config/resources/.engines/TokenAnnotator___0_1.xml" ],
"cause" : {
"arguments" : [ "file:/Volumes/HDD2/ren_data/dev_hdd/uima/sherlok/sherlok_core/config/resources/.engines/TokenAnnotator___0_1.xml" ],
"cause" : {
"arguments" : [ "file:/Volumes/HDD2/ren_data/dev_hdd/uima/sherlok/sherlok_core/config/resources/.engines/TokenAnnotator___0_1.xml" ],
"cause" : {
View angular-post-fix.js
// Modifies $httpProvider for correct server communication (POST variable format)
angular.module('http-post-fix', [], function($httpProvider) {
// This code is taken from http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/
// Use x-www-form-urlencoded Content-Type
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
// Override $http service's default transformRequest
$httpProvider.defaults.transformRequest = [function(data) {
/**
@renaud
renaud / lucas.diff
Created Aug 11, 2014
Fixing UIMA Lucas
View lucas.diff
/uima-addons-2.3.1/Lucas$ st
M src/main/java/org/apache/uima/lucas/indexer/analysis/SplitterFilter.java
M pom.xml
/uima-addons-2.3.1/Lucas$ svn diff
Index: src/main/java/org/apache/uima/lucas/indexer/analysis/SplitterFilter.java
===================================================================
--- src/main/java/org/apache/uima/lucas/indexer/analysis/SplitterFilter.java (revision 1347596)
+++ src/main/java/org/apache/uima/lucas/indexer/analysis/SplitterFilter.java (working copy)
@@ -20,6 +20,7 @@
package org.apache.uima.lucas.indexer.analysis;
You can’t perform that action at this time.