csakatoku has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 248 seconds]
kaustuv has joined #ocaml
<whitequark>
ohh, so ocaml explodes if I try to compare a value which refers to itself
<whitequark>
sad
yacks has quit [Ping timeout: 268 seconds]
<adrien_oww>
let rec x = x ?
<whitequark>
er, that's an error
<whitequark>
but yeah, same idea
<companion_cube>
let rec l = 1 :: l;;
skchrko has joined #ocaml
* whitequark
nods
<whitequark>
hm, interesting, Hashtbl.mem'ing that value seems to work.
<companion_cube>
when you say "compare", do you mean equality or total ordering?
<whitequark>
well, it hangs inside caml_compare_val
<whitequark>
called from caml_equal
<whitequark>
hm, maybe that's a js_of_ocaml bug. let me check the native version.
<kaustuv>
was anything decided at any of the recent ocaml meetings/workshops about the future of ocamlbuild and ocp-build? Are both going to be supported indefinitely, or will ocp-build eventually replace ocamlbuild?
cago has quit [Ping timeout: 248 seconds]
<whitequark>
hmmmm, native build crashes with Out_of_memory
<whitequark>
does that mean "out of stack space" as well?
<adrien_oww>
this exception isn't triggered on stack overflow
<adrien_oww>
s
<whitequark>
hm, then I'm lost
<adrien_oww>
kaustuv: ping wmeyer` :-)
<adrien_oww>
whitequark: strace it
<whitequark>
hm, so it allocated 12GB and then died
<kaustuv>
the .mli says Make is a module type, but the .ml says it's a module.
<kaustuv>
basically, s/module type Make =/module Make :/ in the .mli
<whitequark>
awesome, thanks
ollehar has joined #ocaml
djcoin has joined #ocaml
<whitequark>
>Moreover, hash always terminates, even on cyclic structures.
<whitequark>
how?
<companion_cube>
it only considers a finite number of blocks
walter has quit [Quit: This computer has gone to sleep]
<companion_cube>
so 2 lists of 100,000 elements with the 10,000 first same elements will have the same hash
<whitequark>
I see
<whitequark>
so will it traverse my single-object cycle 10,000 times?
<whitequark>
that's gonna be slow
<companion_cube>
I think it's actually much less ;)
<companion_cube>
that was just an illustration
<companion_cube>
look at Hashtbl.hash_param
<whitequark>
10/100
<whitequark>
yeah, and I could always do hash consing
<whitequark>
it's not hard for my case
<whitequark>
enough to hash the class name for classes, in fact, and everything else is not cyclic
<whitequark>
hm, no, it actually is cyclic. well whatever, then hash of name for classes and regular hash for everything else.
<whitequark>
also yay, custom compare function with Hashtbl.Make works just as I want
<whitequark>
thanks everyone
<companion_cube>
\o/
<whitequark>
I still think that OCaml functors are really ugly :/
<whitequark>
they surely work, and I understand why are the way they are, but still ugly as hell
<companion_cube>
you too wish for typeclasses? ^^
<whitequark>
yes, I think that would do the job
<whitequark>
though I'm not sure how would you fit them into ocaml as it is. for example how'd you express a custom compare function for Hashtbl with typeclasses?
yacks has quit [Ping timeout: 240 seconds]
<companion_cube>
hashtbl would take keys that are instance of Hashable and Eq
<companion_cube>
that would remove the need for polymorphic comparison and hash
<whitequark>
sure, but then you will only be able to have one equality function for a given type
<whitequark>
and hashing
<companion_cube>
most of the time it's enough, but otherwise haskell proposes type aliases
<companion_cube>
(which I find ugly, too)
avsm has joined #ocaml
<whitequark>
yeah
<whitequark>
so essentially that would only remove the need for polymorphic compare
<companion_cube>
otoh, at least it typechecks whether you use consistently typeclasse instances
<whitequark>
which is kind of fine on one hand, but on the another I wish there was better support for polymorphic functions in ocaml
<companion_cube>
it would also make Set, Map, etc. modules rather than functors
<companion_cube>
typeclasses are polymorphic functions, but it's *bounded* polymorphism
<whitequark>
hm. yes, in fact I'm saying exactly same thing as you
<flux>
a function that accepts a string and returns whatever
<companion_cube>
whitequark: you need to give it a continuation
<companion_cube>
the continuation will receive the parsed values
<whitequark>
ah I see
<leo_33>
In mobile networks, data traffic is not evenly distributed. Some sectors/cells have a higher
<leo_33>
concentration of traffic than others. To reproduce this in the case study, the Alcatel-Lucent Radio
<ggole>
The scanf/printf types are definitely a bit strange
<ggole>
And it takes a while to appreciate wtf kprintf is for
<ggole>
But it does more or less make sense
gautamc has quit [Ping timeout: 240 seconds]
walter has joined #ocaml
<companion_cube>
the nice thing is %a, again (or whatever the equivalent of %a is for sscanf)
amirmc has quit [Quit: Leaving.]
amirmc has joined #ocaml
ttamttam has joined #ocaml
<whitequark>
ggole: so why is ksprintf needed?
avsm has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
<ggole>
whitequark: suppose you want to write an error function that takes a format string and some args, and does whatever with those (logs em to a file or something)
<ggole>
How would you write it with printf?
<whitequark>
I'd use sprintf?
<asmanur>
ggole: use kprintf
<ggole>
Try it
<asmanur>
oh sorry
<ggole>
asmanur: yes, I'm explaining the need for it
mika1 has quit [Quit: Leaving.]
<asmanur>
yeah, should've read a bit more of the backlog :/
<flux>
whitequark, why don't you make that work as well?
<whitequark>
flux: oooh that's what you meant
<whitequark>
sure
<flux>
(I bet this is the best way to learn ;-))
mfp has joined #ocaml
<whitequark>
flux: haha, you could say "for user-defined printf-like functions" and that would be 10 minute quicker :p
ygrek has joined #ocaml
<ggole>
It's a bit of a workaround for the lack of variadic arguments
* whitequark
nods
<whitequark>
and for general format string... uh... weirdness
<ggole>
Oh, I forgot to mention that the k stands for "continuation"
<ggole>
Took me ages to figure that out -_-
<whitequark>
sure, that's obvious
<whitequark>
oh
<ggole>
Thanks
<ggole>
:)
<whitequark>
`k' is the standard symbol for continuations :D
<ggole>
Yeah. I was less familiar with FP conventions when I first started with OCaml, though.
<whitequark>
kontinuation
<whitequark>
German?!
ollehar has quit [Read error: Connection reset by peer]
mye has quit [Quit: mye]
ollehar has joined #ocaml
mrvn has left #ocaml []
mrvn has joined #ocaml
amirmc has quit [Quit: Leaving.]
kaustuv has left #ocaml []
introom has joined #ocaml
amirmc has joined #ocaml
cago has quit [Ping timeout: 264 seconds]
ygrek has quit [Ping timeout: 248 seconds]
ben_zen has joined #ocaml
amirmc has quit [Quit: Leaving.]
mye has joined #ocaml
amirmc has joined #ocaml
avsm has quit [Quit: Leaving.]
travisbrady has joined #ocaml
avsm has joined #ocaml
leo_33 has quit [Ping timeout: 264 seconds]
leo_33 has joined #ocaml
redfire has quit [Quit: WeeChat 0.4.1]
hkBst has quit [Quit: Konversation terminated!]
demonimin has quit [Ping timeout: 246 seconds]
leo_33 has quit [Ping timeout: 256 seconds]
leo_33 has joined #ocaml
cago has joined #ocaml
cago has left #ocaml []
leo_31 has joined #ocaml
leo_31 has quit [Client Quit]
introom has quit [Remote host closed the connection]
amirmc has quit [Quit: Leaving.]
ben_zen has quit [Ping timeout: 246 seconds]
leo_33 has quit [Ping timeout: 256 seconds]
leo_33 has joined #ocaml
mika1 has quit [Quit: Leaving.]
demonimin has joined #ocaml
ygrek has joined #ocaml
leo_31 has joined #ocaml
leo_33 has quit [Ping timeout: 264 seconds]
leo_33 has joined #ocaml
leo_31 has quit [Ping timeout: 252 seconds]
amirmc has joined #ocaml
leo_33 has quit [Ping timeout: 256 seconds]
ulfdoz has joined #ocaml
thomasga1 has quit [Read error: No route to host]
thomasga has joined #ocaml
leo_33 has joined #ocaml
shinnya has joined #ocaml
ggole has quit [Ping timeout: 268 seconds]
leo_31 has joined #ocaml
leo_33 has quit [Ping timeout: 264 seconds]
skchrko has quit [Quit: Leaving]
ggole has joined #ocaml
csakatoku has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
gnuvince has quit [Ping timeout: 256 seconds]
amirmc has quit [Quit: Leaving.]
tane has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
ineol has quit [Quit: ineol]
avsm has quit [Quit: Leaving.]
darkf has quit [Quit: Leaving]
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
ttamttam has quit [Quit: ttamttam]
thomasga1 has quit [Quit: Leaving.]
ygrek has quit [Ping timeout: 268 seconds]
<whitequark>
have any of you read the Cyclone paper on regions?
<pippijn>
yes
<pippijn>
but I'm very busy now, so let's talk later
<whitequark>
ok
<whitequark>
one quick question though: must I read Tofte & Talpin's paper as well, or does Cyclone one describe them well enough?
<whitequark>
eh. dumb question. nevermind, I'll just read it nevertheless
dsheets has quit [Ping timeout: 264 seconds]
ocp has quit [Ping timeout: 245 seconds]
travisbrady has quit [Quit: travisbrady]
mort___ has quit [Ping timeout: 276 seconds]
tani has joined #ocaml
<mrvn>
Given a bunch of rectangels that may overlap or contain each other. What is a good way to find a small set of rectanges that covers them all without being too much too large?
csakatoku has quit [Remote host closed the connection]
<ggole>
Sounds a bit like a clustering problem
tane has quit [Ping timeout: 246 seconds]
<thizanne>
mrvn: I would probably list the rectangles which are removables, remove the one which needs the lesser number of other rectangles to be covered, and continue until all rectangles are necessary
<thizanne>
if getting the rectange which needs the less others to be covered costs too much, I expect the rectangle intersecting the smaller amount of other rectangles could give a not so bad result
<ggole>
I think he is after inexact cover
<ggole>
Dirty rectangles for drawing would be my guess
<mrvn>
thizanne: that ignores that fact that I can create a rectangle that covers a bit extra. Say I have to equal sizes rectangles with a 1 pixel gap between them. Then a rectangle that covers them both and that 1 pixel gap is better.
mye has quit [Quit: mye]
<thizanne>
well it will work
<thizanne>
amongst your 3 rectangles, both the two equal size ones can be covered since the big one covers them
<thizanne>
can be removed*
<mrvn>
what big one? There are only 2 rectangles
<thizanne>
oh, ok
<thizanne>
I thought you want a subset of your rectangles
<mrvn>
no, that would be easy
<ggole>
Just unioning the extents is easy
ontologiae_ has quit [Ping timeout: 248 seconds]
<ggole>
If you want some fast sloppy thing you could try to remove the maximum amount of untouched space at corners, recursively
<ggole>
Stopping when the win becomes small
<ggole>
This misses cases like a circle of rectangles with a large amount of unused space in the middle though
<mrvn>
wouldn't that just give me a rectangle covering them all?
<ggole>
No
<ggole>
Start with the big rectangle
travisbrady has joined #ocaml
<ggole>
Then try to kill each corner, replacing it with several smaller bits
<mrvn>
ggole: so I split the rectangle in 4 and see if any covers nothing. the repeat?
<mrvn>
i.e. a quadtree
<ggole>
No, you'd need to do a little search
<ggole>
Looking at how much area you gain by advancing the killed area by X in one direction
<ggole>
You'd need a spatial index to make the queries fast though :/
<bernardofpc>
mrvn: math-wise, this is Vitali covering
<bernardofpc>
(or something like that)
<bernardofpc>
(which is a greedy algorithm)
<bernardofpc>
the too much too large is a 3x condition, or 5x if your collection is infinite
<mrvn>
factor 3 makes that totaly useless
<bernardofpc>
ok
<bernardofpc>
(and in fact Vitali is only for subcover, not what you're looking for, as far as I understand)
tani has quit [Quit: Verlassend]
<mrvn>
I have a GUI and that needs to redraw some widgets. Each widget has a rectangle in which it draws. Once they have drawn I need to copy the affected regions to the screen.
<mrvn>
And it is better to copy a bit more than needed than to have too many small copy operations.
<bernardofpc>
right
<bernardofpc>
you have a cost function in terms of n and m ?
<mrvn>
not yet
<bernardofpc>
(also, trying to make a too smart reclustering may cost you more than what you'll get :d)
<mrvn>
yeah. I need something fast and dirty. No point optimizing the regions for 1s when the copy only taks 1/100th
<ggole>
Are they sorted?
<mrvn>
no
<mrvn>
or maybe
<ggole>
You might be able to exploit ordering to look for "holes" cheaply
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
djcoin has quit [Quit: WeeChat 0.4.0]
osa1 has quit [Ping timeout: 276 seconds]
osa1 has joined #ocaml
travisbrady has quit [Quit: travisbrady]
Zeev has joined #ocaml
Neros has quit [Ping timeout: 264 seconds]
mye has joined #ocaml
travisbrady has joined #ocaml
bkpt has joined #ocaml
bondar has joined #ocaml
bondar has quit [Client Quit]
bondar has joined #ocaml
osa1_ has joined #ocaml
bondar has quit [Excess Flood]
bondar has joined #ocaml
bondar has quit [Excess Flood]
bondar has joined #ocaml
bondar has quit [Client Quit]
yacks has quit [Ping timeout: 268 seconds]
osa1 has quit [Ping timeout: 240 seconds]
yacks has joined #ocaml
mort___ has joined #ocaml
Neros has joined #ocaml
bondar has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
ggole has quit []
osa1_ has quit [Ping timeout: 253 seconds]
ollehar has joined #ocaml
mye has quit [Quit: mye]
avsm has joined #ocaml
tane has joined #ocaml
vpit3833` has joined #ocaml
Anarchos has joined #ocaml
vpit3833 has quit [Ping timeout: 264 seconds]
avsm has quit [Quit: Leaving.]
mort___ has quit [Quit: Leaving.]
bondar has quit []
leo_31 has quit [Ping timeout: 276 seconds]
zRecursive has joined #ocaml
pkrnj has joined #ocaml
levi has joined #ocaml
zRecursive has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
zRecursive has joined #ocaml
mye has joined #ocaml
osa1 has joined #ocaml
dsheets has joined #ocaml
avsm has joined #ocaml
leo_33 has joined #ocaml
travisbrady has quit [Quit: travisbrady]
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
mort___ has joined #ocaml
zRecursive has left #ocaml []
demonimin_ has joined #ocaml
demonimin has quit [Ping timeout: 256 seconds]
tane has quit [Quit: Verlassend]
ineol has joined #ocaml
Simn has quit [Quit: Leaving]
pkrnj has quit [Quit: Computer has gone to sleep.]
ulfdoz has quit [Ping timeout: 264 seconds]
dezzy has quit [Read error: Connection reset by peer]
dezzy has joined #ocaml
vpit3833` is now known as vpit3833
pkrnj has joined #ocaml
vext01 has quit [Ping timeout: 264 seconds]
bkpt has quit [Quit: Leaving]
osa1 has quit [Read error: Connection reset by peer]
vpit3833` has joined #ocaml
vpit3833 has quit [Ping timeout: 256 seconds]
ineol has quit [Quit: ineol]
vpit3833` is now known as vpit3833
dezzy has quit [Changing host]
dezzy has joined #ocaml
dsheets has quit [Ping timeout: 240 seconds]
Drup2 has joined #ocaml
Drup has quit [Ping timeout: 240 seconds]
mort___ has quit [Quit: Leaving.]
Drup2 has quit [Read error: Connection reset by peer]