<dan2>
pango: there isn't another programming language other than maybe SML that lets you apply a variety of techinques i.e. functional, imperative, OO with a high quality type system, and high performance
<dan2>
it's a killer combo
<dan2>
it's the only language truly designed to be as flexible as the programmer
<pango>
they're several tasks it's not very good at however, and require bindings with C libraries (or similar)
<dan2>
but the same could be same for almost every language
<dan2>
pango: imagine implementing List.concat (List.map (traverse (scanner dftag.regex) (function x -> x)) inputdirs) in C
<mikeX>
(apparently not for C) : P
<pango>
Thinks as simple as manipulating 32 bits quantities for example is very inefficient (both cpu and memory)
<pango>
s/thinks/things/
<dan2>
pango: java doesn't have unsigned integers either
<pango>
because it has to be boxed
<delamarche>
is there a 'reduce' in ocaml?
<delamarche>
that was a bad question
<delamarche>
basically i'm wondering what the most concise way is to find the sum of all the elements in a list
<pango>
dan2: some correct programs can't be typed by current system (recursive polymorphism,...)
<delamarche>
</dum>
<pango>
delamarche: List.fold_left ?
<delamarche>
that's what i thought, but for some reason i thought it returned a list
<pango>
# List.fold_left ;;
<pango>
- : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a = <fun>
<delamarche>
i'm still having a hard time reading those, to be honest
<delamarche>
this is day 1 of ocaml for me
<delamarche>
lol
<pango>
the notation is ambiguous on purpose because of the possibility of partial application
<pango>
'a -> 'b -> 'a can be read as a function that takes an argument of type 'a and another of type 'b and returns a value of type 'a
<pango>
or as a function that takes and argument of type 'a and returns a function of type 'b -> 'a
<delamarche>
whoa cool
<pango>
(if partially applied)
<delamarche>
thanks pango
<pango>
np
<dan2>
I must be tired
<dan2>
I have an associative list and I have a list in which parameters must be ordered to grab from that associative list
<dan2>
dftags.tags is a list of say [album;artist;] all in strings
<dan2>
string list
<dan2>
I need to take that information, put it in uppercase then grab it from the associative list
<dbueno>
delamarche, you use multiple lets: let x = <something> in let y = x in ...
<dbueno>
delamarche, if you use the right Emacs mode, it doesn't create a new indentation level for nested lets. So they "behave" syntactically and certainly semantically like let*.
postalchris has quit [Read error: 110 (Connection timed out)]
<delamarche>
thanks dbueno, that's how i did it
<delamarche>
much appreciated
love-pingoo has joined #ocaml
<dbueno>
delamarche, No problem.
<dbueno>
delamarche, I came from Lisp too. It took me a while to figure that out and once I did... boy, it felt awkward.
<delamarche>
hehe
<delamarche>
i'm not even really a lisper
<delamarche>
i just know a bit
<delamarche>
enough to be a poseur i guess
<dbueno>
Ah.
<dbueno>
I was a hardcore common lisp fan, before I discovered ML (SML first of all).
<delamarche>
I'm trying to pick up python, lisp, and ocaml right now
<delamarche>
starting with ocaml, obviously
<mikeX>
dbueno: and what's your opinion on cl now?
<dan2>
does someone have a recursive mkdir that won't do anything if the directory already exists
<levi_home>
Anyone here doing Windows programming with ocaml?
<levi_home>
I've never done Windows programming before, and now I need to write a DLL.
<levi_home>
Visual Studio scares me.
<mikeX>
delamarche: python is quite nice, lisp seems very powerfull, but I'm still struggling to get used to it
<delamarche>
yeah python is wicked
<delamarche>
i was sold when i saw it had coroutines
<delamarche>
thanks for the help, all. You'll be seeing more of me :D
delamarche has quit []
<dan2>
dbueno: do you have a recursive mkdir function for me?
<love-pingoo>
dan2: in unix there is the install command which will do what you want
<dan2>
love-pingoo: no kidding, but I need this inside of my ocaml application
<love-pingoo>
I don't have anything like that, then ;)
<dan2>
love-pingoo: what's irritating here is that it's a pita to recurse on error numbers
<dan2>
bleh
<Ballin_105>
pango: this is really pissing me off
<dan2>
i.e. Unix.Unix_error (Unix.ENOENT, "mkdir", "/tmp/foo/bar")
<dan2>
that means that /tmp/foo doesn't exist
<dan2>
love-pingoo: is it possible to recurse on errors?
<love-pingoo>
what do you mean ?
<love-pingoo>
you can catch the error and do something appropriate
<Ballin_105>
pango: i dont think its sending the xml right grrrrrrr
<dan2>
love-pingoo: that sucks, I just want something to create all the parent directories and bleh
<dan2>
or do nothing if they already exist
<mikeX>
dan2: why not check if file exists and is a directory first?
<love-pingoo>
if I were you I'd split the path, and for every directory create it if it doesn't exist, that should be straightforward
<Ballin_105>
pango: ah shit i see the problem
<dan2>
love-pingoo: huh?
<Ballin_105>
its like sending it twice
<dan2>
mikeX: I think I'm so tired right now I can't answer this problem
<mikeX>
hehe, well it'll probably look a lot simpler after you get some rest
<dan2>
mikeX: alternatively, you could do it and send it to me
<love-pingoo>
dan2: come on you're a grown up, we can't help everybody like Ballin_105 here ;)
<Ballin_105>
see that variable is like sending it twice for some reason
<dan2>
damn, I was hoping for some freebies
<Ballin_105>
love-pingoo: ??/
<love-pingoo>
Ballin_105: just kidding, no hard feeling
<Ballin_105>
love-pingoo: i am sorry i am not as brilliant as you and can fix every signle small problem with no help at all ..........i read documentation for hours yesterdayyy
<love-pingoo>
but it's true that some of us spend quite a while helping you, right ? (for the fact that you're a grownup/(professional programmer) or a student, I don't know
<Ballin_105>
love-pingoo: ocaml is not very well documented
<mikeX>
dan2: off the top of my head, make a routine that checks if file exists and if not creates it (Sys.file_exists, Unix.mkdir), and iterate that over the names in the path starting from the 1st one
<love-pingoo>
Ballin_105: it's not being brilliant, it's just experience, and I'm happy to see people coming here to get help on ocaml
<Ballin_105>
love-pingoo: and most of the time i always ask th question and then figure it out 5 minutes later
<mikeX>
dan2: you kan split the path with String.split or something like that
<dan2>
mikeX: is there a List function that will do exactly that?
<dan2>
mikeX: hmm
<mikeX>
dan2: List.map applies a function to a list, if that's what you mean
<love-pingoo>
dan2: create a Comprehensive OCaml Archive Network, and I'll post a module with the kind of utility you want in it, OK ?
<Ballin_105>
love-pingoo: i have wrote about 800 lines so far error less ............and this is also my first real netwrok programming so not onnly is it new ot ocaml its kinda new to the way netwrok programming works
<mikeX>
I think I meant Str.split
<love-pingoo>
I think we need something like that
<jeremy_c>
mikeX: Filename module contains functions for working with filenames.
<dan2>
love-pingoo: heh
<dan2>
love-pingoo: basically CPAN for Ocaml huh
<mikeX>
jeremy_c: yes, but it only has basename/dirname
<love-pingoo>
Ballin_105: I truly hope you'll succeed
<love-pingoo>
feel free to ask anything here
<Ballin_105>
love-pingoo: yea ........well see i know the problem now but hmmmmm.......for some reason my XML string is getting sent twice and throwing off my jabber server
<mikeX>
dan2: then feed that list, along with the function I mentioned to List.map
<dan2>
mikeX: could you paste it
* dan2
tries to lift an eyelid
<mikeX>
hehe
<Ballin_105>
btw i also got my GUI done ........the new version of Glade is pretty collio
<Ballin_105>
coolio
<love-pingoo>
mikeX: I'd suggest recursively calling basename, to deal with escaping
<love-pingoo>
or use a more complex regexp taking care of backslashes
<love-pingoo>
Ballin_105: glade works for OCaml ?
<love-pingoo>
big news for me
<dan2>
love-pingoo: yes it does
<Ballin_105>
love-pingoo: yes
<Ballin_105>
love-pingoo: Libglade ;)
<love-pingoo>
does it generate ocaml code ? or just xml code that an ocaml function interpretes ?
<Ballin_105>
!lablgtk
<Ballin_105>
?lablgtk
<dan2>
Ballin_105: are you using mlglade?
<Ballin_105>
no
<Ballin_105>
what is it ?
<Ballin_105>
?mlglade
<dan2>
lablgtk can read glade.xml files now?
<Ballin_105>
!mlglade
<Ballin_105>
yes
<dan2>
sweeeeeeeeeeeeet
<love-pingoo>
that's cool
<Ballin_105>
It is still under development, but already fully functional. All widgets (but one) are available, with almost all their methods. The GLArea widget is also supported in combination with LablGL. LibGlade and GdkPixbuf support is also included for both versions. LablGTK2 adds support for gnomecanvas, librsvg and libpanel Many examples are provided.
<love-pingoo>
certainly slower (and increasing the size of the binary) but definitely sweet
<mikeX>
love-pingoo: good point
<dan2>
coding in GTK blows ass
<dan2>
glade is amazing for C++
<Ballin_105>
love-pingoo: how is libglade slower ?
<dan2>
I can imagine it's just as good for ocaml
<Ballin_105>
gloade is best in C lol ..........i never used any of that gtkmm stuff
<love-pingoo>
Ballin_105: libglade interpreting some XML is slower than the native code immediately building the widgets
<Ballin_105>
love-pingoo: i used to think that as well ;)
<Ballin_105>
love-pingoo: but its actually backwards ;)
<dan2>
love-pingoo: I'll trade the development time of 400 hours for half a milisecond of runtime
<love-pingoo>
it's just a startup cost, so in the end it doesn't matter, I agree
<Ballin_105>
dan2: its faster with libglade
<love-pingoo>
oh backwards ? wow
<Ballin_105>
yes
<love-pingoo>
dan2: I agree with you
<Ballin_105>
libglade will be put into the final version of gtk 2.x
<Ballin_105>
maybe a startup cost
<Ballin_105>
but not within runtime
<Ballin_105>
and it only adds kb's not mb's
<love-pingoo>
yeah, only startup, and size of the binary
<Ballin_105>
love-pingoo: your worrry about size ?
<Ballin_105>
i thoght i only did that
<love-pingoo>
no, but I thought you did ;)
<Ballin_105>
yea ;)
<Ballin_105>
as long as my app + gtk stays under 6 mb im happy
<love-pingoo>
I see we're agreeing a lot on the last couple of lines :)
* love-pingoo
back to work
<Ballin_105>
it doesnt matter for linux casue everyone has gtk + w/e installed but for windows no one has that
bzzbzz has quit ["leaving"]
<Ballin_105>
and i will include it with a /exe installer and upx the final installer exe
<mikeX>
jeremy_c: type field has a member field_name, not name
<mikeX>
no, in the create_field function
<jeremy_c>
mikeX: sorry. that wasn't suppose to be there. In the type field it's name. I started to change that, I guess I didn't realize I pasted that version.
<jeremy_c>
Let me just paste a new one so everything is clear.
<dan2>
dbueno: it organizes my mp3s into directory hierarchies listed in the xml file by recursing all the mp3s into the program and using the id3 tags with symlinks
<jeremy_c>
Most errors I am learning to decipher but these last two are confusing to me.
<mikeX>
jeremy_c: line should print_endline rec1.Record.name I think
<dan2>
dbueno: as you can imagine, a perfectly sorted, ordered, and symlinked together mp3 collection can be very useful
<jeremy_c>
mikeX: name is a function I added to the module Record though.
<dbueno>
jeremy_c, check the call to Record.create.
<dbueno>
You're giving it one too few arguments.
<jeremy_c>
dbueno: oh! Gotcha.
<dbueno>
So rec1's type is a function type --- it expects a Field.t list.
<dbueno>
dan2, I let iTunes manage my music for me.
<jeremy_c>
dbueno: yeah. size was left on from me converting from non-module to modules. opps. thanks.
<dan2>
I think my biggest obstacle to learning ocaml was understanding foo -> bar -> unit sequences
<mikeX>
jeremy_c: oh yes, I missed that
<dan2>
dbueno: bleh
<dbueno>
dan2, I have the advantage of being more calloused to the ugliness of its arrangement. =]
<dan2>
dbueno: I have many mp3 collections over multiple hard disks and a music server that automatically generates playlists for me and lets me play over the internet
<dbueno>
dan2, I have like 100 albums, sadly. One hard drive.
<dbueno>
At work, I listen to my iPod.
<dan2>
dbueno: I have well over 1800 songs (albums included)
<dan2>
erm
<dan2>
I don't think that was the right term
<dan2>
over 1800 albums
<dan2>
disk management isn't the right setup right now
<dan2>
I'd like to stop using the database for managing generation of playlists
<dan2>
a filesystem is much easier to manage and maintain
<love-pingoo>
dan2: what do you use as "music server" ?
<dan2>
love-pingoo: a hack on phpgroupware
* love-pingoo
wears its salesman suit..
<love-pingoo>
use liquidsoap, it's the elegant ocaml way !
* love-pingoo
wears back its everyday suit
<dan2>
love-pingoo: it literally just generates playlists that are accessed via the internet
<love-pingoo>
sorry about that, but seriously, liq is cool
<love-pingoo>
actually liq doesn't generate playlists, but would rather schedule different playlists
<love-pingoo>
I guess your use is too simple for benefiting of using liq
<dan2>
love-pingoo: I'll consider it if you want to go write that mkdir recursive function for me
<Ballin_105>
Abiword is theee best
<love-pingoo>
dan2: lol
* love-pingoo
needs testers
<dan2>
love-pingoo: ocaml is amazing stuff isn't it
<dbueno>
That sounds pretty cool, love-pingoo.
<jeremy_c>
love-pingoo: testers for what?
<love-pingoo>
for liquidsoap
<love-pingoo>
we have a few users only, but are seeking for a real community since the project is quite mature now
<jeremy_c>
love-pingoo: I've used liquid soap since I was a baby, cleans me up real nice.
<love-pingoo>
jeremy_c: lol
<love-pingoo>
"liquidsoap is the smooth and clean way to generate audio"
<Ballin_105>
i am not sure what method i should use to play my im sound with ocaml
<Ballin_105>
execute alsa ..........or use the SDL audio thing
<Ballin_105>
im thinking the sdl audio ..........seems more multi platform ish
_velco has joined #ocaml
<mikeX>
love-pingoo: didn't the liquidsoap team create some bindings for id3 and vorbis tags?
<Ballin_105>
imma going to get all this sending crap done tonight then i can just connect the GIO channel and gtk stuff and be done with it hopefully this weekend
<mikeX>
dan2: good news
<dan2>
mikeX: you coded up a recursive mkdir?
<mikeX>
yeah, I think it works
<dan2>
sweety
<dan2>
*sweet
<mikeX>
couldn't you use system("mkdir -p") though?
<dan2>
of course, but that wouldn't be all that useful
<jeremy_c>
mikeX: not cross platform, if that matters.
<jeremy_c>
how long should it take to compile a 5,000 line long ocaml file on a dual core 2g intel mac, 2g memory? native compile? I am at 18 minutes now. Byte compile's in 5 secs or less.
batdog has quit [sterling.freenode.net irc.freenode.net]
jeremy_c has quit [Client Quit]
delamarche has joined #ocaml
mikeX has quit ["leaving"]
postalchris has quit [Read error: 110 (Connection timed out)]
batdog has joined #ocaml
_velco has quit ["I'm outta here ..."]
<dan2>
anybody here know how to strip \0 out strings
<dibblego>
g'day dan2
<dan2>
dibblego: how are ya
<dibblego>
pretty good for a Friday
kilimanjaro has joined #ocaml
<dan2>
dibblego: my mp3 organizing machine is kicking ass, however, the symlink function is bugging out on some of the id3tags that are double null terminated
<kilimanjaro>
Hello
<dan2>
dibblego: as soon as I figure out how to strip them, I'll be all set
<dan2>
hi kilimanjaro
<dibblego>
what does it organise exactly?
<dan2>
dibblego: it reads an XML spec sheet matches files in a recursive fashion with a regex and organizes them together in their own tree with symlinks
<dibblego>
my mp3 files are all over the place - all 105GB of them
<dan2>
dibblego: that's just the point
<dibblego>
once you've organised all yours, you'll have to mail me a hard disk :)
<dan2>
dibblego: I have the same problem
<dibblego>
do you use symlinks to create abum directories for example?
<dan2>
dibblego: my program recursively scans and creates a symlink tree organized with your mp3s in it
<dan2>
dibblego: the album directories are created using mkdir
<dan2>
the files are symlinked into the structure
<dibblego>
does it do that based on reading the id3 tag?
<dan2>
yup
<dibblego>
ah ok
<dan2>
it kicks ass
<dan2>
not to mention it's fast
<dibblego>
going to release it to the public?
<dan2>
of course
<dibblego>
sounds fun then :)
<Ballin_105>
this string is messing up my jabber request but when i print it out they both have the same thing
<dan2>
Ballin_105: is yours getting double null terminated like the issues I'm having with mine
<dibblego>
Ballin_105, print the ASCII/Unicode values to make sure the display is not changing it?
<dan2>
Ballin_105: run String.index <string> \000
<dan2>
Ballin_105: tell me if you get a number back
<dan2>
dibblego: btw, the whole program is seriously a set of recursive data structures
<dibblego>
yeah I can imagine
<dan2>
dibblego: ocaml was the right tool for the job
<dan2>
how many languages can you do this all in a one liner
<dan2>
Filename.concat (List.fold_right (fun file dir -> Filename.concat dir file) (List.map (fun k -> List.assoc (String.uppercase k) list) (List.rev dftag.tags)) outputdir) (Filename.basename file)
<Ballin_105>
i am saying i have a string stores as a function i guess ...........and when i put it in my Unix.send i get an error but if i print it out i get the same thing as if i typed it in the unix send in plain text
<dibblego>
2 in haskell - for good reason :)
<dan2>
dibblego: there's some code in here that might take at least a week in C, and a couple days in java
<dibblego>
dan2, agreed
<dan2>
dibblego: the whole project was done in under 8 hours
<dan2>
it needs some bug fixes like String Chomp, but everything else it's totally functional
<dibblego>
you're preaching to the converted
<Ballin_105>
oh now this is pissing me off
<Ballin_105>
casue i dont even knwo the error lol
<love-pingoo>
dan2: sorry for the permission error, but except for that was it ok ?
bzzbzz has quit ["leaving"]
<dan2>
love-pingoo: ya
<dan2>
love-pingoo: do you know how to clear out \000 from strings
<dan2>
some of the id3 tags have double null terminated strings
<love-pingoo>
dan2: you already owe me one user-report, but I think I can help you again ;)
<love-pingoo>
does (let rec chomp s = if s.[String.length s -1] = '\0' then chomp (String.sub s 0 (String.length s - 1)) else s) work ?
<dan2>
no
<dan2>
there are some crap in the middle of the strings too
<dan2>
I'll use Str.global_repolace
<love-pingoo>
wow.. how do you get these strings ?
<love-pingoo>
where do they come from to be so crappy ?
<dan2>
windows id3tag makers
<love-pingoo>
aha, then i'm not surprised :)
<love-pingoo>
id3tags are a really messy thing
<love-pingoo>
you should cut at the first 0, probably
<dan2>
ok, so apparently my global replacement broke somethign else
<love-pingoo>
using String.index s '\0'
<love-pingoo>
try String.sub s 0 (String.index s '\0') with _ -> s
<love-pingoo>
it's a snippet shiting day ;)
<dan2>
umm
<dan2>
how the hell does that work?
<love-pingoo>
you get the index of the leftmost occurence of '\0'. if it fails, keep s, if it succeeds, cut s
<dan2>
what if there is more than one \000
<love-pingoo>
it cuts at the first 0, you lose the end
<dan2>
that doesn't work
<love-pingoo>
that may not be what you want, but just removing 0 probably leads to weird strings
<dan2>
because the first \000 will be in the middle of a string
<love-pingoo>
dan2: do you have an example of crappy string ?
<love-pingoo>
if you have "foo\0bar\0baz\0\0" you get "foo"
<dan2>
I did before I ran find
<dan2>
heh
<love-pingoo>
hum you need to replace all my \0 by \000 actually
<love-pingoo>
"foo\000bar\000baz\000\000" -> "foo", that's now tested :p
<love-pingoo>
we should get some ocaml-lambdabot just like the haskell folks for testing
<dan2>
it's bugging out on your with
<dan2>
can you send me the updated line
<dan2>
because don't you have to convert
<dan2>
\000 to a string
<love-pingoo>
# let s = "foo\000bar\000baz\000\000" in try String.sub s 0 (String.index s '\000') with _ -> s ;;
<love-pingoo>
- : string = "foo"
<dan2>
want to see a bogied string
<dan2>
Uncaught exception:
<dan2>
Unix.Unix_error (8, "symlink",
<dan2>
"/home/dan/music/Jethro Tull\\000/Aqualung (25th Anniversary \\183 Special Edition)\\000/11 - Wind-Up.mp3")
<dan2>
imagine that symlink is barfing all over this
<dan2>
symlink is just a c call anyway
<dan2>
so c calls look for null terms
<love-pingoo>
oh, \\000 ??
<dan2>
what?
<dan2>
I just copied that from the debugger
<love-pingoo>
there is no \000 in your string, but a \ followed by three 0 if I read well..
<dan2>
hmm
<love-pingoo>
the real terminator probably got translated to that at some point
<dan2>
ahh, well I am getting it from a ntfs file system
<dan2>
they have limits on lengths probably
<love-pingoo>
you app works, but not yet in the real crappy world :D
<love-pingoo>
I have to get back to work, good luck.
<dan2>
for everything on linux filesystems it works great
rzoom has joined #ocaml
<love-pingoo>
just try to track down the point where these terminators (or espaced terminators) appears
love-pingoo has quit ["Leaving"]
<Ballin_105>
i got an error but there is not 1 reason for it and its un explainable isnt this greeeeeaat
jewel has joined #ocaml
batdog has quit [sterling.freenode.net irc.freenode.net]
eradman has quit [sterling.freenode.net irc.freenode.net]
DRMacIver has quit [sterling.freenode.net irc.freenode.net]
jave has quit [sterling.freenode.net irc.freenode.net]
Norgg has quit [sterling.freenode.net irc.freenode.net]
mattam has quit [sterling.freenode.net irc.freenode.net]
cmeme has quit [sterling.freenode.net irc.freenode.net]
batdog has joined #ocaml
jave has joined #ocaml
cmeme has joined #ocaml
DRMacIver has joined #ocaml
eradman has joined #ocaml
mattam has joined #ocaml
Norgg has joined #ocaml
<Ballin_105>
hmmmmmmm
eradman has quit [sterling.freenode.net irc.freenode.net]
DRMacIver has quit [sterling.freenode.net irc.freenode.net]
jave has quit [sterling.freenode.net irc.freenode.net]
Norgg has quit [sterling.freenode.net irc.freenode.net]
mattam has quit [sterling.freenode.net irc.freenode.net]
batdog has quit [sterling.freenode.net irc.freenode.net]
cmeme has quit [sterling.freenode.net irc.freenode.net]
batdog has joined #ocaml
jave has joined #ocaml
cmeme has joined #ocaml
DRMacIver has joined #ocaml
eradman has joined #ocaml
mattam has joined #ocaml
Norgg has joined #ocaml
Snark has joined #ocaml
chs_ has joined #ocaml
b00t has joined #ocaml
jewel has quit [Read error: 104 (Connection reset by peer)]
kilimanjaro has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
rzoom has quit [Remote closed the connection]
jewel has joined #ocaml
dibblego has quit ["Leaving"]
bebui has quit [sterling.freenode.net irc.freenode.net]
Ballin_105 has quit [sterling.freenode.net irc.freenode.net]
shawn has quit [sterling.freenode.net irc.freenode.net]
seafood_ has quit [sterling.freenode.net irc.freenode.net]
triple_ has quit [sterling.freenode.net irc.freenode.net]
datrus has quit [sterling.freenode.net irc.freenode.net]
gim has quit [sterling.freenode.net irc.freenode.net]
bebui has joined #ocaml
Ballin_105 has joined #ocaml
shawn has joined #ocaml
seafood_ has joined #ocaml
triple_ has joined #ocaml
datrus has joined #ocaml
gim has joined #ocaml
<Ballin_105>
still cant even find the error
pango_ has quit ["brb"]
david_koontz has joined #ocaml
pango has joined #ocaml
<pango>
Ballin_105: what error do you get exactly ?
<Ballin_105>
pango: it gets even wierder
<Ballin_105>
something that *was* working is now not working
slipstream-- has joined #ocaml
<Ballin_105>
pango: dammit man my ip chnaged and i did not know right in the middle of an errror GRRRRRRRR
<pango>
you're hosting the server ?
<Ballin_105>
pango: test server
<Ballin_105>
;)
<Ballin_105>
i have a dedicated i am going to run it onm
<pango>
why not connect to 127.0.0.1 then ?
<Ballin_105>
yea i know
slipstream has quit [Read error: 110 (Connection timed out)]
smimou has quit ["bli"]
<Ballin_105>
oh man this is working real good
<Ballin_105>
pango: you there .........can i ask for a opinion ?
<pango>
still here
<Ballin_105>
i dont knwo if i should setup it up in a MSN style im or a AIM style like you can just add someone and im them instantly or msn style where you add soemone and they have to accept you ?
<Ballin_105>
pango: ^^
<pango>
is that up to the client anyway ?
<Ballin_105>
no the server
<Ballin_105>
if i im you on aim .........i can just add you and im you you dont have to accept or anything
<Snark>
on jabber you can always message someone... but you have to be authorized to see their presence
<Ballin_105>
Snark: well default here its not that way
<Ballin_105>
you have to subscribe
<Ballin_105>
Snark: i could be wrong though hmmmmmmmm
<Ballin_105>
whats the point of that though you have to see their presence lol
<Ballin_105>
then you have to approve and deny
<Ballin_105>
i want ot make it like AIM or like MSN
<Ballin_105>
i think the MSN way may be better
lmbdwr has joined #ocaml
<lmbdwr>
hi
<Ballin_105>
where the person will have to accept you to even talk / see them
<lmbdwr>
I have a small question regarding lambda calculus : how to compute the degree of a term ? THe degree of a redex I understand, but not the term
<Ballin_105>
pango: what method you like better?
chs_ has quit []
<pango>
I don't use IM for random chatting, so I prefer validation too
_fab has joined #ocaml
<pango>
however the validation itself contains a message, so it doesn't make so much difference; Only going "invisible" does
<Ballin_105>
pango: what do you mean ?
<Ballin_105>
btw objective C + garbage collector is cool stuff
<pango>
it's still an annoyance
<Ballin_105>
i am going to use for my next project
<Ballin_105>
what is ?
<pango>
receiving random messages
<Ballin_105>
ahhh
clog has joined #ocaml
david_koontz has quit [Read error: 110 (Connection timed out)]
b00t has quit [Client Quit]
b00t has joined #ocaml
<Ballin_105>
alsa is in every linux right ?
_fab has quit []
b00t has quit [Remote closed the connection]
<luca83>
Ballin_105: not, it isn't. oss is more widespread in older linux systems
<Ballin_105>
well
<Ballin_105>
what one should i use
<luca83>
alsa!
<luca83>
oss are deprecated
<Ballin_105>
ahhh
shawn has quit ["Leaving"]
jeremy_c has joined #ocaml
<jeremy_c>
How do I use Stream to read one line at a time?
ramkrsna has quit [Connection timed out]
<jeremy_c>
nm.
ramkrsna has joined #ocaml
jeremy_c has quit [Client Quit]
<luca83>
I resolved the issue I had yesterday
<luca83>
;)
dbueno has quit ["Leaving"]
jeremy_c has joined #ocaml
dbueno has joined #ocaml
jewel has quit [Read error: 110 (Connection timed out)]
mikeX has joined #ocaml
Snark has quit ["Leaving"]
triple_ has quit [Read error: 113 (No route to host)]
delamarche has quit []
david_koontz has joined #ocaml
postalchris has joined #ocaml
postalchris has quit [Read error: 104 (Connection reset by peer)]
postalchris has joined #ocaml
gDanly is now known as danly
smimou has joined #ocaml
bebui is now known as julien
bzzbzz has joined #ocaml
delamarche has joined #ocaml
pango has quit ["Leaving"]
pango has joined #ocaml
<dan2>
pango: ahoy
Leonidas has joined #ocaml
<pango>
hi
<dan2>
pango: do you know how to chomp crap like all special characters out of strings
<pango>
there's as many ways as there's definitions of "special characters"...
<dan2>
symlink bugs out when it gets crap like this in the strings
<dan2>
"/home/dan/music/Jethro Tull\\000/Aqualung (25th Anniversary \\183 Special Edition)\\000/11 - Wind-Up.mp3"
<dan2>
I want to strip all those \\000 and \\183
<pango>
I'd create a Buffer, iter over the original string and only copy the chars I want to keep to the buffer
<pango>
like yesterday, that function can even take a char -> bool predicate to filter out whatever you want
<Ballin_105>
whatup
<delamarche>
newbie attack again
<delamarche>
is there a quick and dirty doc where i can learn how to do basic I/O?
<delamarche>
well mostly I
<delamarche>
i've got the O part no problem (yay printf)
<delamarche>
I'm getting this compiler error: This expression has type player_move but is here used with type
<delamarche>
unit -> player_move
<delamarche>
if I remove the recursive call to get_move_from_user and replace it with a constructor like SelectTail it works
<delamarche>
so the recursive call is definitely the problem. I suspect it's returning the entire function
<delamarche>
instead of applying the function and returning its value
<delamarche>
how do I force the function application?
<pango>
let rec get_move_from_user () = ...
<pango>
otherwise you're defining a value
<delamarche>
sigh
<delamarche>
i'm sucha tool
<delamarche>
thanks pango
<pango>
(well, non-functional value)
<delamarche>
i didn't realize there was a distinction
<pango>
well, you could also have written let rec get_move_from_user = fun () -> ...
postalchri1 has joined #ocaml
<delamarche>
is there one idiom that is preferred over the other?
<delamarche>
i imagine the first is just syntactic sugar for the second
postalchris has quit [Read error: 104 (Connection reset by peer)]
<pango>
that in turn is syntactic sugar over 'function', that only takes a single argument at a time
<delamarche>
ok cool
<pango>
well, let rec get_move_from_user () = just look ok in that case
<pango>
btw, your Printf will happen *after* the read_line () input...
<Ballin_105>
XML - LIGHT is pretty cool
<dan2>
pango: it probably picked up an uncomplete download or something
<pango>
delamarche: you could also use match instead of cascaded ifs
<delamarche>
yup i'm doing that now :)
<delamarche>
thank you
<flux__>
dan2, you would do better catching the exception Unix_error (EEXISTS, _, _) (as suggested), becaause that way the code will be race-free - now your code will throw an exception, if the file is creted after checking if it exists
<flux__>
obviously that is a rare incident..
<flux__>
but better make it a habbit to write race-free code ;)
<flux__>
well, maybe you're checking the exception anyway, after all there are othr cases that might go wrong during the creation of the symlink (such as no permission to create a symlink to the directory - or fs not supporting symlinks at all)
mikeX has quit [Read error: 104 (Connection reset by peer)]
mikeX has joined #ocaml
bzzbzz has quit ["leaving"]
jeremy_c has quit [Client Quit]
<Ballin_105>
anyone here work with LablGTK2?
<Ballin_105>
glade is awesome
<delamarche>
hrm... when I try to use the Str module, the toplevel complains "Reference to undefined global 'Str'"
<delamarche>
i thought this was a standard library?
<delamarche>
specifically, typing Str.split;; at the toplevel
<delamarche>
even if I open Str;; first
<pango>
it's in the standard library, but not automatically loaded
<mikeX>
delamarche: '#load "str.cma";;'
<mikeX>
or make a custom toplevel, instructions are included in the manual
<delamarche>
mikeX: Is that true even if i'm compiling a source file with ocamlc? Because I get a syntax error if i use a load directive in my source file
* delamarche
is a tool
<pango>
add str.cma before your module in ocamlc parameters
<delamarche>
aha there's already a spot for this in my makefile template
<delamarche>
thanks muchly guys
Ballin_105 is now known as Wizz_Kidd
Wizz_Kidd is now known as Ballin_105
<mikeX>
delamarche: directives starting with '#' are specific to the toplevel afaik
<delamarche>
yes that's what i thought as well
<delamarche>
thank you
<delamarche>
i apologize, that stuff about the linking and dynamic loading of Str.cma is right in the module documentation
<delamarche>
I should have figured that out on my own
delamarche has quit []
bzzbzz has joined #ocaml
batdog is now known as batdog|gone
Poopsmith has joined #ocaml
jeremy_c has joined #ocaml
<jeremy_c>
let list_callback ?(model) (req : request) = ..... how can I tell if model was supplied?
<pango>
model will have an option type
<jeremy_c>
pango: and when empty, None then, other wise it could be Some of anything I pass?
<pango>
if the model parameter is polymorphic yes; Otherwise it's type will be statically determined
<pango>
s/it's/its/
<pango>
see the set_age example I gave you around 3 days ago
<jeremy_c>
pango, how do I do ?(model : Hashtbl.t option) ?
<pango>
Hashtbl.t is parametrized, so you need ?(model: ('a, 'b) Hashtbl.t option)
<pango>
do you really want to make type explicit ? :)
<jeremy_c>
pango: don't know. does it help? It's only ever going to be a hashtbl
delamarche has joined #ocaml
<pango>
if it's used as a hash table if the function, it will be inferred... You can just check the inferred function signature to be sure
<pango>
only in some occasions there's a cost to leaving functions overly polymorphic
<pango>
for example when those values are used with inequality operators <, >, etc.
<pango>
because while they're themselves polymorphic, compiler uses faster implementations when the type is known (on int, probably on floats too, etc.)
<pango>
I guess there's some inconsistency on the type of the values you want to put in your hash table
<pango>
maybe you should make the hash table type explicit when creating it, and see where compiler complains
<pango>
add_handlers puts request -> string functions in the table, get_callback either returns such value or not_found_callback (so they must both have same type)
<jeremy_c>
pango: that compiles fine. The only diff is that I created the Hashtbl inside of not_found_callback, instead of callback
<jeremy_c>
pango: Oh!
<jeremy_c>
pango: thanks for that find.
<jeremy_c>
pango: that made things work correctly, adding 'a -> request -> string
Smerdyakov has joined #ocaml
<pango>
jeremy_c: very small tip, you can use %! in printf formats to flush output
<jeremy_c>
pango: Oh, that'll be nice.
<jeremy_c>
pango: those will eventually be turned into log messages.
<Ballin_105>
you ugys like Thunderbird
mattam has quit [Read error: 104 (Connection reset by peer)]
mattam has joined #ocaml
zmdkrbou_ has joined #ocaml
zmdkrbou has quit [Read error: 104 (Connection reset by peer)]
<jeremy_c>
Ballin_105: it's what I used for 2+ years, but I was never really satisfied with it.
<jeremy_c>
Ballin_105: but, I have not been satisfied w/any mail client, so... who knows.
<jeremy_c>
mutt was the closest.
<Ballin_105>
i am not picky i just wanna check mail
<Ballin_105>
;)
<Ballin_105>
jeremy_c: you ever use chatzilla ?
<jeremy_c>
Ballin_105: yeah, but I enjoy Colloquy on mac much more, so it's been a very long time.
<Ballin_105>
i am trying to re install and de bloat my system
<Ballin_105>
my system gets soo bloated sometimes
<jeremy_c>
yes. mine does as well.
<jeremy_c>
I think any power user/programmer's does
<Ballin_105>
you ever use chatzilla ?
<Ballin_105>
i am re installing minimal slack + xfce
<Ballin_105>
imma try out chatzilla ofr my irc solution it looks like enough for what i do
<pango>
if you want to cut on bloat, try sylpheed as a mua
<Ballin_105>
well im jus installig the lightest software i can use
<Ballin_105>
not installing xchat konversation kopete gaim etc when i only use one
<Ballin_105>
im going ot keep it Very simple from now on
<jeremy_c>
xchat is nice. it's what I would use over chatzilla.
<jeremy_c>
real light? irssi is nice too.
<Ballin_105>
well chatzilla provides multiple channels server colors and the TAB key
<Ballin_105>
all i need
<Ballin_105>
xchat has a bunch of other stufff
<Ballin_105>
tons more actually
<jeremy_c>
it's still prob lighter.
<jeremy_c>
quicker response I know.
<Ballin_105>
what is ?
<jeremy_c>
xchat
<jeremy_c>
vs. chatzilla.
<Ballin_105>
how owuld it be lighter
<jeremy_c>
native bindings to code, written in c.
<Ballin_105>
chatzilla is using XUL and i use firefox so its already being used
<Ballin_105>
but theres alot more stuff
<Ballin_105>
i know chatzilla is javascript but so is the whole firefox
<jeremy_c>
lack of features does not mean light.
<Ballin_105>
besides the core
<Ballin_105>
i understand
<jeremy_c>
full featured does not mean heavy.
<Ballin_105>
well .............i want something very simple and light
<Ballin_105>
and have you ever epxeinced delay in irc ?
<Ballin_105>
with chatzilla ?
<jeremy_c>
UI was sluggish as I remember, but it's been a while.
<Ballin_105>
it uses XPCOM libs which are c or w/e i think it just uses javascript to kinda tie it together
<Ballin_105>
jeremy_c: Gtk
<Ballin_105>
it uses GTK
<Ballin_105>
xul on linux outputs gtk
<Ballin_105>
but i think konversation is a resource hog
<jeremy_c>
Ballin_105: KDE is nice, but it does take a bit of a nice machine to handle it.
<Ballin_105>
jeremy_c: i am running it now i have a 2 ghz machine 1 GB ram
<Ballin_105>
but i have a reputation for having 100 things open
<Ballin_105>
so i need the best performance i can have :P
<Ballin_105>
and this gets sluggish at times
<jeremy_c>
yeah, I run 2ghz dual core w/2g ram and I would like more too :-)
<Ballin_105>
yea so i love light minimal and non performance hogging
<Ballin_105>
and i think maybe by using more apps in the mozillla suite i can kinda knock a bunch of things out
<Ballin_105>
firefox - thunderbird - chatzilla
<Ballin_105>
abiword instead of openOffice etc
<bzzbzz>
cd ..
<delamarche>
woowoo
<delamarche>
done writing my first working ocaml program
<delamarche>
man i suck at this
<delamarche>
hehe
smimou has quit ["bli"]
<delamarche>
http://pastebin.com/792344 if anyone wants a laugh. Name-calling and criticisms are much appreciated.
gim_ has joined #ocaml
gim_ has quit [Client Quit]
gim__ has quit [Read error: 110 (Connection timed out)]
<mikeX>
Ballin_105: try irssi if you really want to cut back on bloat
<mikeX>
Ballin_105: why bother with Printf.printf if you've already opened the module?
<mikeX>
sorry, delamarche
<jeremy_c>
to really cut back, use Emacs as your editor, window manager, irc client, mail client, news client and shell :-)
<mikeX>
hahaha
<delamarche>
mikeX: thanks
<jeremy_c>
it'll do it all.
<delamarche>
and jeremy_c: I did that back in the day
<delamarche>
emacs + ratpoison
<jeremy_c>
delamarche: xwem is a nice window manager.
<jeremy_c>
only prob is it only works w/Xemacs.
<delamarche>
then i started using vim
<delamarche>
doh
<delamarche>
6 years later i'm trying to go back to emacs
<jeremy_c>
I really like file navigation w/vim.
<jeremy_c>
well, I should say navigating in the file. like ct" www, 5dd, etc...
<delamarche>
yeah it's great... feels like a keystroke-driven perl sometimes
<jeremy_c>
delamarche: I use textmate and I really wish there was a vim mode for it.
<delamarche>
jeremy_c: I've never been satisfied by vim modes in anything before
<delamarche>
or emacs modes, really
<delamarche>
for a couple years i've been wondering what a really good fusion of vim and an IDE would look like, but it's hard because the two philosophies are pretty much directly in conflict
<jeremy_c>
not really.
<delamarche>
heh i knew you were going to say that
<jeremy_c>
when I think of vim, I think of the keyboard navigation.
<jeremy_c>
anyway, the perfect editor would simply type what your thinking, then who cares about how the keyboard navigates... Guess we will never have the perfect editor.
<delamarche>
mikeX: That's next on my reading list actually