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
(def x `(1 2 3)) | |
(def y `(4 5 6)) | |
(def z `(7 8 9)) | |
(println (mapcat list x y z)) |
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
//perfect number | |
//http://4clojure.com/problem/80 | |
let perfectnumber x = | |
let rec divisor x counter l= | |
match counter < x with | |
|true when x % counter < 1-> divisor x (counter + 1) (counter::l) | |
|true -> divisor x (counter + 1) l | |
|_ -> (l |> List.fold (+) 0) = x | |
divisor x 1 [] | |
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
//P09 Pack consecutive duplicates of list elements into sublists. | |
// https://sites.google.com/site/prologsite/prolog-problems/1 | |
let packDups l = | |
let result = List.foldBack ( | |
fun ele (flist,(mainlist:List<List<_>>)) -> | |
match (flist,mainlist) with | |
|([],_) -> (ele::flist,mainlist) | |
|(h::_,_) when ele = h -> ((ele::flist),mainlist) | |
|(_::_,[]) -> ([ele], [flist]) | |
|(_::_,_) -> ([ele],flist::mainlist) |
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
(* | |
http://4clojure.com/problem/92 | |
Roman numerals are easy to recognize, but not everyone knows all the rules necessary to work with them. | |
Write a function to parse a Roman-numeral string and return the number it represents. | |
You can assume that the input will be well-formed, in upper-case, and follow the subtractive principle. | |
You don't need to handle any numbers greater than MMMCMXCIX (3999), the largest number representable with ordinary letters. | |
(= 14 (__ "XIV")) |
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 isprime i = | |
List.filter(fun x -> i%x = 0) [1..i] | |
|> List.length = 2 | |
let primefactor x = | |
let rec innerprime number divisor l= | |
let intermedidate = number /divisor | |
match (not(isprime intermedidate ),number > divisor) with | |
|true,true when number % divisor = 0 -> innerprime intermedidate divisor (divisor::l) | |
|_,true when number % divisor = 0 -> intermedidate::divisor::l |
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
#! /bin/sh | |
curl -O http://download.linqpad.net/preview/LINQPad4.zip | |
unzip -q -o -d /cygdrive/c/tools/ LINQPad4.zip | |
rm LINQPad4.zip |
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
as /c stack !CLRStack; | |
.if ($spat("${stack}","*Foo*")) | |
{ $$ do the evaluation} |
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
0:000> !do @esi | |
Name: System.Data.SqlClient.SqlCommand | |
MethodTable: 60b9fcb0 | |
EEClass: 60ac8eac | |
Size: 132(0x84) bytes | |
File: C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll | |
Fields: | |
MT Field Offset Type VT Attr Value Name | |
6897f638 40001cf 4 System.Object 0 instance 00000000 __identity | |
662a2480 40001ae 8 ...ponentModel.ISite 0 instance 00000000 site |
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
.foreach ( $obj {$$>a<"d:\Debuggersx86\dumplist.txt" poi(poi(poi(@esi+18)+8)+4)}) { !do poi(${$obj}+38)} | |
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
Name: System.Data.SqlClient.SqlParameter | |
MethodTable: 60ba012c | |
EEClass: 60ac8ef0 | |
Size: 100(0x64) bytes | |
File: C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll | |
Fields: | |
MT Field Offset Type VT Attr Value Name | |
6897f638 40001cf 4 System.Object 0 instance 00000000 __identity | |
60ba1e18 400195f 8 ...qlClient.MetaType 0 instance 00000000 _metaType | |
60ba3cac 4001960 c ...ient.SqlCollation 0 instance 00000000 _collation |
OlderNewer