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
# Encoding: UTF-8 | |
Encoding.default_external = "UTF-8" | |
require 'benchmark' | |
BLACKLIST = %w(på og er om fra med i to det å | |
ditt til ved fra for av en din | |
du at vi har vil nå det som dere | |
kan vår så) |
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 './parser' | |
require './nodes_eval' | |
class Runtime | |
def initialize | |
@file = "test.log" | |
end | |
def loglines | |
@lines = File.readlines(@file) | |
@lines.each_with_index do |line, index| |
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
=begin | |
TO INSTALL DEPENDENCIES | |
----------------------- | |
gem install ffi <-- For Windows users | |
gem install clipboard | |
=end | |
HTML_CODES = { | |
"&" => "&", | |
">" => ">", |
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
REBOL [ | |
Title: "Euler1 dialecting example" | |
Author: "Torbjørn Marø" | |
Home: http://blog.kjempekjekt.com | |
Date: 19-Dec-2011 | |
Purpose: { | |
This script demonstrates how to use the built in parse | |
functionality of Rebol to create an internal DSL. | |
This particular DSL lets you create sums that are the |
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/ruby | |
# | |
# Betterave -- Programmation fonctionnelle obscure | |
# | |
class Source | |
attr_reader :index, :stuff | |
def initialize(stuff) |
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
unless ARGV.length == 2 | |
raise <<EOF | |
Usage: mywebapp_stats.rb folder filepattern | |
Example: mywebapp_stats.rb . AccountWeb.log* | |
EOF | |
end |
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
// JUST A TEST FORM WITH TWO SCOPE CONTROLS AND SOME RANDOM DATA | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Drawing; | |
using System.Linq; | |
using System.Windows.Forms; | |
using System.Threading; | |
using System.Threading.Tasks; |
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
class Stack_calc(object): | |
'''Stack calulator''' | |
def __init__(self): | |
self.item = [] | |
self.calculate = | |
{'+' : lambda: self.item.append(self.item.pop() + self.item.pop()), | |
'-' : lambda: self.item.append(self.item.pop() - self.item.pop()), | |
'*' : lambda: self.item.append(self.item.pop() * self.item.pop()), | |
'/' : lambda: self.item.append(self.item.pop() / self.item.pop())} |
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 will generate a formatting demo | |
;; Call it with a filename to dump demo to file | |
(ns demo.formatting | |
(:use [clojure.contrib.duck-streams :only [with-out-writer]] | |
[clojure.string :only [join]]) | |
(:import java.util.Date)) | |
(defn print-demo-code [fmt & args] | |
(printf "%-50s ;=> %s%n" |
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
(ns si_prefix.core | |
(:use clojure.test | |
clojure.contrib.generic.math-functions)) | |
(def factors | |
(zipmap [:y :z :a :f :p :n :u :m :k :M :G :T :P :E :Z :Y] | |
(map (partial pow 1000) | |
(filter (complement zero?) | |
(range -8 9))))) |