cjeris changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
<eu-prleu-peupeu>
oi holo!
<eu-prleu-peupeu>
do you code in ocaml ?
<eu-prleu-peupeu>
i found out this language the other day, seems interesting :)
<holo>
eu-prleu-peupeu, nao.. estou a usar caml light.. e' muito bom, mas e' parecido. mas usa ocaml :>
<holo>
eu-prleu-peupeu, don't give up easily on ocaml!! it is very nice but if you are not used to declarative languages, it may seem weird
<holo>
it produces very general, elegant and maintainable algorithms
<eu-prleu-peupeu>
:D
<eu-prleu-peupeu>
how about speed ?
<holo>
dunno sorry
<eu-prleu-peupeu>
:)
<holo>
ha
<holo>
lol
<holo>
thought speed was a language
<holo>
:x
<eu-prleu-peupeu>
és português ?
<eu-prleu-peupeu>
hehehe
<holo>
yep
<holo>
ua
<holo>
ist ne?
<eu-prleu-peupeu>
sweet, me too
<eu-prleu-peupeu>
yeps
<eu-prleu-peupeu>
i've been reading about ocaml, and found this on wikipedia:
<eu-prleu-peupeu>
MetaOCaml[4] is a multi-stage programming extension of OCaml enabling incremental compiling of new machine code during runtime.
<eu-prleu-peupeu>
this seems quite powerfull...
<eu-prleu-peupeu>
this concept of "multi-stage programming"
<holo>
ok.. resumindo: em linguagens imperativas tens de alocar explicitamente memoria, em linguagens funcionais como caml, a recursividade e' algo natural, e com recursividade crias as variaveis em cada chamada.. as variaveis existem como argumentos e retornos de funcoes, produzindo assim algoritmos muito generalistas
<holo>
se ja programaste em C, .estas habituado a produzir variaveis dentro das funcoes tipo contadores, variaveis temporarias.. esquece esse codigo sujo em caml
<eu-prleu-peupeu>
sim, estou a tentar evitar isso
<holo>
:)
<eu-prleu-peupeu>
acho algumas semelhanças com lisp e scheme, dos poucos exemplos que vi de ocaml
<holo>
ve tambe haskell
<eu-prleu-peupeu>
ah sim...
<holo>
e' o que usam em lesi
<holo>
dizem que e' potente
<eu-prleu-peupeu>
o que é lesi ?
<holo>
Licen. Eng. Sistemas e informatica
<eu-prleu-peupeu>
ah okok :P
<holo>
em braga
<eu-prleu-peupeu>
very nice
<holo>
ou entao escolhe a que tiver mais libs ;)
<holo>
eu so tenho experiencia em caml
<eu-prleu-peupeu>
hehehe, ou bindings para C :)
<eu-prleu-peupeu>
caml é fixe para se aprender né ?
<holo>
esquece isso.. quando lhe apanhares o gosto, vais esquecer o C
<holo>
caml light e' fixe para aprender, ocaml e' mesmo usado para producao
<holo>
Mas se queres aprender podes comecar a usar ocaml directamente
<holo>
Eu so' estou a usar caml light porque a univ. me obriga
<eu-prleu-peupeu>
eu estou muito ligado ao c++, mas sinto falta de algumas cenas, como lambdas, e reflecção
<holo>
c++ e' uma heresia
<eu-prleu-peupeu>
hehehe
<eu-prleu-peupeu>
eu gosto bastante, é muito muito rápido se for bem feito
<holo>
mas cada um tem os seus gostos
<eu-prleu-peupeu>
claro :)
<eu-prleu-peupeu>
acho que um gajo não pode viver agarrado a uma determinada linguagem
<eu-prleu-peupeu>
sei lah, eh importante escolher uma que se ajuste ao problema em causa
<holo>
Sim, rapidez e' bom, mas com prog. funcional consegues algoritmos muito rapidos (nao tao rapidos como c ou c++) mas o pensamento e' muito mais alto nivel
<holo>
E a beleza duma linguagem e' isso mesmo
<eu-prleu-peupeu>
ya, isso que me interessa
<eu-prleu-peupeu>
conseguir obter um tempo de desenvolvimento muito maior, não sacrificando muito a velocidade, e a leitura/manutenção de código
<holo>
entao escolheste bem o paradigma
<holo>
depois de te habituares, os algoritmos de caml vao parecer extremamente legiveis e mantiveis
<holo>
e com pouco codigo, vais fazer muita coisa
<eu-prleu-peupeu>
:D
<eu-prleu-peupeu>
very nice good
<eu-prleu-peupeu>
entao tass bem
<eu-prleu-peupeu>
vi que o ocaml tem bindings para o QT e para o openGL, e tb me atraiu
<eu-prleu-peupeu>
a malta aqui tb anda a começar com a febre do haskell
<eu-prleu-peupeu>
foi o lisp, depois mudou para o ruby, e agora é o haskell que está aí a infectar
<holo>
exactamente.. vai por ai.. escolhe a que tem mais libs para os problemas que queres resolver
<Smerdyakov>
Excuse me.
<Smerdyakov>
This is an English channel!
<eu-prleu-peupeu>
sorry
<holo>
sorry
<eu-prleu-peupeu>
lets switch to english
<eu-prleu-peupeu>
we were just saying bad things about ocaml, and speaking of how much better C and C++ are compared to ocaml
<Smerdyakov>
Neat.
<holo>
xD
<mbishop>
heh
<holo>
eu-prleu-peupeu, i just have experience in c/c++,caml,prolog,python,pascal (ouch), matlab (yuck)
<holo>
never tried lots of stupid and meaningless parenteses
<eu-prleu-peupeu>
its too long, i haven't managed to get time to watch it yet...
<holo>
he should cut his "barba"
<holo>
omg
<eu-prleu-peupeu>
yes, looks like fidel castro
<eu-prleu-peupeu>
a little fatter
<eu-prleu-peupeu>
something like "fidel goes to usa..."
<holo>
:>
<holo>
the audience is very serious.. they don't lauph at all
<holo>
oh.. they lauphed.. he said a bad word
<holo>
"we wanna talk abut behavior"
<holo>
so this is the canadian accent!!
<eu-prleu-peupeu>
hehehe
mikeX has quit ["leaving"]
holo has quit ["This computer has gone to sleep"]
eu-prleu-peupeu has left #ocaml []
G_ has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
pantsd has quit ["Leaving."]
pantsd has joined #ocaml
Demitar has joined #ocaml
EliasAmaral has quit [Remote closed the connection]
Demitar has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
<pango_>
In case he returns, one can match the empty stream with [<>]
<pango_>
I guess he's getting a match failure, not End_of_file
G_ is now known as G
Smerdyakov has quit ["Leaving"]
ygrek has joined #ocaml
seafood has joined #ocaml
<seafood>
Hi guys. A while back someone show me a cool VI OCaml keyboard short cut that would allow you to press a key and be taken from the "let" part of an expression to the corresponding "in" part, bypassing all nested lets.
<seafood>
I don't use VI and was hoping there might be something familiar in one of the Emacs modes. Know of any?
kosmikus has quit [Read error: 104 (Connection reset by peer)]
kosmikus has joined #ocaml
<flux>
hm, I haven't encountered one
<flux>
I suppose tuareg mode could be hacked to do that, as it must for indentation purposes have the required information
Mr_Awesome has quit ["...and the Awesome level drops"]
Riesz has joined #ocaml
<mrvn>
elisp is turing complete so surely you can do it somehow.
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
<flux>
I was thinking inthe sense "could be hacked without adding much more code" :)
<flux>
syntax analysis being "much more code"..
<mrvn>
that tuareg should already have
<seafood>
Aren't most languages turing complete?
<mrvn>
usefull ones.
<mrvn>
A lot are unknown though
<flux>
turing completeness needs not to be a requirement for a language to be useful, though.. there is some research on non-turing complete languages, which allow statically determining for example the amount of memory consumed, or time spent
<mrvn>
not being able to write "let rec loop () = loop ()" is awfully limiting though. :)
<flux>
well that's totally useless construct without side effects :)
<mrvn>
flux: That is a wait forever
<mrvn>
It is even partially correct for any given problem.
<mrvn>
:)
<mrvn>
partially correct == for all cases where it terminates it gives the right output
<flux>
it would sometimes be nice if the compiler warned abut such constructs.. and infact the type inference process sometimes does that
<flux>
return value being 'a instead of the expected..
<mrvn>
right, I saw that recently for the first time.
<mrvn>
But isn't that when a function will always return an exception?
<flux>
no
<flux>
well, it might not return at all :)
<flux>
it's the same thing, sort of..
<mrvn>
# let rec loop () = loop ();;
<mrvn>
val loop : unit -> 'a = <fun>
<mrvn>
no warning from the toplevel.
<mrvn>
Doesn't seem to be very good at it then.
<mrvn>
Maybe my ocaml is too old.
<flux>
I sometimes inspect the types interactively
<flux>
and I've actually spotted such a bug
<flux>
(obviously a short test would've revealed it also..)
<mrvn>
When my project gets big enough then I create mli files and then you spot it.
<mrvn>
Isn't "-> 'a" when 'a is not part of the argument types always a endless loop (or Obj magic)?
<flux>
actually I tried that, but this did catch it: module Foo : sig val loop : unit -> unit end = struct let rec loop () = loop () end;;
<flux>
or an exception. yes, I believe so.
<mrvn>
I wonder why exceptions aren't part of a functions tpye.
<flux>
that would be an interesting experiment
<flux>
with exception inference
<flux>
it would mean, though, that you couldn't just put any throwing functions to a list of unit -> unit functions
<mrvn>
val loop : unit -> unit * [< End_of_file ]
<flux>
with java checked exceptions quickly become boring
<flux>
but with a solid type system it might be manageable
<mrvn>
unit -> unit * [< ] is subset of unit * [< End_of_file ]
<flux>
(and type inference)
<flux>
so what would be the type of List.fold_left?
<mrvn>
C++ has this sort of. But it converts any exception not declared for the function to a generic exception.
<flux>
and you can wrap around that and wrap it to your kind of exception
<flux>
I've used that mechanism
<mrvn>
flux: ('a -> 'b -> 'a * [< 'c ]) -> 'a -> 'b list -> 'a * [< 'c ] = <fun>
<flux>
anyway, such an extension would not be backwards compatible with current programs
<flux>
it's like adding 'const' to a language that doesn't have one..
<mrvn>
I don't see that.
<mrvn>
except for mli files
<flux>
how do you mark functions that can throw anything?
<mrvn>
But you could say that "unit -> unit" and "unit -> unit * [< ]" are two different things. The former can have any exception.
<mrvn>
flux: [< 'a ]
<mrvn>
But how would you ever throw anything?
<mrvn>
That is the same as returning anything (which means it never does)
<flux>
you could have a pair of functions, where one puts functions in and another calls them
<mrvn>
Then you have an input argument with some exception type and you throw that same type.
<mrvn>
See fold_left above.
<mrvn>
That is an "throws whatever it is given"
<flux>
module DoStuff = struct let f = ref (unit -> unit) let set_f f' = f := f' let call_f () = (!f) () end
<flux>
uh, make that s/unit -> unit/fun () -> ()/
<mrvn>
The mli file would say what exceptions are allowed for f and that type gets thrown by call_f.
<flux>
yes, but you could have that module right now, and you have modules that use that module and they use locally defined exceptions
<mrvn>
For compatibility "unit -> unit" should be the same as "unit -> unit * [< 'a ]" allowing any exception.
<flux>
and anything calling call_f will also be infered to throw anything, unless they narrow it by catching _ - I think very similar to c++ constness :-)
<flux>
(with const_cast)
<mrvn>
Sure. You have to restrict the allowed exceptions to get any benefit from it.
<flux>
it's a shame ocamlexn isn't maintained
<mrvn>
The reason I would want this is so that I can make sure all exceptions are handled.
<mrvn>
And often the manual doesn't say what exception a function can throw.
<flux>
that problem has bitten me a few times
<mrvn>
Another thing I would like would be for exception to have an implicit __FILE__ and __LINE__, at least optionally.
<mrvn>
Just the other day my programm failed with Index out of bounds exception. Now try to find that.
z__z has quit [Read error: 60 (Operation timed out)]
ygrek has quit [Remote closed the connection]
<mrvn>
Python exceptions are nice that way. They give you a backtrace.
ygrek_ has joined #ocaml
<flux>
hm, ocamlc -g and export OCAMLRUNPARAM=b ?
<flux>
but that particular exception might be more difficult to find; there is a module on caml hump (?) that provides more accurate tracing or something
<flux>
I haven't used it
<mrvn>
what does that do?
<flux>
I don't know, but I'm guessing it wraps indexing etc with some other exception throwing code
<flux>
or did you refer to ocamlc -g ?
<mrvn>
-g
<flux>
it compiles with debug information
<mrvn>
No mention in the manpage
<mrvn>
Not sure if -g helps.
<flux>
and OCAMLRUNPARAM=b gives you back traces
<mrvn>
OCAMLRUNPARAM=b would help though
<flux>
well it doesn't work without -g
<mrvn>
ahh, ok.
<mrvn>
I usualy use ocamlopt though.
<flux>
try the new release, it adds backtracing for native binaries
<mrvn>
next time I run into the problem or when debian updates.
<mrvn>
for now I like my stable.
Demitar has joined #ocaml
ygrek_ has quit [Remote closed the connection]
z__z has joined #ocaml
Demitar_ has joined #ocaml
Sparkles has joined #ocaml
holo has joined #ocaml
<holo>
hi
<holo>
i make a program that says print_string "hello world";; in camllight
<holo>
then camlc -o test test.ml
<holo>
./test
<holo>
and it prints nothing
<holo>
weird is, i have a program of 335 lines and it prints things -.-
<flux>
holo, ./test; echo ?
<holo>
flux, that just prints a "\n"
<flux>
yes, correct
<flux>
one common newbie mistake is to output stuff but not output the newline
<flux>
and the prompt erases the output
<flux>
at it appears like it had output nothing
<flux>
some shells handle that issue by outputting a special character and a newline in those cases
<holo>
flux, it outputed the newline becouse you said "echo"
<flux>
I've never used camllight so there might be some other issue too
<flux>
maybe it doesn't flush output automatically on exit
Sparkles has quit []
<holo>
print_endline "bla"
<holo>
;;
<holo>
this one prints the newline
<holo>
in theory
<holo>
but it prints nothing
<holo>
but if i use it in my 335 line program, it prints
<holo>
i'm not messing with channel and stuff like that
<holo>
*channels
<flux>
such is life. the channel can be much more helpful with ocaml-related problems :)
Sparkles has joined #ocaml
<holo>
:\
<holo>
well.. this is weird anyway
<holo>
it is not an explicit behavior
<holo>
it should be explicit
<flux>
perhaps a camllight-related FAQ could be of use?
<holo>
maybe, let me see
G_ has joined #ocaml
rwmjones has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
joelr1 has joined #ocaml
<joelr1>
rwmjones: hi rich
<rwmjones>
joelr1, afternoon
<joelr1>
well, so i'm trying to install cocan wiki first on my mac laptop and then on the solaris box i use for hosting
<rwmjones>
adventurous ...
<joelr1>
i'm curious, do i always have to supply the full path to the cma with CamlLoad?
<rwmjones>
well, I think this channel is logged which is useful coz then people can find the answers to these questions via Google
<joelr1>
right
<rwmjones>
no, not with recent versions of mod_caml
<joelr1>
hmm
<rwmjones>
does it work?
<rwmjones>
CamlLoad calendar/calendar.cma ?
<joelr1>
so how would mod_caml know about ...
<joelr1>
let me see, one sec
<rwmjones>
(* CamlLoad [filename]. Preprend the ocaml standard library path
<rwmjones>
(ocamlc -where) if [filename] is relative. *)
<joelr1>
rwmjones: btw, rss was a godsend! i will be migrating http://wagerlabs.com to cocan wiki just as soon as i finish the installation
<joelr1>
rwmjones: then i will nee to integrate the haskell version of my easylanguage to c# compiler that's currently running at http://algokit.com (that's the haskell version)
<joelr1>
rwmjones: it seems to want ExtString as well
<rwmjones>
ExtString is a module provided by extlib
<joelr1>
ah, i just have to put it before pgocaml
<rwmjones>
joelr1, here's a list from a site which uses cocanwiki with the optional RSS modules installed:
<joelr1>
rwmjones: Failure("error while linking /Users/joelr/work/ocaml/cocanwiki-1.4.3/html/_bin/cocanwiki.cma.\nReference to undefined global `Http_client'")
<joelr1>
gotta look for this one
<rwmjones>
netclient/netclient.cma
<joelr1>
unixqueue?
<joelr1>
Failure("error while linking /usr/local/lib/ocaml/site-lib/netclient/netclient.cma.\nReference to undefined global `Unixqueue'")
<rwmjones>
equeue/equeue.cma
<rwmjones>
see above ...
vorago has joined #ocaml
<joelr1>
i think that's it
<joelr1>
booting up
<rwmjones>
have you loaded the cocanwiki.sql into the database and created an initial host?
<joelr1>
oh
<joelr1>
question
<joelr1>
rwmjones: haven't created initial host yet but
<joelr1>
rwmjones: how does it know what password www-data has?
<rwmjones>
if the database is on the same host, then it doesn't usually need to - it just uses the Unix domain socket to connect
<joelr1>
rwmjones: ok
<rwmjones>
if it's on a different host, then you need to set the environment variables:
<rwmjones>
PGHOST
<rwmjones>
PGUSER
<rwmjones>
PGPASSWORD
<rwmjones>
etc. as appropriate
<joelr1>
tried to access the url /_bin/admin/create_host_form.cmo
<joelr1>
got an error
<joelr1>
[Mon May 21 14:29:33 2007] [error] [client 127.0.0.1] client denied by server configuration: /Users/joelr/work/ocaml/cocanwiki-1.4.3/favicon.ico, referer: http://localhost/_bin/admin/create_host_form.cmo
<joelr1>
rwmjones: i have seen this before...
<rwmjones>
you need ...
<joelr1>
rwmjones: that should have been html/_bin... strange
<rwmjones>
are you including cocanwiki.conf ?
<rwmjones>
ie. all the stuff like:
<rwmjones>
<Location /_bin>
<rwmjones>
SetHandler ocaml-bytecode
<rwmjones>
CamlHandler Registry.handler
<rwmjones>
Options ExecCGI
<rwmjones>
Allow from all
<rwmjones>
</Location>
<rwmjones>
etc?
<rwmjones>
if it's not that, then it'll be because your DocumentRoot is wrong
<joelr1>
rwmjones: yes, i'm including it. that's where all the CamlLoad complaints came from
<joelr1>
rwmjones: now i'm getting the dreaded internal server error w/o any other information. i used to get this with mod_caml "stable" and it went away when i switched to mod_caml cvs
<rwmjones>
so nothing in error_log?
<joelr1>
nope
<joelr1>
rwmjones: nothing in error_log
<joelr1>
rwmjones: again, i had this issue with the stable version of mod_caml
<rwmjones>
but you said the test scripts worked?
<joelr1>
rwmjones: what test scripts?
<rwmjones>
things like
<joelr1>
rwmjones: i don't think i ever said anything about test scripts
<rwmjones>
examples/simple-scripts/hello.cmo
<joelr1>
ah!
<joelr1>
one sec
<joelr1>
rwmjones: well, now they don't
<joelr1>
rwmjones: let me try without loading cocan wiki
<joelr1>
rwmjones: yep, that's it, without cw hello works
<rwmjones>
so the only different is CamlLoad .../cocanwiki.cma ?
<rwmjones>
s/different/difference/
<joelr1>
well
<joelr1>
rwmjones: it works if i don't include the wiki conf
<joelr1>
and thus don't load the cma
<joelr1>
hmm... i can't just load the wiki cma since it pulls in the rest of the stuff... hmm
dark_light has joined #ocaml
<rwmjones>
well load everything except cocanwiki.cma, and try that
<joelr1>
rwmjones: do i need to keep all the cmas in one place? because the mod_caml config says they are in one place and then the wiki config puts them in a different place
<rwmjones>
I don't understand ... the cmas can go anywhere, but you have to specify paths to them, unless they are in ocamllibdir in which case you can miss out the full path
<joelr1>
[Mon May 21 14:56:00 2007] [notice] Digest: generating secret for digest authentication ...
<joelr1>
[Mon May 21 14:56:00 2007] [notice] Digest: done
<joelr1>
[Mon May 21 14:56:00 2007] [notice] Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.7l DAV/2 mod_caml/1.4.2 configured -- resuming normal operations
<joelr1>
this is all i have. trying page
<rwmjones>
it's a 500 Internal Server Error, right?
<joelr1>
rwmjones: 100%
<joelr1>
rwmjones: page fails also
<joelr1>
rwmjones: hello seems to work, though
<rwmjones>
strange
<rwmjones>
but maybe not surprising
<rwmjones>
I'm beginning to think it might be a problem connecting to the db
<rwmjones>
although it really ought to produce an error message if that is the case
<joelr1>
rwmjones: great, how do i troubleshoot?
<rwmjones>
this is Solaris right?
<joelr1>
rwmjones: i didn't set any variables... hmmm...
<rwmjones>
Solaris?
<joelr1>
rwmjones: maybe i should set PGHOST=localhost
<joelr1>
this is all mac osx
<joelr1>
i think i had to set PGHOST when compiling or it would not connect
<rwmjones>
I don't think guessing is going to help
<joelr1>
one sec
<rwmjones>
what you need to do is
<rwmjones>
I've forgotten exactly how you do this, but you have to ktrace one of the Apache processes
<rwmjones>
while it is performing a request
<joelr1>
rwmjones: no, i don't think PGHOST=localhost helped
<rwmjones>
this is somewhat random, because the OS will choose a process at random to run for each request, so you'll have to keep 'ktrace' until it happens to get the right process
<rwmjones>
or you can start Apache with the -X option
<joelr1>
rwmjones: ugh...
<joelr1>
rwmjones: let me see if apachectl takes that
<rwmjones>
but that will let you see what the process is trying to do
<joelr1>
rwmjones: i may be mistaken but my apache2 does not have -X
<rwmjones>
kin eck, I think they removed it
<rwmjones>
just a sec, let me ask someone
<rwmjones>
it's probably to do with the threading model
<rwmjones>
in any case, that doesn't stop you from using ktrace on a random Apache process, keep reloading the failure page a dozen or so times, and you should have a trace of the failure
vorago has quit [Read error: 113 (No route to host)]
<joelr1>
rwmjones: ktrace... ok
<joelr1>
rwmjones: trying
<joelr1>
rwmjones: ##$^#$^#$^ it starts 7 of them!
<joelr1>
rwmjones: i wonder how can i limit the #
<rwmjones>
joelr1, apparently httpd -X should still work?
<joelr1>
rwmjones: .s.PGSQL.5432 and .s.PGSQL.5432.lock in /tmp
<joelr1>
rwmjones: sec
<rwmjones>
more generally, I could use a patch which somehow determines where this lockfile is located (it lives in fairly random places on different distros) and gets this right
<joelr1>
rwmjones: do i nee to recompile anything? ktrace time again
<rwmjones>
you'll need to recompile at least PG'OCaml
<joelr1>
rwmjones: take a look, you are gonna love this
<joelr1>
rwmjones: FATAL: 28000: role "daemon" does not exist
<joelr1>
FATAL: 28000: role "daemon" does not exist
<joelr1>
[Mon May 21 15:21:43 2007] [notice] caught SIGTERM, shutting down
vorago has joined #ocaml
<rwmjones>
this is after recompiling?
<joelr1>
rwmjones: yes
<rwmjones>
so you've recompiled PG'OCaml
<rwmjones>
stopped and restarted
<joelr1>
rwmjones: yes and reinstalled
<rwmjones>
does hello.cmo work?
<joelr1>
stopped and started
<rwmjones>
does page.cmo work?
<joelr1>
sec
<joelr1>
rwmjones: hello works. checking page
<joelr1>
rwmjones: page complains. FATAL: 28000: role "daemon" does not exist
<joelr1>
FATAL: 28000: role "daemon" does not exist
<rwmjones>
ok, right I understand
<rwmjones>
apache is running as user "daemon"
<rwmjones>
trying to access the database
<joelr1>
rwmjones: ah!
<rwmjones>
the database doesn't allow this
<mrvn>
Mine is running as www-data
<rwmjones>
mrvn: exactly
<rwmjones>
so if you grep through cocanwiki.sql for any grants which grant permissions to www-data
<rwmjones>
just change them to daemon
<joelr1>
rwmjones: PGUSER in the same place where cocam wiki is set?
<rwmjones>
and run the grants (on their own) again
<mrvn>
I would rather run apache as www-data
<rwmjones>
it very much depends on how your pg_hba.conf is set whether just setting PGUSER will work
<joelr1>
rwmjones: why don't i try that first? one sec
malc_ has joined #ocaml
<joelr1>
woohoo! page works
<rwmjones>
ok, so you're almost there now
<rwmjones>
just need to go to /_bin/admin/create_host_form.cmo
<joelr1>
rwmjones: did that
<joelr1>
rwmjones: is this it? how do i get the nice merjis look?
<rwmjones>
fiddle around with stylesheets
<rwmjones>
if you go to ...
<rwmjones>
well, if you're logged in with the right amount of permissions, then go to
<rwmjones>
Sitewide settings
<joelr1>
rwmjones: one more thing... when i click on homepage it goes to localhost/ which has the default apache page. how do i make it go to the "wiki home"?
<rwmjones>
then there's a global stylesheet and a per-page stylesheet to work with
<rwmjones>
that must mean that the canonical hostname is set wrong
<rwmjones>
try:
<rwmjones>
select * from hosts;
<joelr1>
rwmjones: i think i typed localhost in there
<rwmjones>
and:
<rwmjones>
select * from hostnames;
<joelr1>
rwmjones: localhost
<rwmjones>
the canonical_hostname field is where it will redirect browsers to, so that needs to be right
<rwmjones>
furthermore, you need to list all possible hostnames in the hostnames table (including the canonical_hostname)
<rwmjones>
so for example ...
<joelr1>
rwmjones: so i just type in a url there?
<rwmjones>
no, just a hostname,
<rwmjones>
for example .....
<joelr1>
rwmjones: it _is_ set right in my case, except i was expecting it to go to the top of the wiki, not to pull up /index.html
<rwmjones>
select id, canonical_hostname from hosts where id = 11;
<rwmjones>
god knows what "new.demo.merjis.com" is though ...
<joelr1>
rwmjones: how do i make it pull up the wiki top instead of /index.html. it seems to be doing the right thing, no?
<rwmjones>
I don't really know your Apache setup, but if it redirects to http://[canonical_hostname]/ and that is the wrong place, then canonical_hostname is definitely wrong
<joelr1>
rwmjones: that is the right place, except there's no wiki there
<rwmjones>
& I don't know what 'index.html' is
<rwmjones>
the index page is called / or /index
<rwmjones>
in COCANWIKI
<joelr1>
rwmjones: hmm... let me see something real quick. it's pulling up the apache It Works page but maybe it's cached
<joelr1>
rwmjones: mea culpa! it was a cached page. next and, hopefully, final question
<joelr1>
rwmjones: are there any default stylesheets supplied with cocanwiki? like the merjis look, for example? is it difficult to customize the look?
<rwmjones>
no, but by all means grab the merjis.com stylesheet
<rwmjones>
it's probably more fun to make your own though
<joelr1>
rwmjones: i will, of course. let me try the merjis one first, real quick
<joelr1>
rwmjones: i paste it into the global stylesheet box?
<rwmjones>
yeah ... actually the merjis one is really complicated & depends on a bunch of images too
<rwmjones>
btw, always Shift+Reload when trying out stylesheet changes
<rwmjones>
back in 10
<joelr1>
rwmjones: i would go for the cocan.org stylesheet
<joelr1>
thanks
<joelr1>
mrvn: would you know how to remove the bunch of links including versions of this page from the bottom of the default wiki?
<joelr1>
with the cocan.org stylesheet
<joelr1>
rwmjones: ^^^
<rwmjones>
joelr1, you can edit the templates, but normally what you'd do is just hide it by putting display:none in the stylesheet
<rwmjones>
depending on the security settings for anon users, they will or won't see the history link
<joelr1>
rwmjones: and where would i change security settings for anon users?
<rwmjones>
basically you can select security level for a spectrum from open wiki <---> commercial website
<rwmjones>
in Sitewide Settings
<joelr1>
rwmjones: i want commercial website, looking
<rwmjones>
yeah, so set it up as:
<joelr1>
rwmjones: hmm... do i need to login? as what user by default?
<rwmjones>
Allow anyone to see the site: Yes
<rwmjones>
Allow anonymous edits: No
<rwmjones>
Allow anyone to create accounts: No
<rwmjones>
do select * from users;
<joelr1>
sec
<rwmjones>
if you don't have any users set up, create one either by inserting into that table, or by going to the 'Site Administration' link at the bottom of the page
<rwmjones>
you'll want to give yourself the "can_manage_users" permissions, which is kind of like 'root'
<joelr1>
rwmjones: i go to sitewide settings but i don't see the options that you see
<joelr1>
i just see users, edit site menu, homepage, sitemap, recent changes
<joelr1>
and the interesting pages and links section
<joelr1>
ok, that's under Users
<rwmjones>
go into users and give yourself some permissions
<rwmjones>
if you can't do that, then set can_manage_users in the users table directly
<joelr1>
rwmjones: yes, gotta do that i think
<joelr1>
rwmjones: wait, i can manage users. where are the settings for anon user, though?
<rwmjones>
the anon user is not a user
<rwmjones>
the settings above are on the Sitewide settings page
<joelr1>
rwmjones: so i edited administrator. how do i restrict anon settings?
<rwmjones>
go to Sitewide settings
<joelr1>
rwmjones: never mind, got it
<joelr1>
rwmjones: interesting... it appears i can pick a theme
<joelr1>
rwmjones: what does picking a theme do? does it override global stylesheet?
<rwmjones>
no, it adds an extra stylesheet before the global stylesheet
<joelr1>
rwmjones: i picked merjis but the look didn't seem to change, even after restartin the browser
<rwmjones>
best thing to do is to look at the source for /index after each change, or else look at the file templates/page_header.html
<joelr1>
rwmjones: ok, thanks. the theme thing didn't work for some reason. let me just check one last thing, i.e. the rsss for the home page
<joelr1>
rwmjones: can you remind me, please, where are the rss feeds per page?
<joelr1>
rwmjones: found, thanks!
<rwmjones>
there are lots - grep cocanwiki.conf for rss
<joelr1>
woohoo!
<joelr1>
rwmjones: thank you very much for an awesome product. gotta go install on solaris now :D
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
<joelr1>
rwmjones: once again, thanks! over and out
joelr1 has quit ["rcirc on GNU Emacs 22.0.50.1"]
<flux>
I tried that a year ago or so.. I gave up :) (I didn't try very hard, though)
smimram has joined #ocaml
smimou has quit [Read error: 110 (Connection timed out)]
tree_ has quit [Read error: 110 (Connection timed out)]
Sparkles has quit []
tree has joined #ocaml
gim_ has joined #ocaml
seafood has quit []
postalchris has joined #ocaml
postalchris has quit [Client Quit]
postalchris has joined #ocaml
benny_ has joined #ocaml
Hadaka has quit [pratchett.freenode.net irc.freenode.net]
seafood has joined #ocaml
pango__ has joined #ocaml
pango__ is now known as pango
pango_ has quit [Remote closed the connection]
benny has quit [Read error: 110 (Connection timed out)]
cjeris has joined #ocaml
Smerdyakov has joined #ocaml
dark_light has quit [Read error: 101 (Network is unreachable)]
ita|zzz is now known as ita
ygrek has joined #ocaml
bluestorm_ has joined #ocaml
love-pingoo has joined #ocaml
Submarine has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
beterraba has joined #ocaml
<beterraba>
somebody know isabelle/isar?
<ita>
beterraba: coq
<beterraba>
what coq means?
<Smerdyakov>
Coq is number one theorem prover of the universe!
<ita>
beterraba: it is another prover
<ita>
Smerdyakov: :-)
<beterraba>
yes"
<beterraba>
=)
<beterraba>
but..
<beterraba>
do u domain some of them?
<beterraba>
Smerdyakov, do u know where can i find some chat or discussion group about isabelle / isar?
<Smerdyakov>
No.
<beterraba>
i'm having some troubles and i need assistence
<Smerdyakov>
Well, you won't find it here. Sorry.
<beterraba>
ok.
screwt8 has quit [Remote closed the connection]
<beterraba>
well.. but do u know anything about modal logic. i mean, have u already proved something about it in coq?
<beterraba>
hello? =(
<ita>
beterraba: try #isabelle one never knows
<beterraba>
no one. =/
<ita>
beterraba: i have proved very simple things and i doubt i can help you much
<ita>
beterraba: what are you trying to do by the way ?
* ita
is too curious .. but sometimes it is a good thing(tm)
<beterraba>
hm.. im trying to prove there is a finite way to express the same formula ALPHA just combinating modal unary operations
<beterraba>
i must use structural induction.
<beterraba>
u know what modal unary operations mean, right?
screwt8 has joined #ocaml
<beterraba>
there are 2 of them: one represents necessity and the other represents possibility
<beterraba>
my task is prove there are only 14 forms to represent formulas by combinating modal operators
<ita>
beterraba: you should try the isabelle mailing-list right now
<ita>
beterraba: search in the coq collection of proofs too, it might help
<Smerdyakov>
ita, that sounds like very bad advice.
<ita>
beterraba: here, i doubt anyone can really help you
<Smerdyakov>
(to search Coq proofs)
<ita>
Smerdyakov: why ?
<Smerdyakov>
Because they're very different tools.
<ita>
ah
<ita>
well, the principle behind is the same
<ita>
or should be :-)
<Smerdyakov>
No.
<beterraba>
thanks
<beterraba>
i will thy
<beterraba>
try*
<Smerdyakov>
There are without doubt informal pencil-and-paper proofs of the theorems of interest, and reading those would be better than reading proofs in a different system.
<ita>
well, if he came here to ask for help he must be really desperate :-)
<beterraba>
lol
<beterraba>
i am!
<Smerdyakov>
beterraba, I guess this is for a class?
malc_ has quit ["leaving"]
<ita>
beterraba: Smerdyakov is tough you know, i guess we all become grumpy after knowing lots of things
<beterraba>
+-
<Smerdyakov>
beterraba, is that a yes?
<beterraba>
yes and no
<beterraba>
let me try explain:
<ita>
mas o menos
<beterraba>
firstly sorry my english if u dont understand what im saying =P .. it's a scientific project which i should use some computacional tool with mathematical reasoning. my search and project is about modal logic and structural induction over this kind of logic. but i'm having some sintatical troubles and need help urgently. i must finish this work in 31st may.
<Smerdyakov>
beterraba, don't you have an advisor you can ask?
mnemonic has joined #ocaml
<beterraba>
yes, i do. but im shame (i dont know how spell it)
<mnemonic>
hi
<Smerdyakov>
If you are unable to talk to the person in charge of your project for emotional reasons, then you're already lost beyond hope of redemption.
<Smerdyakov>
It generally takes a few YEARS to learn to use a theorem proving tool like Isabelle effectively.
<ita>
years ? omg
<Smerdyakov>
General rule of thumb: it takes as long to reach some level of proficiency at computer theorem proving as it took to reach the same level of proficiency at programming.
<ita>
in a few weeks i could do interesting things in coq already
<ita>
the coq tutorial is not too intuitive, and the concepts are a bit scattered all around
<Smerdyakov>
You probably did them in crappy, non-maintainable ways. ;)
<Smerdyakov>
(Just like in programming!)
<Smerdyakov>
(At a correspondingly early stage, I mean)
<cjeris>
learning coq is certainly much more like learning C++ than it is like learning a civilized language.
<Smerdyakov>
I don't think anyone knows how to do any better than Coq in this domain..
<ita>
Smerdyakov: there are less than 100 regular users, let's bet on the quantity
<Smerdyakov>
I'm pretty sure the number is higher than that.
<Smerdyakov>
That was the number from a survey a few years ago.
<Smerdyakov>
And Coq is getting more popular.
<ita>
the coq error messages are clear like joe black in a tunnel with a zorro mask at midnight
<Smerdyakov>
If it matters enough to you, then you can work on improving them. I don't think there has ever been any other theorem proving tool in the history of mankind that compares to Coq for quality, though.
rwmjones has quit ["Closed connection"]
<ita>
Smerdyakov: in the history of compilers, coq compares to branefsk :-)
<Smerdyakov>
Completely irrelevant.
<ita>
yes.
<ita>
(coffee overload)
<Smerdyakov>
You don't seem to understand that we are in the early days of practical proof assistants for higher-order logic.
<Smerdyakov>
Nothing good springs fully formed.
<bluestorm_>
(isn't that what the POPLmark challenge is about ?)
seafood has quit []
<Smerdyakov>
bluestorm_, exactly what do you mean?
<bluestorm_>
hm
<Smerdyakov>
Lately, the POPLmark challenge is about "no one wants to try the challenge problems I suggest." =(
<bluestorm_>
about "we are at spring, let's see how good we can get now"
<bluestorm_>
but anyway i don't know the subject
<bluestorm_>
so i'm lot likely to know something interesting
<Smerdyakov>
I have the best approach to compiler certification, but no one is willing to post alternative solutions to the problems I suggest. :P
<mbishop>
Smerdyakov: you're working there (or will be) aren't you? gonna get them to release some more stuff? :P
holo has joined #ocaml
<holo>
hi
<ita>
holo: hola
<holo>
i want to add a counter to a lexer, so it can count the column a token is ocurring. code: http://rafb.net/p/Kt3N4A52.html
<holo>
hi ita
<holo>
but i can't get the design to it in my head
<holo>
i thought of getting the value of the counter by its argument, but i don't even know if caml can do that
<ita>
holo: wait, shouldnt you do that in the parser ?
<holo>
in C for example i would get the variable by reference
<holo>
ita, is this situation no
<holo>
but in this case i can't really get the counter becouse i call it by: alex_scan(code, 1);;
<holo>
so, the argument is called with initialization
<holo>
for obvious reasons, this doesn't work: [<'`&`>] -> count, [<'E; alex_scan(code, count+1)>]
<holo>
the "count" in the return branch
<holo>
i thought of a let var = func in expr
<holo>
is this last option viable?
* ita
has no idea
<holo>
this may seem weird code, those are streams, with imperative behavior
<holo>
and caml light forbids branches with different return types
<holo>
so i can't do: | [<>] -> count, [<>]
<holo>
and at the same time do: | [<'`:`>] -> [<'DOIS_PONTOS; alex_scan(code, count+1)>]
<ita>
(perhaps define a new return type ? but form me counting tokens should be part of the parser, not the lexer)
<holo>
[<'`&`>] -> let code_res, count_res = alex_scan(code, count) in [<'E; alex_scan(code_res, count_res+1)>]
<holo>
this is like weird right?
<holo>
code and count are in "let rec alex_scan(code, count) = match code with"
<holo>
ita, define a return type? what do you mean?
<holo>
ita, it should be part of the lexer for eficience reasons
<holo>
if a token that is not part of the language in inputed, it should exit imediatly before going to the syntax analiser
<holo>
argh.. i can't think of let in with streams
<holo>
something is wrong
<holo>
ok, i think i have another of doing this :.
<holo>
:>
<holo>
thank you anyway ita
beterraba has quit [Remote closed the connection]
Oxylin has joined #ocaml
<ita>
holo: well, a type some of stuff | none
<ita>
holo: since you want to return more than more thing, you can aggregate them instead
<ita>
holo: and for the efficiency reason, that part looks totally irrelevant to me :-)
<ita>
holo: when you have a proof that the system is way too slow you would recode that part in c anyway, so there is no need to try to think about optimizations at this point
gene9 has joined #ocaml
ita is now known as waf
G_ is now known as G
waf is now known as ita
Oxylin has quit [Client Quit]
cjeris has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has joined #ocaml
Mr_Awesome has joined #ocaml
gene9 has quit ["Leaving"]
ygrek has quit [Remote closed the connection]
Demitar has quit [Read error: 110 (Connection timed out)]
holo has quit ["This computer has gone to sleep"]
CosmicRay has quit ["Client exiting"]
Demitar has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
Submarine has quit ["Leaving"]
malc_ has quit ["leaving"]
Smerdyakov has quit ["Leaving"]
_JusSx_ has joined #ocaml
mnemonic has quit ["leaving"]
screwt8 has quit [Remote closed the connection]
slipstream-- has joined #ocaml
screwt8 has joined #ocaml
slipstream has quit [Read error: 113 (No route to host)]
<mbishop>
Anyone ever thought about making a "planet" for ocaml blogs?
_JusSx_ has quit ["leaving"]
gim_ has quit ["bonne nuit à vous"]
ppsmimou has quit [pratchett.freenode.net irc.freenode.net]