ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
<Drup> you just did :]
justgage has quit [Quit: Lost terminal]
justgage has joined #ocaml
asQuirreL has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mort___ has joined #ocaml
nullcat has quit [Ping timeout: 256 seconds]
ljs has joined #ocaml
nullcat has joined #ocaml
bobry has quit [Quit: Connection closed for inactivity]
bobfang has quit []
freling has joined #ocaml
freling has quit [Ping timeout: 245 seconds]
javamonn has joined #ocaml
ontologiae_ has quit [Ping timeout: 245 seconds]
lewis1711 has joined #ocaml
darkf has joined #ocaml
jabesed has joined #ocaml
psy has quit [Ping timeout: 256 seconds]
psy has joined #ocaml
<lewis1711> filter_map is a great function. it makes me rue that 1 - I never thought to write something similar myself 2 - that I wasted so much time filtering and mapping separately
freling has joined #ocaml
javamonn has quit [Remote host closed the connection]
jabesed has quit [Quit: Konversation terminated!]
BitPuffin|osx has quit [Ping timeout: 250 seconds]
javamonn has joined #ocaml
freling has quit [Ping timeout: 252 seconds]
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml
slwmnop has joined #ocaml
mort___ has quit [Ping timeout: 256 seconds]
slwmnop has quit [Quit: Lost terminal]
javamonn has quit [Remote host closed the connection]
bobfang has joined #ocaml
hbar has joined #ocaml
ygrek has joined #ocaml
manizzle has quit [Ping timeout: 256 seconds]
<bobfang> hi its me again, so if you are using js_of_ocaml, what is the easist way to get string out from a textarea element?
<bobfang> there is a value method but it seems that it is used for setting the value
<Drup> ##innerHTML, iirc
<Drup> value seems fin too, it's marked as a prop in jsoo, so it should be readable too
<bobfang> isn't that also for setting the value
<Drup> why do you think that ?
<bobfang> so I can just do let s = someTextArea##innerHTML?
<Drup> yeah
<bobfang> then how can I get ocaml string from it?
<bobfang> I tried to call toString on s
<bobfang> but it does not typecheck...
<Drup> Js.to_string
<bobfang> cool thanks
keen____ has quit [Read error: Connection reset by peer]
badkins has quit [Remote host closed the connection]
keen____ has joined #ocaml
nullcat has quit [Ping timeout: 264 seconds]
freling has joined #ocaml
nullcat has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
palomer has joined #ocaml
freling has quit [Ping timeout: 246 seconds]
javamonn has joined #ocaml
leblon has joined #ocaml
nullcat has quit [Ping timeout: 240 seconds]
bobfang has quit [Remote host closed the connection]
bobfang has joined #ocaml
bobfang has quit [Remote host closed the connection]
bobfang has joined #ocaml
nullcat has joined #ocaml
swgillespie has joined #ocaml
NoNNaN has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
HrafnA has quit [Read error: Connection reset by peer]
idegen has quit [Quit: Leaving.]
nullcat has quit [Ping timeout: 272 seconds]
nullcat_ has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
freling has joined #ocaml
freling has quit [Ping timeout: 256 seconds]
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml
nullcat_ has quit [Ping timeout: 255 seconds]
nullcat_ has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
bobfang has quit [Remote host closed the connection]
bobfang has joined #ocaml
bobfang has quit [Ping timeout: 244 seconds]
ljs has quit [Quit: Be back later ...]
ljs has joined #ocaml
palomer has quit [Quit: palomer]
osa1 has quit [Ping timeout: 256 seconds]
osa1 has joined #ocaml
ljs_ has joined #ocaml
ljs has quit [Read error: Connection reset by peer]
badkins has joined #ocaml
badkins has quit [Ping timeout: 240 seconds]
vodkaInf1rno has quit [Quit: leaving]
vodkaInferno has joined #ocaml
javamonn has quit [Remote host closed the connection]
NoNNaN has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
javamonn has joined #ocaml
josch has left #ocaml [#ocaml]
rgrinberg has quit [Ping timeout: 265 seconds]
freling has joined #ocaml
freling has quit [Ping timeout: 264 seconds]
palomer has joined #ocaml
olibjerd has joined #ocaml
ljs_ has quit [Quit: Be back later ...]
ljs_ has joined #ocaml
olibjerd has quit [Read error: Connection reset by peer]
olibjerd has joined #ocaml
olibjerd has quit [Read error: Connection reset by peer]
olibjerd has joined #ocaml
javamonn has quit [Remote host closed the connection]
vodkaInferno has quit [Quit: Changing server]
olibjerd has quit [Read error: Connection reset by peer]
ljs_ has quit [Ping timeout: 256 seconds]
osa1 has quit [Ping timeout: 265 seconds]
slash^ has joined #ocaml
vodkaInferno has joined #ocaml
olibjerd has joined #ocaml
justgage has quit [Quit: Leaving]
pyon has quit [Quit: brb]
pyon has joined #ocaml
nullcat_ has quit [Ping timeout: 276 seconds]
nullcat_ has joined #ocaml
olibjerd has left #ocaml [#ocaml]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
freling has joined #ocaml
freling has quit [Ping timeout: 264 seconds]
ggole has joined #ocaml
nullcat_ has quit [Ping timeout: 256 seconds]
nullcat has joined #ocaml
willy_ has joined #ocaml
MercurialAlchemi has joined #ocaml
nullcat_ has joined #ocaml
nullcat has quit [Ping timeout: 265 seconds]
palomer has quit [Quit: palomer]
pobivan has joined #ocaml
nullcat has joined #ocaml
nullcat_ has quit [Ping timeout: 246 seconds]
psy has quit [Ping timeout: 265 seconds]
rgrinberg has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
nullcat has quit [Ping timeout: 240 seconds]
nullcat_ has joined #ocaml
freling has joined #ocaml
freling has quit [Ping timeout: 256 seconds]
ygrek has quit [Ping timeout: 256 seconds]
psy has joined #ocaml
palomer has joined #ocaml
Gama11 has joined #ocaml
psy has quit [Ping timeout: 240 seconds]
psy has joined #ocaml
palomer has quit [Quit: palomer]
AltGr has joined #ocaml
freling has joined #ocaml
freling has quit [Ping timeout: 256 seconds]
keen____ has quit [Read error: Connection reset by peer]
nullcat_ has quit [Ping timeout: 252 seconds]
keen____ has joined #ocaml
nullcat has joined #ocaml
rand000 has joined #ocaml
javamonn has joined #ocaml
javamonn has quit [Ping timeout: 252 seconds]
<reynir> Drup: I didn't realize you could use furl to generate URLs. I have a use case for it then with the digitalocean api! :)
matason has joined #ocaml
matason has quit [Client Quit]
matason has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freling has joined #ocaml
Kakadu has joined #ocaml
<flux> hmm, furl looks pretty fun
<adrien> furl = fun + rul ?
<adrien> fun + url *
freling has quit [Ping timeout: 255 seconds]
ljs_ has joined #ocaml
ljs_ has quit [Ping timeout: 250 seconds]
<flux> [ERROR] spoc is not available because your system doesn't comply with ocaml-version = "4.01.0". <- I wonder if this is rather a bug in the package..
<flux> or maybe not, the package doesn't seem to compile as-is..
rgrinberg has quit [Ping timeout: 244 seconds]
matason has quit []
<flux> ..though the git-repo works fine
Hannibal_Smith has quit [Quit: Leaving]
SomeDamnBody has quit [Ping timeout: 250 seconds]
Hannibal_Smith has joined #ocaml
willy_ has quit [Quit: This computer has gone to sleep]
MercurialAlchemi has joined #ocaml
matason has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
freling has joined #ocaml
dev_ss has joined #ocaml
freling has quit [Ping timeout: 240 seconds]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Gama11_ has joined #ocaml
Gama11 has quit [Ping timeout: 256 seconds]
Sorella has quit [Quit: Connection closed for inactivity]
Haudegen has joined #ocaml
matason has quit []
MercurialAlchemi has joined #ocaml
tane has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
MercurialAlchemi has joined #ocaml
TheLemonMan has joined #ocaml
tani has joined #ocaml
dev_ss has quit [Ping timeout: 256 seconds]
tane has quit [Ping timeout: 264 seconds]
<flux> so I guess it's bad form to publish git repos or packages that require oasis to opam?
everyonemines has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
<flux> well, here it is prior to publishing to opam: https://github.com/eras/ocaml-jpeg
<flux> perhaps camlimages does the same, but atleast if your goal is to convert jpegs from memory to RGB in memory then this is your library ;)
MercurialAlchemi has joined #ocaml
<flux> ..though really works only with turbojpeg though it pretends to support libjpeg as well..
<dora-molly> flux: you might be interested in https://github.com/def-lkb/stb_image for the same purpose
<dora-molly> it decodes JPEG, PNG, TGA, BMP, PSD, GIF, HDR, PIC and PNM, from file or from memory, using stb_image (without external dependencies).
<flux> well, in my use case performance was pretty important, and turbojpeg was able to be a bit faster than plain libjpeg
<flux> so I wonder if such a library is able to complete :-o
<flux> or compete..
<dora-molly> it is quite fast, faster than libjpeg i think
freling has joined #ocaml
<dora-molly> but not safe (no check is done if image is forged to trigger bad cases)
<flux> how about if it's not forged but just happens to be broken?
<dora-molly> the same
<dora-molly> between libjpeg and libjpeg-turbo, quite competitive in general
<flux> some random guy on irc also is writing his own jpeg decoder that's able to parallelize decoding, starting from the reset markers
<dora-molly> :)
<flux> so it can be pretty fast if there happen to be reset markers. if not, well it's still decent I understand.
<dora-molly> what is your use case?
<flux> I have webcams that produce jpeg image streams
<flux> currently I'm showing them with https://github.com/eras/webcamviewer, but I would also like to run some analysis on them
freling has quit [Ping timeout: 252 seconds]
<flux> currently I'm running 3 streams at it takes 60% cpu from one core, so I guess I have plenty to spare
<flux> that particular piece actually incorporates that jpeg module, today I just extracted it from it :)
<flux> and before that it lived in another module.. and I think before that in another.. so I figured it's time to extract it :)
<dora-molly> which analysis are you interested into?
<flux> well, in particular movement
MercurialAlchemi has quit [Ping timeout: 256 seconds]
<dora-molly> makes sense :-). Do you have an algorithm to recommend for such task?
<flux> I'll start with subtracting consecutive frames and see where it takes :)
asQuirreL has joined #ocaml
freling has joined #ocaml
freling has quit [Ping timeout: 240 seconds]
ontologiae_ has joined #ocaml
freling has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
milosn has quit [Quit: leaving]
lordkryss has joined #ocaml
larhat has joined #ocaml
HrafnA has joined #ocaml
ontologiae has joined #ocaml
ontologiae_ has quit [Read error: Connection reset by peer]
manizzle has joined #ocaml
everyonemines has left #ocaml [#ocaml]
Hannibal_Smith has joined #ocaml
<Drup> adrien "Formatted URL"
<Drup> reynir: sure, it works both ways.
freling has quit [Quit: Leaving.]
<Drup> happy to take early opinions about the general concept, the API will still move though
<reynir> I think I will start use it once the ocaml-re PR has been merged .)
Submarine has joined #ocaml
Submarine has joined #ocaml
AltGr has left #ocaml [#ocaml]
<Drup> that's rather reasonable.
bobfang has joined #ocaml
Submarine has quit [Remote host closed the connection]
Submarine has joined #ocaml
Submarine has joined #ocaml
NoNNaN has joined #ocaml
MercurialAlchemi has joined #ocaml
dav- has joined #ocaml
dav has quit [Ping timeout: 272 seconds]
BitPuffin|osx has joined #ocaml
<reynir> most of the code looks more or less like this http://paste.reyn.ir/21
<reynir> (I left out how the result is handled)
<Drup> ah, yeah :]
<reynir> Hm
ontologiae has quit [Ping timeout: 256 seconds]
lewis1711 has quit [Ping timeout: 256 seconds]
badkins has joined #ocaml
ljs_ has joined #ocaml
badkins has quit [Ping timeout: 264 seconds]
ljs_ has quit [Client Quit]
ljs_ has joined #ocaml
idegen has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
<Drup> In fact, integrating the "type" of the result could be intesresting too
<Drup> but I think it would be pretty hard to do in a reasonably general fashion, since there are many ways to send in the same information for web queries like this
Sorella has joined #ocaml
redpoppies has joined #ocaml
<reynir> Do you want access to the repository? It's a private repo on github right now because it's not too useful in the current state
<reynir> (or I could open source it)
<Drup> not really
<reynir> heh :)
<Drup> I can't work on furl for the next two weeks anyway
osa1 has joined #ocaml
bobfang has quit []
<adrien> Drup: fun+url was a better explanation
rwmjones has quit [Read error: Network is unreachable]
thomasga has joined #ocaml
rwmjones has joined #ocaml
Haudegen has quit [Ping timeout: 255 seconds]
HrafnA has quit [Quit: HrafnA]
<reynir> Is it possible to use Lwt_js_events with websockets?
dav has joined #ocaml
<Drup> how would that even work ? ^^'
<Drup> I mean, there are not events per-se.
thomasga has quit [Quit: Leaving.]
dav- has quit [Ping timeout: 250 seconds]
Haudegen has joined #ocaml
thomasga has joined #ocaml
javamonn has joined #ocaml
<reynir> Hm
milosn has joined #ocaml
yomimono has quit [Ping timeout: 256 seconds]
javamonn has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
ir2ivps4 has joined #ocaml
darkf has quit [Quit: Leaving]
<reynir> I don't think I understand
javamonn has joined #ocaml
helix__ has joined #ocaml
<kaepora> Can I define a function within a tuple?
<flux> yes, and its scope will be the particular expression
<flux> in this case one field of the tuple
<kaepora> let ((a b), c) = ((let x = a + b in), 5);;
<kaepora> For example
<flux> no, let x = y in z always needs the 'z' there
<kaepora> OK
<kaepora> let ((a b), c) = ((let x = a + b in 0), 5);;
<kaepora> Would this work?
<kaepora> Oups, I mean
<kaepora> let ((a b), c) = ((let x = b in 0), 5);;
<ggole> No
<kaepora> Basically I want this to be a shorthand for
<kaepora> let a b = let x = b in 0;; let c = 5;;
<flux> that's a longwinded way to say: let a b = 0 let c = 5
<kaepora> Sure
<kaepora> The function is different
<kaepora> The actual function is
<ggole> Seems like a strange thing to want
<kaepora> let w s a b = let c=s.(a) in s.(a)<-s.(b);s.(b)<-c;;
<kaepora> So what I'm trying to do is
<kaepora> let ((w s a b), p) = ((let c=s.(a) in s.(a)<-s.(b);s.(b)<-c), 5);;
<flux> so after that expression, what value should w have?
Haudegen has quit [Ping timeout: 256 seconds]
<ggole> Seems like you can just bind w and p separately
<flux> because it looks like you are trying to pattern match a function (cannot be done) but I think that's not what you want
<ggole> let w s a b = ... let p = 5
<ggole> Or let w, p = (fun s a b -> ...), 5
<kaepora> ggole: Yes, but this is for a competition to use as little characters as possible for a piece of code :P
<ggole> Oh :|
<ggole> let w s a b =let c=s.(a)in s.(a)<-s.(b);s.(b)<-c let p=5 is still shorter
<kaepora> Yup...
<ggole> Does whitespace count?
<kaepora> Yes
<ggole> Then your code is gonna be lexically fugly
<ggole> But I guess that's all part of the fun.
thomasga has quit [Quit: Leaving.]
<ggole> Oops, let w s a b =let could be let w s a b=let
jbrown has quit [Ping timeout: 244 seconds]
thomasga has joined #ocaml
<kaepora> Relatedly
<kaepora> Is there a way to swap two elements of an array without using a third temporary variable?
<ggole> No.
<kaepora> :(
<Drup> well, there is the xor magic trick
<Drup> but it works only for ints
<Drup> writing a code minimizer for OCaml would be rather funny
Haudegen has joined #ocaml
<kaepora> Drup: Both elements of the array are ints!
<Drup> not sure if shorter, completely sure that more terrible
willy_ has joined #ocaml
<TheLemonMan> 100% faster on '90 hardware :D
<Drup> not even sure, with modern compilers
<TheLemonMan> it's not bad if you assume the compiler is smart enought not to spill variables every now and then
<ggole> It's a bit annoying that you can't abstract over access to mutable things
<ggole> Eg there's no incf for array elements or mutable record fields
<Drup> lenses! :D
* ggole s t a b s Drup
javamonn has quit [Remote host closed the connection]
osa1 has quit [Ping timeout: 265 seconds]
<Drup> As a short-sighted, I never go out without my lenses. :]
<ggole> I guess you'd have to hack the language up a bit
<ggole> := and incf are just ordinary functions over refs, they'd have to take a special access type or something to be generic
<ggole> And then there'd have to be a hack so that the access for a.(0) is passed in and not the value of a.(0)
<Drup> well, that's kinda what lenses are ...
<ggole> Hmm, not really
<ggole> Lenses are a strange way to produce new values in a nested way
<ggole> While you could have an access be simply a pair base * offset
helix__ has quit [Quit: Page closed]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
rgrinberg has joined #ocaml
osa1 has joined #ocaml
javamonn has joined #ocaml
jbrown has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
lobo has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
palomer has joined #ocaml
ljs_ has quit [Quit: Be back later ...]
javamonn has quit [Remote host closed the connection]
thomasga has joined #ocaml
yomimono has joined #ocaml
javamonn has joined #ocaml
<kaepora> let p,j,n,s,w=ref 0,ref 0,256,Array.make 256 0,fun s a b->let c=s.(a) in s.(a)<-s.(b);s.(b)<-c;;for i=0 to 255 do s.(i)<-i done;for i=0 to 255 do j:=(!j+s.(i)+k.(i mod 16))mod n;w s i!j;done;j:=0;while 1=1 do p:=(!p+1)mod n;j:=(!j+s.(!p))mod n;w s!p!j;print_int s.((s.(!p)+s.(!j))mod n);done
<kaepora> My smallest implementation of RC4 in OCaml :D
<dmbaturin> Why so imperative? :)
<Drup> the uglyness is strong in this one
<kaepora> dmbaturin: Would it be smaller if less imperative? :-)
<ggole> You can shave more whitespace
<dmbaturin> Possibly.
javamonn has quit [Remote host closed the connection]
<ggole> ) in can be )in
<ggole> And for i=0 to n can be for i = 0to n
<flux> for i=0 to 255 do -> for i=0to 255do
<ggole> ^
<flux> meh
<flux> well I had 'do' there as well :)
* ggole collects his all-important internet race winner points
<Drup> In fact, Array.iter(fun i->...)
<Drup> seems shorter
<flux> I was wondering if it comes shorter
<Drup> it allows you to shave off all the array accesses
thomasga has quit [Quit: Leaving.]
<flux> if it does in fact become shorter, then module A=Array might help a bit as well
<Drup> "open Array"
<Drup> ;)
<flux> oh right, forgot someone might do that.. ;-)
<kaepora> Nice!
<flux> no.. it's not nice.. it's awful :)
<ggole> Hmm, unbound value k?
thomasga has joined #ocaml
<kaepora> Drup: How would you use Array.iter?
<flux> you probably need the index to Array.iteri
<flux> and then it becomes slightly longer
<Drup> first step is to use Array.init to create the array, which eliminates the first for loop
<kaepora> let p,j,n,s,w=ref 0,ref 0,256,Array.init 256 (fun i->i),fun s a b->let c=s.(a)in s.(a)<-s.(b);s.(b)<-c;;for i=0to 255do j:=(!j+s.(i)+k.(i mod 3))mod n;w s i!j;done;j:=0;while 1=1do p:=(!p+1)mod n;j:=(!j+s.(!p))mod n;w s!p!j;print_int s.((s.(!p)+s.(!j))mod n);done
<kaepora> :D
redpoppies has left #ocaml [#ocaml]
thomasga has quit [Quit: Leaving.]
<reynir> my eyes
<ggole> let(%),p,j,n,s,w=(mod),ref 0,ref 0,256,Array.init 256(fun x->x),fun s a b->let c=s.(a)in s.(a)<-s.(b);s.(b)<-c;;for i=0to 255do j:=(!j+s.(i)+k.(i%16))%n;w s i!j done;j:=0;while 1=1do p:=(!p+1)% n;j:=(!j+s.(!p))%n; w s!p!j;print_int s.((s.(!p)+s.(!j))%n)done
thomasga has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
<kaepora> ggole: *clapclapcalp*
<reynir> you can replace 255 with n-1, but that's not shorter :P
<ggole> Oops, extra space: ))%n; w
<reynir> if you replace 255 with n it would exit with an exception after printing, right? But it's 2 characters shorter :D
<ggole> Compile with -unsafe!
<ggole> No, that would print an extra garbage line (or crash)
palomer has quit [Quit: palomer]
theblatt1 has joined #ocaml
<reynir> without -unsafe it would just print an exception to stderr, right?
theblatte has quit [Ping timeout: 256 seconds]
<Drup> let(%),p,j,n,s=(mod),ref 0,ref 0,256,Array.init 256 (fun i->i)let w a ?(c=s.(a)) b=s.(a)<-s.(b);s.(b)<-c;;for i=0 to 255 do j:=(!j+s.(i)+s.(i mod 16))%n;w i!j;done;j:=0;while 1=1 do p:=(!p+1)%n;j:=(!j+s.(!p))%n;w !p!j;print_int s.((s.(!p)+s.(!j))%n)done
<Drup> 254 chars
<Drup> I'm especially proud of the optional argument.
<ggole> Error: Only variables are allowed as left-hand side of `let rec'
<ggole> Bugger
<ggole> Drup: ah, you had the same idea of closing over the s
<ggole> But your approach actually compiles
<Drup> let(%),p,j,n,s=(mod),ref 0,ref 0,256,Array.init 256 (fun i->i)let w a ?(c=s.(a)) b=s.(a)<-s.(b);s.(b)<-c;;for i=0 to 255 do j:=(!j+s.(i)+s.(i%16))%n;w i!j;done;j:=0;while 1=1 do p:=(!p+1)%n;j:=(!j+s.(!p))%n;w !p!j;print_int s.((s.(!p)+s.(!j))%n)done
<Drup> 250!
<Drup> forgot a %
<ggole> let(%),p,j,n,s=(mod),ref 0,ref 0,256,Array.init 256(fun i->i)let w a?(c=s.(a))b=s.(a)<-s.(b);s.(b)<-c;;for i=0to 255do j:=(!j+s.(i)+s.(i%16))%n;w i!j;done;j:=0;while 1=1do p:=(!p+1)%n;j:=(!j+s.(!p))%n;w!p!j;print_int s.((s.(!p)+s.(!j))%n)done
<ggole> You missed some spaces
<ggole> That's 242
<Drup> I don't think we can do much smaller without changing the structure of the code
<kaepora> I love you guys
<kaepora> That last one doesn't work
<kaepora> Incorrect output
<Drup> oh ?
<kaepora> let k = [|75;101;121|];;
<kaepora> Correct code:
<kaepora> let(%),p,j,n,s,w=(mod),ref 0,ref 0,256,Array.init 256(fun i->i),fun s a b->let c=s.(a)in s.(a)<-s.(b);s.(b)<-c;;for i=0to 255do j:=(!j+s.(i)+k.(i%3))%n;w s i!j;done;j:=0;while 1=1do p:=(!p+1)%n;j:=(!j+s.(!p))%n;w s!p!j;print_int s.((s.(!p)+s.(!j))%n);done
<kaepora> Correct output starts with 235
<Drup> ah, you didn't include the k !
<kaepora> That's how you can test :-)
<kaepora> Yup
<ggole> Ah, I changed the k to s
<ggole> Because it didn't compile
<ggole> Just change it back
<ggole> Right
<Drup> Definitly should do an automatic minimizer, at least for the whitespaces.
Haudegen has joined #ocaml
<kaepora> let w a?
<kaepora> Genius
<kaepora> *clap clap clap*
<Drup> yeah, I'm very proud of the optional argument
thomasga has quit [Quit: Leaving.]
<ggole> wa?, indeed
Gama11 has joined #ocaml
Gama11_ has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
thomasga has joined #ocaml
willy_ has quit [Remote host closed the connection]
axiles has joined #ocaml
jeffmo has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
thomasga has quit [Quit: Leaving.]
Denommus has joined #ocaml
nullcat_ has joined #ocaml
thomasga has joined #ocaml
Tekilla has joined #ocaml
Denommus has quit [Ping timeout: 256 seconds]
freling has joined #ocaml
yomimono has quit [Ping timeout: 245 seconds]
manizzle has quit [Ping timeout: 250 seconds]
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
smtb has joined #ocaml
mengu has joined #ocaml
AlexRussia has quit [Ping timeout: 265 seconds]
jeffmo has quit [Quit: jeffmo]
badkins has joined #ocaml
jeffmo has joined #ocaml
slash^ has quit [Quit: Leaving.]
struktured has quit [Ping timeout: 256 seconds]
freling has quit [Quit: Leaving.]
freling has joined #ocaml
jeffmo has quit [Ping timeout: 246 seconds]
jeffmo has joined #ocaml
Hannibal_Smith has joined #ocaml
TheLemonMan has joined #ocaml
freling has quit [Quit: Leaving.]
struktured has joined #ocaml
Submarine has quit [Ping timeout: 272 seconds]
k1000 has quit [Ping timeout: 240 seconds]
k1000 has joined #ocaml
Denommus has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
javamonn has joined #ocaml
yomimono has joined #ocaml
dev_ss has joined #ocaml
srcerer has quit [Read error: Connection timed out]
srcerer has joined #ocaml
dev_ss has quit [Remote host closed the connection]
pobivan has quit [Quit: pobivan]
larhat has quit [Quit: Leaving.]
jeffmo has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
jeffmo has joined #ocaml
larhat has joined #ocaml
smtb has quit [Quit: Page closed]
swgillespie has joined #ocaml
struktured has quit [Ping timeout: 276 seconds]
larhat has quit [Quit: Leaving.]
Night_Elf has joined #ocaml
<Night_Elf> Hi all. There is this message which comes up when I try to run make for a small piece of software I need built. the message is: ocamlfind: Package `re.str' not found
<Night_Elf> How can I fix this?
jeffmo has quit [Ping timeout: 272 seconds]
lopex has joined #ocaml
<jcloud> Is there supposed to be a package `re.str’?
<Night_Elf> jcloud: I don't know. I know nothing of ocaml and related. This was a message I saw while I was looking to build https://github.com/xapi-project/wsproxy for a problem I have with Xen consoles which don't display in XenOrchestra. I have come to understand the webinterface uses wsproxy for tunneling the consoles.
MercurialAlchemi has quit [Ping timeout: 255 seconds]
ggole has quit []
<reynir> opem install re
<reynir> opam
<Night_Elf> reynir: I get a command not found for 'opam'.
<Night_Elf> I did install ocaml with "apt-get install ocaml" and it got a few packages.
<reynir> sorry, I'm watching a movie :)
<Night_Elf> reynir: ok np
Simn has joined #ocaml
antegallya has joined #ocaml
tani has quit [Quit: Verlassend]
javamonn has quit [Remote host closed the connection]
mengu has quit []
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gbluma has joined #ocaml
ontologiae has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
HrafnA has joined #ocaml
javamonn has joined #ocaml
rand000 has quit [Quit: leaving]
soultadu has joined #ocaml
Gama11 has quit [Read error: Connection reset by peer]
soultadu has left #ocaml ["Quit"]
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml
<dmbaturin> Night_Elf: opam.ocaml.org. There's a binary installer that works with any distro.
<dmbaturin> Also, opam can install ocaml compilers and maintain multiple versions of the compiler on the same machine (you can switch between them).
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
antegallya1 has joined #ocaml
antegallya has quit [Ping timeout: 264 seconds]
antegallya1 has quit [Ping timeout: 264 seconds]
lobo has quit [Quit: leaving]
osa1 has quit [Ping timeout: 256 seconds]
avsm has joined #ocaml
javamonn has quit [Read error: Connection reset by peer]
javamonn has joined #ocaml
zaquest has quit [Read error: Connection reset by peer]
antegallya has joined #ocaml
Kakadu has quit [Remote host closed the connection]
zaquest has joined #ocaml
avsm has quit [Quit: Leaving.]
ontologiae has quit [Ping timeout: 256 seconds]
osa1 has joined #ocaml
<Denommus> Does this channel have a OCaml top-level bot? If not, why?
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<thizanne> Denommus: no it doesnt, and probably mainly because no one did it
<Denommus> Hm. Ok.
<zozozo> Denommus: for security purposes you'd most likely want to prevent accesse to some modules such as Sys or Unix, or at least forbid some functions (to avoid users messing with your file system for instance), and that would be annoying to do I think
<zozozo> probably why nobody did it yet
<Denommus> Yeah, the lack of typed IO probably makes that harder
<Denommus> #haskell 's bot simply ignores IO
<zozozo> also, I don't see much use to such a bot, since everyone with ocaml installed has access to the toplevel
<dmbaturin> It's probably easy to ignore IO by shadowing a bunch of names, and prevent infinite loops and memory hogs by running that code in a separate thread with time limit. But I doubt such a bot is all that useful for ocaml, since there's a fully functional web top level.
<dmbaturin> I mean http://try.ocamlpro.com/
<Denommus> Well, my computer is broken XD
<dmbaturin> Most Haskell online REPLs are not very useful IMHO, since they don't allow you to create bindings.
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
Simn has quit [Quit: Leaving]
c74d is now known as Guest32371
Guest32371 has quit [Read error: Connection reset by peer]
c74d has joined #ocaml
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml