munga has quit [Read error: 145 (Connection timed out)]
kaustuv_ has joined #ocaml
kaustuv_` has quit [Read error: 60 (Operation timed out)]
rwmjones_lptp has quit ["This computer has gone to sleep"]
antegallya has joined #ocaml
antegallya has quit [Client Quit]
tmaeda is now known as tmaedaZ
atol has quit [Read error: 131 (Connection reset by peer)]
verte has joined #ocaml
_unK has quit [Remote closed the connection]
verte is now known as verte-work
palomer has quit [Read error: 110 (Connection timed out)]
eldragon has left #ocaml []
travisbrady has quit []
tmaedaZ is now known as tmaeda
travisbrady has joined #ocaml
mfp has quit [Read error: 110 (Connection timed out)]
mfp has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
valross has joined #ocaml
caligula_ has joined #ocaml
thrasibule has joined #ocaml
caligula__ has quit [Read error: 110 (Connection timed out)]
thrasibule_ has joined #ocaml
thrasibule has quit [Read error: 104 (Connection reset by peer)]
verte-work has quit [Remote closed the connection]
verte-work has joined #ocaml
travisbrady has quit [Read error: 60 (Operation timed out)]
tmaeda is now known as tmaedaZ
travisbrady has joined #ocaml
tmaedaZ is now known as tmaeda
verte-work has quit ["~~~ Crash in JIT!"]
verte has joined #ocaml
BigJ2 has joined #ocaml
mjonsson has quit [Remote closed the connection]
Alpounet has quit ["Leaving"]
valross has quit [Remote closed the connection]
verte has quit ["~~~ Crash in JIT!"]
mishok13 has joined #ocaml
jonafan has quit [Read error: 104 (Connection reset by peer)]
julm has joined #ocaml
ttamttam has joined #ocaml
valross has joined #ocaml
kaustuv_` has joined #ocaml
valross has quit [Read error: 110 (Connection timed out)]
valross has joined #ocaml
kaustuv_ has quit [Read error: 110 (Connection timed out)]
Submarine has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has quit ["aunt jemima is the devil!"]
Vital303 has joined #ocaml
Submarine has joined #ocaml
BiDOrD has quit [Read error: 110 (Connection timed out)]
BiDOrD has joined #ocaml
valross has quit ["Ex-Chat"]
verte has joined #ocaml
ikaros has joined #ocaml
rwmjones_lptp has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
ikaros has joined #ocaml
waleee_ has joined #ocaml
waleee_ has quit [Client Quit]
waleee has joined #ocaml
<waleee>
quick question: why doesn't Array.make_matrix work with other types than int (I'm using ocaml 3.11.1) ? Array.make x ( Array.make x here_is_the_type) works
<waleee>
ehm ... nevermind
albacker has joined #ocaml
tmaeda is now known as tmaedaZ
<flux>
:)
Associat0r has quit []
thrasibule_ has quit [Read error: 60 (Operation timed out)]
thrasibule has joined #ocaml
ztfw has joined #ocaml
thrasibule has quit [Read error: 110 (Connection timed out)]
travisbrady has quit [Read error: 145 (Connection timed out)]
mrvn has joined #ocaml
<mrvn>
Hi.
rwmjones_lptp has quit ["This computer has gone to sleep"]
<mrvn>
How do I get a char as signed int? How do I convert 2 chars to signed 16bit int?
tmaedaZ is now known as tmaeda
<mrvn>
i.e. how to sign extend 8/16 bit to 31
<thelema>
if c land 127 then c lor min_int + 127 else c
<thelema>
err, land 128
<thelema>
c land 128 != 0
<mrvn>
Currently I have if c >= 128 then c - 256 else c
<thelema>
c-256? somehow I don't think that's right
<mrvn>
128 -> -128, 255 -> -1
<mrvn>
I was hoping for something that would make the compiler emit a sign extend opcode for the cpu.
<thelema>
C
<mrvn>
calling a C function is way to expensive
verte has quit ["~~~ Crash in JIT!"]
<thelema>
then you're stuck with this, unless you want to extend the ocaml code gen
<mrvn>
:( Too bad.
<mrvn>
Any tip for 32bit unsigned int?
<mrvn>
and 64bit unsigned come to thing of it
* thelema
looks in codegen
waleee has quit ["leaving"]
_andre has joined #ocaml
<mrvn>
WTF? 'int_of_char str.[off]; str.[off] <- char_of_int v' is slower than external get_uint8_le : string -> int -> int = "get_8_le_unsigned" "noalloc"
<mrvn>
external set_uint8_le : string -> int -> int -> unit = "set_8_le_unsigned" "noalloc"
<mrvn>
38s vs. 45s for 10000000 repeats on 64 bytes.
<mrvn>
aeh, 45s vs 38s I mean.
<thelema>
mrvn: interesting... I guess C isn't that slow
<mrvn>
but faster?
<thelema>
char_of_int should be free, but mutating the string might be expensive in ocaml
<thelema>
it shouldn't be that expensive, but apparently more than in C
<mrvn>
why? strings are mutable. doesn't copy it.
<thelema>
shifting & masking?
waleee has joined #ocaml
<thelema>
it's not starting off with a char, so alignment...
<mrvn>
huh?
<thelema>
it starts with a wird having 31-bits of data
<mrvn>
char_of_int isn't free as it checks bounds. But s.[x] <- c sould just write the byte.
<thelema>
it has to turn that into a char
<mrvn>
The c code too.
<mrvn>
t1 = Int_val(ml_x);\
<thelema>
hmmm...
<mrvn>
I don't range check so that might make C faster.
* thelema
knows timsort, but can't see an easy way to reduce its complexity with fewer rounds or anything..
<mrvn>
thelema: use a fibbonachi heap or so.
<thelema>
hmm, I have code for that, but I have to be able to update the rankings, and that seemed... hard
<mrvn>
so you need a priority queue where the priority changes over time?
<thelema>
yes, and I've written one, but it's not functional - I'm doing branch and bound and want different priority orderings in different subtrees
tvn2009 has joined #ocaml
<mrvn>
I've once done a bubble-heap. When I update a priority the item can move in the heap up or down a bit. Like a buble rising or falling.
<mrvn>
Seems to work well when the priorities change often but little.
<thelema>
yes, that's what I'm doing. I learned it as "percolate"
<thelema>
percolate up/down
<thelema>
but this is very non-functional. At least it's pretty cheap to clone the heap array and lookup array
ikaros has quit ["Leave the magic to Houdini"]
<mrvn>
pretty impossible otherwise.
<thelema>
ok, thanks for thinking about it.
<mrvn>
To be functional you need to always walk till the root.
<mrvn>
And then you have a tree. Inserts must start at the root, go down and come back too.
<thelema>
the walking isn't a problem, the problem is how to do lookups into the tree?
<thelema>
remember a binary path (left, right, left, left)?
<mrvn>
remember a key. lookup in log n
<mrvn>
or rther a pointer to the priority
<mrvn>
I would think hard about making this functional.
<thelema>
with a pointer to the priority, I can update the priority, but I have to change the tree, and to do this, I have to have either a doubly-linked tree (not very functional) or a path...
BiDOrD has quit []
<thelema>
maybe the path idea isn't bad.
<thelema>
although updating the paths will be a pain.
<mrvn>
thelema: you get the priority, then you search the tree for the priority to remove the item and then reinsert it.
<mrvn>
a balanced tree with key (priorty, unique id)
<thelema>
search the tree? I'm using a binary tree, not a heap?
<mrvn>
if you can have priority collisions
<thelema>
I will have lots of priority collisions
<mrvn>
thelema: The problem is you can use an array for functional unless you copy the array every time.
<mrvn>
can't
<thelema>
yup.
<mrvn>
that only leaves you with a tree
<thelema>
maybe I need to spend more time preventing array copying
infoe has joined #ocaml
<thelema>
It's possible to use trees for heaps - it's the example in 2.1 of the manual
<mrvn>
Why do you need it to be functional?
<thelema>
so I can have different priorities of the "next" search item in different parts of my search tree
<mrvn>
so when the priority of an item changes you copy the item?
<thelema>
when I take a right branch, I copy the whole heap structure so I can reweight it.
<mrvn>
oehm, how do you do that with an array?
<mrvn>
The right branch is like off+1, off+3, off+4, off+8, off+9, off+10, off+11, off+16, off+17...
<thelema>
? Array.copy
<mrvn>
(ups, thats left)
<thelema>
"
<thelema>
"take a right branch" refers to the higher-level search algorithm going on in a *huge* tree
<mrvn>
oh, misread. Thought you only cpied the branch but you said whole heap.
<mrvn>
Maybe use a b-tree where each node contains a heap? Would that be workable?
<mrvn>
The nice part is that it supports "decrease key"
<thelema>
I have to increase keys too...
<mrvn>
If you increase a key you might have to cut all children. I think that violates the amortized costs.
<mrvn>
So might be a bit more expensive than thought
<thelema>
I can try it with judt decreasing keys, but I really want to shuffle around priorities.
<thelema>
I want to avoid 1st and second neighbors, but head towards 3rd nrighbors
<mrvn>
You also have to work out how to eliminate the double linked lists or copy them completly.
<thelema>
(in a graph)
<thelema>
yes, I'll look down other paths.
<mrvn>
Each node has at most log(n) children and I think the height is similary bound. Might take log n * log n copies to make it functional.
<mrvn>
The "functional" part makes it really hard. I think all the normal algorithms you learn about are not functional.
<thelema>
yup
<thelema>
I'm going to see if I can mutate the state one way, and reverse the mutations as I backtrack...
<mrvn>
brendan: unless you work on a Indy over serial console, in which case it goes into the bios.
<mrvn>
ups
waleee has quit ["Lost terminal"]
_unK has joined #ocaml
lutter has joined #ocaml
tmaeda is now known as tmaedaZ
ttamttam has quit ["Leaving."]
ztfw has quit [Connection reset by peer]
ztfw has joined #ocaml
lutter has quit ["Leaving."]
mishok13 has quit [Read error: 60 (Operation timed out)]
_zack has quit ["Leaving."]
<mfp>
mrvn: string does have unsafe_get and _set, are you referring to this? " So most of the time I want unsafe calls and String does not have any." ??
<mfp>
there's also Char.unsafe_chr : int -> char fwiw
<mrvn>
Indeed it does. Why is that left out of the docs?
<mfp>
mrvn: if the extra indirection is OK, you can use an OCaml value pointing to the string residing outside the caml heap, with a finaliser that frees it
<mfp>
that way the un-managed string can be GCed
<mrvn>
mfp: then I need a C wrapper that follows the indirection
<mfp>
then, you get rid of the indirection by doing:
<mfp>
with_buffer (fun s -> .... )
<mrvn>
which might let the string escape the scope, then it gets freeed and later used
<mfp>
which is written in such a way that the wrapper is not GCed before the func is done
<mfp>
true, you'd have to be disciplined
<mrvn>
can't garanty that in the lib.
<mfp>
BUT
<mrvn>
Currently I have unsafe_string : buffer -> string
<mfp>
nothing
<mfp>
what are you writing?
<mrvn>
a filesystem + libfuse bindings + lbaio bindings
<flux>
mrvn, you could use monads \o/ ?
<mrvn>
I actualy have all that already. Just making it nicer and cleaner now so it can be packaged and used by others too.
<mfp>
they cannot prevent escape
<mrvn>
flux: How does that get around the problem of having a chunk of unmovable memory to read/write data from/to?
<flux>
with_buffer (fun () -> get 4 >>= fun ch -> set 3 ch) etc..
<flux>
when you don't have any actual handle to the data, you cannot escape it
<mfp>
oh
<mfp>
but >>= would kill perf
<flux>
that might be :)
<mrvn>
and how does that access the string if it doesn't have a handle?
<flux>
mrvn, it provides generic accessors for any 'buffer' that has been 'with_buffer'ed
<mrvn>
that still needs the buffer
<mfp>
mrvn: it'd work like the state monad
<mfp>
is camlp4 out of the question?
<mrvn>
It needs to cache the string behind the buffer somehow and that means its lifetime is different to that of the buffer. Unless it keeps them both.
<mrvn>
type buffer = string_freeer_custom_block * string would work at the cost of the extra indirection.
<mrvn>
as hidden type so one can't just pick out the string.
<mrvn>
abstract I mean
<flux>
basically what you can do, is to have a with_buffer -function and prevent escaping by invalidating the buffer object after with_buffer finishes?
<flux>
but that requires an extra level of indirection which you don't want?
Submarine has quit ["Leaving"]
<mrvn>
that would leave objects around that give errors at runtime.
tvn2009 has quit [Read error: 110 (Connection timed out)]
<flux>
yes, but I think that's acceptable..
<mrvn>
Really not.
<flux>
if it isn't, let the user write the code in Coq :P
<flux>
or patch linear typing into ocaml
<mrvn>
The above as abstract type manages it without creating broken objects.
<mrvn>
The user will only get the abstract type and that holds the custome block and fake string alive. When the abstract type gets freed the custom blocks frees the string.
<flux>
that's ok, if it's not a problem that the block has a too long lifetime
onigiri has joined #ocaml
<mrvn>
No longer than a plain string would have.
ttamttam has joined #ocaml
<mrvn>
(*COcamlunsafe uint8 le 19.49617.43314.843
<mrvn>
So C is 31% slower getting a byte.
<mrvn>
And safe is 17% slower.
<mfp>
mrvn: you didn't unroll the loop, the diff is larger than that
<mrvn>
16bit unsafe is 2% slower than C
ulfdoz has joined #ocaml
<mrvn>
Unrolling 8 calls gives 14.257 vs. 14.843
<mrvn>
Unrolling 8 calls to C gives 18.713 vs 19.496
<mrvn>
Seems to help more with C
thelema has quit [Remote closed the connection]
<mfp>
wait a sec
<mfp>
you're using a HoF to time that??
<mrvn>
HoF?
<mfp>
higher-order function
<mrvn>
Yeah. That probably kills any unrolling.
<mfp>
it might even be doing caml_apply2 for the caml one
<flux>
remember to get a baseline with some function equal to nop?
<mfp>
and there's no inlining, no out-of-order execution gains
<mrvn>
for n = 0 to 10000000; do for i = 0 to 63 do ignore (oget_uint8_le s i); done; done
<mrvn>
5.002s ocaml, 6.722s C
<mfp>
still not unrolled :)
<mfp>
(fwiw, it was really using call caml_apply3)
<mrvn>
8x unrolled: C 5.606s, ocaml 4.292s
<mrvn>
16bit, 8x unrolled: C 6.652s, ocaml 10.309s
<mrvn>
let oget_uint8_le str off = int_of_char (String.unsafe_get str off)
<mrvn>
let oget_uint16_be str off = ((oget_uint8_be str off) lsl 8) + oget_uint8_be str (off + 1)
<mfp>
sometimes you get speedups by reordering computations a bit
<mfp>
like let a = get off in let b = get (off + 1) in a lsl 8 + 1
thelema has joined #ocaml
<mfp>
depends on how lucky you are
<mrvn>
That is what the compiler is for usualy.
<hyperboreean>
if I have a function that should return a socket is it safe to assume that it returns Unix.file_descr ? So I can define it into mli file?
<mfp>
+ b even
<thelema>
optimize the part of your program that takes enough time to be worth optimizing
<mrvn>
hyperboreean: what else would a socket be?
<mfp>
mrvn: yes, but ocamlopt isn't an optimizing one
<mrvn>
thelema: This going to read/write a gigs to terrabytes of data.
albacker has quit ["Leaving"]
<hyperboreean>
mrvn: I'm pretty new to ocaml, but thanks, you've answer my question
<mrvn>
hyperboreean: Look at the Unix module at the socket functions.
<thelema>
mrvn: yes, and you should write your program first, and look at where it's spending its time before writing fragile code to make some tiny part of it faster
<flux>
thelema, but maybe it's more fun to make tiny parts faster?-(
<mrvn>
thelema: well, the main part is spend in sha1_buffer. But I can't do anything there.
<thelema>
mrvn: then you work on the next part.
<mrvn>
The other main part is memcpy of string to Aio.buffer which I can get rid of by having nice access functions directly to the buffer.
<thelema>
flux: agreed, I do have fun optimizing, and I'm reminding myself not to work hard on something that doesn't matter.
<mrvn>
i.e. what we were talking about. :)
<mrvn>
It is too bad the code must run on a VIA Eden (32bit single core). I could throw away int32 and stuff the sha1_buffer into worker threads on my 64bit dual core Atom330.
<mrvn>
dual core, dual thread even.
ikaros has joined #ocaml
peddie has quit [Remote closed the connection]
peddie has joined #ocaml
_JusSx_ has joined #ocaml
ulfdoz has quit [Remote closed the connection]
ulfdoz has joined #ocaml
julm has quit [Read error: 60 (Operation timed out)]
Submarine has joined #ocaml
julm has joined #ocaml
tvn2009 has joined #ocaml
Submarine_ has joined #ocaml
_JusSx_ has quit ["leaving"]
spicey has joined #ocaml
spicey has left #ocaml []
spicey has joined #ocaml
Submarine has quit [Success]
<spicey>
How can I store together in some iterable structure a bunch of objects which have a common parent class, but have additional specific methods added down the hierarchy? A trivial failing example: http://codepad.org/phdz3cxZ
<wolfslack>
It is possible to use C and C++ libraries in Ocaml without too much hazzle?
<wolfslack>
Im deciding what language to learn next at the moment.
<Camarade_Tux>
yes it's possible
<Camarade_Tux>
there are several programs that can automate the bridge too
<Camarade_Tux>
wolfslack: do you have any specific library in mid?
<Camarade_Tux>
*mind
<wolfslack>
well, im curious about Qt integration and just C, C++ in general. The libraries for these oldies are quite wast :)
ulfdoz has quit [Read error: 110 (Connection timed out)]
<wolfslack>
And after learning ML i would like to stay in the environment.
<mrvn>
c++ isn't that trivial though with all the classes. Hard to get that to map to ocaml classes sometimes.
<Camarade_Tux>
qt in ocaml is not ready unfortunately
<Camarade_Tux>
there is at least someone who used ocaml for core code and python for gui
_JusSx__ has joined #ocaml
<wolfslack>
Thats one way to enforce MVC i suppose
_JusSx__ has quit [Client Quit]
Alpounet has quit [Remote closed the connection]
_JusSx_ has quit [Read error: 110 (Connection timed out)]
<wolfslack>
well ocaml definetly looks slick.
<wolfslack>
how does it compile versus SML on Milton ?
<Camarade_Tux>
it is :P
<Camarade_Tux>
what do you mean? speed of code?
Alpounet has joined #ocaml
<wolfslack>
yes
<Camarade_Tux>
mlton is probably faster (sml, I don't know but I don't think so) but mlton takes ages to compile even simple programs (that really put me off)
<Camarade_Tux>
be warned I don't have much experience with them so I may be wrong
<Camarade_Tux>
hahaha, python is slower than javascript-v8 on the great language shootout :)
<wolfslack>
wow Oo
<BigJ>
for some reason array.sort is sorting my array and gets rid of the last element
<Camarade_Tux>
huh ?
<wolfslack>
Python is an interesting hybrid, don't think i dare to learn it.
<Camarade_Tux>
my number one reason for not learning it is I don't like its syntax (and already have ocaml)
_JusSx_ has joined #ocaml
<wolfslack>
Well i might be on the wagon ;)
rwmjones_lptp has joined #ocaml
spicey has quit ["Leaving"]
hto has joined #ocaml
Associat0r has quit [wolfe.freenode.net irc.freenode.net]
eldragon has quit [wolfe.freenode.net irc.freenode.net]
sramsay has quit [wolfe.freenode.net irc.freenode.net]
travisbrady has quit [wolfe.freenode.net irc.freenode.net]
Amorphous has quit [wolfe.freenode.net irc.freenode.net]
mfp has quit [wolfe.freenode.net irc.freenode.net]
Asmadeus has quit [wolfe.freenode.net irc.freenode.net]
flux has quit [wolfe.freenode.net irc.freenode.net]
bohanlon has quit [wolfe.freenode.net irc.freenode.net]
mehdid has quit [wolfe.freenode.net irc.freenode.net]
rwmjones_lptp has quit [wolfe.freenode.net irc.freenode.net]
BigJ2 has quit [wolfe.freenode.net irc.freenode.net]
struktured has quit [wolfe.freenode.net irc.freenode.net]
jknick has quit [wolfe.freenode.net irc.freenode.net]
schme has quit [wolfe.freenode.net irc.freenode.net]
mlh has quit [wolfe.freenode.net irc.freenode.net]
tonyIII__ has quit [wolfe.freenode.net irc.freenode.net]
mbishop has quit [wolfe.freenode.net irc.freenode.net]
Xteven has quit [wolfe.freenode.net irc.freenode.net]
tiz has quit [wolfe.freenode.net irc.freenode.net]
Vital303 has quit [wolfe.freenode.net irc.freenode.net]
ozzloy has quit [wolfe.freenode.net irc.freenode.net]
Pepe_ has quit [wolfe.freenode.net irc.freenode.net]
ygrek has quit [wolfe.freenode.net irc.freenode.net]
Alpounet has quit [wolfe.freenode.net irc.freenode.net]
Submarine_ has quit [wolfe.freenode.net irc.freenode.net]
julm has quit [wolfe.freenode.net irc.freenode.net]
jonafan has quit [wolfe.freenode.net irc.freenode.net]
smimou has quit [wolfe.freenode.net irc.freenode.net]
M| has quit [wolfe.freenode.net irc.freenode.net]
jimmyb2187 has quit [wolfe.freenode.net irc.freenode.net]
ezra has quit [wolfe.freenode.net irc.freenode.net]
Associat0r has joined #ocaml
eldragon has joined #ocaml
sramsay has joined #ocaml
travisbrady has joined #ocaml
Amorphous has joined #ocaml
mfp has joined #ocaml
Asmadeus has joined #ocaml
bohanlon has joined #ocaml
flux has joined #ocaml
rwmjones_lptp has joined #ocaml
Alpounet has joined #ocaml
ygrek has joined #ocaml
Submarine_ has joined #ocaml
julm has joined #ocaml
jonafan has joined #ocaml
Vital303 has joined #ocaml
BigJ2 has joined #ocaml
smimou has joined #ocaml
mehdid has joined #ocaml
ezra has joined #ocaml
M| has joined #ocaml
struktured has joined #ocaml
Xteven has joined #ocaml
Pepe_ has joined #ocaml
mbishop has joined #ocaml
jimmyb2187 has joined #ocaml
mlh has joined #ocaml
schme has joined #ocaml
jknick has joined #ocaml
ozzloy has joined #ocaml
tonyIII__ has joined #ocaml
tiz has joined #ocaml
ttamttam has quit ["Leaving."]
<wolfslack>
whats going on in this channel
ygrek has quit [Remote closed the connection]
<Camarade_Tux>
netsplit :)
<Camarade_Tux>
happened everywhere on the freenode channel, a connectivity problem at the server level
<wolfslack>
aha
ztfw has quit [Remote closed the connection]
<Camarade_Tux>
does anyone have a Mastermind solver? mldonkey has "reliable sources" which pinpoints bad sources which corrupted your download (since several sources contribute to a single transfer)
slash_ has joined #ocaml
<BigJ>
is there anyway to tell the Array.sort function to only sort a certain # of elements in an array?
<Camarade_Tux>
no, it wouldn't be a sort ^^
<Camarade_Tux>
BigJ: why?
<wolfslack>
The list wouldnt be sorted after.
<wolfslack>
why don't just cut out a piece of the array, sort it and glue it back on.
<BigJ>
wolfslack, it might be easier to use a for loop to sort to the length I want...
<mrvn>
Camarade_Tux: I do
<Camarade_Tux>
mrvn: will you mind sharing it? (but not today, I'm going to bed now ;) )
<Camarade_Tux>
BigJ: why do you want to sort only parts of the array? (not saying you don't have a good reason to)
<BigJ>
Camarade_Tux, because I initial define an array to have a max_length = 100; I think have a function that adds individual elements 1 at a time and I track the length of the array by a seperate int value
<BigJ>
so I have all values in the array initialized to 0
<mrvn>
initialize them to max_int
<BigJ>
and I only want to sort the number of elements I have placed into the array and then place them in order from smallest to largest
<wolfslack>
BigJ well, if you glue off and on you can use any algorithm you want. Loops make me thing of complete partial reinplementations.
<wolfslack>
things = think
<mrvn>
Camarade_Tux: Usage is "./Mastermind abcd" where abcd are the possible colors. The width is hardcoded.
rwmjones_lptp has quit ["This computer has gone to sleep"]
<Camarade_Tux>
BigJ: seems a very inefficient way to create your arrays
* mrvn
likes merge sort
<BigJ>
Camarade_Tux, I agree
<BigJ>
but it is for the purposes of an assignment
<mrvn>
BigJ: and initialzing with max_int and just sort them all isn't an option?
<wolfslack>
first you sort it with bubble sort, then use iteration to access elements.
<mrvn>
or are you supposed to implement your own sort?
<mrvn>
wolfslack: I prefer spaghetti sort.
<wolfslack>
everytime you insert a new element, just run bubble sort again. And whoila. A well-maitained sorted array.
<Camarade_Tux>
mrvn: the logic in a mastermind solver helps find "bad" entries among several ones with only knowing the global effect
<BigJ>
I can sort in any manner
<mrvn>
Camarade_Tux: logic? I just do exhaustive search.
<Camarade_Tux>
mrvn: I'd like to have that for my browser :) (I'm using a C library)
<Camarade_Tux>
mrvn: argh :P
<wolfslack>
Blindsort?
<Camarade_Tux>
mrvn: i'll have to check anyway, thanks :)
* Camarade_Tux
needs to go to bed now
<Camarade_Tux>
BigJ: hmmm, that's weird
<Camarade_Tux>
BigJ: but Array.sort is probably bad for your thing, a bubble sort sounds better there
* Camarade_Tux
poofs
<mrvn>
Camarade_Tux: I generate all possible combinations. Then I find the combination so that no matter what the answere is I'm left with the least number of combinations and I print that as guess.
<mrvn>
Input black and white pins, filter only combinations matching that b/w count and repeat.
<mrvn>
Camarade_Tux: How else do you want to solve it?
tmaedaZ is now known as tmaeda
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
<Camarade_Tux>
mrvn: I think that fits what I need
<Camarade_Tux>
mrvn: as for how else, can I answer on tomorrow after sleeping? :D
<mrvn>
Camarade_Tux: Mine takes |colors|^holes^2 time and |colors|^holes space.
ikaros has joined #ocaml
julm has quit ["leaving"]
ikaros has quit ["Leave the magic to Houdini"]
<travisbrady>
anyone know of online docs anywhere for Jane Street's Core?