logs archiveIRC Archive / Freenode / #php / 2015 / August / 26 / 1
mchelen
retran: hmm interesting i haven't really tried it
retran
weird thing with couch... you have to only use their REST interface, and any "drivers" are just implementing that RESTful http interface
so it's kinda niche
daniman
good night
retran
couch is similar to Mongo in how storage is based json objects
so dont bother with it if you hate mongo :p
mchelen
does that mean couch stores every previous version of every object?
retran
sorta... it each update as a diff
and it wil cache the full current object as needed internally, (or whatever version of the object)
to display it as the result, or do map-reduce, etc stuff
and there's no query's in couch, nothing ad-hoc... ever.
you have to preconfigure all your "views"
its absolutely rigid that way, for better or worse
just think of Mongo done by something thinking thoughtfully pedantic with versioning, JSON and Map/Reduce as their ideology
(typo... meant "done by someone thinking...")
PsychoBoB
O meu sensor de piriguite explodiu !
TML
retran: That's a false allegation about CouchDB
retran
lol awww how so
         

TML
You can absolutely query CouchDB
They even invented their own query langauge based roughly on SQL called "N1QL" (nickle)
http://blog.couchbase.com/n1ql-it-makes-cents
retran
oh but that's what i'm tlaking about.. it's implemented with 'views'
TML
you can do an ad-hoc N1QL query without building views for it
I do it all the time
retran
aint that neat
what's the history behind n1ql
PsychoBoB
the history
retran
so it's more the case that Mongo stlil doenst have ad-hoc querying
just how long has it been around
TML
At least since 2013
retran
how's couch doing with replication and sharding
damn i like how CouchDB has ability to subscribe to "change notifications"
i could really abuse that
SHA-7
(..)
retran
TML, what's your use case for Couchdb
tasaif
hi, so in ruby on rails there's a function called render that I can supply an html file to and a bunch of parameters. I can't seem to pass local variables to an include in php besides defining them right before the (include) call. Is there a built-in way to do this, or do I have to write my own render function?
retran
you could wrap your include into self-executing closure
Sourcey
Majeh
tasaif
is that like an IIFE?
mewm
retran, change notifications like oplog for mongo?
Sourcey
TML:
sorry for late reply
retran
oplog for mongo is cheating
Sourcey
I want everything after the >
the full line
retran
couch has real subscribing to change notifications
you'd have to poll an oplog, if you wnated to execute something on change
TML
Sourcey: http://codepad.viper-7.com/9Sm8Cd
         

runinsquares
mewm
retran, and why is oplog cheating?
mongo oplog*
retran
because you're having to implement a poll to create a "push"
Sourcey
TML it seems to catch the whole mail
retran
that's 'cheating'... or whatever you want to call it
thebuccaneersden
tasaif : nothing natively like that in php. youd have to build your own function or use a templating engine. keep in mind that ruby on rails is a framework and there is no render function in plain ruby either just like with php ( AFAIK anyways )
Sourcey
forgot to mention that the lines I _dont_ want also have that >
mewm
retran, I'm pretty sure that's intended... So I'm not sure in what context that is cheating.
retran
not a pure solution. you have ot have access to the oplog on the system, bla bla bla. problematic
TML
...
runinsquares
TML
Sourcey: So your answer was meaningless
Sourcey: how do you know the difference between a line you DO want to match and a line you DON'T want to match?
Sourcey
By the following : "FHS", "Start", "Stop"
mewm
runinsquares hey mate o./
TML
So you want lines that start with 'FHS', 'Start' or 'Stop'?
Sourcey
yep, sorry
TML
http://codepad.viper-7.com/2wI4mp
retran
tasaif, http://codepad.viper-7.com/MoM2Jx
mewm
retran, anyhow, the systems I use, push the oplog changes via websockets, so no polling required....
retran
how are you knowing when the oplog changes
tasaif, http://codepad.viper-7.com/MoM2Jx
Sourcey
Thank you for the codes TML. But the last one is not picking up the numbers behind "FHS"
retran
tasaif, you understand the gist of the idea?
mewm
retran, whenever I receive the change through the websocke
socket*
retran
no i'm saying, what is monitoring the oplog for changes
TML
Sourcey: '!> ((FHS|Start|Stop).*)!m'
Sourcey
thanks m8
looks fine now
paddyez
today I found out the hard way that in php 1234 == 01234 WAT?
mewm
retran, while I'm not entirely sure, I assume it's an constant stream from the instance itself.
runinsquares
well i'd expect 1234 + 1 and 01234 + 1 to have the same result...
caffinated
paddyez: that's not true. https://3v4l.org/B8R1U
more likely what you had was 1234=="01234"
runinsquares
echo 01234 // 668
retran
http://codepad.viper-7.com/g62bQA
1234!=01234
caffinated
since a string and an integer are incompatible types, the string will be converted to an integer. the conversion behavior is well known.
mewm
retran, where tailing that stream would be adequate for something real time.... But again, I'm not entirely sure of the specifics in the internal work, I just found your argument interesting :)
paddyez
*hmm*
retran
demo of what caffinated says: http://codepad.viper-7.com/Mk93xc
for paddyez
mewm, how often do you have to tail
that seems like polling
paddyez
actually the one comes fron database from typo3 framework the other form XML
caffinated
I understand if it's a bit counter-intuative coming from another language though. php casting usually throws people for a loop the first few times.
paddyez
both should be Strings
is there a rule when php tries to interpret as integer?
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 next »