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
type 'a ty = | |
| Abbrev of 'a list * string | |
| Function of 'a ty * 'a ty | |
| Record of string * (string * 'a) list | |
| Tuple of 'a ty list | |
| Union of string * (string * 'a 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 rec type_of f = function | |
| ty when Reflection.FSharpType.IsFunction ty -> | |
let ty_arg, ty_ret = Reflection.FSharpType.GetFunctionElements ty | |
Function(type_of f ty_arg, type_of f ty_ret) | |
| ty when Reflection.FSharpType.IsTuple ty -> | |
Tuple | |
[ for ty in Reflection.FSharpType.GetTupleElements ty do | |
yield type_of f ty ] | |
| ty when Reflection.FSharpType.IsRecord ty -> | |
Record( ty.Name, |
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
> List.fold.GetType() | |
|> type_of (fun (ty: System.Type) -> ty.Name);; | |
val it : string ty = | |
Function | |
(Function | |
(Abbrev ([],"System.Object"), | |
Function (Abbrev ([],"System.Object"),Abbrev ([],"System.Object"))), | |
Function | |
(Abbrev ([],"System.Object"), | |
Function |
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
;; acgetchell's solution to A nil key | |
;; https://4clojure.com/problem/134 | |
(fn f [key map] (and (#(contains? map key)) (#(nil?(val(find map key)))))) |
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
;; From http://clojure-euler.wikispaces.com/Problem+007 | |
;; Useful examples on how easy it is to do number processing in Clojure | |
;; achim_p's solution, understandable and REPLicable | |
(defn div? [n d] | |
(= 0 (rem n d))) | |
(defn smallest-prime-factor [number] | |
(loop [n number d 2] | |
(cond (> d (int (Math/sqrt number))) 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
\usepackage[final]{feynmp} | |
\DeclareGraphicsRule{*}{mps}{*}{} | |
\makeatletter | |
\def\endfmffile{% | |
\fmfcmd{\p@rcent\space the end.^^J% | |
end.^^J% | |
endinput;}% | |
\if@fmfio | |
\immediate\closeout\@outfmf | |
\fi |
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{figure} | |
\centering | |
\begin{fmffile}{compton} | |
\begin{fmfgraph*}(80,50) | |
\fmfleft{i1,i2} | |
\fmfright{o1,o2} | |
\fmflabel{$\gamma$}{i2} | |
\fmflabel{$e^-$}{i1} | |
\fmflabel{$\gamma$}{o1} |
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
Hapkido:bin getchell$ brew doctor | |
Warning: Unbrewed dylibs were found in /usr/local/lib. | |
If you didn't put them there on purpose they could cause problems when | |
building Homebrew formulae, and may need to be deleted. | |
Unexpected dylibs: | |
/usr/local/lib/libmacfuse_i32.2.dylib /usr/local/lib/libmacfuse_i64.2.dylib /usr/local/lib/libosxfuse_i32.2.dylib /usr/local/lib/libosxfuse_i64.2.dylib | |
Warning: Unbrewed .la files were found in /usr/local/lib. | |
If you didn't put them there on purpose they could cause problems when | |
building Homebrew formulae, and may need to be deleted. |
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/bash | |
# This shell script was created at solowizard.com | |
# | |
# Usage: | |
# Running the script remotely: | |
# bash < <(curl -s http://www.solowizard.com/soloist_scripts/dqhzj8.sh ) | |
# Running the script if you have downloaded it: | |
# ./dqhzj8.sh | |
# | |
# http://github.com/tommyh/solo_wizard |
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
# in problem7.jl | |
# find the 10,001st prime number | |
# isPrime(n) uses the sieve of Eratosthenes | |
# Test LaTeX | |
# Using [Pandoc] allows us to have math inline $x=y$ or in display mode | |
# $$ | |
# \begin{aligned} |
OlderNewer