gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
avsm has quit [Quit: Leaving.]
fraggle_laptop has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
buriedhead has joined #ocaml
f[x] has quit [Ping timeout: 240 seconds]
f[x] has joined #ocaml
philtor has joined #ocaml
<thelema> Drakken: http://pastebin.com/F6LNHq2t -> example data to be graphed
<thelema> generated by examples/listmap
bobry has quit [Remote host closed the connection]
lopex has quit [Read error: Connection reset by peer]
philtor has quit [Ping timeout: 252 seconds]
lopex has joined #ocaml
bobry has joined #ocaml
ulfdoz has joined #ocaml
dilange888 has joined #ocaml
joewilliams has quit [Read error: Connection reset by peer]
<Drakken> thelema got it.
joewilliams has joined #ocaml
<Drakken> Incidentally, have you considered converting the times to microseconds?
buriedhead has quit [Read error: Connection reset by peer]
<Drakken> or nanoseconds?
joewilliams has quit [Remote host closed the connection]
bobry has quit [Remote host closed the connection]
lopex has quit [Remote host closed the connection]
joewilliams has joined #ocaml
<Drakken> thelema how am I supposed to parse "rev rev_map ..."? The function name contains both a space and an underline.
<Drakken> If it really needs to be that general, it would be easier to have it on its own line:
<Drakken> foo
<Drakken> lo ..............
<Drakken> mid ....................
<Drakken> hi
<Drakken> oops I forgot the dots (they represent the data)
<Drakken> hi ......................
<Drakken> bar
<Drakken> lo .......................
<Drakken> mid ................................
<Drakken> hi ...........................
<Drakken> no need to repeat the func name as long as you keep the name and data together.
bobry has joined #ocaml
buriedhead has joined #ocaml
ankit9 has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 252 seconds]
dilange888 has quit [Read error: Connection reset by peer]
lopex has joined #ocaml
ankit9 has joined #ocaml
mnabil has quit [Ping timeout: 240 seconds]
<Drakken> thelema here's a quick plot of the data: http://tinypic.com/r/de5jbl/5
<Drakken> Lots of work left for tomorrow.
edwin has joined #ocaml
edwin1 has joined #ocaml
edwin has quit [Disconnected by services]
Cyanure has joined #ocaml
noj has quit [Quit: leaving]
testcocoon has quit [Quit: Coyote finally caught me]
<flux> sorry if 'lo .....' and 'hi ....' seem like a retarded way to greet people ;-)
fantasticsid has joined #ocaml
noj has joined #ocaml
testcocoon has joined #ocaml
buriedhead has quit [Ping timeout: 248 seconds]
milosn has joined #ocaml
ikaros has joined #ocaml
thomasga has joined #ocaml
taupin has joined #ocaml
buriedhead has joined #ocaml
buriedhead has quit [Ping timeout: 240 seconds]
roha has joined #ocaml
buriedhead has joined #ocaml
ikaros has quit [Remote host closed the connection]
buriedhead has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
buriedhead has joined #ocaml
buriedhead has quit [Ping timeout: 252 seconds]
Kakadu has joined #ocaml
<Kakadu> Qrntzz: hi!
Snark has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
buriedhead has joined #ocaml
ttamttam has joined #ocaml
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
thomasga1 has quit [Read error: Connection reset by peer]
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 244 seconds]
letrec has joined #ocaml
Snark has quit [*.net *.split]
roha has quit [*.net *.split]
milosn has quit [*.net *.split]
samposm has quit [*.net *.split]
caligula__ has quit [*.net *.split]
rwmjones has quit [*.net *.split]
companion_cube has quit [*.net *.split]
Snark has joined #ocaml
roha has joined #ocaml
milosn has joined #ocaml
samposm has joined #ocaml
caligula__ has joined #ocaml
companion_cube has joined #ocaml
rwmjones has joined #ocaml
Drup has joined #ocaml
rixed_ has quit [Read error: Connection reset by peer]
buriedhead has quit [Ping timeout: 252 seconds]
roha has quit [Ping timeout: 240 seconds]
emmanuelux has joined #ocaml
buriedhead has joined #ocaml
roha has joined #ocaml
pr_ has joined #ocaml
pr has quit [Disconnected by services]
pr_ is now known as pr
pr has quit [Changing host]
pr has joined #ocaml
buriedhead has quit [Ping timeout: 252 seconds]
<Drakken> Anybody up for some ocamlbuild troubleshooting?
<Drakken> I seem to be having some kind of trouble:
<Drakken> dan[benchplot]$ cat _tags
<Drakken> <benchplot.cm*>: package(archimedes), package(cairo2)
<Drakken> plottest.byte or plottest.native: package(archimedes)
<Drakken> dan[benchplot]$ ocamlbuild -use-ocamlfind benchplot.native
<Drakken> Failure: lexing: empty token.
<Drakken> Compilation unsuccessful after building 0 targets (0 cached) in 00:00:00.
<Drakken> dan[benchplot]$ cat _build/_log
<Drakken> ### Starting build.
<Drakken> # Compilation unsuccessful.
<Drakken> dan[benchplot]$
<f[x]> > plottest.byte or plottest.native
<f[x]> wrong syntax
avsm has joined #ocaml
<Drakken> f[x] good thought. I forgot about that.
<Drakken> Unfortunately, that doesn't seem to be the problem: http://pastebin.com/TsrahBqP
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
avsm has quit [Quit: Leaving.]
roha has quit [Ping timeout: 260 seconds]
<thelema> Drakken: try <plottest.*>
<thelema> it doesn't hurt to apply packages to everything.
<thelema> (maybe except for lablgtk.init)
<f[x]> syntax still wrong
<f[x]> see "Syntax and semantics of glob expressions" at http://nicolaspouillard.fr/ocamlbuild/ocamlbuild-user-guide.html
roha has joined #ocaml
<Drakken> f[x] (a) I don't see a syntax error, and (b) even if there is one, why doesn't ocamlbuild -verbose 9 complain about it?
<thelema> Drakken: you need <> around filename globs
<thelema> the only things allowed outside <> are the boolean operators and constants
<f[x]> it complains : Failure: lexing: empty token.
<thelema> the ocamlbuild lexer/parser could definitely use better error messages
roha has quit [Ping timeout: 252 seconds]
Kakadu has quit [Quit: Page closed]
<Drakken> literal filenames don't have angle brackets around them, but I didn't notice the quotation marks.
rixed has joined #ocaml
<Drakken> Speaking of poor error messages, it's hard to get useful information out of "syntax still wrong" and "lexing: empty token".
<Drakken> f[x] thank you for trying, but I don't see why you had to be so vague.
<Drakken> but thank you anyway. I guess that's better than nothing.
<Drakken> btw, I don't see anything about quotation marks in the user manual.
<Drakken> thelema thank you, that worked. My original version also works as long as the literal names are quoted.
<f[x]> Drakken, that's intentional. I prefer to find and give the url to the manual, than to type the verbose answer by hand :)
<Drakken> f[x] "quote filenames" is no more verbose than "syntax still wrong".
<Drakken> I've already read the manual, so unfortunately, your comment was not helpful to me.
<Drakken> If you really want to avoid verbosity, just type "RTFM".
<f[x]> Drakken, that was my first thought :)
<Drakken> f[x] please go with your first thought next time. That would be better.
* rwmjones is surprised .. no pa-do in Debian?
* f[x] is surprised - rwmjones uses debian??
* orbitz is just usually surprised
roha has joined #ocaml
<Drakken> thelema did you see my posts from late last night? There'a a comment about the file format and links to a plot and a first draft of the plotting code.
* rwmjones is looking to see if debian have already fixed this bug or not
<f[x]> rwmjones, I guess all camlp4 extensions packaged can be found with `aptitude search camlp4`
<f[x]> not much really
probst has quit [Quit: probst]
probst has joined #ocaml
Kakadu has joined #ocaml
<Drakken> thelema here's a plot vs. log10 x: http://tinypic.com/r/25jy49w/5
ikaros has joined #ocaml
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
ankit9 has quit [Quit: Leaving]
probst has quit [Quit: probst]
probst has joined #ocaml
roha has quit [Ping timeout: 240 seconds]
metasyntax|work has quit [Ping timeout: 252 seconds]
metasyntax|work has joined #ocaml
pango has quit [Ping timeout: 252 seconds]
<Kakadu> Qrntzz: ping!
roha has joined #ocaml
willb has joined #ocaml
ulfdoz has joined #ocaml
pango has joined #ocaml
smerz has joined #ocaml
ttamttam has left #ocaml []
dsheets has quit [Ping timeout: 240 seconds]
ankit9 has joined #ocaml
ankit9 has quit [Client Quit]
dsheets has joined #ocaml
ankit9 has joined #ocaml
ulfdoz_ has joined #ocaml
buriedhead has joined #ocaml
ulfdoz has quit [Ping timeout: 252 seconds]
ulfdoz_ is now known as ulfdoz
<thelema> Drakken: I think I missed your posts
<thelema> Drakken: It'd be great to have x labels corresponding to actual plotted values
letrec has quit [Ping timeout: 244 seconds]
<thelema> can make those changes to the format, no problem
buriedhead has quit [Ping timeout: 260 seconds]
<thelema> also, "mid" is the best estimate value, lo and hi are 95% bounds on it
<Drakken> thelema here's a plot with a bigger title: http://tinypic.com/r/35hke44/5
<thelema> Drakken: as to printing more nicely; maybe I could do nanoseconds, but I worry a bit that we might need more precision in the future
<adrien> I guess that if I create "marshal.ml", ocamlbuild will complain, right?
<thelema> Drakken: "Comparison between foo1, foo2 and foo2"
<thelema> adrien: why?
<Drakken> thelema last night's version of the code: https://github.com/Drakken/benchplot/blob/master/multiplot.ml
<thelema> yes, I found that - would it be useful for you if I integrated that into the benchplot tool?
<adrien> thelema: I was expecting the module name clash to make it fail (but I haven't tried yet)
<Drakken> thelema archimedes doesn't seem to support auto-log scaling. We'll have to roll our own.
<thelema> adrien: batdep might have a whitelist that it doesn't include in deps
<adrien> hmmm, ok, I'll try and see how that goes
<thelema> Drakken: yes, my rule of thumb is that if the max x-value is >100* the min x-value, log-scale
<thelema> adrien: ocamlbuild gets deps from it, iirc
<adrien> btw, for archimedes, it might have changed since then, but last summer, I hacked x/y axis labels by specifying what to write on the x and y scales
<adrien> instead of writing the actual biggest value, I wrote the axis label
<Drakken> thelema I mean we'll have to write our own displaying tic marks of x instead of log x.
<Drakken> deciding whether or not to convert to logs is NBD
<thelema> Drakken: oh... :(
<Drakken> it's not too hard as long as I can figure out the lower-level API.
<thelema> I'm about to commit the new format, as you wanted.
<thelema> you were right about "rev rev_map" being a problem
<Drakken> :)
sebz has joined #ocaml
<thelema> changes pushed, you should be able to generate the new format output from listmap.native
<thelema> gotta run
<Drakken> thelema about integration, how do you want to use the plots?
<Drakken> Wait!
<Drakken> separate executable for multiplot?
<Drakken> that mostly affects you as the user, right?
<Drakken> oh well, that's not really urgent. no hurry
<Qrntzz> Kakadu: good evening
<Qrntzz> Kakadu: sorry, was in the city all day long
oriba has joined #ocaml
<Kakadu> Qrntzz: ok
ttamttam has joined #ocaml
as has joined #ocaml
as has quit [Client Quit]
ttamttam has left #ocaml []
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<thelema> Drakken: I think we can auto-detect what type of file is being read and produce the right plot from that
<thelema> I'd rather not have two plotting executables
<thelema> This 2d plot is for compression - one color for each testing function, slightly lighter colors for the high/low (or a background band would be great)
<thelema> s/compression/comprehension/
<thelema> or even comparison
<Drakken> thelema for some reason archimedes doesn't seem to support the floating backround for uneven xs, at least not easily. There's a ~base arg for even xs (benchplot), but I couldn't get it to work (and it's not in the ocamldoc) for user-supplied xs.
<Drakken> the base is the bottom of the fill zone. the plotting functions are Archimedes.Array.y for even xs and Archimedes.Array.xy for user xs.
<thelema> ok
ttamttam has joined #ocaml
ttamttam has left #ocaml []
_andre has quit [Quit: leaving]
iago has joined #ocaml
Julien_T has joined #ocaml
mdelaney has joined #ocaml
<adrien> wrote C stubs which compiled without any warning at first try
<adrien> 40 lines of code, I think I can safely say that I'll have at least 3 bugs in them
thomasga has quit [Quit: Leaving.]
<maufred> Hello, I have a hashtbl of size one million. In the table, on each binding there is a set of size 100000. Is this too much ? (I have an out of memory issue but I suspect it is because I have a non tail rec function)
<maufred> The set contains only int
<thelema> depends on if the sets have any shared components
<maufred> they don't
<thelema> 1m * 100K ~ 100G words = 6.4TB?
<maufred> ouch !
<thelema> just the ints, no pointers, no hashtbl buckets
<thelema> If your sets are over a small range, you could use bitsets, but likely you'll have to rethink what you're doing
<thelema> or use range sets, if there's a lot of contiguous ranges in your sets
<adrien> or maybe store ranges in the set if you have many contiguous values
<maufred> And how can I share this components ? Because one set will have (let's say) {1;2;3;5} and the other {2;3} ?
<thelema> adrien: better for sets to use range sets
<adrien> thelema: that's what I meant but you're wording it better =)
<maufred> I can't know if they are continious
<thelema> maufred: ocaml sets are balanced binary trees - if you generate one set, and then add an element to it to get another set, the the two sets will have pointers to many common subtrees
<thelema> i.e. adding a value to a set doesn't allocate O(n) data, but O(log n)
<maufred> (give me 30 sec to think ;) )
<maufred> let's explain it clearer (it will be more easy for you to understand)
<maufred> I have a database of 10 000 persons
<maufred> I want to know who has the most ancestors
<maufred> so I build a hashtbl
<adrien> (you share memory when constructing the values, not afterwards with a function that would scan memory and try to locate common chunks)
<maufred> in each binding there is a set of ancestor
<maufred> so maybe Hashtbl 42 will whare common ancestor (values) or hashtbl 12
<maufred> So, I should find a way to shared this set ?
<thelema> ok, so you're building a graph with direct index using the hashtable?
<maufred> yes
<thelema> so build your 10K node graph, and use a 10K entry hashtable to index into it.
<flux> maufred, you can't really share single integers
* thelema scoffs at the camlp5
<maufred> This is my function to update a root (but i have many roots)
<maufred> theleman: he he
<flux> maufred, but maybe you could use ranges, if you know that you often have a lot of consecutive numbers
<maufred> flux: how can I do that ?
<thelema> Since you have a directed graph, just traverse the graph, setting the "value" of each node equal to the sum of values of its parents
<maufred> Right now I just do Set.add
<maufred> thelema : that's what I do (I think)
<flux> maufred, find an integer range data structure.. maybe Batteries has one
<maufred> flux: OK, thanks
<thelema> you don't need a hashtable to do this
<thelema> maufred: yes, batteries' ISet can help you
<thelema> may help you
<maufred> I used a hashtbl because the ancestor of A may be the same of B then I don't want to compute them again
<maufred> is that not true ?
<thelema> maufred: store the values in the nodes
<maufred> ... of course
<maufred> Then, should I use a Map or a Set ?
<thelema> the trick is building the graph if it's immutable, but just use something like type node = {mutable weight:int; mutable parent: node list; mutable child: node list}
<thelema> if you need any other data for each node (some sort of person-id), put it in the record
<maufred> Ah yes !
<thelema> initialize all the weights to -1, ...
<maufred> It's much more clear now !
<thelema> if you want a graph, build a *graph*
<maufred> OK, it's perfect, I'll try this
<maufred> Thanks all !
<thelema> If you know all the people without children, you don't need the child: field
<maufred> Yes, I can reduce a list with a lot of persons with only the people without child and then reduce again to clean the brother/sister (to keep only one)
<thelema> then you only need to get the # of ancestors for each of those people, and any duplicate work will be prevented by mutating the graph
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
<maufred> wonderful !
<maufred> I think this is exactly what I want
<maufred> I tried the wrong way with the hashtbl
<thelema> the right data structure makes the algorithm easy
<maufred> yes ! I tried so many ways that does'nt work, that I came to ask some help
Snark has quit [Quit: Quitte]
Kakadu has quit [Quit: Konversation terminated!]
dsheets has quit [Ping timeout: 240 seconds]
dsheets has joined #ocaml
roconnor has joined #ocaml
<roconnor> let print_num ff n = fprintf ff "%s" (string_of_num n);;
<roconnor> #install_printer "print_num";;
<roconnor> gives me the error:
<roconnor> Wrong type of argument for directive `install_printer'.
<roconnor> val print_num : Format.formatter -> Num.num -> unit = <fun>
<thelema> try `#install_printer print_num`
<roconnor> thanks
<thelema> #install_printer printer-name;;
<thelema> as opposed to #use "file-name";;
<hcarty> roconnor: If it doesn't exist already, it's probably worth submitting a bug in Mantis
<thelema> roconnor: would you like to ... what hcarty said
<roconnor> who is Mantis?
dsheets has quit [Ping timeout: 248 seconds]
<roconnor> I don't suppose one of you would rather sumbit it; maybe you already have accounts
jrslepak_ has joined #ocaml
<thelema> I'll get it.
<adrien> what's the C conversion for a size_t?
<adrien> like Val_size_t / Size_t_val
dsheets has joined #ocaml
<thelema> adrien: system-dependent
<adrien> thelema: ok, thnka
<adrien> thanks*
* adrien starts crying
<thelema> usually size_t is unsigned - this doesn't have a correspondance in ocaml
<adrien> true
<thelema> there are libs for unsigned ints in ocaml, fwiw
<adrien> I don't think I'll need the extra bit for strings over the network :-)
<thelema> then just use int
<adrien> yup, good idea
<adrien> now, let's debug the C stubs
dsheets has quit [Ping timeout: 248 seconds]
<roconnor> thelema: thanks
<thelema> roconnor: n/p
roha has quit [Quit: Leaving]
dsheets has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<_habnabit> hmm, I'm getting `ocamlfind: When using -syntax, the META variable 'preprocessor' must be set` when trying to use ocamlbuild with camlp4
<_habnabit> the tag is `"algexp.ml": syntax(camlp4o)`
<_habnabit> I've never used camlp4 before, so I might be doing something very silly here
<thelema> I dunno how the builtin ocamlbuild rules handle camlp4, one sec
<_habnabit> that's with ocamlbuild -use-ocamlfind
<_habnabit> oh, the tag is just `camlp4o`
<thelema> ok.
<adrien> you need package(foo.syntax)
<_habnabit> for using the syntax rules defined in algexp.ml?
<adrien> if you want the syntax defined by package "foo" that is
<adrien> (the ".syntax" is a standard but the exact name might sometimes be different)
<adrien> is there something to copy a C string that has nulls in it (basically, a buffer)?
<adrien> caml_copy_strng doesn't look after nulls iirc
<_habnabit> memcpy ?
<adrien> I'm currently writing caml_alloc_string+memcpy, we'll see how it goes
wmeyer has joined #ocaml
<wmeyer> hello
<adrien> hi
<thelema> hello
<wmeyer> does anybody know if the 2012 OCaml Meeting will happen?
<thelema> nope, don't know.
<thelema> last year's organizer might be too busy with new job.
<wmeyer> :(
<wmeyer> you mean Sylvain, that's a pity
<wmeyer> I regret I didn't come last year
<wmeyer> almost booked tickets for Eurostar
<thelema> it's not too bad for sylvain.
Julien_T has quit [Quit: Julien_T]
<adrien> _habnabit: memcpy(Strinv_val(s), src, len) worked
<_habnabit> hooray
<adrien> yeah, now I can debug the second error :p
mfp has quit [Ping timeout: 244 seconds]
<wmeyer> how do you allocate s? isn't better to use string_copy_string ?
<wmeyer> you should be able to say:
<wmeyer> CAMLlocal1(s);
<wmeyer> s = copy_string(src);
roconnor has quit [Ping timeout: 240 seconds]
<adrien> wmeyer: caml_copy_string expects a C-string: null-terminated
<adrien> that part is working now
<adrien> the new issue is when doing the opposite operation =)
<adrien> funny things is that I had actually done the same mistake: I used strlen on binary data
ikaros has quit [Quit: Ex-Chat]
mfp has joined #ocaml
sebz has joined #ocaml
edwin1 has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 240 seconds]
ulfdoz has quit [Ping timeout: 268 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 240 seconds]
dsheets has joined #ocaml
mdelaney has quit [Quit: mdelaney]
dsheets has quit [Ping timeout: 240 seconds]
dsheets has joined #ocaml
willb has quit [Ping timeout: 240 seconds]
dsheets has quit [Ping timeout: 240 seconds]
letrec has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
roconnor has joined #ocaml
letrec has quit [Read error: Connection reset by peer]
letrec has joined #ocaml
dsheets has joined #ocaml
Morphous_ has quit [Ping timeout: 240 seconds]
<adrien> I hate binding C, I hate it, I hate it, I hate it
Morphous_ has joined #ocaml
dsheets has quit [Ping timeout: 240 seconds]
Drup has quit [Quit: Leaving.]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 255 seconds]
roconnor_ has joined #ocaml
dsheets has joined #ocaml
roconnor has quit [Ping timeout: 268 seconds]
letrec has quit [Ping timeout: 252 seconds]
dsheets has quit [Ping timeout: 244 seconds]
dsheets has joined #ocaml
Cyanure has quit [Read error: Connection reset by peer]
Submarine has quit [Ping timeout: 240 seconds]
iago has quit [Quit: Leaving]