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