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
// | |
// FlycutOperator.m | |
// Flycut | |
// | |
// Flycut by Gennadiy Potapov and contributors. Based on Jumpcut by Steve Cook. | |
// Copyright 2011 General Arcade. All rights reserved. | |
// | |
// This code is open-source software subject to the MIT License; see the homepage | |
// at <https://github.com/TermiT/Flycut> for details. | |
// |
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
""" | |
Spyder hacks: backup and edit config files for each environment. | |
Upcoming release Spyder 5 will hopefully offer something better than this soon. | |
Created 28 May 2020 | |
@author: Patrick Toche | |
""" | |
# import common packages here, otherwise import inside each function (helps me understand which packages are needed where and how much they are needed) | |
import os |
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
# benchmark computing time differences | |
n = 1e6 | |
set.seed(1) | |
Date = sort(replicate(n, paste0(Sys.Date(), " ", | |
sample(0:23, 1), ":", sample(0:59, 1), ":", sample(0:59, 1)))) | |
Date <- as.POSIXct(Date, format="%Y-%m-%d %H:%M:%S", tz = "Europe/Paris") | |
diff_seq_along <- function(x) { | |
x[seq_along(x)+1]-x[seq_along(x)] |
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
%\documentclass[border=12pt]{standalone} | |
\documentclass{article} | |
\usepackage[active,tightpage]{preview} | |
\usepackage{tikz} | |
\usetikzlibrary{calc} | |
\PreviewEnvironment{tikzpicture} | |
\usepackage{pgfplots} | |
\usepackage{fourier} |
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 ruby | |
require "csv" | |
File.open("contacts.adr", "r") do |f| | |
contacts = [] | |
f.read.split("#CONTACT").each do |entry| | |
unless entry.empty? | |
contact = {} | |
entry.each_line do |line| |
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
## create 'nice' annual breaks for use with ggplot | |
## because sometimes it's tedious to 'manually' set the minimum and maximum of the date range, | |
## when the data starts on odd years, like 1927, but you really want the labels to start at 1925 | |
## x denotes the date variable, e.g. x = df$date | |
## for m = 5, the breaks will be multiples of 5 years | |
## breaks below min and above max | |
## replace floor and ceiling with round, if desired | |
annual_breaks <- function(x, m = 5) { | |
require('scales') |
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
% Bibliography on the Secretary Problem and Related Games (Dynkin's game, Poisson search games, etc.) | |
@Article{Abdelaziz:Krichen:2005, | |
author = {Ben Abdelaziz, F. and Krichen, S.}, | |
title = {An Interactive Method for the Optimal Selection Problem with Two Decision Makers}, | |
journal = {European Journal of Operational Research}, | |
volume = {162}, | |
number = {3}, | |
year = {2005}, |
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
# global.R | |
# Static Non-Reactive Area | |
# Read Survey Questions & Suggested Answers | |
Q <- read.csv("survey.csv", 'header' = FALSE) | |
# column 1 : questions | |
# column 2+: several answers | |
# Store Survey Questions & User Answers in a dataframe |
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
// This script just listens for "enter"s on the text input and simulates | |
// clicking the "send" button when that occurs. Totally optional. | |
jQuery(document).ready(function(){ | |
jQuery('#entry').keypress(function(evt){ | |
if (evt.keyCode == 13){ | |
// Enter, simulate clicking send | |
jQuery('#send').click(); | |
} | |
}); | |
}) |
NewerOlder