smkl changed the topic of #ocaml to: OCaml 3.07 ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn, A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/, A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list
<Nutssh> Does ocaml support async IO well?
<teratorn> I don't really know - I havn't written an ocaml program that uses it yet.
<Nutssh> Ok. Thanks. TTYL.
Nutssh has quit ["Client exiting"]
blueshoe has quit [Read error: 104 (Connection reset by peer)]
blueshoe has joined #ocaml
_JusSx_ has quit ["[BX] Automatically bored away"]
ita has joined #ocaml
<ita> hi
<Demitar> Hello ita.
<ita> has anyone ever tried cameleon ? (ide for ocaml?)
<ayrnieu> ita - no, but why do you ask?
<ita> i have an error when i try to compile it
<ita> i complains about a missing file - gtkThread.gmx (what is a .gmx file ?)
<Demitar> gmx? Are you sure it shouldn't be cmx?
<ita> err yes cmx
demitar_ has joined #ocaml
<ita> "Cannot find file gtkThread.cmx"
<Riastradh> Most of us just use Emacs, if I'm not mistaken.
<ayrnieu> yes, Tuareg does a good job.
* ita sticks to vim
<blueshoe> yay vim
<Riastradh> vim doesn't have Tuareg. QED.
<Riastradh> Depart to meet Smerdyakov, blueshoe, you scumulous vim-toting knave!
<blueshoe> how can i leave without praising vim?
<Smerdyakov> Riastradh, sometimes I just want to hug you, and sometimes I just want to lug you.
<Riastradh> blueshoe, it's a very complicated process of muscle manipulation to get up out of your chair and leave, but I think your body can manage it, having had decades of practice.
Demitar has quit [Read error: 110 (Connection timed out)]
ayrnieu has quit ["Lost terminal"]
<ita> anyone using lablgtk2 here ?
`John has quit ["ChatZilla 0.9.35 [Mozilla rv:1.5/20031007]"]
ayrnieu has joined #ocaml
blueshoe has quit [Read error: 54 (Connection reset by peer)]
blueshoe has joined #ocaml
Nutssh has joined #ocaml
rox has left #ocaml []
Nutssh has quit ["Client exiting"]
blueshoe has quit [Read error: 104 (Connection reset by peer)]
jdmarshall has joined #ocaml
teratorn has left #ocaml []
blueshoe has joined #ocaml
blueshoe has quit [Client Quit]
blueshoe has joined #ocaml
d2004xx has joined #ocaml
Nutssh has joined #ocaml
blueshoe has quit [Read error: 104 (Connection reset by peer)]
gim_ has joined #ocaml
jdmarshall has quit ["ChatZilla 0.9.35 [Mozilla rv:1.5/20031007]"]
Nutssh has quit ["Client exiting"]
blueshoe has joined #ocaml
blueshoe has quit [Read error: 104 (Connection reset by peer)]
* Maddas mutters something about the vim ocaml mode
buggs has joined #ocaml
<Maddas> What does the O'Reilly mean when it says " This function uses the auxiliary function domain_of"
<Maddas> It uses the function domain_of in the examples, but it isn't defined anywhere in the book and O'Caml chokes at it
_JusSx_ has joined #ocaml
<_JusSx_> cjohnson : hyea
<_JusSx_> wuuru _ heya
<Maddas> It's not in any library I have either
wazze has joined #ocaml
lus|wazze has joined #ocaml
ita has quit [Remote closed the connection]
<drWorm> Maddas: which book is that?
<Maddas> I think I reconstructed the function by seeing the type signatures
<drWorm> thanks :)
<Maddas> no problems
blueshoe has joined #ocaml
mattam_ has joined #ocaml
drWorm has quit ["Lost terminal"]
mattam has quit [Read error: 110 (Connection timed out)]
owll has joined #ocaml
owll has quit [Remote closed the connection]
owll has joined #ocaml
owll has left #ocaml []
mattam_ is now known as mattam
<cjohnson> howdy
<Maddas> hm. Does Unix.accept work on OS X?
<Maddas> Code from the book hangs at a Unix.accept command, it doesn't seem to go any further, yet I don't know what I did wrong.
<Maddas> It's supposed to be a server that accepts connections and returns any passed string in uppercase, but it doesn't accept any connections. *shrug*
<mattam> could you paste a snipet ?
<Maddas> Sure
<Maddas> I just copy-pasted the source from the book, I'll put the entire thing online, just a second
<Maddas> It gets until this line, never seems to go past it:
<Maddas> let (s, caller) = Unix.accept sock in
<Maddas> inside the while true do ... done
<Maddas> inside function establish_server :)
<Maddas> It does get up to that point -- I debugged with print messages and they always printed
<Maddas> Also, connecting to the port doesn't work (connection refused), but the script did bind to the port
<mattam> hmmm, weird
<mattam> have you tried strace?
<Maddas> nopue
<Maddas> good idea though
<karryall> Maddas: why don't you use Unix.inet_addr_any ?
<Maddas> karryall: I just used the code from the book, I don't know anything about using inet with O'Caml
<Maddas> I'm learning :-)
<karryall> try establish_server serv_fun (Unix.ADDR_INET (Unix.inet_addr_any, port))
<karryall> maybe it'll work better
<Maddas> ok
<Maddas> Cool!
<Maddas> karryall: Works now, thanks a lot!
<karryall> heh
<karryall> don't know why the book version doesn't work though
<karryall> it should
<Maddas> Shall I check the return value of get_my_addr()?
<Maddas> Hm, just Unix.inet_addr, I don't know how to peek at what's inside :-)
<karryall> string_of_inet_addre
<Maddas> ok
<Maddas> hm
<Maddas> karryall: get_my_addr returns a inet_addr with the value (printed) 192.168.1.2
<Maddas> Unix.inet_addr_any returns 0.0.0.0
<Maddas> err, it is, not it returns :)
<karryall> yes, 0.0.0.0 is a special address for bind meaning "accept connections from everywhere"
<karryall> with get_my_addr, you tell bind to accept connections only from one interface
<Maddas> I see
<karryall> if the client is not connecting to this precise address, you get a connection refused
<Maddas> Ah, I see
<Maddas> I think I understand the problem
<karryall> you could have used Unix.inet_addr_of_string "127.0.0.1" also if you want only local connections
<Maddas> yes, that's it, how silly
<Maddas> I always connected to 127.0.0.1 not 192.168.1.2
<Maddas> I see, yeah.
<Maddas> Oh well, thanks for the explanation, now at least I know what that part of the code does!
madroach has joined #ocaml
<madroach> Hello, is there no book about ocaml out there that is written in english or german ?
<Maddas> There is!
<Maddas> I occasionally have my problems with it (like just now ;)), but try this:
<madroach> Maddas: Yes, this is online. But I'd like it as book - printed. I just printed out the first part of this book.
<Maddas> Oh, I see, sorry.
zulzul has joined #ocaml
<madroach> date
madroach has quit ["leaving"]
<karryall> madroach: Sat Jan 17 16:06:13 CET 2004
gim|570 has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
blueshoe has quit [Read error: 104 (Connection reset by peer)]
gim|570 has quit [Read error: 104 (Connection reset by peer)]
lus|wazze has quit [brunner.freenode.net irc.freenode.net]
lus|wazze has joined #ocaml
zulzul has quit ["Irssi on NetBSD just roxes"]
gim has joined #ocaml
blueshoe has joined #ocaml
blueshoe has quit [Read error: 104 (Connection reset by peer)]
_JusSx_ has quit ["No windows for this server"]
blueshoe has joined #ocaml
Etaoin has quit ["Client exiting"]
Nomme has joined #ocaml
<Nomme> hi
<Riastradh> Hi.
Etaoin has joined #ocaml
_JusSx_ has joined #ocaml
Kinners has joined #ocaml
_JusSx_ has quit [Remote closed the connection]
_JusSx_ has joined #ocaml
jdmarshall has joined #ocaml
demitar_ is now known as Demitar
blueshoe has quit [Read error: 54 (Connection reset by peer)]
jdmarshall has quit [Remote closed the connection]
<Defcon7> ip := (Str.global_replace (Str.regexp "\\]$") "" (Str.global_replace (Str.regexp "^ip=\\[::ffff:") "" (getel lastlist 7)));
<Defcon7> let result = exec mydb (String.concat "" ["select * from allowrelay where ip='"; !ip; "'"] ) in
<Defcon7> if (myel (fetch result)) then
<Defcon7> (
<Defcon7> the last check is right or not ?
xolution has joined #ocaml
xolution has quit [Read error: 104 (Connection reset by peer)]
gim has quit [Read error: 104 (Connection reset by peer)]
housetier has joined #ocaml
<Defcon7> 09:57:35 [root@spawn]:~# ocamlopt -o pbs -I /usr/lib/ocaml/mysql mysql.cmxa usleep.c pbs.ml
<Defcon7> /usr/lib/ocaml/mysql/mysql.cmi is not a compiled interface
<Defcon7> 09:57:56 [root@spawn]:~#
<Defcon7> there is something wrong ?
<Defcon7> resolved np.
<Nomme> # #load "nums.cma";;
<Nomme> Cannot find file nums.cma.
<Nomme> I have installed ocaml stuff with apt-get (debian), it seems not to include nums lib
<Nomme> what can i do ?
<Kinners> you have to add the path
<Kinners> ocaml -I +whatever
<Kinners> assuming you actually have the files
<Nomme> $find / --name "nums.cma"
<Nomme> give nothing :/
<Nomme> where can i download the package ?
<Kinners> can you do a search with apt-get? (I haven't used it...)
<housetier> apt-cache search search term
<Nomme> there is no package named "ocaml-nums" or something like that
<Nomme> i think nums.cma is normally include to the standard distribution, isn't he ?
<wuuru> Nomme: try nums.cmxa :)))
<Nomme> i have ocaml 3.07
<wuuru> i have both though
<wuuru> in 3.07
<_JusSx_> Nomme : hi
<wuuru> Nomme: in debian they sometimes place some useful libs to a package XXX-extra o something like tgat
<_JusSx_> wuuru : hi
<wuuru> _JusSx_:
<Nomme> hi you ;)
<Defcon7> 09:59:35 [root@spawn]:~# ocamlopt -o pbs -I /usr/lib/ocaml/mysql mysql.cmxa usleep.c pbs.ml
<Defcon7> File "pbs.ml", line 31, characters 22-28:
<Defcon7> This expression has type 'a -> Mysql.result but is here used with type
<Defcon7> Mysql.result
<Nomme> germaine:~# apt-get install libnums-ocaml
<Nomme> Reading Package Lists... Done
<Nomme> Building Dependency Tree... Done
<Nomme> E: Couldn't find package libnums-ocaml
<Nomme> sorry
<Defcon7> whats wrong in my program ?
<Defcon7> (i am an ocaml beginner)
<housetier> Nomme, you do have unstable, right?
<Nomme> right
<housetier> hmm
<housetier> well you can download the package, although it really should be installable via apt-get
<Nomme> i update my access
<Nomme> it's ok, "i've got it"
<Nomme> thanks ;)
<housetier> -mc_okkie/#jungletrain- housetier = Your Personal Debian Guru
<housetier> ;)
<Nomme> i hate computers...
<ayrnieu> I hate people that hate computers...
<Nomme> "computers always make what i say but never what i want"
<Defcon7> someone can help me ?
<Nomme> i'm trying
<Defcon7> :P
<Nomme> fetch ;;
<Nomme> Unbound value fetch
<Defcon7> it if of mysql
<Defcon7> *it is
<Nomme> # Mysql.fetch;;
<Nomme> Unbound value Mysql.fetch
<Defcon7> hrm i'am sure it exists
<Defcon7> ocamlopt -o pbs -I /usr/lib/ocaml/mysql mysql.cmxa usleep.c pbs.ml
<Nomme> i'm not lucky today...
<Nomme> and stupid !
<Defcon7> usleep.c is trivial
<Defcon7> 10:26:14 [root@spawn]:~# cat usleep.c
<Defcon7> #include <unistd.h>
<Defcon7>
<Defcon7> void ousleep(unsigned long usecs) {
<Defcon7> usleep(usecs);
<Defcon7> };
<Defcon7> and probably wrong in some way, but it worked
<Nomme> #load "mysql.cmxa";;
<Nomme> Cannot find file mysql.cmxa. ;)
<Nomme> grrr
<Defcon7> anyway the problem is in 'myel' definition
<Defcon7> [22:15] <Defcon7> 09:59:35 [root@spawn]:~# ocamlopt -o pbs -I /usr/lib/ocaml/mysql mysql.cmxa usleep.c pbs.ml
<Defcon7> [22:15] <Defcon7> File "pbs.ml", line 31, characters 22-28:
<Defcon7> [22:15] <Defcon7> This expression has type 'a -> Mysql.result but is here used with type
<Defcon7> [22:15] <Defcon7> Mysql.result
<Defcon7> if (myel (fetch result)) then
<Defcon7> i probably have to call or define myel in a different way
<Defcon7> but for my actual understanding of ocaml i'am unable to find it
<Nomme> fetch() seem to return a function, and myel need a "Mysql.result"
<Nomme> but i don't know the def of "fetch"...
<Defcon7> al fetch : result -> string option array option
<Nomme> i'm a beginner too ;)
<Defcon7> hehe yes and that isnt tool clear for beginners :P
<Nomme> i know nothing about mysql ...
<Nomme> what's "option" ?
<Nomme> oh, the module "weak" ...
<Nomme> ok
<Defcon7> i believe it is ocaml related
<Nomme> yes
<Nomme> i have just openned my ocaml's book ;)
<Defcon7> but i dont understood it :P
<Nomme> do you know a little bit C ?
<Defcon7> just a lil bit
<Nomme> the "Weak" module is for use array like in C
Kinners has left #ocaml []
Nutssh has joined #ocaml
<Nomme> Defcon7, i have found
<Nutssh> Hi.
<Nomme> sed "s/result lt/result/" pbs.ml :)
<Nomme> Defcon7 ?
<Nomme> Hi Nut[Secure]Shell
<ayrnieu> nomme - no! His name stands for 'nuts shell'
<Nomme> :> :)
<Nomme> i hope Defcon7 is still in live
<Nutssh> ocamlshell?
<Smerdyakov> "In live" is not a usual English phrase.
<Smerdyakov> Do you mean "alive"?
<ayrnieu> or 'around'.
<Nomme> yes, sorry and thanks
<Nomme> english and me aren't good friends, i do my best :(
cjohnson has quit ["Drawn beyond the lines of reason"]
<Nomme> i hope Defcon7 is still alive
<Riastradh> Sorry, I ran him through a few minutes ago in a duel.
<Nomme> i've found his error and he's left
<Nomme> :'(
cjohnson has joined #ocaml
<Defcon7> back
<Nomme> !
<Defcon7> :)
<Nomme> sed "s/result lt/result/" pbs.ml !
<Nutssh> LOL. Defcon was a nick, not a conference.\
Etaoin has quit ["Client exiting"]
<Nomme> (without the '!')
<Nomme> sed "s/result lt/result/" pbs.ml > pbs.ok.ml && ocamlopt -o pbs -I /usr/lib/ocaml/3.07/mysql mysql.cmxa pbs.ok.ml
<Nomme> this should work
<Defcon7> woah
<Defcon7> :DDD
<Nomme> you're right ?
<Defcon7> yes i had to remove 'let' before myel
<Nomme> yes :)
<Defcon7> and now i have to understand why it doesnt find these: No implementations provided for the following modules:
<Defcon7> Str referenced from pbs2.cmx
<Defcon7> Unix referenced from pbs2.cmx
<Nomme> i have it too :)
<Defcon7> 11:09:46 [root@spawn]:~# ocamlopt -o pbs -I /usr/lib/ocaml/mysql -I /usr/lib/ocaml unix.cmxa str.cmxa mysql.cmxa usleep.c pbs2.ml
<Defcon7> 11:09:55 [root@spawn]:~#
<Defcon7> yep
<Defcon7> thank you a lot :*
<Nomme> héhé ;)
blueshoe has joined #ocaml
<Nomme> between beginners we have to help each other :)
<Defcon7> 170 rows in set (0.18 sec)
<Defcon7> yeees
<Defcon7> it works :)
<Defcon7> mysql> select * from allowrelay where ip='80.181.98.167';
<Defcon7> +---------------+
<Defcon7> | ip |
<Defcon7> +---------------+
<Defcon7> | 80.181.98.167 |
<Defcon7> +---------------+
<Defcon7> 1 row in set (0.00 sec)
<Defcon7> and it doesnt create duplicate records
<Defcon7> but i had to invert these:
<Defcon7> | None -> false
<Defcon7> | Some x -> true;;
<Defcon7> like this:
<Defcon7> | None -> true
<Defcon7> | Some x -> false;;
<Defcon7>
<Defcon7> the program that we worked on
<Defcon7> adds ips who login into my mailserver to a mysql table
<Defcon7> so they are allowed to send mail
<Defcon7> it works by parsing the log file
<Nomme> nice for a beginner ;)
gim_ has quit ["'ne nuit tout l'monde"]
gim has joined #ocaml
Etaoin has joined #ocaml
blueshoe has quit [Read error: 104 (Connection reset by peer)]