« first day (1733 days earlier)      last day (3230 days later) » 

7:00 AM
@Ja͢ck yeah but.. the point is, it doesn't really have many (5 votes give or take) compared to the number of views :(
 
that's not unusual :)
 
@Ja͢ck how long did take you to get too 100k? or is there a point, where karma just flows in at ridiculous numbers?
 
@Killrawr Sure. If you repwhore :)
 
Getting 100k takes a while, chasing the legendary badge definitely helped ;-)
 
@PeeHaa I'm pretty proud of my account so far lol, I've had a job interview at Google, TradeMe (Biggest NZ website 3,675,349 member accounts), and some other good corporates haha
 
7:04 AM
What does that have to do with your SO account? :P
 
I'm just happy with my coffee mug and t-shirt haha
 
I don't know, I put it on my resume haha (that and I have a double major kind of helps).
 
Also note that you don't mention getting a job in any of those places ;)
 
cool, what did you major in?
 
Nah already employed ... that was when I was job hunting
 
7:05 AM
I need to add a small chatbox/shoutbox for my website through my index.php file. I dont have sql at server, any recommendation on the same?
 
Did a major in Computer Science, and another in Communications
 
@user1977867 sqlite?
 
Graduated last year :P
 
i can get it installed by the admin if its necessary
@Jack
 
ah nice, i've only got a degree in CS ... but 12 years experience heh
 
7:07 AM
I don't have any real degree
 
@Ja͢ck do you have experience in a particular lang? or just an all rounder?
@Ja͢ck I know about 9-10 different langs lol
 
"know"
 
i know Dutch! =D
 
And "languages"
 
@Killrawr knowing or mastering?
 
7:08 AM
because javascript is also probably on that list
 
@bwoebi I'd say my best lang is PHP, then Java (oracle) lol
 
@bwoebi "function name must be a string" => it can also be an array [$obj, 'bar'], or an obj implementing __invoke()
 
@PeeHaa JavaScript is awesome dude :P
 
@bwoebi know of an extension that returns props from a read_property with refcount = 0 ?
 
No it is not
It is horrific
 
7:08 AM
@JoeWatkins nope
 
Naysayer!
 
@PeeHaa jQuery > JavaScript
 
@JoeWatkins also… that shouldn't happen AFAIK?
 
possibly there is a bug in the logic of the object model now ...
 
lol now you are just trolling
 
7:09 AM
@PeeHaa wanna play Noughts and Crosses? :P
 
CoffeeScript, baby!
 
@Ja͢ck That is reeeeeally scary
 
It really is
 
The problem is that CoffeeScript questions typically stem from misunderstanding JavaScript in the first place.
 
the model requires it, if there are no other references to set refcount = 0, but when you do that, things go really wrong
 
Is it okay to ask here about a question that is posted on a different Stack? The chat over at ServerFault is pretty dead :(
 
@Ja͢ck And even if it solves something. It solves it in the most stupid way possible
 
@JoeWatkins when there aren't you're supposed to return &EG(uninitialized_zval) or &EG(error_zval) (I believe?)
 
7:11 AM
33/* The following rule applies to read_property() and read_dimension() implementations:
34   If you return a zval which is not otherwise referenced by the extension or the engine's
35   symbol table, its reference count should be 0.
36*/
37/* Used to fetch property from the object, read-only */
38typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type, void **cache_slot, zval *rv);
 
@ircmaxell if I come to New York one day, can we have a coffee, you are one of my favorite American people I know
 
no if the property exists, but isn't otherwise referenced by the engine (not in prop table or any other tables)
 
@ziGi what country are you in?
@JoeWatkins what language is that? doesn't really look at PHP.
 
@PeeHaa I think that's one of my worries starting with Ruby development ... you get sucked into a world of stuff like CoffeeScript, Yaml, and Haml =/
@Killrawr It's C
 
@JoeWatkins that looks like an outdated comment to me
 
7:13 AM
Oh god. Haml.
 
yeah I think so, but I dunno what the new advice should be .. so stuck ...
 
mmm I don't really know C ... (isn't C on its way out? with swift and Go) btw??
 
pfft
 
:P
 
2 mins ago, by bwoebi
@JoeWatkins when there aren't you're supposed to return &EG(uninitialized_zval) or &EG(error_zval) (I believe?)
 
7:13 AM
no the property exists, you need to return the property
 
@Killrawr C on its way out, say what now?
 
I heard javascript is going to fill in the gap
 
@JoeWatkins then return it, with refcount 1?
 
but I don't have another reference, so it stays in memory until gc
 
Btw, I am somewhat happy that I can still hack in C when moving to Ruby ... \o/
 
7:15 AM
@JoeWatkins (assuming you're going to zval_ptr_dtor() it in case when the object is dtor'ed?)
 
no Im not, because there is no zval
 
or what exactly are you even trying to achieve?
 
when you read a property from a Threaded object, it's not referenced by the engine, the zval is created in the context that called read_property, and it needs to be destroyed by the engine at the point of exit from the current stack (which is how it used to work), I have the property in another format, and tthat is destroyed with the object, but zvals passed to the engine are disconnected completely from that storge
 
@Killrawr the Netherlands
 
@Ja͢ck Yeah I was reading a CodeProject article about the development of Google's Go language, can't seem to find it now though.
 
7:19 AM
go's compiler is written in C ... C makes the world go round, it's going nowhere ...
 
@JoeWatkins ehm, but the zval has no refcount anymore, just the zend_string*/HashTable*/zend_object* have now. … Are these three also created in that context?
 
@Ja͢ck found it jaxenter.com/go-1-5-is-out-118704.html "Go 1.5 is out: Say goodbye to C"
 
@bwoebi they are created in that context, need to be dtored by that context, if you pass refcount = 1 it won't be ... isn't ...
 
@Killrawr For somebody who knows 10 languages it's a bit odd you don't actually understand plain English :P
 
This reminds me of Delphi, whereby Delphi 4 was built with Delphi 3 ;-)
 
7:21 AM
@PeeHaa I'm pretty sure the article is referencing to C within the Go compiler ;) .. now you say this!
 
:-)
 
@JoeWatkins okay… and what goes wrong when they have refcount 0?
 
leaks
you got time to debug some code ?
 
valgrind stacktrace? (where is the leaking memory allocated?)
yep
 
but you'd add a reference on the receiving end, no?
 
7:22 AM
let me push the branch, I'm going round in circles another set of eyes will be invaluable ...
 
@ziGi oh true, should visit NZ before New York ... we have better scenery ;).
 
I'm visiting NZ soon.
 
@Killrawr oh yes, I love your country and the people there, I have 3-4 NZ friends and they are so nice
 
Won't find hqwallbase.com/… in New York guys! haha
 
And my family comes from the mountains in Bulgaria, so you can imagine that even bigger mountains in NZ is gonna make me melt
 
7:24 AM
Going to NZ as a Dutch makes complete sense, because we came up with the name hehe ... too bad they renamed New Holland, though hah
 
[seven b559fba] initial import of PHP7 work ... DON'T USE THIS YET
 54 files changed, 3476 insertions(+), 4313 deletions(-)
 
@ziGi yeah I've heard good things about Netherlands too, I had a friend who recently competed in the Powerlifting worlds, and his snapchats of Netherlands were Oh my god.... so awesome
 
ah, I see a few places where that may leak…
 
@bwoebi pthreads_store_read in store.c is where refcount is set on property
I also have a problem when std_dtor is called, it tries to destroy what looks like a property already destroyed
 
@Killrawr what exactly do you find awesome? I think we are just hyped since we've never been to the countries we're talking about. New things are always exciting
 
7:26 AM
@ziGi yeah you'd want to visit en.wikipedia.org/wiki/Aoraki_/_Mount_Cook 3,724 metres (12,218 ft) its epic. You can rent bikes, the bike lanes are way better than what we have here (but we are starting to see like $50M investments to better bike lanes here). The night life, the women?! ... so awesome
 
@Killrawr yes, I am saving now 20K, so I can go on a sabbatical in 2 years when I am 27 and explore the world
 
Code is missing some else if (UNEXPECTED(Z_REFCOUNT_P(read) == 0)) { zval_ptr_dtor_nogc(read); } in some places
 
:24458985 he's from NZ, they say dick for deck :D don't be so harsh on him
 
heh
 
@JoeWatkins do you have a quick simple script to repro?
 
7:28 AM
class-defaults.phpt
but that fails for two reasons
 
@ziGi my uncle who is Australian, gives me a hard time for six (our accent makes it sound like sex) hahha mashable.com/2015/04/09/siri-new-zealand the issue is real
 
tests/magic-methods-get-set.phpt
seems connected only to the refcount problem
 
@ziGi yep haha that is brilliant
 
indeed
That's why my neighbors are jealous of my dieck, right John? YES! You've gotta nice dieck!
 
7:33 AM
gotta pop out for an hour or so @bwoebi, I'll read whatever you ping t o me when I get back ... thanks for looking ...
 
okay
 
@JoeWatkins at first I read "gotta poop out for an hour or so..."
 
it sounds yucky when you say it like that =p
 
@Ja͢ck why is that yucky and yummy are so close to each other in terms of pronunciation
 
why are desert and dessert for that matter? :)
 
because dessert comes from French des + servir (to serve) desservir -> dessert
and desert comes from latin desertus (left waste) -> deserter (old french) -> desert middle english
 
"to server"?
 
typo
 
8:00 AM
why is it waiter and not server?
 
garçon!
 
@FlorianMargaine because he "waits" on tables
and waiting is to remain inactive while still available to serve
 
so when he stops waiting, he becomes a server?
interesting
 
and server is to fulfill someone's wishes in a reasonable amount of time
 
SYN/ACKing everywhere around
 
8:04 AM
> The version of your website (php.net) and SEO-algorithm is outdated and affecting your outcome on prominent search-engines.
 
hehehe
 
the "throw exceptions from functions" debate is heating up nicely >D
 
If anyone has a moment and cares to have a read, I need some feedback on this gist.github.com/srgoogleguy/f1255a141a437ed24576
Thanks
 
8:21 AM
Use the reverse object enumerator, of course!
> as long as the code can reverses
reverse*
> you're not a good candidate for the job when you aren't able to write the functional
if, not when; function*
 
Yea, rough draft. More interested in the content than the grammatical quips at the moment :)
 
Yeah, but I stop reading whenever I see those
 
Sure, feel free to point them out :)
 
Our pet question is writing a prime number generator.
> So on one hand this question does two things.
 
Yea, that's also a pretty common one. That and how do you find two numbers in an array given a sum of X.
 
8:25 AM
I don't see the "other hand" :)
 
> They are asking if you understand how the wheel works
In my experience this is mostly not true
They are trying to finding out how you react
 
@PeeHaa React? React to what?
 
How you are going about to trying to solve it
 
"Ohnoes, I have to write code. This is not what I signed up for!" type reaction?
 
It's more a thought process than a knowledge thing
Which is what I read when I see "how the wheel works"
 
8:27 AM
@PeeHaa Oh yea, well, doesn't that fall under "how the wheel works"?
Sure, knowledge is one part of it.
Keep reading it.
> Realistically, the question goes beyond just addressing your understanding of a particular implementation...
 
> There is no right or wrong answer to this question, by the way, as long as the code can reverses the array
Yeah that ^ is more like it
> No the real fun begins
Now
 
This is really written to target the sheepish jr candidate going on their first couple of job interviews or the guy (or gal) that thinks he/she has too impressive of a resume to have to write code in an interview. Some people think I'm trying to trick them, but I could really care less if the code is amazeballs or not. I just want to see they can write it at all so I can figure out if this person is even worth continuing the interview with.
 
No junior will be able to tell you WTF big O means
 
Depends on the quality of their education.
For example, the candidates I've interviewed coming out of MIT could probably explain some probabilistic algorithms to me better than I understand them. :)
Knowledge is passive though.
You have to remember that bit going in.
 
// me goes to lookup the difference between probabilistic and randomized algorithms…
ah ok.
 
8:35 AM
lol
I think the question I like the most is implement rand7 using rand5
... on the topic of random
First time I encountered that it really got me thinking about my understanding of consistent distribution.
 
...
 
@bwoebi That's exactly what I thought too at first :)
 
wrong answer.
yes.
 
of course it is
But the interesting part is figuring out why on your own and coming up with the correct answer.
 
@Sherif simple… generate 7 numbers, add them and use modulo 7.
 
8:37 AM
Still wrong
 
aha?
 
I'll give you a hint... your function will likely have to call rand5 more than once ;)
 
@Sherif I said generate 7 numbers? (means calling rand5 seven times)
 
Hi
Need some expert suggestion to fix google analytic issue
 
or maybe add 1 to the result to have true 1-7… instead of 0-6 (assuming rand5 being from 1-5)
 
8:40 AM
muuuuuuuuuuurghning
 
Issue : verification failed. we could not find any google analytics tracking code on index page of website.
 
@Sherif please, tell me what's wrong about it … and why?
 
I have found extra code in my PHP file:
observer one extra code in PHP file
<script type="text/javascript"> //<![CDATA[ try{(function(a){var b="https://",c="www.qasource.com",d="/cdn-cgi/cl/",e="img.gif",f=new a;f.src=[b,c,d,e].join("")})(Image)}catch(e){} //]]> </script>
 
@DaveRandom dsmfsdiofdsucsiduvsdomf
 
Must... have... tea...
 
8:43 AM
Tea?? You people are strange
 
@bwoebi Because the probability that you will get even distribution across all 7 numbers is not 1/7 in that implementation. What happens when you do X % 7 on an integer space of 0 through 4?
 
@Sherif Sure?
 
@VishalBharti I'm going to take a wild stab in the dark here and suggest that you are running Wordpress?
 
no my website is in core PHP
 
@Sherif that's why I generate 7 integers
 
8:46 AM
Well that code looks like it's probably unwanted, it fact it looks like that sort of thing that ends up in places because of some WP/framework back door
 
One more thing I am using CloudFlare . May be Cloudflare push some code.
 
@bwoebi Well let me clarify the requirements a bit: rand5 always returns an integer between 0 and 4, inclusive and garauntees a 20% probability that you will get any integer in the given range each time, so even distribution across the integer space. The requirement is that you implement rand7 using only rand5. i.e. you can not make a call to any other PRNG.
 
@DaveRandom Looks more like a tracking pixel
 
Even if you generate 7 integers and use mod 7 you still don't have even distribution.
 
Either way it is unwanted :P
 
8:47 AM
http://stackoverflow.com/questions/29672254/unknown-img-gif-cloudflare

Just got some idea from here
 
@PeeHaa Will yeh I'm not really concerned with what it actually is, more that it's there at all
 
You have a 50% chance that any time you do 6 % 7 you will get 1 or 5 % 7 you will get 0. Thereby increasing the distribution of those two numbers.
Think about it.
 
People don't pointlessly break up constant strings like that unless they are trying to hide them
 
@bwoebi The correct answer to completely satisfy the requirement of even distribution requires writing an implementation that becomes potentially unbounded time (i.e. a recursive call to rand7).
 
@DaveRandom I'm sure they didn't do it just because :P
 
8:53 AM
@DaveRandom : You have any idea about the issue ?
 
Hey guys, a bit of a DBA question, but is it okay to have entities that have foreign key to entities with foreign primary key? I mean is there any consequences / performance impacts?
 
@Ivan0x32 Yes, your insertion times become horridly slow.
 
ThW
Morning
 
You mean records or entities? @Ivan0x32
 
8:59 AM
Either way it's a trickling effect. A FK constraint on the entity means an FK constraint on each record within that entity.
My advice for FK is try to avoid them whenever possible. They're rarely ever necessary in practice.
 
Yes, that involves a JOIN, meaning you're now locking two tables instead of one for an INSERT
Of course the characteristics of the actual performance impact depends a lot on the dbms you're using.
In MySQL, for example, I've seen devastatingly poor performance consequences of that.
Try inserting a million rows at the same time with a high-load read on the slaves in that constraint.
Good luck :)
 
fml
 
You can obviously tweak that quite a bit given someone savvy enough in MySQL tuning, but really, it's not fucking worth it man. Just get rid of the FKs. There is a better way.
 
So, its going to be better if I'll just give those entities an ID and just enforce uniqueness through indexes?
okay, thanks a lot!
 
9:05 AM
Yes, indexing the PK across the entities will help speed up the lookup, but it's not going to enforce shit.
You will have to enforce the constraint yourself in code.
You could do that by writing a stored procedure and requiring that it only be done through the stored procedure. That is assuming your primary concern here is performance and not compliance.
Because a unique constraint just means I have to provide you with a unique value, doesn't mean that value necessarily exists as a PK in the other entity :)
 
$array3rdValue = myfunction(parm1)[2];
is this a valid code for php?
it is in JS
 
should be
If you're using 5.5+ afair
 
It does work on my machine but my colleague said it is causing the whole page from rendering any thing no error nothing...
blank page
 
ThW
@ImranBughio compare the php versions
 
It's 5.4+ actually, but whether or not it's valid really isn't the underlying reason for why it could cause a bug.
For example, if myfunction happens to return an array that does not contain a key of 2, then you would get an undefined index notice. Or if it happens to return something that isn't an array at all.
If you're using a custom error handler that throws an exception for every error, and that exception is uncaught, it becomes a fatal.
 
9:16 AM
I see
 
A fatal in a production environment that does not have display_errors turned on is a WSOD :)
It's just not good practice to do that given those reasons.
The better approach is to always assign the return value to a temporary variable and then check isset if you can't be certain the return value will always be an array containing that key, with any given input.
 
Great tip :)
I will use isset
Taking the value in a different variable have solved the conflict on different machine.
 
Look at that. I helped someone today. I should really try installing this PHP thing and learning how to use it.
 
lol, you are not a PHP guru ?
 
I didn't even know what PHP was up until 5 minutes ago. I thought this was a room for Pervasive Hemorrhoid Patrons.
4
 
9:33 AM
@Sherif This isn't that room?!
So if this room isn't about bottom problems, what is it about?
 
@salathe duh, no, it's Pretty High People
 
I thought it is Personal Home Page
 
@bwoebi ping
 
@JoeWatkins pong
 
did you find anything out ?
 
9:35 AM
I'm not 100% sure, but actually you're setting rv too
 
I thought that's what it was for ?
because stack space, right ?
 
I'm not quite sure.
 
Yep, but that thing also want to return something with refcount >0
 
9:38 AM
ah
 
@RonaldUlyssesSwanson Yes, sounds fine
@JoeWatkins pong
 
hi Nikita, so I have this problem when returning a zval from read_property with refcount = 0, am I supposed to use rv param, or something else ?
 
@JoeWatkins really, don't set the rv.
 
that means emalloc'ing a zval though :(
 
nah, don't emalloc() a zval, use a static zval (or in the zts case now a PTHREADS_G())
 
9:43 AM
My job would be a lot easier if pirate sites weren't so poorly made. Sigh.
 
Good morning
 
@JoeWatkins okay, bad advice
 
maybe I could stick it in std->properties_table
also, then I wouldn't need to set refcount=0, because it'll be dtored with the object
 
@JoeWatkins yes
 
Z_TRY_ADDREF_P(rv);

in handlers.c:152 seems to remove the leak
 
9:47 AM
@JoeWatkins Or best, be more precise about where that refcount 0 zval is coming from
 
@JoeWatkins I now remembered that the rv variable is something what's supposed to be freed
you can't have a rv variable with refcount 0, that'll go wrong.
 
Has anybody got experience with SlimPHP??
 
Yes, if you put it into rv it should have a higher refcount
But it's the right mechanism to return something you do not own
 
right, okay
so I shouldn't use rv if refcount == 0
 
Where is it coming from?
 
9:51 AM
@JustSteveKing it's another one of those frameworks, which use global state and think that "view" is just a different name for a "template"
 
a separate properties table that is shared among threads @NikiC, it doesn't use zvals and can't use refcounting built into zend, because not safe ...
 
Yea pretty much haha
@tereško have you used it at all though?
 
@JoeWatkins and you duplicate out of it?
 
yes
 
@JustSteveKing nope, I have only browsed its source on several occasions
 
9:52 AM
@JoeWatkins In that case duplicating into rv and giving it rc=1 sounds like the right thing to do
 
I am having issues with native sessions and it is driving me crazy!!!
 
@NikiC okay, that does work ...
but I'm still left with a bug
 
@JoeWatkins that other one is unrelated and I have no real idea why
 
it's trying to dtor an already destroyed zval that is not in gc
 

« first day (1733 days earlier)      last day (3230 days later) »