« first day (984 days earlier)      last day (3969 days later) » 

2:01 PM
I hate it when this happens:
if (strlen($match >= 6)) {
 
@dragon112 hehe
 
I need a DV here pls :) stackoverflow.com/questions/17320990/… - so that delvs can be placed ... :/
 
@hakre Just wait a little, when I reach 10k I can help.. xD
 
2:08 PM
 
These submenues when closing suck. Put it in one menu with 15 buttons if needed, but not in three different menues .__. And don't tell me this wouldn't be neat… If you close 20 times you remind where which button is and don't have to search........
because in at least 50% of the cases we go into the off-topic menu (replaces too-localized)
 
Anyone familiar with adaptive-images+ from Chris Ferdinandi ?
 
2:24 PM
wat
 
@bwoebi Moan. Meouw. Jaul ;) Give it a day or two at least I'd say. Something need some training with the new interface.
 
@hakre you mean I should train clicking more? xD
 
@bwoebi ah, we can get shortcuts if that's the issue. Like most favorite close reason on the first page with a browser-addon or something.
Or the big-pane close-planel with left and right side ;)
Plus pre-written off-topic individual close reasons gg
 
meta.stackoverflow.com/questions/185991/… … mh, shouldn't we just use too broad instead of the tl as SO suggests? :-P
@hakre mh, yeah, my resolution is big enough (iMac 1920 and MBP 2880 px wide)
@hakre write some userscript? :-)
php.markmail.org/message/xc4lkhzbleslnmr6 This (all these new rfcs) sound primarily nice, but do we really need to add more and more new complexity to the PHP language?
I think PHP is slowly saturated of features… (I still miss the property accessors ...)
 
2:45 PM
so, people
assuming I'm quite knowledgeable in PHP
why would a cookie not being set?
varnish is disabled, path and domains are set with setcookie()... I don't see where else I could be looking
 
@crypticツ are you checking the link when its submitted by the user? if you're going to have multiple users clicking these links, one plausible solution would be to have a "report broken link" that could be monitored.. obviously not fool proof but having it user moderated would cut down on manually checking for a 404 on a regular basis.. also, a cron job that just runs through the links would help cut down as well
 
So who do you think you are to tell me what I should do with my free time? Fetching documentation bits on a silver patter? No thanks. I prefer to keep the question quality higher instead. Let's vote and see. I'd say the way you ask is prone to the XY problem. — hakre 1 min ago
 
@hakre what do you expect? rep whores WILL deliver the page number, line number, character start/end of the documentation he needs to solve that specific problem -.-
and they will get their 1-4 upvotes for it, oddly enough
 
@ircmaxell quoting from your last internals mail: if it was, why the heck was goto introduced? — Easy to answer: it wasn't mass voted.
 
@FlorianMargaine cookies only get set in $_COOKIE after headers are sent
 
2:54 PM
@ExplosionPills checking what you said.
 
@hakre I can't figure out the answer to that question you closed; I think it's harder than you think, but I can't find anything in the documentation that says how to check whether a node is removed from the document. Removing the node doesn't unset ownerDocument, and if you iterate over the dom list parentNode is not unset for child nodes even if that parent node was removed (it may generated new dom node instances in the DOMNodeList for each individual element)
 
hi, not a php question. Looking for a tool (web or mac app) that can help me organize data/ thoughts as nodes. one node can have attributes, n children and so on.
 
@tgkprog freemind
 
thank you
 
@tgkprog html
 
2:59 PM
@ExplosionPills hakre didnt put the question on on-hold. I did. I explained why in a comment. Also note that Alex has a habit of asking either extremely trivial questions or non-questions like this.
 
html? maybe but i want a tool that can help me build and make it look good. freemind looks promisin
 
@ExplosionPills It is more the point in case that Alex only asks those questions without even showing what he/she tried. I just had it with a previous one of here which was a clear duplicate.
 
@hakre duplicate of that qusetion?
 
@ExplosionPills If a DOMNode is on the one hand imported into the document but has no parent, what is then?
 
@bwoebi eih
 
3:02 PM
@hakre I don't know what you mean
 
Do you now understand what I mean?
 
@ircmaxell hm?
 
A DOMNode without a parent must be the root node or it is detached.
To check if a node is the root node, you can test against the owners document root node
and you can also test against the document which is the one I think that has no parent.
 
yeah but what I'm saying is that if you iterate over $xpath->query('//*') even if you remove a node, a child node's parentNode will still be set even if the parent was removed earlier in the loop
which is maybe unexpected, hence the problem
 
But about such an inherited case has not been asked in the question.
And even if, you can get the upper-most ancestor by running an xpath query as well. Like /* relative to the context node.
 
3:05 PM
Initially they didn't specify; in the comment they said they're using $xpath->query('//*') to iterate through the nodes which probably shouldn't be done
 
@ExplosionPills I fail to see how this can happen. if you remove a node, the entire tree will be deleted and so the child be will no longer be in the DOMNodeList.
 
@ExplosionPills Then check her previous question, you can see where that xpath comes from: stackoverflow.com/questions/17321194/…
I think some user is just professionally guessing because of using Alex profile's links to the previous questions of that user.
 
@Gordon it seems like xpath::query generates a new instance for parent nodes as well in the DOMNodeList. I agree that it is weird. PHP 5.3.3 gist.github.com/ajcrites/5868194
@hakre well I don't want to get into the whole politics of SO, I'm just interested in this question specifically
 
@ExplosionPills Well you already started to post an example in your gist, however I don't see your test.
 
that iterates through each node. That means that the div gets removed before p is reached in the loop. When p is reached, you would expect its parentNode to be null, but it isn't; it's div. Also ownerDocument doesn't get unset
I didn't add the relative xpath check you suggested
well now that I think about it it probably makes sense that parentNode is not changed even if its removed since I suppose it removes all the nodes together and the parent/child relationship is maintained
 
3:19 PM
@ExplosionPills The DOMNodeList is built at the time the query executes. So it contains all the nodes.
Unless those nodes are destroyed they will still be in that list.
 
morning ....
which company do you use to manage domain ?
 
As you only remove a node from it's parent (but it's still part of the document, just not attached), no nodes are destroyed.
So, only the first element here (div) losses it's parent technically.
 
that makes sense, so now how do you check if it was removed. The only thing I can think of is to bubble up the DOM to see whether the original DOMDocument is an ancestor node (before you reach null) which would be very inefficient I think
 
And right it does, you will see that it has ...->parentNode as NULL after it has been removed from it's parent.
@ExplosionPills First of all you can check with the return value of removeChild().
If it's return value is a DOMNode which has a parentNode === NULL then it has been removed.
(actually I think if there is a failure in the removal there also is some value to check against, like NULL or so)
 
3:22 PM
@hakre but then you end up calling removeChild for each node anyway
 
i don't see how that user is in the wrong?
your reply seems incredibly argumentative imo
 
@CarrieKendall Yes, but as it's commentary, why not? I mean, isn't close to writing: Are you too dumb to enter your search into google? Just a bit more through the flower but the user might then realize?
 
@hakre when someone posts a helpful/related link as a comment, who cares if it implies that OP could've googled and got the same result? i am not disagreeing that you're wrong about OP, its just that ejo was generally trying to be helpful
 
@CarrieKendall Yes, I just was a bit chit chatting.
I know it's hardly argumentative, just wanted to take a look how far one can take it.
Just for the summer of love.
In the end I find it problematic to even feed users with bits of information if the question already is closely.
 
well if you're going to be argumentative, point it at the person who deserves to hear it, because in its current state, it sounds like you're attacking ejo for helping in a way that might benefit others
 
3:28 PM
@ExplosionPills I'm not sure you need to do that. It seems to me more that the understanding how to remove a node is missing and what that means.
 
i mean the question is crap, but it will still be cached, and those keywords might help someone find a useful question/answer
unless deleted, of course
 
@CarrieKendall yes, it's close to delete, but you're right, I'm barking the wrong tree.
@ExplosionPills The more I look into this, the less I think that sentence makes sense. I can't hardly imagine a reason in practice, why I would need to check that.
Only if the xpath query already is too broad given me too many nodes back.
I can remove a whole tree by removing the root-node of that tree, there is nothing more I need to do.
@ExplosionPills what you probably want is to remove the node incl. all of it's children:
foreach($xpath->query('//*') as $node)
{
    $result = $node->parentNode->removeChild($node);

    foreach($result->childNodes as $node) {
        $result->removeChild($node);
    }
}
 
Good afternoon, I have some trouble with Adaptive images+ in combination with WordPress. I have followed the author's tutorial, have also debug as shown in the tutorial. Things work right. When I upload a retina image and check my site on non retina it works. when I check it on a retina display, it will give the normal one, not the high resolution.. Plugin I downloaded from: cferdinandi.github.io/adaptive-images/index.html
 
@hakre I don't get why this is iterating over the whole DOM tree. It shoud stop after the first deletion.
 
@Gordon Because you can have nodes that are not attached to the document any longer
 
3:38 PM
@hakre see eval.in/35092
 
That's different to ->childNodes
 
when using XPath //*, it will iterate 5 times. When I use getElementsByTagName('*') it will iterate once
that's weird and new to me
 
@Gordon Well, getElementsByTagName() and ->childNodes is part of the DOM spec and that behavior is defined.
XPath has a different model of parents and children.
Or only of parent, children is the same IIRC
 
@hakre that doesnt explain anything to me
 
@Gordon If DOM says the nodelist needs to be updated if a node from within is removed (e.g. children, getElementsByTagName), then this can be different to an XPath result (query, expression).
 
@ircmaxell too much facepalms lately, I don't know why. It seems like SO is suffering from a wave of crap questions
 
@hakre NodeList and NamedNodeMap objects in the DOM are live; that is, changes to the underlying document structure are reflected in all relevant NodeList and NamedNodeMap objects. - w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/…
 
@Gordon Do we have Level 3 or Level 1?
 
@hakre 3 afaik
 
@Gordon Read carefully, I can only reflect those if I know about the structure, like with ->children or with GetElements... usw.
If I just query a nodelist with not further information and the nodes so long still exists, why should they be removed from that list?
E.g. I query the document for named nodes. Now I remove one of these, this list needs to be updated, because the list was about named nodes.
Same for children, because the list was for children.
I can simulate that with xpath by re-querying the xpath query.
However with the xpath result alone, I only get nodes which's parent can be freely detached from their parent, however they are still nodes of that document. Just not of the tree any longer.
those nodes still exist.
One might want to try when those nodes are freed, perhaps when the xpath result nodelist is destroyed.
 
3:52 PM
that doesn't make sense
 
@Charles how much $ ?
 
@Gordon what doesn't make sense?
 
evening
 
That XPath is not part of DOM Model?
I can live with it actually. I queried the nodes, I don't need to care about the hierarchy any longer.
Otherwise I could use traversal.
Like creating - in this case - a DOMIterator that iterates in document order.
 
@hakre it doesn't make sense that a DOMNodeList created through an XPath query is not live.
 
3:55 PM
@Gordon But it is live!
You can change the nodes.
 
@bwoebi how did you get 7K :p
 
hey... anyone can give me text copy protected code?
 
@CoolBoy I lost you at "text"
 
@Gordon are you agile yet?
 
scrumbag
 
3:59 PM
@hakre but they won't get removed from the DOMNodeList. Whereas they will when I use getElementsByTagName.
 
@Gordon Sure, because all the xpath query did was obtaining those nodes.
As long as they live, they will be part of that list.
 
@Ocramius to some extent, yes.
 
Removing a child from a parent, does not remove the node from the document.
 
damnnnn .... my net banking isnt working and i have to buy new hosting now :(
 
@hakre why should the DOMNodeList behave different based on whether I obtained the nodes in it via getElementsByTagName('*') or the equivalent XPath query('//*') eval.in/35093 vs eval.in/35097
 
4:02 PM
@CoolBoy what ?
 
@Gordon Because it is used as Node Set in XPath and not as a NodeList with hierarchy information and ordering as in DOM?
The DOM Model you quoted does not talk a single word about XPath results.
XPath results I think are known to not have a specific order (as in 1.0; libxml by convention uses document order IIRC).
@Gordon getElementsByTagName is a DOM Method. query is not a DOM Method.
Let me get it from the specs, now you got me.
 
@HamZa you where laughing this morning right ??? Just saw a mobile banking application using base64
 
@Baba
 
4:14 PM
@Gordon Yes, and PHP confirms, that it's implementation does not have this.
var_dump($dom->implementation->hasFeature("xpath", "3.0")); # bool(false)
var_dump($dom->implementation->hasFeature("xpath", "")); # bool(false)
var_dump($dom->implementation->hasFeature("xpath", NULL)); # bool(false)
 
@HamZa Here is a simple transfer ?=T*PocketMoni Default CA 11111111 100 NTAwMDAwMTc
@HamZa in fact not all the data is encode in base64 only fragments
 
This is a very simple issue, but it's driving me nuts. I'm on my desktop, running xampp.

I echo `date('Y-m-d')` and it comes out as 2013-06-27

I've put date_default_timezone_set("Asia/Kolkata") at the top of the page.

My system date is 2013-06-26....why on earth is the date echoed by my php file one day ahead?
 
@Baba Hmmm ok
 
user895378
@DaveRandom Eddie Izzard is a hero.
 
@HamZa too bad am not the type that steals other people money
 
4:17 PM
@rdlowrey He certainly is
 
@Baba that's great
 
@HamZa I would have been minimum $200,000 richer by now
 
user895378
"What is it Gunther?"
"I have invented a maneuver."
 
@Baba heh, I guess way more with the knowledge you have :-)
 
It's not really a manoeuvre at the moment. It's more of a gesture.
 
4:19 PM
@HamZa cool
 
user895378
New queue!!!
 
@hakre that still doesn't prove that it should behave like it does
 
@rdlowrey New queue?
What new queue?
 
@Gordon Well, as XPath not has any node-lists, the differentiation at least is already immanent.
Therefore you can not expect this to behave like the same.
Next to this, there are already other hints, like in DOM that there is hierarchy information whereas in a Node Set in XPath no such hierarchy information exists per each node.
 
user895378
4:22 PM
 
Still yet, even officially there is no XPath at all in PHP's DOMImplementation, we have a return type that allows us to get live-nodes from the document.
So I would rather not complain but honor this.
Because technically, those nodes can be without any document, just representing the data.
 
@hakre that's your interpretation. I think I can very much expect them to behave the same given the scope.
 
@Gordon Well, if you can tell me how hierarchy information looks like in a Node Set, please share.
It's not that I wouldn't been open to the debate.
 
@webarto 50-90+k DOE
 
@hakre what do you mean?
 
4:29 PM
> The DOM also specifies a NodeList interface to handle ordered lists of Nodes, such as the children of a Node, or the elements returned by the Element.getElementsByTagNameNS(namespaceURI, localName) method
Bold / Italic by me
 
and?
 
As per definition in XPath the result is not ordered or more specifically a set and not an ordered list, how would that ordering look like?
As you have the thought that there must be ordering, I ask you.
 
@Charles I'll take it.
;P
 
@webarto If you're legally allowed to work full time for a US company, send in your resume!
 
4:35 PM
@Charles I'm sure I'm not :) Forgot that you can telecommute from USA, heh. I work for US company but I'm not sure how I'm regulated there.
 
@Charles could you give me link of legal document ... which have rules about it
 
@NullPoiиteя I think you have to be in USA mate. No love for us in 3rd world :P
 
:P :D
 
blah, I hate doing paperwork... Is anyone in germany and fresh from starting a freelancing career? :|
 
@webarto i just wanted to get job in usa ..before 4-5 months but now i think i can mint money here by easy way and yes not by computer science :D :P
 
4:38 PM
@Gordon This is not used in Node Sets, it's used for expressions, not the result of an expression.
XPath 1.0 does not have that document-order in it's sets.
So you can not expect this.
 
@NullPoiиteя IDK, it's just too complicated and not sure if it's worth it :) I mean, I'm sure it is, it's just unlikely to happen, at least for me.
@Ocramius I used to be a freelancer and had no money :P (I don't have money now either)
 
@webarto Eh, there's contract and full-time. There are some legal restrictions on US companies with regard to actual employees, which is what we want here. If you're working for a US company now you're probably a specific type of contractor, which does indeed work out...
@NullPoiиteя I'll see if I can get the specific requirements from HR, but she's not in today...
 
@hakre ok, this is not going anywhere. I cannot make sense of your replies.
 
@HamZa I don't have enough repwhored. I normally wold have ±20k
 
@webarto what about power and construction industries ..i mean both are cool .. while you have good knowledge off law and capable of blackmail politician and officers you can get big project :) and i found that way quite easy .. got few contract
 
4:49 PM
@webarto If you want to work in the us you will find a way eventually. But right now is definitely not the best time. (H1 cap has been reached for a while...)
 
stackoverflow.com/questions/17325922/… when do people learn that if you run a query n times you won't have different results?
 
may be remote location is better thought ...
 
H1 cap? I'm going to move to america within the next couple of years, and I'm from the uk. Would this affect me if I wanted to get a job in a web company? Or even burger king? Lol.
 
@bwoebi lol query in loop and query makes no sense
 
@SixteenStudio Yep. You need a visa to work in the us (unless you are American of course). And being from the uk you can't even get your chance at the lottery :/
 
4:52 PM
How about, if my brother lives in america?
He has a child over there, an an ex-wife
 
@cheesemacfly you mean USA gov doesn't want British people work in USA :-\
 
@rdlowrey Made my day sir.
 
@SixteenStudio if YOU marry an american lady then you should be ok. But your brother is not related to you when it comes to the visa!
@NullPoiиteя They already have too many of them I guess
 
I'll have to consult my partner about that
Don't know if it'll go down to well, lol
 
It is almost always complicated. But never impossible
unless you have been into trouble with the american justice
 
4:54 PM
@SixteenStudio lolo
 
@NullPoiиteя in some cases it's impossible to solve a problem without query in loop
 
Hmmmmm
It has to be done though
I love the US!
 
@SixteenStudio why ?
 
If you love the US and found a company that's willing to get you then with patience you will end up here :)
 
@iroegbu in some rare not matching that, what most OPs want, cases.
 
4:57 PM
@SixteenStudio and US foreign policy ( which is limited to OIL ) ?
 
@SixteenStudio The industries in which they give H1B visas are limited. You have to be in a specialized field along with at minimum a bachelor's degree and certification in the field if required. It is hugely complex and is gonna vary on a case by case basis. But you will not be able to get one for flipping burgers at the local fast food joint :P
 
Not to mention that the way that they give out H1Bs prevents most companies from even being able to do so.
 
@Charles Yes. And the amount of H1B visas they hand out and how long you have to wait will be dependent on your home country
I have some teammates going through that process now
 
@bwoebi true that... especially for SELECTs
 
Yep and this year they took 125K applications for only half available visas
 
5:01 PM
62.5k is quite many already
 
The right numbers are 124,000 H-1B petitions vs H-1B cap of 65,000
 
bye guys ..
 
@cheesemacfly Yup, that's the problem really... :)
 
bye @NullPoiиteя
 
I ♥ USA
 
5:04 PM
@webarto yep, but then you can have J1, o or E visa too depending on your situation
 
Ok, give me visa now :)
 
If only I could :D
 
;)
 
I want to may ircmaxell cry:
http://stackoverflow.com/questions/13816019/php-ajax-post-data-not-being-taken
 
@NullPoiиteя Mainly the people. 95% of the population here SEEM to be antisocial ****s. Maybe I'm just being judgemental. Lol
@cspray Shame I cannot flip burgers for a living, lol. Could easily live in a motorhome :P
 
5:06 PM
@Charles I work for Site5 which is based in Colorado, and I did signed a contract between company and me. Thanks.
 
@Gordon Node Sets in XPath 1.0 are not ordered. Period. It's not my invention, it's just the case. So all I say is if you suggest a Node Set to be in Document Order - per the link you gave - this can not be the case because the Node Set is not ordered.
 
@SixteenStudio We do seem that way sometimes. But put in a little effort and we're very helpful.
 
@SixteenStudio you can work illegally in the US. The key is to NEVER leave the country...
 
@SixteenStudio Having worked in the burger flipping industry before...trust me, you don't want this :P
 
and I would strongly advice not to do so anyway
 
5:11 PM
@Pheagey
 
Yea, I know you see it all the time.
Question for you 'maxell. Say I wanted a code review of an application. Can you point me where I might submit such a review request?
 
I find it ironic that the people who argued that PHP doesn't need a vision are now decrying features for not fitting the vision. #wat?
@Pheagey ummm, that's vague
 
@ircmaxell in the current internals mails?
 
Um, peer review?
 
@HamZa That's a start. Any other options you know of HamZa?
 
@Pheagey First of, we are talking about what ? PHP project ? How big ? How many lines of code ? Do you want it to be in the wild (do you care to share with everyone) ?
 
ARGH such crap questions last days
 
@HamZa Small utility. Maybe 1000 lines all total. It was be public on GitHub.
MIT lic.
 
5:20 PM
@Pheagey So it is on github ?
 
@HamZa It is yes. But no where near close to being review ready.
 
@Pheagey So it is working, but you want to review it against what exactly ?
 
@hakre I still fail to see how any of what you said explains why the resulting DomNodeListshouldn't be live when the specs clearly they should be.
 
someone flagged my comment and it was removed… Is it so wrong when I write "Sorry, but I call this bullshit"?!
 
@bwoebi yep
 
5:24 PM
@HamZa ?!
 
@HamZa Not working (yet). I want to use this project to setup a peer review process for myself.
 
@bwoebi didn't flag it, but we are in a community, we should watch our language. In the chat, it should be fine (in some situations)
@Pheagey heh, maybe if you add a link in your "about me" people will try to commit :p
 
@HamZa then, how do I intensify the "this is a very very bad idea"? bullshit would the appropriate word I thought…
 
@bwoebi lol use BOLD !
 
@HamZa I want to intensify the word, not the style ;-D
 
5:27 PM
@HamZa Hello
 
@HamZa :) Valid.
 
@user4035 yellow !
 
@HamZa or is bullshit offensive? thought this would be only a synonym for a horribly bad thing?
 
Look here:
http://stackoverflow.com/questions/17325418/sql-query-for-totals-of-products-for-last-six-months#17325418

He has an SQL request, written in 1 line. Will it be reasonable to encourage the people to put their code
into structured manner, like this:
SELECT
	 product,building,
	 SUM(qty) AS 'month1'
FROM
	 sh_orders
WHERE
	 MONTH(order_date) = MONTH(CURDATE())
GROUP BY
	 product
@HamZa I want to ask a question about horizontall scrolling of code.
@HamZa So everybody could instantly see the contents of the code instead of stupidly scrolling it back and forth
 
wait wait wait! Shut the front door!
php.net is changing its interface?!
 
5:33 PM
@bwoebi ok, just a question: do you think you could use the word "bullshit" in front of your parent(s) ?
 
@HamZa I can use a lot worse ^^
 
@HamZa I sometimes do.
 
@Pheagey where have you been ;-) :-P
 
@Pheagey @bwoebi It just depends on the culture, and education you have from your parents. For me you shouldn't use it. It could be the same for the one that flagged @bwoebi
 
I'm Madara though, what are they gonna do? :P
 
5:35 PM
@MadaraUchiha heh, nothing
 
@HamZa don't know, I'm not native english speaker ;-)
 
@user4035 Sorry I don't follow you ?
@bwoebi Well me neither, just translate it lol
 
@bwoebi you should consider adding a warning about sync ajax in your answer
 
@user4035 You could edit the question, and then put in the comments to take more care about formatting the question
 
@BenjaminGruenbaum don't know why sync ajax is bad. at least when something must be loaded in order so that the other code won't fail on undefined ids for example.
@HamZa then the answer is yes
 
5:38 PM
@bwoebi Imagine you're scrolling through a webpage and then it suddenly _FREEZES and you can't scroll for like a second and a half. Sound bad?
 
@bwoebi So how do you say "bullshit" in your language ?
 
@bwoebi It's very possible to circumvent it using continuation style passing with promises or callbacks.
 
@BenjaminGruenbaum Erm, it doesn't freeze always? It just freezes the current asynchronous branch?
 
Once you get used to it, it's as readable, if not more
@bwoebi There are no 'branches', JavaScript is single threaded in the browser by default.
 
@HamZa Schäissdreck
 
5:40 PM
@bwoebi Hmm... imagine this: You go to the library and you want a book, they don't have that book yet so instead of standing there and waiting for the book until they have it, they tell you they'll call you back when they'll have it.
 
@HamZa I edited it, but he reverted this part back, and I don't want to touch it any more. I just wanted to ask, what is better for the people to read: 1-liners with horizontal scrolling or multilined content with structure?
 
@BenjaminGruenbaum but somehow the browser must switch between the different executing paths (one click event being processed here, one mouse event there, …) or are they executed sequentially?
 
@bwoebi which language ^^ /?
 
@bwoebi Sequentially using an event loop, but since there are no threads it all happens really fast , when the user clicks the browser first finishes executing what JS its currently doing and then checks for events, then executes them sequentially. It's a very simple and powerful model for concurrency. @rdlowrey is currently working on something that works similarly for serverside PHP :)
 
@HamZa Luxembourgish
 
5:43 PM
@bwoebi Isn't it written: Scheiss?
 
user895378
non-blocking event-loop execution should be fast enough for anyone.
 
@user4035 this is German (Scheiß or Scheiße)
 
@bwoebi yes
 
@rdlowrey Me and @bwoebi were talking about the problem with synchronous IO (Sync AJAX in this example) in such and environment and why it should be avoided.
 
The one you proposed here is nice, but don't bother too much. I mean that user probably didn't even put some efforts, and look at the formatting ? It's horrible
Also it's a user\d+ user with 2 questions in 2 months with 0 answers. That would be another indicating point
 
5:45 PM
@BenjaminGruenbaum oh, okay didn't know. thought this would be some sort of emulated threading or such thing.
 
user895378
@BenjaminGruenbaum Yeah, if it can't be done asynchronously it's right out. I can't imagine halting javascript on the client side to wait for an HTTP request to come back ... that'd be awful.
 
@HamZa Sure, this user is sloppy
 
(I just don't notice problems there as my testserver answers in less than 5 ms)
 
@bwoebi You can do threading in JS, it's quite possible and not too complicated (both in nodejs with fibers for example, or clientside JS with WebWorkers). It's often not needed, using the event loop for asynchronous I/O is both simpler and faster.
3
A: JavaScript setInterval only runs once

bwoebiI suppose your browser is caching. You get the data exactly once and then the next requests are served from cache. So the refreshLog should be called repeatedly, just the following calls won't have any effect on the page as it's serving from cache. Append to the URL some unique part like a ?=<ti...

 
@ircmaxell Buried in work and video games :)
@HamZa very true
 
user895378
5:46 PM
I prefer event loops just because my small brain has an easier time making sense of them than threaded concurrency.
 
@BenjaminGruenbaum I meant: I thought this would be an implicit emulated threading model.
@rdlowrey yes. event loops are nice in PHP as long as you don't use queries (or something other which blocks)
 
hi guys, anyone here who's good in git? ive got problems with my ssh and i can't seem to find a solution. been googleing for almost a day now.. :(
 
user895378
@bwoebi Yeah ... the problem with event loops is you get numpty PHP programmers who don't understand that you can't just stick a synchronous mysql_query() in the middle of your loop :)
 
@user4035 I would close vote it
 
@rdlowrey that's one main reason why I'm using pthreads for PHP daemons.
 
user895378
5:50 PM
And it's also not feasible to create a non-blocking API for each individual synchronous task you require. I think that's the wrong way to approach event loop concurrency.
 
user895378
And it seems like that's where PHP development has focused recently where event loops are concerned.
 
@HamZa ok
@reikyoushin Describe, what's happening
 
user895378
But the problem with threads is that you can't go to high volume (such as having thousands of concurrent clients connected to a server).
 
@rdlowrey no. that's why I store the database's content I often need in an PHP array on startup and only do update queries in a separate thread. (and I assume that nobody changes the db during the daemon's runtime)
 
ive got this problem with bad file number error.. i can successfully ssh to github, but i cant do it on my own server
 
5:52 PM
This way I don't need selects which would block.
 
btw, my server is a shared hosting one..
 
@reikyoushin I was able to successfuly interact with a git repository on a shared hosting through ssh
but it required to install git there
 
:-P
 
and set up the ssh public/private keys
 
yeah ive done that already.. (git is preinstalled on that shared hosting so all i needed to do was to connect via ssh)
 
user895378
5:54 PM
I think it's difficult to abstract a threaded concurrency model into an API that has broad applicability. i.e. you can use threads quite powerfully if you write your entire application around their functionality. But the problem with that is you lose all encapsulation when you have data shared in that manner. Maintenance difficulty increases exponentially and bugs become far more likely.
 
user895378
You can use threads and get fantastic performance but IMO for any non-trivial application you're making your life very difficult in the future.
 
i tried this $ssh -vT gerrickv@git.gerrickvillarama.com <~ but this stops on a stdin: is not a tty error
 
user895378
Like everything, threads present a tradeoff.
 
although i can see a debug1: Authentication succeeded (publickey) just above it
 
5:56 PM
@reikyoushin This works for me: git push ssh://user_name@host_name/~/gitprojects/myproject.git
I have all the projects in ~/gitprojects directory
 
user895378
I'm not arguing against threads, BTW. Just discussing. @JoeWatkins work on pthreads is awesome and should be encouraged.
 
@user4035 do you have a shared hosting too?
 
@rdlowrey don't think this. If you access GlobalStorage::users or write a query, it's exactly the same result. It's exactly as encapsulated as a database.
 
@reikyoushin yes
 
did you follow a tutorial to create it? ive been trying to create one for myself for almost 2 days now and i still can't make it work :(
 
user895378
5:59 PM
@bwoebi Right. Of course, that's a simple, straight-forward case. If that's the full extent of your multiprocessing needs then threads are awesome.
 
although i was supposed to put it on domain.com/~repos/
 

« first day (984 days earlier)      last day (3969 days later) »