« first day (1554 days earlier)      last day (3409 days later) » 

The environment prior to its definition is []
The environment after its definition is ['foobar' => Closure...]
That's a problem, because foobar calls foobar
So the solution is for foobar to close over not the environment before it is defined, but the environment that will be created by that specific use of let
 
user895378
@crypticツ that works but in that case you may actually want to use defineParam() because your $dbRead and $dbWrite parameters probably are global in your application.
 
You can quite easily implement this by passing the environment around by reference
 
@rdlowrey yes, they will be.
 
So that $newenv['foobar'] = evalLisp(..., $newenv); works
 
user895378
3:03 AM
I see.
 
@rdlowrey but they will only be getting passed to that class, as all other controllers extend the abstract class, so would I not want to have it specific to that class?
 
Now, passing the environment around by reference would mean that code in a nested scope could modify the outer scope, right? Actually, nope!
You can just copy the environment and modify the copy, then use that copy from that point onwards, for let and lambda :)
 
user895378
@crypticツ Sure that's safer to just define it for the one class.
 
This could be done "properly" with array objects and copying, but why bother :p
 
user895378
@AndreaFaulds oh nice :) It took me a moment to understand this.
 
3:05 AM
@rdlowrey sweet, thanks for the help!
 
user895378
@crypticツ no problem ... vampire.
 
That's why there's the $env/$newenv distinction
 
user895378
@crypticツ I actually meant time-wise because all your pings happen at night ... not the help vampire variety :)
 
If you don't assign by-reference, PHP copies for you when you do $newenv = $env;
People say references suck but they work perfectly and pretty intuitively here :D
 
user895378
@AndreaFaulds I agree ... there are times when references are extremely useful
 
user895378
3:07 AM
especially when I'm doing crazy stupid zero-copy performance hacks that I probably shouldn't be doing
 
heh
By the way, references in PHP 7 are now literally just a value in a box
 
user895378
Okay, time for some zzzs.
 
user895378
@AndreaFaulds \o/ booooo
 
Previously all values were in boxes and references were special, but now only references are in boxes
(Which makes references slower, actually)
 
user895378
I was about to say I don't understand why that would be, but I think I do.
 
3:09 AM
@rdlowrey We unboxed everything else
 
user895378
So everything else is faster now, yes?
 
Yeah
Instead of copying around a 64-bit pointer to a zval allocated somewhere, we copy around a 128-bit zval
64 bits are the type and some flags
 
user895378
Oh, I do remember this RFC
 
other 64 bits are the value (or a pointer sometimes)
Yeah
 
user895378
I'm looking forward to getting back into php-src soon. I've carved out some mandatory time for it in the new year.
 
user895378
3:12 AM
Anyhow, I'm an old man and I need sleep. I will catch you folks on the flip side.
 
user895378
It’s only 22:15 here and I’m totally ready for bed. On a Friday.
 
@rdlowrey booooooo
 
Goodnight @rdlowrey
 
@rdlowrey you're on the east-coast?
 
If you two meet up, take pictures. Particularly pictures of @rdlowrey. So we can admire him.
 
3:33 AM
Oh yeah, for retweet whoring:
I wrote a working #PHP Lisp implementation in 1:01:54.32 after @ircmaxell challenged me! https://gist.github.com/TazeTSchnitzel/44720ea3aec64a9e330a
And with that... goodnight, I should sleep :)
(still haven't responded to the Scalar Type Hints RFC thread on internals, trolololol)
(goodnight for real)
 
3:57 AM
@rdlowrey You should leave all the vacationing to the young folk who can bear it ^^
@AndreaFaulds Erm, join?
 
@LeviMorrison Not always possible, and this isn't the only case where you want to do something either only on the first iteration, or every other iteration
 
ah, wait, I should be sleeping
alas
 
4:16 AM
does anyone know how I can do this:
$get=print_r($_GET);
 
@eyeLoveFiddle Yes, output buffering
 
yes
to see what i'm dumping through a jquery
 
ob_start(); ☜ anything outputted after that is called gets stored instead
 
like a sift for data
k
ty
 
Then, you can get the contents of the buffer as a string with ob_get_contents();
Then you just need to do ob_end_clean(); to end output buffering and clear the buffer
so, putting it all together:
ob_start();
print_r($_GET);
$output = ob_get_contents();
ob_end_clean();
 
4:22 AM
k
 
Oh, actually, there's a shorter version
 
ob_start();
print_r($_GET);
$output = ob_get_flush();
 
doesn't it need to end first?
 
ob_get_flush() both gets you the contents of the buffer, clears it and stops output buffering
 
4:23 AM
aww
 
okay C++ dev in desperate need, do you guys know CSS? xD
 
@Gizmo Yes, but I think you'd be better helped by people in the web dev room
 
I hope someone's alive there at this time :)
My image gets cutt off and I can't get it to fully display xD
exe24.info , on the top :(
 
Well, someone there can help you, please go there
I need to sleep, sorry
 
Good night :P
 
4:25 AM
Goodnight
 
@AndreaFaulds I found a bug
Warning: Unterminated comment starting line
my bug
gotta end /*
 
Hi, I am getting this error when importing the xml to mysql using php
Notice: Trying to get property of non-object i
can u pls help me
here is the program and xml
http://stackoverflow.com/questions/27995698/importing-the-data-from-xml-using-php
 
5:08 AM
what's wrong with my path: /other/test.php
i've tried everything
 
5:24 AM
good morning guys
 
morning
@farooqshaik are you there?
 
i am here
 
5:40 AM
@rdlowrey I think I'm doing it wrong. See test gist.github.com/KyraD/5c6a771af8a94fdb8b28 the output should be of both instances, but it's showing the same instance for both.
 
i never learned how to use classes yet XD
 
6:28 AM
@AndreaFaulds can't you just do $output = print_r($_GET, true);? print_r allows returning the output as it only accepts one input, var_dump allow multiple inputs so the output buffering method needs to be used in that case.
I wish both had the return option =o(
Could it not be given that option since we now have ...? I don't know much about that new feature so not sure.
 
user3949359
7:05 AM
Why is PHPStorm want my deployment path to be relative the local project folder?
 
8:45 AM
@nosille it doesn't
 
9:37 AM
mornin'
 
Morning
 
10:35 AM
which server should be used at the learning stage of zf2 ?
 
user3949359
10:52 AM
Is the cursor in MongoDB just a list of the documents, that resulted from the query?
 
user3949359
and not the documents themselves
 
user3949359
Like a pointer?
 
11:08 AM
Mornings!
 
Hi guys
 
user3949359
12:06 PM
What do I see MySQL more often than Oracle RDBMS if Oracle is such a huge corporation?
 
12:29 PM
why are bioware games so damned annoying ?
mean, seriously: punishing minigames, safepoints before unskippable cutscenes before major battles, dodgy hit dection, one-kill kills,
 
1:02 PM
:-P
 
Morning
 
morning
today is a good day... I can verify emails on gmail \o/
 
@FlorianMargaine Awesome progress \o/
 
mornig
 
1:22 PM
Morning mr Crovella
 
1:33 PM
Do mods have a sane way to see voting inregularities?
 
@nosille Didn't you ask for help yesterday with MongoDB on your other account?
 
Does anyone know how can I use dependency injection here?

--------------------------
// Get questions:
$questions = $this->questionsData->getQuestions($where, $this->start);

$pagination = new \Ask\Other\Pagination($questions['total'], $this->page);
-------------------------

It's part of a method in my class.
As you can see, just the class know how to create a new instance of that class.
I can use Factory. but It's kind of weird that I use Factory just because that I want to use dependency injection.
 
@user3002233 Not sure whether I get what you are doing. But using a factory to build new instances of some thing inside some fetcher sounds like a sane approach to me
 
@user3002233 This is possibly one of those places where you don't need to be able to use DI. Unless you want to be able to swap what type of pagination is used then you probably don't need to use it. And yeah, if you do want to swap what type is created, then you would have to inject an instance of a factory.
http://stackoverflow.com/questions/27992415/imagine-imagick-error-wh‌​en-error-reporting-is-enable
 
@user3002233 Also I have to ask: what does $questions contain? Because it looks like you are querying more than just a count
Again I just woke up so not sure what is going on in there :)
 
1:41 PM
@PeeHaa sounds like OOP's weakness to me.
 
@user3002233 Why?
 
OOP has plenty of weaknesses, we wouldn't need patterns otherwise
2
 
As @Danack said you can just tight couple the object instantiation if you don't think you will need it?
Pro tip: when it comes to programming (and with almost everything in life) there is no magical silverbullet
*- PH*
aaaah cock markdown
 
Having a factory wouldn't really hurt tbh... Factories aren't big objects to be feared, they can (and should) be very small
 
@PeeHaa I think there's no harm in doing so. You don't save any time overall by injecting factories first, compared to doing tight coupling and then refactoring when you realise you need to decide what type is used at run-time. It's a very strong case of yagni
 
1:44 PM
Imho they should be small
@Danack Yeah I don't disagree with that sentiment
 
It's more just the arse of having to create the factory interface, create the factory, and the added cognitive load that would be required to understand an extra level of abstraction, which just may never be needed.
 
@PeeHaa there is a silver bullet in sex: me.
 
badumtish :)
 
You kill werewolves when you have sex?
 
No, I shoot very fast.
 
1:45 PM
lol
 
^^
 
@PeeHaa It returns an array containing all of the information about some questions and also a ['total'] that contains the number of questions that there is in the db (I can't just use count() here. because I want to know how much questions there are in my db. so it's the number of all of the questions( without LIMIT in the query)).
 
@Danack and dunno, you only create factories when you need to reuse them? It's a recipe for disaster to think this IMO... Sure, keep it simple, but this is like the basis of loose coupling
 
A so basically you have a total index and a items index in there?
That would make sense
 
1:47 PM
@PeeHaa yeah. kind of. ['total'] and ['questions'].
 
Yeah makes perfect sense
 
@PeeHaa really? I'm not sure if it's right!
 
Anybody has a stylesheet fixer for main by any chance. Trying to read it gives me a headache (and not just because of all the bad questions)
@user3002233 Perhaps I would get the info using two dedicated methods. But I can see a "proxy" method being easier
 
@FlorianMargaine I think it's ok to have tight coupling internally for library code and also at the top level 'controllers' where you know what type of object you want, but even if you do need it eventually:
6 mins ago, by Danack
@PeeHaa I think there's no harm in doing so. You don't save any time overall by injecting factories first, compared to doing tight coupling and then refactoring when you realise you need to decide what type is used at run-time. It's a very strong case of yagni
 
@DaveRandom Please ping me when you're here.
 
2:03 PM
0
Q: Does somebody already created a user style of a readable Stack Overflow

PeeHaaI have been going through a couple of pages of https://userstyles.org, but I didn't find yet what I am looking for. Does anybody has a way to make Stack Overflow readable again? By readable I mean basically like SO was before the latest tweaking of the layouts. Something like a user style thing ...

 
@PeeHaa "persitent"
 
ty
 
yeah Martijn cv-ed because of some reason
 
I did the same
 
in Python, 2 mins ago, by Martijn Pieters
Because, as worded, it isn't really about Stack Overflow itself anymore. It's a where can I find a stylesheet request.
 
I think the same ^
 
in Python, 1 min ago, by PeeHaa
@MartijnPieters Yes but it is about SO.
in Python, 1 min ago, by PeeHaa
I could try to ask the SO team, but I have learned from the past that trying to work with them is pretty much useless
 
2:25 PM
then maybe move to stackapps requests or something
 
Martijn said the same thing, but also said they don't do requests
 
@PeeHaa is new layout so bad?
 
The only othe roption I have is to ask SO team, but they don't care about stuff like that
@bwoebi The /questions page for example...
37 mins ago, by PeeHaa
Anybody has a stylesheet fixer for main by any chance. Trying to read it gives me a headache (and not just because of all the bad questions)
 
@PeeHaa true… never using this specific page
uh, tag specific too…
okay
 
yeap
 
user1804599
2:28 PM
The web would be better without stylesheets.
 
I'm having trouble trying to describe my problem with the new style. Does this make sense? The lighter weight fonts and overall... I don't know the word, "slighter"(?) styling basically turns the entire page to mush when I'm trying to quickly skim over it for questions
 
@рытфолд I kinda agree with you :)
@PaulCrovella Exactly
@FlorianMargaine Anyway I can reword it so that the end result will be the same?
 
@PaulCrovella It's a weird thing that the fonts seem denser but run into each other....making it really hard to scan read the letters...I think.
 
3:03 PM
Good morning
 
@PeeHaa hmm... I guess you could ask the old spritesheet to remain on topic
And just that...
 
working on a quick and dirty user style. it seems reverting the question titles to the old font family/size/weight and adding back the bottom/right borders on the tags makes a big difference. does this look like enough to be useful for folk?
@PeeHaa ^
 
God yes <3
How does it look on /questions ?
 
user1804599
Type hints are great.
 
@PeeHaa No change there except the tag buttons. With all the crap they did to things like code formatting I didn't want to touch it. Aiming for low-hanging fruit right now.
 
3:17 PM
@PaulCrovella Yes start small. After that world domination!
:)
 
user1804599
Currently implementing something similar to them in my compiler.
 
@PeeHaa I'm not the css guru I was a decade ago, so I don't know how much I can help before making a mess of things. Hell, I don't even know how to export this user style. Shit's changed, man. Shit's all changed. :/
 
@PaulCrovella If you have a start dump it somewhere so I can tweak when needed
@PaulCrovella room 11 github and stackapps?
 
@PeeHaa pastie.org/private/dzayl7ah4eezuvfowydtg is the start. If you wanna put it together properly and github it that'd be great.
 
awesome
Is stylish the way to go to be able to sanely use userstyles?\
 
3:23 PM
@PeeHaa It's what I just installed to do this, seems to still work just fine.
 
Great.
@PaulCrovella Can I slap a MIT license on the thing?
 
@PeeHaa I usually go with apache, but mit is fine too
 
Both work for me. Your call
 
apache then
 
@PaulCrovella Which reminds me. Do you already have access to the room 11 org?
 
3:32 PM
@PeeHaa negative
 
What's your github?
 
pcrov
 
> Invitations are sent via email and can be accepted at github.com/Room-11
 
Hi room
a little basic question about phpunit
can I use a dataProvider function to provide data to multiple tests or not?
is it a sign of poor code?
 
you definitely can
 
3:44 PM
@ircmaxell is it advised though or not?
@ircmaxell are there to your knowledge naming conventions as far as the name of the dataprovider function is concerned?
I have been using this: function this_tests_that() and for my dataprovider provider_this_tests_that()
I was thinking that if I use the provider for another function this_also_tests_that(), I could rename the provider for provider_this_tests_that_and_this_also_tests_that
 
it's probably quite trivial, but I wanted to know if there are any "best" practices on this
 
@PeeHaa I'm fixing votes/answers/views counts on the question list right now too
 
\o/
Damnit. I think I should have used a room 11 user styles account instead
 
@PeeHaa yeah, do that
 
3:51 PM
!important everything! — Florian Margaine 25 secs ago
 
@FlorianMargaine I don't know how better to force the goddamn page to use my styles (fuck specificity). It's been a crazy long time since I've done this kinda stuff. PRs are welcome.
 
nah, you kinda have to.
 
@FlorianMargaine Staph trolling mah question!1111 :P
@FlorianMargaine BTW I might need your translations services again soonish :)
 
@PeeHaa sure. I'll need dutch translation services too :D
 
Only fair :D
 
3:57 PM
Oh yeah,
 
morning
 
I might be fixing octal today
 
@PaulCrovella Can I revert the sep between links under questions or are you fixing that already?
shareeditdeleteflag
 
@PeeHaa revert away, i've run into a kerning issue I'm probably going to give up on and ignore :)
 
:P
 
4:03 PM
any makefile guru? you know how you can make something like src/*.c: binary\n\tgcc -o binary src/main.c or something
I'd like to find all the C files in src/, recursively
i.e. it recompiles when it finds a modified C file in src or in src/foo
 
@Ocramius Apologies if I'm misremembering, but I believe that you've had a problems with people saying that "exceptions aren't needed because you can just set an error handler" and then you've pointed out that that can't work for libraries....do you have any links to something that says that in an easy to understand and convincing way - for context news.php.net/php.internals/80697
 
woot, up to 165 retweets
 
Hello.
How was i able to share snippet here ?
 
put in pastebin or similar
 
@animaacija if it's about 4 lines or less, you can just press ctrl+k. but yeah pastebin if it's big, or 3v4l.org if it's running code.
 
4:13 PM
http://pastebin.com/AgpD7XXw

I have this array, and i need to sort it by 'voted' key value
 
Hallo. I want to install ZendFramework 1.12 and I didn't get the right files with the composer. All other skeleton projects are not complete.
Any Ideas?
 
@internetztube Why on earth would you want to install that freshly?
 
animaacija have you tried searching the interwebs for a phrase like "php sorting multidimensional associative array"? And remember to also add what you have tried + which part you are stuck on in the paste
 
the part i found is using ksort() function, but
 
@PeeHaa The new version of Zend is for me very confusing. And the controllers and the models are on a central place.
 
4:17 PM
Isn't ZF1 basically dead?
 
Yeah, but
 
ksort($result_content['voted']); would not work, by reaching that key, because arrays are 0=>array(voted=>a), the number (0) at beginning makes it confusing to solve
 
Yeah, but it is still ok for me.
 
@internetztube no it's not
 
Well it shouldn't be is all I am going to say
 
4:19 PM
using unmaintained software is not acceptable
 
Ninja'd like a pro
 
Ok, i don't care. I just want to install a skeleton project.
 
usort($array, function($a, $b) {
return $b["voted"] - $a["voted"];
});
 
@internetztube =] sometimes.. some of us try to avoid giving straight up solutions to encourage learning..
 
4:23 PM
for the earlier makefile question, the answer: github.com/Ralt/erinome/blob/master/Makefile
 
@RonniSkansing "sometimes" is a bit of a stretch :P
also, morning
 
Morning =] hehe
 
Hmm..

My employer is using ZF1 and there I get support for my code.
I just want to install it. :(
 
@internetztube Amazing, 3 lines! Thank you. It works
 
@animaacija thx. :)
 
4:26 PM
@internetztube If you've got a working ZF1 program, I'd recommend just copying the files from it, rather than trying to install it from scratch....
 
@PeeHaa should I have push access to stylefixer?
 
@PaulCrovella Unless I have screwed up yes you should :)
Does this mean I screwed up?
 
it means one of us did.. :/ I'm getting a 403 on push
 
something something api.github.com in a config file....
 
hehe yeah probably me. 1 sec
@PaulCrovella yeap I thought all room 11 people automagically have access. I have created anew team and added you
 
4:41 PM
@internetztube I believe you have a possible error in that sort function - it's meant to return 0 if the things are equal right? /cc @animaacija e.g.:
function contentCompare($a, $b) {
    if ($a['voted'] == $b['voted']) {
        return 0;
    }
    if ($a['voted'] < $b['voted']) {
        return -1;
    }
    return  1;
}
Possibly not an issue in this case.....but it could might be.
 
@PeeHaa well crap, I don't know why I'm still getting a 403 then :(
 
Can you try again?
I think I forgot to actually add the team to the repo :P
 
success \o/
 
\o/
 
@Danack If they're equal... surely something - something does return zero...
 
4:50 PM
@salathe unless it's floating point arithmetic
 
@salathe I mean the return $b["voted"] - $a["voted"]; never returns -1, which something something darkside.
 
@Danack why not?
 
@Danack Why does that never return -1?
 
4 - 5
 
We only care that the return value is a) an integer and, b) positive, zero, or negative
 
4:52 PM
 
So floats are out. And the values don't have to be +1/0/-1
 
but "The comparison function must return an integer less than" ....so i'll just go back to bed...
 
1 message moved to Orphan GIFs
 
@PeeHaa Need an Orphan JPEGs room!
 
:P
 

« first day (1554 days earlier)      last day (3409 days later) »