<adrien>
not related to your error, you should use printf rather than several print_int, string, newline, ...
<adrien>
also, what goes wrong? when? what is your version of gtk+, and run your program with the OCAMLRUNPARAM environment variable set to "b"
cyphase has quit [Read error: Connection reset by peer]
Razzllls has joined #ocaml
<Razzllls>
hello, I am using yojson parser to create equivalent Ocaml types, but it is pretty slow and I think I am doing it wrong
<Razzllls>
I am using a record that is originally initiated with empty/meaningless data then I fold left on the json object and return a new record with additional data
<mrvn>
nothing wrong so far
Tobu has quit [Ping timeout: 272 seconds]
<pmurias>
adrien: gtk_text_view_buffer_to_window_coords gets a wrong argument
<pmurias>
what does setting OCAMLRUNPARAM to "b" do?
ggherdov has joined #ocaml
<Ptival>
pmurias: it prints a backtrace of the stack when exceptions raise to toplevel
<pmurias>
adrien: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.1
<pmurias>
14:42 -!- Channel #ocaml created Sun Nov 26 07:42:40 2006
<pmurias>
14:42 -!- Irssi: Join to #ocaml was synced in 7 secs
<pmurias>
14:42 < pmurias> is this the right channel for asking lablgtk questions?
<pmurias>
sorry
<Ptival>
pmurias: it only works well with bytecode compiled with -g
<pmurias>
adrien: 20.20-1.2
<mrvn>
works fine with binary code here
<pmurias>
adrien: there is no exception, just a warning from gtk and it returns garbage values
<pmurias>
the binding of the function lablgtk2 looks very suspect, i'll have to check that
<Ptival>
mrvn: I believe with binary the stack is incomplete (like, tailcalls and stuff...)
<Ptival>
usually I just get a "in pervasives.ml" which is not useful :d
GPHemsley has joined #ocaml
GPHemsley has quit [Changing host]
GPHemsley has joined #ocaml
<adrien>
pmurias: "20.20-1.2"? what is that?
<adrien>
gtk+ version number?
Tobu has joined #ocaml
<pmurias>
adrien: ye
<pmurias>
s
<adrien>
where is it from?
<adrien>
I mean gtk+
<pmurias>
where did i get the gtk+ from?
<adrien>
yeah
<pmurias>
the debian repo
<adrien>
so "20.20-1.2" is the version number of the debian package?
<pmurias>
yes
<pmurias>
i'm not really sure, it's not important
<pmurias>
as the error is in lablgtk2
<adrien>
20.20-1.2 or 2.20-1.2?
<Razzllls>
mrvn: but it is kinda slow, compared to the time I retrive data from servers and the time the library parses json
<mrvn>
is the record big and do you create a new one on every change?
<pmurias>
adrien: 2.20.1-2
<Razzllls>
mrvn: yes, I return a new one on every change
<Razzllls>
mrvn: should I use mutables instead?
<Razzllls>
last time I tried with mutables it didn't change values, very strange
<Razzllls>
basically the object is returned after each modification
<Razzllls>
and reused , added a new field and reused again
<mrvn>
you can parse the data into temporary bindings and construct the record at the end or use mutables and see how that compares.
<Razzllls>
mrvn: I will try to experiment with mutables then, but that is so much code to change meh ok
Razzllls has quit [Quit: ChatZilla 0.9.88.2 [Firefox 12.0/20120420145725]]
ggherdov has quit [Read error: Connection reset by peer]
ggherdov has joined #ocaml
<pmurias>
adrien: i sent a patch to the bug tracker
<pmurias>
adrien: are you the maintainer of lablgtk2?
* pmurias
just noticed that lablgtk2 has a git repo
<adrien>
yup, I am
<adrien>
I agree on the patch but I'm really surprised the bug got made in the first place; explicit casts in bindings is something that is almost always guaranteed to be an error :P
<adrien>
seems to be the only one in that file at least
<adrien>
well, the patch is almost probably good and is probably complete too but there still is a bug with the code you've pasted
<pmurias>
what's the problem with that code?
<adrien>
dunno; I still get warnings at each char:
<adrien>
(a.out:13848): Gtk-WARNING **: Attempt to convert text buffer coordinates to coordinates for a nonexistent or private child window of GtkTextView
<pmurias>
adrien: do you know how to call ml_gtk_menu_popup_at from src/ml_gtkmenu.c?
notk0 has joined #ocaml
<notk0>
hello, if I have a record with mutable types, how can I obtain an instance with variables initiated ?
<notk0>
for example if I have type t = { mutable i :int }
<notk0>
and empty= { i =0; }
<notk0>
how can I obtain a clone of empty
<flux>
any suggestions on working v4l2 bindings for ocaml? savonet's don't work for some reason (invalid ioctl) and the debian gstreamer bindings don't work either..
<adrien>
pmurias: hmm, no, if you can't find how to, I can take a look
* adrien
needs to start a gcc build first
<adrien>
flux: fix savonet's?
<flux>
adrien, well, probably yes
<flux>
or write my own
<adrien>
the invalid ioctl shouldn't be terribly hard to fix although ioctl() is pure crap
<flux>
turns out the bindings are really specific
<adrien>
well, I expect savonet's to only need updating
<adrien>
ah
<flux>
for example, it requires that the video device outputs interlaced video
<flux>
that wae asy to fix, now how about pixel format..
<adrien>
you're not going to have a lot of fun =/
<adrien>
ioctl and v4l2...
<adrien>
notk0: how do you define "a clone of"?
<flux>
it assumes RGB frames, but my camera produces JPEG frames
<flux>
(uses an assertino to check that requirement, thank it for that)
<flux>
it's probably easier to just write my own
<flux>
it has some code to deal with palette :P
<flux>
(well, various bit depths really, but I really doubt they're going to work with raw JPEG frames)
<notk0>
adrien, same data, not same pointers
<notk0>
If I do a = empty and b = empty
<notk0>
I don't want a.i to modify b.i
emmanuelux has joined #ocaml
<adrien>
notk0: well, there is a construct but with your example, ocaml will spit a warning:
<adrien>
let new_record = { old_record with some_field = new_value } in
<adrien>
that allows you to make a copy except for one field which you can set to a new value
<adrien>
(actually, I guess you can set several fields at the same time but I've probably never used that)
<adrien>
the warning is only because in your example, there is only one field
<mrvn>
why doesn't let new_record = { old_record } work?
<adrien>
it doesn't look very useful to me
<adrien>
and I guess you could Obj.dup
<mrvn>
notk0: don't declare an empty. use let make () = { i = 0; }
<adrien>
also, I second mrvn's advice (I hadn't looked at what you were trying to achieve)
<pmurias>
adrien: that function only seems to be defined in the c file, should i try to export it to ocaml land?
<adrien>
no
<adrien>
how do you see it's only in a .c file? (there's a catch)
<Qrntz>
adrien, you can set several fields at the same time, separating the assignments with «;»
<Qrntz>
«let y = { x with foo = 1 ; bar = 2 }»
<pmurias>
adrien: i ack (better grep) for popup_at
<adrien>
ocaml has quite a lot of source code generation, so, yeah, better to search for "popup_at"
<adrien>
or grep after building
<notk0>
mrvn, I see I will try that
<adrien>
pmurias: how do you get changes in lablgtk on your system? you rebuild the debian package?
<pmurias>
make install
<adrien>
arf
<pmurias>
i used the debian package for gtk only
<pmurias>
arf?
<adrien>
you've used lablgtk git?
<adrien>
well, guess not
<pmurias>
i checkout out the repo now
<pmurias>
ack after make helps
<adrien>
well
<adrien>
now you have two installs of lablgtk on your system
<adrien>
so you should remove the debian package, and clean what lablgtk's make install has installed (there's maybe a "make uninstall" to try)
<adrien>
the build system in lablgtk's git head should be different
<adrien>
hmm, no uninstall, and no new build system (that is still in a branch)
<pmurias>
i have very little ocaml knowledge/experience so i'm likely doing all the ocamlish thing incorrectly
<adrien>
you should make install lablgtk2 again, and check what it installs, then remove the .cm*, .a, .so files
Kakadu has quit [Quit: Konversation terminated!]
<pmurias>
popup_at works :)
<pmurias>
walk&
<adrien>
what did you do?
<pmurias>
just typed the name with the package correctly ;)
<pmurias>
GtkMenu.Menu.popup_at
<adrien>
well, yeah, the function is currently available in the non-object interface; if you can use it, that's great
<adrien>
otherwise, the fix is to add a trivial line to gMenu.ml
munga has quit [Ping timeout: 248 seconds]
<notk0>
can I post one of my function so someone could tell me where the slow part is?
eni has joined #ocaml
<flux>
if I want to link a c-file with ocamlbuild, must I use a custom myocamlbuild.ml?
<adrien>
you shouldn't have to; but I'd avise you to use oasis and CSources
<flux>
I only want one C file, I don't even want libraries :)
<adrien>
you want a .h?
<flux>
I want to include some .h-files in my .c-file, sure..
<flux>
it seems to me there's no avoiding writing a myocamlbuild.ml for this purpose
<mrvn>
flux: I do that with oasis and it generated the myocamlvuild.ml for me.
ikaros has joined #ocaml
<flux>
ocamlbuild is possibly one of the more annoying tools in ocaml, possibly neck-to-neck with camlp4. both that could be fixed by excellent documentation.
<adrien>
one annoying thing with ocamlbuild is that it seems to be made for the ocaml compiler itself
<adrien>
but it won't change in order to help things for other projects (or not much)
<flux>
well, now it compiles my stubs, but doesn't seem to link if I'm to believe its "The external function `v4l2_open' is not available"
<mrvn>
missing -lv4l
<adrien>
bytecode?
<flux>
yes. now I went from no definition to multiple definition :)
<adrien>
I used to know that stuff pretty well but then I've mostly stopped building by hand; I'm a bit sad I can't remember but at the same time, I'm also pretty happy
<flux>
finally
<flux>
I put these to dispatch: flag ["ocaml"; "link"; "use_v4l2"] (S[A"-custom"]); dep ["link"; "ocaml"; "use_v4l2"] ["v4l2_stubs.c"]; and these to _tags: <*>: use_v4l2
<flux>
I've not learned where the ocaml-mm code originates from
<flux>
the first hit on v4l2 example also does only interlaced video :P
<adrien>
ocaml-mm?
<flux>
savonet subproject, some multimedia bindings
<adrien>
ah
Submarine has joined #ocaml
snearch has quit [Quit: Verlassend]
<wmeyer>
did anybody generate declaration polymorphic variant type through Camlp4?
<wmeyer>
I have some weird problem, when I use camlp4of and preprocess my DSL I can compile the resulting file. However, when using -pp flag, and camlp4 pipe marshaled AST to ocamlc it fails badly
<wmeyer>
which compiles fine under normal circumstances
<wmeyer>
but chokes when AST is consumed
<wmeyer>
it's a production stop --- however I might consider just dumping the ML file anyway
<mrvn>
Why not remove the |?
<wmeyer>
How?
<mrvn>
No idea how you are generating that code.
<wmeyer>
mrvn: I use Ast.tyOr_of_list
<wmeyer>
which is the preffered way
<wmeyer>
I don't have idea how to not generate the leading bar
<wmeyer>
because I don't even include the bar in my qutation
<wmeyer>
it feels like a bug, need to ask Jeremie about it
iago has joined #ocaml
lopex has quit [Ping timeout: 252 seconds]
IbnFirnas has quit [Read error: Operation timed out]
IbnFirnas has joined #ocaml
lopex has joined #ocaml
goncalo has quit [Quit: leaving]
goncalo has joined #ocaml
IbnFirnas has quit [Read error: Operation timed out]
<wmeyer>
I'm going to file a bug - it looks like the problem is with marshaling on camlp4 side, when pretty printed, even to the output file it works like a charm
wtetzner has quit [Ping timeout: 246 seconds]
bobry has quit [Ping timeout: 240 seconds]
lopex has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
<wmeyer>
beautiful
<wmeyer>
this rule killed the problem
lopex has joined #ocaml
notk0 has quit [Remote host closed the connection]
bobry has joined #ocaml
eni has quit [Ping timeout: 252 seconds]
eni has joined #ocaml
ikaros has quit [Remote host closed the connection]
eni has quit [Ping timeout: 245 seconds]
ikaros has joined #ocaml
untroubled has joined #ocaml
eni has joined #ocaml
untroubled has quit [Quit: leaving]
eni has quit [Ping timeout: 245 seconds]
hto_ has joined #ocaml
Submarine has quit [Quit: Leaving]
<flux>
cool, I got a jpeg frame in an ocaml string from v4l2
<flux>
suggestions for the easiest way to go from that to RGB?
eni has joined #ocaml
<flux>
for example CamlImages only supports jpegs from file
<wmeyer>
flux: Which version of CamlImages you are talking about? the new revamp by furuse?
<wmeyer>
flux: I am sure you can use streams
<flux>
1:4.0.1-4+b2 in debian unstable
<flux>
well, that would be great. I'll check ocamlsdl first, I already use that library as well
<thelema>
maybe it's at this point that I should seriously look into extracting dependencies from _oasis files
<pippijn>
flux: imagemagick
ikaros has quit [Quit: Ex-Chat]
<pippijn>
also, a web application, a voip+camera program, they all need in-memory image processing
<pippijn>
web application as in web server
Haseo has joined #ocaml
<hcarty>
thelema: Perhaps an odb-heavy version which can be installed with odb
<hcarty>
thelema: That would ease the burden of having a dependency on oasis, not to mention Batteries and other libraries.
<hcarty>
odb.ml could stay close to where it is. odb dot nothing (.native, .heavy, .full...) could provide more comprehensive support.
<hcarty>
Or the two could be made to cover separate cases. odb for interaction with oasis-db, new-unwritten-odb for local/special/outside-of-oasis-db packages