This file contains hidden or 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
| /* REXX *** */ | |
| /* echo the input parameters */ | |
| PARSE ARG parms | |
| nargs = WORDS(parms) | |
| Say 'There are 'nargs' parameters' | |
| DO i = 1 to nargs | |
| Say Right(i,4)'=>'WORD(parms,i) | |
| End i | |
| Exit 0 |
This file contains hidden or 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
| fibonacci(n: ZZ): ZZ requires { n >= 0 } = | |
| if n < 2 then n else fibonacci(n-1) + fibonacci(n-2) end |
This file contains hidden or 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/local/bin/perl | |
| # | |
| # create a series of directories | |
| # | |
| if ($#ARGV != 2) { | |
| print "usage: mkdirs base start stop\n"; | |
| exit; | |
| } | |
| $base = $ARGV[0]; |
This file contains hidden or 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
| with Gnat.Io; use Gnat.Io; | |
| procedure Arr1 is | |
| A: array(1..5) of Integer; -- Array subscripts 1 to 5. | |
| I: Integer; | |
| begin | |
| -- Read 'em in. | |
| for I in 1..5 loop | |
| Put("> "); | |
| Get(A(I)); | |
| end loop; |
This file contains hidden or 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))))) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) |