basic Ocaml syntax

for variable = start [strong]to[/strong]/downto end do
    expression
done   List.iter f my_list (* f is a function that takes 1 argument *)

Add comment 23 December 2007

watercolor books reviews

Fill Your Watercolor With Natures Light: Features Masking, Pouring & Spatering Techniques by Roland Roycraft

I don’t like this book, the description is rather vague.  The author’s 4-step method is as written in the title “masking, pouring, spattering, brushing”. It sounds simple enough as description, but not when you try to paint your own landscape (honestly, I have not tried this method, simply that this book doesn’t even get me excited to try it out). As a side note, I dislike masking liquid.


Atmosphere, Mood And Light: Paint a Watercolour Landscape in Minutes
by Keith Fenwick

cookbook style but extremely poorly written. A total lack of instruction, basically there is no work-in-progress photo. I don’t like the style of the author’s painting, which is too realistic for my taste but too unrealistic to be realistic.

Add comment 27 November 2007

lablgtk compile

ocamlc -I +lablgtk2 -o base lablgtk.cma gtkInit.cmo base.ml

windows installation:

cygwin standard installation (select also binutils)

ocaml-mingw

gtk+-win32-devel : 2.10 :

lablgtk2, read the install file

Add comment 20 November 2007

drawing cat’s eye

Here are extract of the book “The Complete Guide to Coloured Pencil Techniques”, this project looks interesting, especially for a cat lover like me. I’ll post some finished pictures later.cat-eye1.jpgcat-eye2.jpgcat-eye3.jpgcat-eye4.jpgcat-eye5.jpgcat-eye6.jpgcat-eye7.jpgcat-eye8.jpg

Add comment 16 November 2007

module

Please ignore all the posts tagged with “ocaml”, I’m just posting them here for my reference.

renaming module:  module Gr = Graphics;; (* all subsequent calls to Graphics will be Gr.xxx *)

named tuple: type tuple = {a : int; b : int}

string concatenation: ^

pattern guard: match x with SomePattern(a,b) [when  a = b] -> …

assert: assert (x=5);;

print:

prerr_endline (“radius is ” ^ (string_of_int radius));

eprintf “radius is %d\n” radius;

compilation: (in cgywin with binutils and gcc installed)

ocamlopt -c amodule.ml
ocamlopt -c bmodule.ml
ocamlopt -o hello amodule.cmx bmodule.cmx

with interface (inerface must be compild first)

ocamlc -c amodule.mli
ocamlopt -c amodule.ml

module extension

module List =
struct
include List
let rec optmap f = function
[] -> []
| hd :: tl -> match f hd with
None -> optmap f tl
| Some x -> x :: optmap f tl
end

usage: open Extensions…
List.optmap …

Add comment 14 November 2007

knitting and crocheting

I’ve crocheted some dollies in the past, I didn’t like it particularly (I crocheted mostly with very fine thread/yarn). Recently I’ve ordered a Holz & Stein crochet hook (I like very much their knitting needles and expected they make the same difference to crochet hook). I’m disappointed. There is no difference from the cheap metal crochet hook. Maybe I should just conclude that I don’t like crocheting.

However I very much like the drape and texture of single crocheted fabric, it holds structure without feeling stiff. It would make beautiful body of a coat.  It would be a torture for me to make such a big piece. I didn’t even finish a piece of swatch (I got bored after finishing about 3cmx8cm…). Instead I like very much making stockinette stitch with knitting, it’s just pleasurable. With knitting I don’t see to watch often what I’m doing. I can feel it. With crochet I’ll need to cross my eyes, especially that I like mostly black yarn for clothes. crochet coat

Add comment 30 October 2007

knitting blog

It’s really difficult for me to find an interesting knitting blog. There are literally thousands and thousands of them, but till to now I’ve actually only found one that is interesting (but I found it by pure chance). By interesting I do not mean that it should contain plenty of useful information (which can be found easily in books or by google). The writer of the blog should have some kind of appeal to me (not necessarily a kind of admiration), get me interested in what she’s doing.

Add comment 22 October 2007

Living room drapes

The fabric I ordered at the beginning of August has finally arrived last Saturaday. But as I still had to finish repainting the windows in the living room, I’ve not yet started sewing. Well, these are my last days, I really hope to at least start this project. Next week I’ll have to go back to the university again, that means that I’ll have next-to-none free time :-\ I still have in mine so many things to make.

Talking about the fabric, it’s a lovely salmon-orange shade. It doesn’t look attractive at all in the sample, but I’m convinced that it’ll match my living room.

Maybe tonight I’ll cut the fabric in half. I’m kind of nervous as it’s the most expensive piece of fabric that I’ve ever bought, no mistake please :-)

Add comment 20 September 2007

My first moebius scarf

Today I started a new project after reading about the moebius ring. The only yarns that can be used in my stash is a red cotton yarns that I’ve bought years ago when I rediscovered crochet. My stash is a really small collection as I’ve just started knitting from about 2 weeks ago. Yet I’ve already created a UFO :-D (a halfy finished crochet camisole that is completely out of gauge and in an unflattering color combinations). I’ll post some pictures when I finish it.

Add comment 20 September 2007


Categories

  • Blogroll

  • Feeds