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
[~/Desktop]$ aptitude moo | |
There are no Easter Eggs in this program. | |
[~/Desktop]$ aptitude moo -vv | |
Didn't I already tell you that there are no Easter Eggs in this program? | |
[~/Desktop]$ aptitude moo -vvv | |
Stop it! | |
[~/Desktop]$ aptitude moo -vvvv | |
Okay, okay, if I give you an Easter Egg, will you go away? |
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 uses the @ operator (aka List.append) which is not tail recursive *) | |
let suffixes list = | |
let rec loop l acc = | |
match l with | |
| [] -> acc | |
| x::xs -> loop xs (acc @ [xs]) in | |
loop list [list] | |
(* This uses an operator @+ constructed from two tail recursive methods... :P *) |
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
(* Brian McNamara's approach isn't actually that bad, unless List had an efficient append. But simplify it like so... *) | |
let suffixesTR3 list = | |
let rec loop l acc = | |
match l with | |
| [] -> acc | |
| _::xs -> loop xs (xs :: acc) in | |
List.rev (loop list [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
let subs (s:string) = | |
let lim = s.Length - 1 | |
[ for ii in [0..lim] do | |
for jj in [0..lim] do // can these two be combined? | |
if ii < jj then | |
yield s.[ii..jj] ] | |
let isPalindrome s = | |
let s' = Array.ofSeq 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
margin: 40px; | |
} | |
a { | |
display: inline-block; |
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
open System | |
open System.IO | |
// use an @ string | |
let list = @"C:\list.txt" | |
// initialize a reader | |
let reader = new StreamReader(list) | |
// create a list of lines |
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/bash | |
FSI="/cygdrive/c/fsharp/FSharp-2.0.0.0/bin/fsi.exe" | |
FLAGS="--nologo" | |
if [[ $# -eq 0 ]] | |
then | |
exec "$FSI" "$FLAGS" |
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
// Copyright © 2011, Kevin Cantu, [email protected] | |
// | |
// Usage: runfsi --nologo --exec args2.fs -- $@ | |
module Simple | |
open System | |
open System.IO |
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
using System; | |
using System.IO; | |
using Gtk; | |
namespace DemoII | |
{ | |
public class FruitTreePiece | |
{ | |
public string name; | |
public string description; |
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
fn f(s : option::t<str>) { | |
let r = alt s { | |
some(ss) { { x: 123, y: ss } } | |
none. { fail } | |
}; | |
} |
OlderNewer