<NaCl>
how do I set a button's sensitivity on lablgtk2?
<NaCl>
button#misc#set_sensitive
<NaCl>
yeah, uh...
<NaCl>
that isn't laid out well
ikaros has quit [Quit: Ex-Chat]
iratsu has quit [Ping timeout: 250 seconds]
iratsu has joined #ocaml
lopex has quit []
joewilliams is now known as joewilliams_away
jmcarthur has quit [Quit: WeeChat 0.3.4]
dnolen has quit [Quit: dnolen]
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
charlesno has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
arubin has joined #ocaml
lamawithonel_ has quit [Remote host closed the connection]
lamawithonel_ has joined #ocaml
dnolen has joined #ocaml
sebz has joined #ocaml
charlesno has left #ocaml []
sepp2k has quit [Remote host closed the connection]
<NaCl>
another question
<NaCl>
so, I have an Lwt+gtk application that spawns a subprocess. The subprocess does not automatically die after I close the application while it is running. I add a Lwt_main.at_exit hook to kill the child process by its PID, but it doesn't seem to do anything.
<NaCl>
Interrupting the main process with C-c at the terminal kills the subprocess along with the main one, no matter if the exit hook is set.
<NaCl>
Any ideas?
<_habnabit>
well, do you know if the child process is receiving SIGINT?
<_habnabit>
when you use C-c, I mean.
<NaCl>
C-c kills it
<NaCl>
SIGINT does not
<NaCl>
nor does QUIT, TERM, or KILL
<NaCl>
or HUP
<NaCl>
nor does closing by using the window manager
<_habnabit>
eh? C-c sends SIGINT
<NaCl>
maybe it sends it up the process tree as well
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
ankit9 has quit [Quit: Leaving]
ygrek has quit [Ping timeout: 250 seconds]
edwin has joined #ocaml
Snark has joined #ocaml
ankit9 has joined #ocaml
Ptival has joined #ocaml
ftrvxmtrx has joined #ocaml
ygrek has joined #ocaml
eikke has joined #ocaml
thomasga has joined #ocaml
Snark has quit [Quit: Quitte]
Cyanure has joined #ocaml
blinky- has joined #ocaml
avsm has joined #ocaml
larhat has joined #ocaml
ikaros has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
ikaros has quit [Quit: Ex-Chat]
<eikke>
is Martin Jambon in here, by accident?
lopex has joined #ocaml
<flux>
bah, I was building a module for dynamically constructing sql queries, but then realized that I'm using pgocaml as my backend and it's going to be quite difficult
<flux>
I guess it's still feasible, though. has anyone used pgocaml's lower layers?
ygrek has quit [Ping timeout: 250 seconds]
Amorphous has quit [Ping timeout: 255 seconds]
Amorphous has joined #ocaml
clog has quit [^C]
clog has joined #ocaml
<hcarty>
But only until oasis-db/odb/etc are in full swing!
<flux>
hcarty, also I'm this -> <- close to trying plplot/ocaml once I figure ocsigen a bit further :)
<hcarty>
flux: Glad to hear it. 5.9.8 was just released, without too many OCaml changes.
<hcarty>
let plug = "It does add nice legend support and some (very) experimental color bar support"
<flux>
finally, I managed to pull a custom binary blob out from ocsigen, time to dig into plplot
mattam_ is now known as mattam
<flux>
hcarty, so the bindings are generated from an idl file? (btw, the idl-file's copyright is 2007,2008)
<hcarty>
flux: Thanks for the tip on the copyright
<hcarty>
Yes, most of the bindings are generated with camlidl
<hcarty>
Some are not, either due to poorly supported types or function callbacks
<flux>
hcarty, does it provide means to write into memory and then produce a png into an ocaml string?
<flux>
oh, there's documentation :)
dnolen_ has joined #ocaml
<hcarty>
flux: Some documentation at least :-) The core C API is well documented and available more or less in raw form from OCaml
<hcarty>
flux: The OCaml section of the documentation gives a quick overview of the OCaml interface and its components
<hcarty>
flux: You can create a PNG in memory using the Plcairo library + the OCaml Cairo bindings
<flux>
hcarty, would it be simpler for svg?
_andre has quit [Quit: leaving]
<hcarty>
flux: I don't this so. The SVG output device writes directly to disk IIRC.
<flux>
apparently the version of plplot in debian was somewhat old as well, 5.9.5.
<hcarty>
The Plcairo module has functions to allow a user to supply their own Cairo surface to draw on.
<hcarty>
You can then use that surface as you see fit - the original Cairo bindings provide a way to get PNG contents as a string, for example.
sepp2k has joined #ocaml
ikaros has joined #ocaml
<flux>
fiinally I have a web page with dynamically create pictures with it. alas, they were created directly with cairo :).
drake01 has quit [Quit: Ex-Chat]
<adrien>
eikke: afaik, Martin Jambon isn't on the channel
<eikke>
hmh
<eikke>
had a question on a baoug.org challenge he made
<eikke>
got 2 implementations which pass my testcases, but they turn out 'wrong', so I must misunderstand the description
<eikke>
and there's no 'discuss' feature on the site
<adrien>
well, you can maybe harass fenard in order to get a discuss feature ;-)
drake01 has joined #ocaml
drake01 has quit [Max SendQ exceeded]
Snark has joined #ocaml
drake01 has joined #ocaml
<NaCl>
adrien: wha?
Snark has quit [Remote host closed the connection]
Snark has joined #ocaml
<NaCl>
adrien: no effect
drake01 has quit [Quit: Ex-Chat]
dnolen_ has quit [Quit: dnolen_]
<NaCl>
adrien: the flam3-render process refuses to go down with the UI
<NaCl>
oh
* NaCl
had to kill the process group
<NaCl>
killall -g
<NaCl>
but... how do I kill it internall?
<adrien>
NaCl: no, I was mentionning that you wanted to avoid sigpipes killing everyhing
<adrien>
NaCl: can't you simply signal it from inside flamel?
<hcarty>
flux: Ah, too bad! But going from pure Cairo to Cairo + PLplot requires very little if/when you decide to make the jump :-)
<adrien>
btw, I'll maybe (probably?) use plplot soon ;-)
<NaCl>
adrien: uh, I do. At exit. It doesn't die.
BiDOrD has joined #ocaml
<NaCl>
does not die
<adrien>
ah, and if you signal it from somewhere else? with pkill?
<adrien>
because if it refuses to listen to sigkill...
<NaCl>
if I make sure the signal is sent to the process group, then yes, it dies
<adrien>
"pkill flam3" doesn't work?
<NaCl>
it does
<NaCl>
if I "pkill flamel", it lives
<NaCl>
if I "pkill flam3" it dies
<adrien>
and from flamel, do you try to send flam3-render a kill signal?
<NaCl>
with Lwt_main.at_exit, yes
<hcarty>
adrien: My only request is that you provide feedback :-) But even if you don't - have fun with it!
<NaCl>
adrien: I'm trying to zap it at exit, or when I "cancel" it
<NaCl>
"cancel" isn't implemented yet
<adrien>
Functions registered using atexit() (and on_exit(3)) are not called if
<adrien>
a process terminates abnormally because of the delivery of a signal.
<adrien>
would that apply to your case?
<NaCl>
doesn't work even if I click the little "x" in the corner
<adrien>
"x" of flamel?
<adrien>
hcarty: sure
<NaCl>
adrien: yes
<adrien>
hcarty: btw, I had one question: is there something to be able to "pan" the plot? and something to get the coordinates of the cursor in the plot? (haven't had time to check yet, I'm still on something else)
BiDOrD has quit [Remote host closed the connection]
<adrien>
NaCl: can't you do it in the usual gtk callback for X?
<hcarty>
adrien, flux: I'd like to write a few blog/wiki/documentation articles on using PLplot with OCaml. If you find information which is missing and would be useful for documentation it may give me something to start with
<hcarty>
adrien: There is no built-in panning support, but I've done something like this when mixing PLplot + Cairo + lablgtk2
<adrien>
ok
<NaCl>
adrien: which one is that, anyway?
<adrien>
NaCl: it usually goes like ignore (window#connect#destroy ~callback:GMain.Main.quit);
<adrien>
hcarty: well, what is going to hurt is that it will be on windows and might be with C++ ='(
<hcarty>
adrien: That should still be possible :-)
<hcarty>
I haven't used PLplot's C++ support beyond building and running the examples, but all of the same features should be supported there
<hcarty>
Even if having to work in C++ on Windows is sad :-)
<NaCl>
adrien: uh, this uses lwt internally, and not the glib mainloop. there is something similer that diml coughed up...
<NaCl>
s/coughed up/made
BiDOrD has joined #ocaml
<adrien>
hcarty: yeah, probably, but C++ ='(
vext01 has joined #ocaml
<vext01>
hi, i am learning ocaml, and thus far enjoying it as my first touch on functional programming
<vext01>
i was wondering what function the top level is calling to print evaluations
<vext01>
can I use this in batch progams?
<NaCl>
adrien: blah, it even calls the function. the subprocess is not responding to the signal
<edwin>
vext01: I think extlib offers a function Std.print/Std.dump to print things like the toplevel would, but not exactly like that because type info is lost already
<vext01>
edwin: cheers i'll take a look
<vext01>
and loiter here for a while
<adrien>
NaCl: that's a bit weird, tell me if you figure that out
* NaCl
rages
<vext01>
oh, extlib is another project
<NaCl>
of which there are many
<vext01>
surely this is one of the things people would need
<thelema>
vext01: the toplevel cheats and gets type information from the compiler, which it uses to print things. Outside the toplevel, the compiler erases types, so there's no really nice printing as we all wish.
* NaCl
wonders why it did that
<vext01>
workaround, import my functions into the toplevel?
<vext01>
no extlib package available for me right now
<thelema>
vext01: Std.dump uses the runtime representation of values, and tries to guess types from that, but is far from perfect, especially on variant types
* NaCl
never needed such a thing
<thelema>
NaCl: efficiency - having to carry around types would make values larger
<vext01>
so how would you print the results of your analysis, which for example is a list of lists?
<vext01>
traverse manually?
<thelema>
vext01: the workaround is to print values with a printer constructed for their type. Batteries' has a lot of composable printers that help do this.
<thelema>
vext01: a list of lists of what?
<vext01>
i dunno, it could be anything
<thelema>
if floats, then I'd probably do: printf "Results: %a\n" (List.print (List.print Int.print)) results
<thelema>
oops, thta's ints. Float.print for floats
<vext01>
i see
<det>
Im using sexplib to print out types
<thelema>
there are syntax extensions that auto-generate printing functions
<det>
its not the same notation as the toplevel, but it works for me
<thelema>
(such as sexplib)
<adrien>
vext01: well, why do you want pretty-printing? only for "pretty"? what's the end goal?
<NaCl>
adrien: mmmmmmm
<adrien>
mmm, an html 3 browser written in ocaml and using tk
<adrien>
no, that "mmm"?
<NaCl>
adrien: using pervasives.at_exit results in errno 35
<NaCl>
adrien: EDEADLK
<vext01>
adrien: i had been using the toplevel to try snippets of code, but they eventually got too large for single liners
<adrien>
perror is C89, I wonder if it'd be worth to have it in ocaml
<vext01>
so i put it in a file and was hoping for something like str() of python to print a result
<eikke>
adrien: yes!
* eikke
is always cursing on how to handle error situations consistently when writing bindings to posix stuff
<NaCl>
vext01: you can dynamically load files into the toplevel
<adrien>
vext01: emacs has integration with the toplevel if you use it
* NaCl
wonders why this process refuses to be killed
<vext01>
NaCl: yup, ill try that
<vext01>
adrien: im a vimmer im afraid
<NaCl>
ah, yes. The Editor Dichotomy.
<vext01>
lets not go there
<adrien>
vext01: gg"*yG Alt-Tab Shift-Insert :P
<vext01>
hah
* adrien
has to get back to work, C++ and Qt....... ='(
<vext01>
ouch
<adrien>
and I don't really find Qt to be better than GTK, I don't know if it's because I'm used to GTK through ocaml or if it's because I'm doing it wrong in Qt but I prefer GTK
<vext01>
adrien: what is your job?
<adrien>
(otoh, I've probably spent more time doing Qt than GTK, so if I'm doing it wrong with Qt, it's maybe that their "introduction" is not better)
<adrien>
vext01: trainee at a motorsport company, replacing an interface written in VB3 (control of an embedded system, communication is done over serial)
<NaCl>
adrien: double fun: if I try to kill the process twice, the system throws a ESRCH
<hcarty>
adrien: Another plug - PLplot supports Qt as well....
<NaCl>
adrien: meaning no such process
<vext01>
hrm, how to load into the toplevel
<vext01>
#load and #use are not right
<NaCl>
they are
<hcarty>
vext01: Both are right in different contexts
<adrien>
hcarty: yeah, I saw that ;-)
<adrien>
NaCl: zombie?
<NaCl>
no
<vext01>
interesting they dont fail if i type a name that does not exist
<NaCl>
alive, and using 90% of my CPU
<adrien>
vext01: they fail here
<vext01>
maybe rlwrap is hiding the errors
<adrien>
NaCl: sounds like you're running skynet :P
<NaCl>
skynet was written with ocaml?
<vext01>
adrien: i see quoted
<adrien>
who know, it didn't rash all the time so that's actually pretty likely
<adrien>
knows* crash*
<vext01>
adrien: which motorsport company, may i ask? anything awesome?
<adrien>
KMP? k-m-p.nl iirc
<eikke>
ah, een nederlander
<adrien>
I actually wonder whether I've visited the website
<adrien>
well, french, I'm on an internship
<eikke>
ah
<eikke>
sure, ocaml, must be french (;-))
<adrien>
heheh =)
<vext01>
he3h
<NaCl>
heh
<vext01>
if only you could apply such reasoning to other languages
<NaCl>
ok, my problem is 100% related to EDEADLK
<adrien>
I _so_ miss the ability to do "List.iter (fun p -> p#set_param "foo") somelist_I_built_only_for_that_occasion", i.e. being able to create lists very easily
<adrien>
(and first-class functions and higher-order-f functions)
ankit9 has quit [Quit: Leaving]
<NaCl>
adrien: I think it doesn't like my mutex lock
lopex has quit []
Ptival has quit [Quit: Leaving]
alfa_y_omega has quit [Ping timeout: 252 seconds]
alfa_y_omega has joined #ocaml
alfa_y_omega has quit [Max SendQ exceeded]
alfa_y_omega has joined #ocaml
jonafan has quit [Remote host closed the connection]
jonafan has joined #ocaml
lopex has joined #ocaml
thomasga has quit [Quit: Leaving.]
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
joewilliams_away is now known as joewilliams
eikke has quit [Read error: Operation timed out]
larhat has quit [Quit: Leaving.]
alfa_y_omega has quit [Ping timeout: 276 seconds]
alfa_y_omega has joined #ocaml
junsuijin has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
cizra2 has quit [Ping timeout: 260 seconds]
fraggle_ has quit [Remote host closed the connection]
cizra2 has joined #ocaml
Ptival has joined #ocaml
alfa_y_omega has quit [Ping timeout: 276 seconds]
fraggle_ has joined #ocaml
avsm has quit [Quit: Leaving.]
eikke has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
metasyntax|work has joined #ocaml
ulfdoz has joined #ocaml
iratsu has quit [Ping timeout: 276 seconds]
sepp2k has quit [Ping timeout: 255 seconds]
StepanKuzmin has quit [Remote host closed the connection]
alfa_y_omega has joined #ocaml
lopexx has joined #ocaml
lopex has quit [Ping timeout: 240 seconds]
sebz has joined #ocaml
lopexx has quit [Client Quit]
lopex has joined #ocaml
sepp2k has joined #ocaml
rbancroft has quit [Ping timeout: 252 seconds]
fenard has quit [Quit: fenard]
rbancroft has joined #ocaml
sebz_ has joined #ocaml
sebz has quit [Ping timeout: 240 seconds]
sebz_ is now known as sebz
ftrvxmtrx has joined #ocaml
alfa_y_omega has quit [Ping timeout: 246 seconds]
Guest72979 has joined #ocaml
Guest72979 has quit [Client Quit]
alfa_y_omega has joined #ocaml
drake01__ has joined #ocaml
drake01__ has quit [Client Quit]
ulfdoz has quit [Ping timeout: 260 seconds]
drake01__ has joined #ocaml
drake01__ has quit [Read error: Connection reset by peer]
drake01__ has joined #ocaml
drake01__ has quit [Read error: Connection reset by peer]
sebz has quit [Quit: Computer has gone to sleep.]
drake01__ has joined #ocaml
drake01__ has quit [Read error: Connection reset by peer]
ftrvxmtrx has quit [Quit: Leaving]
<thelema>
6
<adrien>
17
<NaCl>
= 23
<thelema>
hike!
<dsheets1>
What is natural number addition, Alex?
drake01 has joined #ocaml
Snark has quit [Quit: Quitte]
edwin has quit [Remote host closed the connection]
<flux>
ooh, finally got my temperature chart working: http://[2002:6dcc:c861:11:21c:25ff:febe:5971]:8080/lampo/ - but I guess I should make it prettier :)
<flux>
..although something in the back of my brain is telling me that I would've been done with this at 10 AM had I juse used perl :)
<_habnabit>
when using BatResult, is there a simple way to say 'reraise if the exception isn\'t this type' ?
<thelema>
_habnabit: no, but you're welcome to make this and we'll add it to batresult
<_habnabit>
hmm, okay.
<_habnabit>
I just don't like catching more exceptions than necessary.
drake01 has quit [Quit: Ex-Chat]
<thelema>
It's reasonable to have a handle function that handles just some exceptions
<_habnabit>
... actually, can you even pass an exception type as a parameter?
<thelema>
sure, why not?
<_habnabit>
well, I don't know how. it seems like you'd have to instantiate it first.
<thelema>
Exceptions are just a special variant type - just don't raise it and it's a simple value
<dsheets1>
_habnabit: you can't have a parameterized catch clause without syntax extension, i think
<_habnabit>
okay, that's what I was trying to say.
<_habnabit>
something like `exception X of string;; Result.catch f |- Result.trap X`
<dsheets1>
_habnabit: you can use guards to take apart exceptions, though, iirc
<thelema>
_habnabit: more like Result.trap (function X s -> ... | x -> x)
<_habnabit>
how so?
<_habnabit>
thelema, right, okay, that makes sense.
<dsheets1>
like "with exn when myexnpred(exn,44) -> exit 44"
<_habnabit>
I'm just debating whether it would be useful to have trap: ('a, 'b) t -> ('b -> 'a) -> ('a, 'c) t
<_habnabit>
or just ('a, 'b) t -> ('b -> bool) -> ('a, 'b) t
<_habnabit>
or just make it 'a -> 'b option on the end there.
<thelema>
List.filter_map (fun x -> try Gtree.get_name gt x |> Tax_seqinfo.tax_id_by_name seqinfom) with Gtree.Lacking_name -> ...)
<_habnabit>
yeah, maybe I'll end up just doing that.
<thelema>
sometimes it's easy to forget that everything doesn't have to be written in terms of higher order functions, and that one is allowed to do actual work in the base language.
<_habnabit>
really I just wanted to get more familiar with what batteries can provide for me here.
<_habnabit>
since I know it can do more than I'm currently using it for.