Add your thoughts here… (optional)

India at night, composite image showing changes in illumination from 1992-2003 / by NOAA/Science Photo Library
Add your thoughts here… (optional)

India at night, composite image showing changes in illumination from 1992-2003 / by NOAA/Science Photo Library
After much experimentation and digging around on google groups (special thanks to Ibrahim Hadad) I have finally managed to get Monodevelop 3 and F# working together nicely on Ubuntu. These were the steps I took. Your mileage may vary. :)
(Update: Knocte has suggested a couple of modifications to simplify the process. These are now reflected below.)
1) sudo apt-get install mono-complete libgdiplus git autoconf libtool
2) Install monodevelop using the script from John Ruiz’ blog:
http://blog.johnruiz.com/2012/05/installing-monodevelop-3-on-ubuntu.html
3) Get F# source and compile:git clone git://github.com/fsharp/fsharp
cd fsharp/
./autogen.sh --prefix=/usr
make
sudo make install
4) Run monodevelop. Go to tools, add-in manager, gallery. Install F# language binding.
5) Enjoy!
This post describes how we can define a custom operator with F#. Defining a new operator in F# is very straightforward. For instance, by using the following code, we can define “!” as an operator to compute factorial of an integer.
| let rec (!) n = | |
| match n with | |
| | 1 -> (1) | |
| | n -> n*(n-1) |
Running the following command in the interactive F# console computes the factorial for 10.
> !10;; val it : int = 3628800 >
A symbolic operator can use any sequence of the following characters: ! % & * + - . / ? @ ^ |~. Note that, “:” can also be used in the character sequence of symbolic operation if and only if, it is not the first character in the operator.
Following is an example of modulo operator defined using F#:
| let rec (|%|) a n = | |
| match a, n with | |
| |_ when a < n -> a | |
| |_ when a>=n -> (|%|) (a-n) n | |
| //Resulting signature: val ( |%| ) : int -> int -> int |
Following outputs shows how to use it from F# interactive shell.
> 23 |%| 3;; val it : int = 2 > 3 |%| 3;; val it : int = 0 >
I’ve come to enjoy writing posts, transcriptions, reading notes, and even formal papers using markdown and its variants. I really want to do so with this blog as well, but it’s cumbersome. For wordpress.org sites, there is a plugin to use markdown. But of course, plugins aren’t available on the wp.com side. I started this blog as one of my first-ever entries into the world of the web, and went with wp.com because it was comfortable and easy. I certainly could migrate it to a self-hosted site, but if I’m doing that, then I’m going to move it off of wordpress altogether. I could also write the posts in markdown, transform them to html, and then cut-and-paste the html into a new post in the web browser. That sounds like a pain in the ass, and duplicates files where duplication isn’t necessary.
In the meantime, I still want to write…
View original post 815 more words
To filter the folders (i.e., directories) available in the current context, the following property can be used with a predicate:$_.psiscontainer
In essence, it returns a boolean indicating whether the current object is a directory or not. Hence, the following script prints the absolute path of the each sub-directories from the current context.
ls –r | ?{$_.psiscontainer} | select fullname