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
(defun project-euler-1 (n) | |
"Implementation for Project Euler 1" | |
(let ((sum 0)) | |
(dotimes (i n) | |
(if (or (= 0 (% i 3)) (= 0 (% i 5))) | |
(setq sum (+ sum i)))) | |
sum)) | |
(project-euler-1 1000) | |
(defvar memoize (make-hash-table :test 'equal)) |
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 'json' | |
require 'httparty' | |
require 'logger' | |
KB_PROJECT_ID = 12345 | |
GITHUB_TOKEN_ID = 'abcdef' | |
project_location = project = 'my_project' | |
project = ARGV[0] if !ARGV.empty? |
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
% | |
% my-local-deps.pl | |
% marelle-deps | |
% | |
meta_pkg('my-local-deps', [ | |
cntlm, | |
git, | |
tig, | |
emacs, |
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
(defvar counter 0) | |
(defun print-message () | |
(setq counter (1+ counter)) | |
(message "Hello World %s" counter)) | |
(run-with-timer 20 20 'print-message) | |
(cancel-timer (car timer-list)) |
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
➋ greystones:~/tmp (master)$ cat main.rs | |
fn main() { | |
println!("Hello World!"); | |
} | |
➋ greystones:~/tmp (master)$ rustc main.rs | |
➋ greystones:~/tmp (master)$ ls -al | grep main | |
-rwxr-xr-x 1 sebastien sebastien 3049726 mars 23 15:36 main | |
-rw-r--r-- 1 sebastien sebastien 43 mars 23 15:35 main.rs |
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
# coding: utf-8 | |
PREFIXES = ['Gal', 'Glan', 'Glas', 'Kil', 'Lough', 'Rath', 'Ty', 'Ennis', 'Dun', 'Dolly'] | |
SUFFIXES = ['bally', 'farne', 'ealy', 'liney', 'cullen', 'coole', 'cock', 'nagh', 'negal', 'garvan', 'gloe', 'corthy', 'kerry'] | |
number = ARGV[0].to_i || 5 | |
number.times { puts PREFIXES.sample + SUFFIXES.sample } |
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
Galadhir | |
Galadgorn | |
Isentirith | |
Núrdûr | |
Galadtirith | |
Isenmorgul | |
Dagordel | |
Fandale | |
Isendûr | |
Galadbad |
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
require 'wavefile' | |
def sine_samples(sample_rate, duration, frequency) | |
total_frames = (duration*sample_rate).to_i | |
samples = [] | |
total_frames.times.map do |k| | |
samples << Math.sin(2*Math::PI*frequency*k/sample_rate) | |
end | |
samples |
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 java.util.concurrent.DelayQueue | |
import java.util.concurrent.Delayed | |
import java.util.concurrent.TimeUnit | |
long start = System.currentTimeMillis() | |
class DelayObject implements Delayed { | |
def data | |
def triggerTime |
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
# | |
# A fatal error has been detected by the Java Runtime Environment: | |
# | |
# SIGSEGV (0xb) at pc=0x00007ff2683cb4e8, pid=8904, tid=140678909056768 | |
# | |
# JRE version: Java(TM) SE Runtime Environment (7.0_80-b02) (build 1.7.0_80-ea-b02) | |
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.80-b07 mixed mode linux-amd64 compressed oops) | |
# Problematic frame: | |
# V [libjvm.so+0x5624e8] PhaseCFG::schedule_early(VectorSet&, Node_List&)+0x1f8 | |
# |
OlderNewer