logs archiveIRC Archive / Freenode / #php / 2015 / August / 15 / 1
__adrian
this is why we don't use xhtml
SJr
Does memcache truncate data that is too long or fail to set it. The interwebs say truncate but my test case says fails to set.
Alphos
wget http://www.w3.org/TR/html5/tabular-data.html#the-tr-element
choki
i love xhtml
voodookobra
I love HTML5
Alphos
<tr> elements belong as children of a <table> element only in a specific set of cases
(usually, they don't)
wget
Alphos: ok I see.
$nodes = $xpath->query('tfoot/following:tr/td');
this is thus what I'm trying to do
all td elements in a tr element which follows a tfoot
but not output.
undrinkablesoup
I wouldn't go as far as saying I love HTML 5, but the removal of idiotic syntax such as type="text/javascript" and type="text/css", as well as the placeholder= attribute to form inputs were good.
I'd rather say that HTML 4.x was idiotic rather than calling HTML 5 great.
monodesigns
data attributes FTW.
         

undrinkablesoup
And the saner UTF-8 meta thing.
Alphos
wget this node list should be empty in every case
wget
why?
Alphos
because there shouldn't be a <tr> after a <tfoot>
it's the whole point of a <tfoot>
wget
Alphos: then, how am I supposed to be parsing that document with Xpath?
Alphos
wget what do you mean by "follow a tfoot" ?
wget
Alphos: </tfoot><tr>
Alphos
yeah, that shouldn't exist
undrinkablesoup
XPath syntax is voodoo.
caffinated
xpath syntax is easy
wget
Alphos: yep, tr should be enclosed in a tbody, but I have not that node in the verion downloaded via PHP. So, again, how am I supposed to use Xpath in this use case?
caffinated
you should learn it. in some ways, it's very similar to CSS selectors.
Alphos
wget that shouldn't exist, but well, they did it anyway... for presentation...
Bittarman
heh... xpath is easy....
/text()[ancestor::*[contains(@role, "indexable")] and not(ancestor::*[contains(@role, "noindex")])]
caffinated
Bittarman: it is easy. anything seems hard when you don't know the syntax.
wget
caffinated: yep indeed this is really easy. I've partially learned it via the wikipedia page. It was enough. But in my use case, this is quite special. If Xpath respects the DOM interpreted version, then I'm fuc***, as I'm parsing the RAW version sent from the server.
Bittarman
caffinated, I know, but... its not *always* easy.
undrinkablesoup
(Action) becomes tired just seeing that syntax
HShar
Does anyone use magento2?
Bittarman
it has some really backwards things
HShar, #magento
         

HShar
nobody is replying there
Bittarman
oh.. you're in there, don't crosspost it here.
Alphos
wget following is an axis though, so you'll need :: between it and "tr"
Bittarman
HShar, you didn't even way 30 seconds for a reply :|
Alphos
'//tfoot/following::tr/td'
HShar
I know man but nobody replied for the person before me. He waited long time
Alphos
HShar that's not really our problem :/
HShar
Alphos: Sorry
wget
Alphos: Why do I need to //? Do not specifying trailing / should have been enought, as I'm looking for theses nodes anywhere in the DOM. This is the second time I'm not speicyin // and this is not working.
*two
The specification is pretty clear. According to https://en.wikipedia.org/wiki/XPath#Abbreviated_syntax
Alphos
wget "//element" selects from the document root, "element" from the context node
wget
Alphos: Yep, I've read that indeed. But I don't understand from which point the "context node" is, not from the root apparently
Alphos
wget if your context node is the root, you're fine. if not, why take a risk ?
Qiller
Friends, how can i get ['lat'], into stdClass Object? stdClass Object ( [id] => 10 [name] => Test [location] => stdClass Object ( [lat] => -12.907632827759 [lng] => -38.432300567627 )
__adrian
looks like it already is ..?
Alphos
Qiller $object->location->lat
wget
Alphos: yep indeed. Thus my question, what do we mean by "context node"? What is the context, how can I determine where I am?
n0rp3d
create a method to read lat?
Alphos
n0rp3d create a method for stdClass ? uh...
Qiller
omg, thank Alphos
__adrian
unless you're asking how to *access* it (see Alphos' answer)
n0rp3d
oh my bad
Alphos
Qiller where does your data come from ? if it's a json, use the second param of json_decode()
...
undrinkablesoup
Screw DOM.
I wanna play DOOM.
n0rp3d
^
undrinkablesoup
How do you make money? Seriously.
Every imaginable service that you can provide seems to require massive initial funding/infrastructure.
__adrian
printing press
undrinkablesoup
I bet there are people out there who somehow, legally, make money with just a server and some PHP scripts running on the CLI.
But what do they do with those scripts? It's unknown.
And they certainly won't be telling me or you.
n0rp3d
botnets )
monetizing facebook likes
renting a dedicated server and renting it as a shared hosting
jimlei
undrinkablesoup: you can make money on pretty much everything, takes either a great product, a great seller, or great service (or a combination). it's amazing how much you can actually make on small services / apps that solve very specific problems for different industries. like this guy I know who made an algorithm/app that calculated how to stack up cargo in planes (he had a summer job as a cargo guy at the airport)
I forgot luck.. :P
easteregg
indeed luck
undrinkablesoup
jimlei: Hmm.
The absolute last thing I wanna do ever is hosting. :P
I don't need to have done that to know it's a nightmare.
That is, of content out of your control.
Utils
If I had a VPS specifically to store my images (CDN is best, I know but concept would probably remain the same), how would a form processed by PHP end up uploading the image to the remote host?
remote server, even.
i mean, it cango like normal, and then the web server in php makes a curl request to the image server and uploads there
but wouldn't that be extra dleays? i dunno how it all works
tdutrion
Utils: how are you going with your problem?
Utils
The one I just mentioned? I've only really just asked it. I'm not sure on the common practise.
tdutrion
Im starting with the same concept (looking at S3/Runabove object storage and Cloudflare on top of it)
yes the one you just wanted to discuss :)
using S3 you can use the direct upload feature
Utils
I plan to try Amazon AWS but it wouldn't let me verify my identity with my mobile number. so I'm going to hav to go another route.
but I'm not sure how i'd measure the required costs if I went with AWS too... I'm not very mathy lol
tdutrion
on Runabove or Rackspace (Swift object storage) you have tempUrl (Im not there yet :))
Utils
so I figured for the time being, setting up a $5 VPS with 20gb storage and just allowing 50 images per user at 1MB max (I only have 80 users, most are inactive)
tdutrion
Runabove is actually very cheap (same cost issue&)
my current solution is: PAAS for the app, upload through the app, then using Flysystem I send images to runabove
I have cloudflare setup to cache my whole object storage
Utils
Oh, the images aren't cached by default?
tdutrion
and Im currently trying to use cloudflare api to clear the cached file when re-uploaded
« prev 1 2 3 4 5 6 next »