An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
(ns bootcamp.factorial) | |
(defn fast-factorial [number] | |
(loop [n number factorial 1] | |
(if (zero? n) | |
factorial | |
(recur (- n 1) (* factorial n))))) | |
(defn fast-no-loop-factorial | |
([number] (fast-no-loop-factorial number 1)) |
An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
#include <cstddef> | |
#include <cstdint> | |
#include <cstdio> | |
namespace util { | |
struct funcs; | |
template <typename S> struct mh3_internal; | |
template <typename S, S default_seed> struct mh3; | |
typedef mh3<uint32_t, 0> mh3_default; |
This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
<html> | |
<head> | |
<script type="text/javascript"> | |
window.onload = draw; | |
function draw(){ |
;; Keybonds | |
(global-set-key [(hyper a)] 'mark-whole-buffer) | |
(global-set-key [(hyper v)] 'yank) | |
(global-set-key [(hyper c)] 'kill-ring-save) | |
(global-set-key [(hyper s)] 'save-buffer) | |
(global-set-key [(hyper l)] 'goto-line) | |
(global-set-key [(hyper w)] | |
(lambda () (interactive) (delete-window))) | |
(global-set-key [(hyper z)] 'undo) |
create a new dir
$ mkdir /tmp/ruby
$ cd /tmp/ruby
create extconf.rb
The MIT License (MIT) | |
Copyright (c) <year> <copyright holders> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
package org.linux.X11; | |
import com.sun.jna.Native; | |
import com.sun.jna.NativeLong; | |
import com.sun.jna.platform.unix.X11; | |
import java.awt.*; | |
/** | |
* Author: Vladimir Kravets |