00:01
ulfdoz has joined #ocaml
00:03
Smerdyakov has quit [Quit: Leaving]
00:11
philtor has quit [Ping timeout: 246 seconds]
00:14
dnolen has joined #ocaml
00:19
andreas2 has joined #ocaml
00:22
andreas1 has quit [Ping timeout: 240 seconds]
00:30
boscop_ has quit [Ping timeout: 258 seconds]
00:33
boscop has joined #ocaml
00:37
mnabil has quit [Ping timeout: 276 seconds]
00:50
mnabil has joined #ocaml
01:06
sepp2k has quit [Quit: Leaving.]
01:18
lamawithonel has quit [Remote host closed the connection]
01:41
groovy2shoes has joined #ocaml
01:47
mnabil has quit [Ping timeout: 252 seconds]
01:53
wormphlegm has quit [Quit: leaving]
01:56
surikator has joined #ocaml
01:56
surikator has quit [Client Quit]
01:59
mnabil has joined #ocaml
02:01
groovy2shoes has quit [Read error: Connection reset by peer]
02:03
groovy2shoes has joined #ocaml
03:29
groovy2shoes has quit [Quit: groovy2shoes]
03:48
dnolen has quit [Read error: Connection reset by peer]
03:48
joewilliams is now known as joewilliams_away
03:50
dnolen has joined #ocaml
04:02
mnabil has quit [Remote host closed the connection]
04:08
vivanov has quit [Ping timeout: 260 seconds]
04:10
vivanov has joined #ocaml
04:30
eye-scuzzy has quit [Ping timeout: 260 seconds]
04:45
dnolen has quit [Quit: dnolen]
04:46
philtor has joined #ocaml
04:50
eye-scuzzy has joined #ocaml
04:51
orbitz has joined #ocaml
05:38
philtor has quit [Ping timeout: 260 seconds]
06:45
jderque has joined #ocaml
06:54
hyperboreean has quit [Ping timeout: 240 seconds]
07:10
jderque has quit [Ping timeout: 252 seconds]
07:32
jamii has joined #ocaml
07:34
ygrek has joined #ocaml
08:15
jamii has quit [Ping timeout: 276 seconds]
08:23
Yoric has joined #ocaml
08:28
jamii has joined #ocaml
08:37
waern has joined #ocaml
09:06
eye-scuzzy has quit [Read error: Operation timed out]
09:08
jamii has quit [Ping timeout: 250 seconds]
09:21
jamii has joined #ocaml
09:33
jamii has quit [Ping timeout: 276 seconds]
09:43
eikke has joined #ocaml
10:03
ftrvxmtrx has quit [Remote host closed the connection]
10:05
jderque has joined #ocaml
10:10
ftrvxmtrx has joined #ocaml
10:22
sepp2k has joined #ocaml
10:25
impy has quit [Quit: impy]
10:27
eikke has quit [Ping timeout: 276 seconds]
10:39
impy has joined #ocaml
10:40
impy has left #ocaml []
10:49
edwin has joined #ocaml
10:54
ulfdoz has quit [Ping timeout: 248 seconds]
11:21
lopex has joined #ocaml
11:22
ulfdoz has joined #ocaml
11:31
ygrek has quit [Ping timeout: 246 seconds]
11:58
jamii has joined #ocaml
12:12
DimitryKakadu has joined #ocaml
12:20
eikke has joined #ocaml
12:43
jderque has quit [Quit: leaving]
12:50
notk0 has joined #ocaml
12:50
<
notk0 >
why does ocaml suck so much?
12:50
<
adrien >
camls bite, they don't suck
12:52
<
notk0 >
adrien, ocaml does tho
13:02
asn has joined #ocaml
13:20
DOUK has joined #ocaml
13:24
asn has left #ocaml []
13:24
Smerdyakov has joined #ocaml
13:33
<
DOUK >
how can i make graphs of fonctions in ocaml?
13:33
<
DOUK >
like i have my fonction doing its calculations and i want to make a graph of the time it took and the numbers of elements in the list it sorted
13:42
<
vivanov >
DOUK: you can use plplot bindings for ocaml
13:42
<
DOUK >
what is this
13:43
<
DOUK >
is there a way to do it with gnuplot
13:44
<
DOUK >
oh wait plplot is free
13:48
<
DOUK >
i tried using this but i dont know how to use it
13:49
<
vivanov >
plplot has good documentation
13:49
<
DOUK >
ocaml gnuplot has very little
13:52
jamii has quit [Ping timeout: 250 seconds]
14:05
jamii has joined #ocaml
14:08
<
DOUK >
can i use ocaml plplot with ubuntu?
14:16
oriba has joined #ocaml
14:26
jderque has joined #ocaml
14:26
DOUK has quit [Ping timeout: 252 seconds]
14:38
<
vivanov >
it's not in debian
14:41
notk0 has quit [Ping timeout: 260 seconds]
14:42
<
vivanov >
i guess not in ubuntu as well
14:43
<
vivanov >
DOUK: you can compile ocaml bindings from source -- see plplot documentation
14:48
Smerdyakov has quit [Quit: Leaving]
14:56
ygrek has joined #ocaml
15:05
* NaCl
casts a gildor summoning spell
15:07
<
adrien >
still away during a few days
15:14
jamii has quit [Ping timeout: 240 seconds]
15:22
douknoukem has joined #ocaml
15:33
hyperboreean has joined #ocaml
15:45
philtor has joined #ocaml
15:46
douknoukem has quit [Ping timeout: 248 seconds]
15:47
ygrek has quit [Ping timeout: 246 seconds]
15:55
douknoukem has joined #ocaml
16:05
Smerdyakov has joined #ocaml
16:05
arubin has joined #ocaml
16:07
jderque has quit [Ping timeout: 260 seconds]
17:03
jderque has joined #ocaml
17:20
bohanlon has quit [Quit: So long, and thanks for all the fish!]
17:30
DOUK has joined #ocaml
17:34
douknoukem has quit [Ping timeout: 264 seconds]
17:36
<
hcarty >
DOUK: Debian + Ubuntu packages may be available eventually, but for now Fedora is the only platform with pre-built PLplot + OCaml packages.
17:37
<
hcarty >
All of the prerequisites are packaged for Ubuntu
17:37
<
DOUK >
i dont really know if i need plplot because i have to make graphs about functions and how much time they take to sort a list
17:38
<
hcarty >
Graph as in a series of (x, y) points, or something else?
17:38
<
DOUK >
i would say something else
17:39
<
DOUK >
i dont see how i can make a graph with a series of x,y points with what i want to do
17:42
<
DOUK >
basically i have to compare functions on how much time they take to sort a list
17:44
<
hcarty >
Functions on the x-axis, time on the y-axis could work
17:45
<
hcarty >
But if you only need it for this one thing then it may be easier to write the information out to a text file and plot it with gnuplot.
17:46
<
hcarty >
If it's something you plan to do over and over then PLplot is likely simpler in the long run.
17:46
<
hcarty >
With the disclosure that I'm the author/maintainer of the PLplot OCaml bindings :-)
17:46
<
DOUK >
well i wont be doing it over and over
17:46
<
DOUK >
thanks for the help man
17:47
<
hcarty >
You're quite welcome
17:47
<
zorun >
I agree that the simpler solution would be to output raw data
17:47
<
zorun >
and use gnuplot afterwards
17:48
<
hcarty >
The OCaml PLplot bindings have some very simple single-line functions for point, line and contour plots. Nothing for bar charts though.
17:51
<
zorun >
are you able to choose the output format?
17:51
<
zorun >
I mean, svg, pdf...
17:51
<
hcarty >
zorun: Yes
17:51
<
hcarty >
png, svg, pdf, ps, X, Cairo surface, and a few others
17:54
myst has joined #ocaml
17:59
philtor has quit [Ping timeout: 252 seconds]
18:16
Smerdyakov has quit [Quit: Leaving]
18:20
Vinnipeg has joined #ocaml
18:32
Vinnipeg has quit [Remote host closed the connection]
18:34
avsm has joined #ocaml
18:35
avsm has quit [Client Quit]
18:35
avsm has joined #ocaml
18:39
tautologico has joined #ocaml
18:41
DOUK has quit [Ping timeout: 250 seconds]
18:45
douknoukem has joined #ocaml
18:58
dnolen has joined #ocaml
19:03
lopex has joined #ocaml
19:07
happy4crazy has joined #ocaml
19:21
iris1 has joined #ocaml
19:24
robinnn has joined #ocaml
19:24
robinn has joined #ocaml
19:24
robinnn has quit [Remote host closed the connection]
19:25
Egbert9e9 has joined #ocaml
19:30
DOUK has joined #ocaml
19:31
douknoukem has quit [Ping timeout: 240 seconds]
19:33
wagle has quit [Read error: Connection reset by peer]
19:33
wagle has joined #ocaml
19:37
undecidable has joined #ocaml
19:43
Associat0r has quit [Read error: Connection reset by peer]
19:43
Associat0r has joined #ocaml
20:01
<
DOUK >
anyone can help me with a list problem
20:01
<
DOUK >
so i have a list and i have to remove doubles
20:01
<
DOUK >
my problem is that i fail to apply that function to the rest of the list
20:01
<
DOUK >
just for the first element
20:01
wagle has quit [Remote host closed the connection]
20:01
<
DOUK >
i fail somewhere in the recursive
20:02
dnolen has quit [Quit: dnolen]
20:06
<
iris1 >
You seem to have at least two problems with this code
20:06
<
iris1 >
1. the recursive call to killdoubles_bis uses a instead of x
20:07
<
iris1 >
2. the call from killdoubles to killdoubles_bis is structured so as to drop the first element, no matter if it's a double or not
20:07
<
DOUK >
yes when i use x instead of a in the recursive call
20:07
<
DOUK >
only the first element drops
20:07
tautologico has quit [Quit: tautologico]
20:08
<
iris1 >
My recommendation would be to scratch this code and start again, with a pattern match that looks at [], [x], x::y::r separately. That would probably lead to better code.
20:08
mnabil has joined #ocaml
20:13
lopex has quit [Ping timeout: 260 seconds]
20:15
jderque has quit [Quit: leaving]
20:16
Associat0r has quit [Read error: Connection reset by peer]
20:16
olauzon has joined #ocaml
20:17
lopex has joined #ocaml
20:18
Associat0r has joined #ocaml
20:21
undecidable has quit [Quit: Leaving]
20:22
<
DOUK >
well the function is about removing elements that appear more than once in the list
20:22
<
DOUK >
so i can have a list of unique elements in the end
20:25
<
happy4crazy >
one way would be to scan through the list and place each "new" element into a list of the unique elements
20:25
<
happy4crazy >
at the end, you return the constructed list of uniques
20:25
<
DOUK >
thats what i tried to do with the first function but i failed
20:39
olauzon has quit [Quit: olauzon]
20:46
DimitryKakadu has quit [Remote host closed the connection]
20:47
robinn has quit [Quit: Leaving]
20:53
mnabil has quit [Ping timeout: 252 seconds]
21:03
mnabil has joined #ocaml
21:05
Yoric has quit [Quit: Yoric]
21:13
DOUK has quit [Ping timeout: 252 seconds]
21:14
douknoukem has joined #ocaml
21:18
edwin has quit [Remote host closed the connection]
21:24
<
douknoukem >
hey so i tried to make that function
21:24
<
douknoukem >
but i fail
21:24
<
douknoukem >
i am doing the tests two by two
21:25
<
douknoukem >
and i dont know how i can take the current first element then test it with the tail
21:25
<
douknoukem >
then delete that element and add it to a new list
21:25
<
douknoukem >
and repeat untill list is empty
21:25
Egbert9e9 has left #ocaml []
21:26
<
happy4crazy >
in pseudo code, here's how i would do it
21:26
<
happy4crazy >
is it ok if i give a pseudo-code solution?
21:26
<
happy4crazy >
or do you want to keep strugglign with it :)
21:26
<
douknoukem >
i feel like i wont move a inch if i keep going
21:27
<
happy4crazy >
ok, that's fair :)
21:27
<
happy4crazy >
1 sec
21:28
<
zorun >
from a theorical point of view, it is very similar to a sort
21:28
<
zorun >
as such, while the easiest solution would be in n², you could do it in n*log(n)
21:44
<
happy4crazy >
sorry for the delay, i wanted to code it up first and i'm used to haskell :)
21:44
<
douknoukem >
no problem
21:45
<
happy4crazy >
given a list
21:45
<
happy4crazy >
pattern match it against []
21:45
<
happy4crazy >
or x :: xs
21:46
<
happy4crazy >
if the list is empty, then the uniques are empty as well
21:46
<
happy4crazy >
if it looks like x :: xs
21:46
<
happy4crazy >
then check to see if x is already contained in the currently accumulated uniques
21:46
<
happy4crazy >
if so, don't add x to the uniques, since it's already in there
21:47
<
happy4crazy >
if not, then it's a new unique, so cons it onto the front
21:47
<
happy4crazy >
and recurse on the rest of the list, the xs
21:47
<
happy4crazy >
hmm, this is harder to read in pseudocode than in actual code :/
21:48
<
douknoukem >
i dont know how to set the new value to test
21:48
<
douknoukem >
then check to see if x is already contained in the currently accumulated uniques
21:49
<
happy4crazy >
here, i'll just post the code, it's easier to read
21:49
wagle has joined #ocaml
21:49
wagle has quit [Read error: Connection reset by peer]
21:49
<
happy4crazy >
this is one way, but as zorun suggests you can do it better
21:50
<
happy4crazy >
the first function checks if x is an element of xs
21:50
<
happy4crazy >
the second one finds uniques
21:50
<
douknoukem >
ok thanks man
21:51
<
happy4crazy >
does the code make sense?
21:51
wagle has joined #ocaml
21:51
wagle has quit [Read error: Connection reset by peer]
21:52
<
douknoukem >
what is helper
21:52
<
happy4crazy >
an example might help
21:52
<
happy4crazy >
say the list is [1; 1; 2; 2;]
21:52
<
happy4crazy >
and consider the helper function
21:52
boscop_ has joined #ocaml
21:52
<
happy4crazy >
it pattern matches the list, so x -> 1, xs -> [1; 2; 2]
21:53
<
happy4crazy >
initially, acc is []
21:53
<
happy4crazy >
acc will hold all of the uniques
21:53
<
happy4crazy >
next we check if x is an element of acc
21:54
<
happy4crazy >
acc is empty, so we add 1 to acc
21:54
<
happy4crazy >
and recurse on the rest of the list, [1; 2; 2]
21:54
<
happy4crazy >
now x is 1
21:54
<
happy4crazy >
and xs is [2; 2]
21:54
<
happy4crazy >
and acc is [1]
21:54
<
happy4crazy >
1 is already an element of acc, so don't add it to acc
21:54
<
happy4crazy >
and then recurse
21:55
<
happy4crazy >
we pattern match again on [2; 2]
21:55
<
happy4crazy >
x -> 2
21:55
boscop has quit [Ping timeout: 250 seconds]
21:55
<
douknoukem >
thanks a lot
21:55
<
zorun >
pretty nice solution
21:55
<
happy4crazy >
at the very end, I reverse the accumulated list, so it's in the right order
21:55
<
zorun >
still in n^2, though ;)
21:55
<
happy4crazy >
heh :)
21:56
<
happy4crazy >
i actually hadn't thought about an n log n solution for uniques before
21:56
<
zorun >
I'm almost done with a variant of merge sort
21:59
boscop_ has quit [Read error: Connection reset by peer]
21:59
<
douknoukem >
so elem x xs tests if x = y
22:00
<
douknoukem >
if not it keeps looking in the list right
22:00
boscop_ has joined #ocaml
22:00
<
happy4crazy >
in words, x is an element of xs if it's equal to the first element of xs, or if it's an element of the rest of xs
22:00
wagle has joined #ocaml
22:04
eikke has quit [Ping timeout: 246 seconds]
22:15
<
zorun >
in fact, it is a pretty standard merge sort: you first split the list recursively in two lists
22:15
boscop_ is now known as boscop
22:16
<
zorun >
when you have 1 element, it is sorted
22:16
<
zorun >
and then you merge back all of your little lists
22:16
<
zorun >
the key is to eliminate duplicates while merging
22:17
<
happy4crazy >
argh, you beat me :)
22:17
<
zorun >
(the `compare h1 h2' part)
22:17
<
douknoukem >
compare is a function of comparison right
22:17
<
happy4crazy >
heh i'm new to ocaml, and keep typing haskell instead :/
22:17
<
douknoukem >
you put < or > or another comparator
22:18
<
zorun >
I've always wanted to try haskell out...
22:18
<
zorun >
an friend that was once an ocaml-freak now seems to enjoy haskell a lot :)
22:19
<
happy4crazy >
haskell is very fun
22:19
<
happy4crazy >
i'm fairly new to functional programming, and it definitely has a slicker marketing dept than ocaml
22:19
<
happy4crazy >
but lately i've been following CMU's new intro programming class
22:19
<
zorun >
douknoukem: "compare a b" returns -1 if a<b, 1 if a>b, and 0 if a=b, but it works for int, float, string, ...
22:19
<
happy4crazy >
which uses ml
22:20
<
happy4crazy >
carnegie mellon
22:21
<
happy4crazy >
the prof has a very fun blog: existentialtype.wordpress.com
22:21
<
zorun >
the name is fun by itself :p
22:23
<
happy4crazy >
actually, not to spam, but i'm experimenting with writing a blog too :)
22:23
<
happy4crazy >
monastic.io
22:23
<
happy4crazy >
probably mostly haskell stuff, but maybe ocaml too
22:28
oriba has quit [Quit: Verlassend]
22:29
<
zorun >
wow, nice work
22:29
<
zorun >
I mean, the blog itself
22:29
<
happy4crazy >
thank you
22:30
<
happy4crazy >
also, i like your merge sort--mine is not nearly as nice looking
22:30
<
zorun >
I've been looking for a way to have a simple architecture for my blog, allowing to write articles in markdown and pushing them via git
22:30
<
happy4crazy >
i'm using jekyll
22:30
<
zorun >
well, you did it
22:32
<
happy4crazy >
here's how i did it
22:33
<
happy4crazy >
basically, you create a github repository
22:33
<
happy4crazy >
and github will host it for you
22:33
<
happy4crazy >
so git push etc. works really smoothly
22:33
<
happy4crazy >
they run everything through jekyll behind the scenes
22:34
<
happy4crazy >
i think
22:34
<
happy4crazy >
i've just started it, so i'm still working out kinks etc.
22:36
<
zorun >
I didn't know github was providing such a service
22:37
<
zorun >
anyway, I fell back to a wordpress blog ...
22:37
<
happy4crazy >
what's your blog?
22:38
<
happy4crazy >
gotta run out for a bit
22:39
<
douknoukem >
problem is
22:39
<
douknoukem >
for the first go i dont see what value m takes
22:39
<
douknoukem >
so it can compare to the first element of the list
22:40
<
zorun >
happy4crazy: blog.invokk.net
22:40
Amorphous has quit [Read error: Connection reset by peer]
22:40
<
zorun >
but I believe you'll be the first real visitor, I just made it public today :)
22:41
<
zorun >
running? it's 1am here :p
22:41
<
douknoukem >
and i dont understand this part here" else min_list_bis r m in match l with [] -> failwith "min_list" | x::r -> min_list_bis r x ;; "
22:42
<
douknoukem >
is it to give m the value of the current element of the list
22:42
<
zorun >
well, m is the current min of the list
22:43
<
zorun >
so, at first, you just initialize it with the first element of the list
22:43
<
douknoukem >
but when does it do it
22:43
<
zorun >
from line 2 to 7, it's actually a function definition
22:44
<
zorun >
so it only gets executed when you call it on line 10
22:44
<
douknoukem >
that is strange
22:45
<
douknoukem >
so the initialisation is after the in?
22:45
<
douknoukem >
and the part inside of the in is from line 2 to 7
22:46
<
zorun >
let rec min_list_bis l m = <function definition> in ...
22:46
<
zorun >
it's a definition, nothing more
22:46
<
douknoukem >
i thought only else min_list_bis r m was inside in
22:46
<
zorun >
you could even move line 2 to 7 to the top, outside of the min_list function
22:47
<
zorun >
although this is bad style, I think
22:47
<
douknoukem >
yes thats what i do when i make a _bis function
22:47
<
douknoukem >
is it better with in
22:49
<
zorun >
happy4crazy: what is that : " partition <- parts (xs \\ anchor)"
22:50
<
zorun >
are you doing, like, the substraction of two lists?
22:50
impy has joined #ocaml
22:51
<
zorun >
I'm so tired... it's getting pretty late an hour for a french guy
22:52
<
zorun >
hope to see you soon
22:52
ymasory has joined #ocaml
22:52
Smerdyakov has joined #ocaml
22:56
<
happy4crazy >
zorun: yes, that's list subtraction
22:57
<
happy4crazy >
it's defined in the Data.List module
22:57
<
happy4crazy >
so 'import Data.List' to make it work
22:57
<
happy4crazy >
or ':m + Data.List' in the repl
22:57
<
happy4crazy >
zorun: ok gotta run, i'll check out the blog :)
22:58
Amorphous has joined #ocaml
23:25
Smerdyakov has quit [Quit: Leaving]
23:38
dnolen has joined #ocaml
23:55
douknoukem has quit [Ping timeout: 250 seconds]
23:58
ulfdoz_ has joined #ocaml