longh has quit [Read error: 104 (Connection reset by peer)]
Palace_Chan has quit [Read error: 110 (Connection timed out)]
jknick has joined #ocaml
alexyk has joined #ocaml
<alexyk>
I try to compile pgocaml, which needs calendar.cma -- but my godi install has only calendar.cmi... how do I make cma?
<alexyk>
how can I see which cmo's are inside a cma?
ched_ has joined #ocaml
_andre has quit ["Lost terminal"]
ched has quit [Read error: 110 (Connection timed out)]
johnnowak has joined #ocaml
orbitz has joined #ocaml
alexyk has quit []
<Squirrel>
Is there a quick way to check that a list of elements has no repeated elements ? (all unique) ?
<Raevel>
quick as in complexity or quick as in a built in function?
<johnnowak>
Squirrel: sort and iterate?
<Squirrel>
quick as in easy/short no big deal with time complexity since these are short
<Squirrel>
sort and iterate ? hmm iterate applies a function to each element
<Squirrel>
it would have to remember the previous to check for two consecutively equal elements after a sort
<johnnowak>
er -- didn't mean the iterate function. i mean sort it then iterate over the list checking for equality.
<orbitz>
hehe
<orbitz>
is there no unique function for lists?
<orbitz>
i guess not
<dibblego>
orbitz, nub?
<dibblego>
> nub [1,2,3] == [1,2,3,3]
<dibblego>
I imagine if you had Ord you could sort it first, but otherwise...
<orbitz>
dibblego: get lost on your way to #haskell ?
<dibblego>
oh oops :)
<dibblego>
sorry
<orbitz>
:)
<Raevel>
heh
<Raevel>
okay, i can't do recursion at night
<Squirrel>
johnnowak, so i can sort it, but going through it i would have to compare consecutive elements, would you for loop ? (new to ocaml and using a looooot of recursion)
<johnnowak>
i'd use fold
alexyk has joined #ocaml
<Raevel>
Squirrel: you could loop through and check that the head of the list isnt also in the tail
<johnnowak>
ow
<Raevel>
i can't think of how to solve it with fold -- my head hurts
<Squirrel>
Raevel, oh nice..would you loop with a for loop ?
<Raevel>
well, doing that or using a recursive function won't make a difference
<Squirrel>
think i got it recursively...now i gotta struggle with the typechecker...... :(
<palomer>
and setting the time to 200 ms or something
<palomer>
100ms gives me funky warnings
<palomer>
and inserting 100 widgets at a time
* thelema
looks forward to jacques' response on the lablgtk list
<palomer>
me too
<palomer>
this seems like a big bug
<thelema>
or a misuse of the library
<palomer>
according to the gtk documentation:
<palomer>
gtk_container_remove ()
<palomer>
Removes widget from container. widget must be inside container. Note that container will own a reference to widget, and that this may be the last reference held; so removing a widget from its container can destroy that widget. If you want to use widget again, you need to add a reference to it while it's not inside a container, using g_object_ref(). If you don't want to use widget again it's usually more efficient to simply destroy
<palomer>
it directly using gtk_widget_destroy() since this will remove it from the container and help break any circular reference count cycles.
<palomer>
is there any way to reset gtk?
<palomer>
I can simple include a reload button to my system if it did
<thelema>
?? like destroy all top-level objects and re-run Gtkmain.Main.init ()?
<palomer>
yeah
<palomer>
free all the memory
<thelema>
it's a bad solution, even if it does work.
<palomer>
hrmph...
<palomer>
double hrmph...
<palomer>
there IS a hack around this
<palomer>
but it's a little ugly
pierre- has joined #ocaml
<palomer>
(for my specific application)
<palomer>
but it's dog ugly
<thelema>
then don't do it.
<palomer>
but it stops me from destroying the widgets in the first place
<palomer>
by reusing them
<palomer>
heck, that's an easy solution enough
<thelema>
that doesn't necessarily sound ugly.
<palomer>
so I'll have this widget factory
<palomer>
rather, entry factory
<palomer>
which stores every entry it has created
<palomer>
and simply checks if one of them is no longer needs it
<palomer>
and returns that one (instead of creating a new one)
<thelema>
you could have an idle task that recycles unneeded entries into a pool
<palomer>
oh my
<palomer>
that's also a good idea
<palomer>
I was thinking of just attaching a bool ref to each entry
<palomer>
and storing these pairs
<thelema>
?? just remove the widget from its container and store it in a stack or queue.
<thelema>
or whatever lightweight structure you like.
<palomer>
that works too
<palomer>
(I'll use a list)
* palomer
is not a big fan of fancy datastructures
<palomer>
pressing a key on the view will scroll to either line 0 or line 500 (thereabouts)
Submarine has joined #ocaml
<palomer>
but...it doesn't work
pierre- has quit [Read error: 60 (Operation timed out)]
jstash has quit []
<palomer>
hmm
<palomer>
my application still eats up memory like a mofo
* palomer
continues the hunt
<palomer>
actually
<palomer>
I did it wrong
<palomer>
doesn't work
<palomer>
:P
zenhacker_rouan has quit ["Lost terminal"]
* Yoric[DT]
hopes that someday, someone will write a complete documentation for LablGTK.
<tsuyoshi>
amen brother
<flux>
yoric[dt], maybe you could start by writing complete, but fully erronous, documentation into a wiki, and then bait people to fix it
<tsuyoshi>
ha
<tsuyoshi>
I think you just need to take the c docs and adapt them to ocaml
<Yoric[DT]>
flux: well, I'm already busy writing the documentation for the ocaml libraries + batteries included.
<tsuyoshi>
it's not difficult, it's just tedious
<Yoric[DT]>
That takes most of my time.
<Yoric[DT]>
Now, LablGtk is on the list.
<Yoric[DT]>
If nobody has written any documentation for LablGtk when we get around to it, I/we'll certainly try.
<Yoric[DT]>
But we have a looooooong list of things to do first.
<Yoric[DT]>
That probably won't be before 2010.
<Yoric[DT]>
So if anyone else wants to take that particular job, that's probably a good idea :)
<Yoric[DT]>
Side-note: at the moment, I'm busy adding a on-line help system to the toplevel.
<Yoric[DT]>
That would fit in nicely.
<Yoric[DT]>
Other side-note: if anyone is interested in implementing Thompson (I think it's Thompson)'s graphics combinator library for beginners, I'd be interested in using it.
<Yoric[DT]>
But for the moment, I have a train to catch.
<Yoric[DT]>
Cheers.
Yoric[DT] has quit ["Ex-Chat"]
mishok13 has joined #ocaml
jstash has joined #ocaml
ulfdoz has joined #ocaml
Submarine has quit ["Leaving"]
<palomer>
it works!
<palomer>
(kind of)
Snark has joined #ocaml
Camarade_Tux has joined #ocaml
<palomer>
nope
<palomer>
doesn't work
<palomer>
recycling widgets doesn't work
<palomer>
don't do it kids
<tsuyoshi>
palomer: what were you trying to do?
<palomer>
tsuyoshi, add a lot of entries to a text view
<palomer>
many times a second
<palomer>
what happens is that I run out of memory
<palomer>
I have a few test cases showing this behaviour if you're interested
pango has quit ["I shouldn't really be here - dircproxy 1.0.5"]
seafood has quit []
<palomer>
I posted it on the list
yangsx has quit [Remote closed the connection]
filp has joined #ocaml
<tsuyoshi>
I see.. so Gc.allocated_bytes keeps going up?
<palomer>
yup
<tsuyoshi>
that's a leak in lablgtk then
<palomer>
pretty serious leak, if you ask me!
Snark has quit ["Ex-Chat"]
<tsuyoshi>
well the code is unusual
<palomer>
removing widgets from a vbox?
<palomer>
I do it all the time!
<tsuyoshi>
standard practice for removing widgets from a container is to destroy the children, not remove them
<palomer>
this test case is supposed to destroy them
<tsuyoshi>
yes
<palomer>
I don't keep them
<palomer>
this is how the program works: create 100 brand new text entries, put them in a vbox, clear the vbox, repeat
<tsuyoshi>
yes, but the vbox clearing is not how I would do it
<tsuyoshi>
so I'm curious as to whether the way I would do it still results in a leak
<tsuyoshi>
(it should still result in a leak)
<palomer>
how do you do it?
<tsuyoshi>
#destroy, not #remove
<palomer>
oh
<palomer>
List.iter (fun y -> y#destroy) c#all_children <--like this?
<palomer>
same result
<palomer>
(you can try it out!)
<tsuyoshi>
hrm.. I'd probably iterate some other way but I guess that's close enough
<tsuyoshi>
yeah that's definitely a bug in lablgtk
<tsuyoshi>
I imagine whatever code contains the bug is pretty trick, since translating gtk allocation to ocaml allocation ought to be tricky
<tsuyoshi>
pretty tricky
<palomer>
bummer
<palomer>
now, the way I want to get around this is by using labels
<palomer>
ugh
<palomer>
I have no idea how I could otherwise mix text and text entries
* palomer
gives up and goes to bed
<palomer>
night!
<tsuyoshi>
well, labels are what I always use
rmns has joined #ocaml
<tsuyoshi>
if my code leaks I wouldn't even notice though, I don't create that many widgets
Camarade_Tux has quit ["Leaving"]
<palomer>
labels and entries?
johnnowak has quit []
jknick has quit ["leaving"]
seafood has joined #ocaml
_zack has joined #ocaml
rmns has left #ocaml []
vpalle has joined #ocaml
vpalle_ has joined #ocaml
vpalle has quit [Read error: 110 (Connection timed out)]
Yoric has joined #ocaml
<Yoric>
hi
seafood has quit []
itewsh has joined #ocaml
vixey has joined #ocaml
<guyzmo>
hi
<guyzmo>
I'm having difficulties to install ocamlwizard
<guyzmo>
first it says '/bin/sh: ocamlwizard: not found' at every compilation command
<guyzmo>
and then it ends with an error : 'Unbound module type Sig.COMPARABLE'
<guyzmo>
ah
<guyzmo>
it seems to be using ocamlgraph from ocaml 3.10.0 not 3.10.2
<guyzmo>
:]
vpalle__ has joined #ocaml
<guyzmo>
I have to find out how to specify the correct module path (/usr/local/lib and not /usr/lib)
<guyzmo>
if anyone can tell me how to do so ..
<guyzmo>
;)
Associat0r has joined #ocaml
vpalle_ has quit [Read error: 110 (Connection timed out)]
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
Demitar has quit [Remote closed the connection]
Linktim has joined #ocaml
Linktim_ has joined #ocaml
azi_ has joined #ocaml
<azi_>
hm.. i have three files calc.ml, parser.mly and lexer.mll i've compiled the last two with ocamlaycc/ocamllex. calc.ml uses a function defined in "parser.ml" but when i issue ocamlc -o calc calc.ml it fails saying that the named function from parser.ml is unbound, what could that mean?
<Smerdyakov>
Look at the generated mli file for your parser. Is the function you want exposed?
<azi_>
Smerdyakov: well I usually do that when i'm doing something specific for me. in this case it is something i need to extend and if it doesn't work as they wrote it should, then I start wondering if I missed something not so trivial
Linktim has quit [Read error: 110 (Connection timed out)]
<vixey>
it's trivial just read that link
<azi_>
vixey: sadly, i have no choice
<Smerdyakov>
azi_, could be. I don't vouch for any tutorial not found in the real OCaml manual.
<vixey>
no choice about what?
<azi_>
Smerdyakov: nether do i for all generic topics.. but when you have some silly "homework" stuff to do, then it's another song :)
<azi_>
+ i think spoting mistakes in such text is part of the lerning process :)
Linktim_ has quit [Read error: 110 (Connection timed out)]
Snark_ has joined #ocaml
Snark_ is now known as Snark
itewsh has quit ["KTHXBYE"]
GustNG has joined #ocaml
Yoric has quit [Remote closed the connection]
Linktim has joined #ocaml
vixey has quit ["Leaving"]
alexyk has joined #ocaml
Linktim has quit [Read error: 104 (Connection reset by peer)]
GustNG1 has joined #ocaml
Linktim has joined #ocaml
alexyk has quit []
GustNG has quit [Read error: 110 (Connection timed out)]
_zack has quit [Remote closed the connection]
GustNG has joined #ocaml
GustNG1 has quit [Read error: 60 (Operation timed out)]
_zack has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
pierre_m has joined #ocaml
_zack has quit [Client Quit]
Demitar has joined #ocaml
Demitar has quit [Remote closed the connection]
Demitar has joined #ocaml
filp has quit ["Bye"]
Associat0r has quit [Read error: 54 (Connection reset by peer)]
Associat0r has joined #ocaml
Amorphous has quit [Read error: 104 (Connection reset by peer)]
Associat0r has quit [Read error: 104 (Connection reset by peer)]
GustNG1 has joined #ocaml
vpalle__ has quit ["Leaving"]
Amorphous has joined #ocaml
GustNG2 has joined #ocaml
Associat0r has joined #ocaml
GustNG has quit [Read error: 110 (Connection timed out)]
GustNG1 has quit [Read error: 110 (Connection timed out)]
pierre- has joined #ocaml
vixey has joined #ocaml
pierre_m has left #ocaml []
itewsh has joined #ocaml
pierre_m has joined #ocaml
jstash has joined #ocaml
Camarade_Tux has joined #ocaml
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
guyzmo has quit [Remote closed the connection]
guyzmo has joined #ocaml
det has quit [Remote closed the connection]
det has joined #ocaml
alexyk has joined #ocaml
_zack has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
pierre_m has quit [Remote closed the connection]
mishok13 has quit [Read error: 110 (Connection timed out)]
dondy has joined #ocaml
_zack has quit ["Leaving."]
Linktim has joined #ocaml
johnnowak has joined #ocaml
pierre- has quit [Connection timed out]
pierre- has joined #ocaml
johnnowak has quit [Client Quit]
Linktim_ has joined #ocaml
GustNG has joined #ocaml
Yoric[DT] has joined #ocaml
<fremo>
how to get a functions dependencies graph ?
itewsh has joined #ocaml
Linktim has quit [Read error: 113 (No route to host)]
<Yoric[DT]>
hi
<Yoric[DT]>
fremo: you can try ocamldoc -dot
<fremo>
'lo Yoric[DT]
<fremo>
ok, thanks :)
alexyk has quit []
<Yoric[DT]>
np
filp has joined #ocaml
GustNG1 has joined #ocaml
pango has joined #ocaml
GustNG2 has quit [Read error: 110 (Connection timed out)]
Linktim_ has quit [Read error: 110 (Connection timed out)]
Axioplase_ is now known as Axioplase
Linktim has joined #ocaml
blue_prawn has joined #ocaml
GustNG has quit [Read error: 110 (Connection timed out)]
Linktim_ has joined #ocaml
hkBst has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
marmotine has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
<flux>
evening
tomh has joined #ocaml
<flux>
fremo, you might get good (approximate) results by using ocamlopt -pp, gprof, gprof2dot.py and graphviz
itewsh has quit ["KTHXBYE"]
Submarine has joined #ocaml
dondy has quit ["ERC Version 5.2 (IRC client for Emacs)"]
Linktim has joined #ocaml
alexyk has joined #ocaml
Linktim has quit [Read error: 104 (Connection reset by peer)]
Linktim has joined #ocaml
jeddhaberstro has joined #ocaml
* palomer
is getting out of the business of recycling widgets
<palomer>
srsly
<palomer>
the internet is so boring
<palomer>
I don't know how I can spend all my time on it