« first day (1909 days earlier)      last day (3265 days later) » 

No thoughts atm, but agree 100% with the concept
00:25
@Sara I said I'd probably make an RFC for this at PHPNW back in October
the main reason is I've mistakenly used + for string concatenation after coming back from writing JavaScript on more than one occasion
@Andrea There was a time in my carry MANY moons ago when I had a habit of conflating . and | for the same reason. :)
@Sara does some language use | for concat?
Some SQL uses ||
Aha
@Andrea Yeah, one of those weird database languages from the 90s.... Foxpro maybe? I can't recall, I've blocked it out.
ISTR some variant(s) of BASIC using & for concat
00:32
Ooh
We should all get back to good old fashioned openerator<<(const std::string&)
00:56
@schmunk fyi - you don't want to use that thing you starred. Although it's amusing, it isn't a good thing.
01:10
MS Excel uses & for concat as well
 
2 hours later…
03:09
hey, quick question.
Is the practice of defining an extra member that is static which holds the exact value of a private member of an object so it can be used to pass the data around the application without the threat of its modification leading to disrupting the flow or business logic of the application considered okay or bad? I know its opinion based. But just want to know what you guys think on this.
hum... I don't understand. A static property holding an instantiated value? like a singleton?
how does your static property relates to the instantiated private member? you pass the object to the static call?
Sorry if i was confusing.
My issue is that i need an effective way to communicate certain data between different classes. Now since the members are private and their data is assigned in the construct method of one class. I also set those values to static members
For example - $this->name = "John' self::$_name = "John";

So any other class that needs access to the name can do so by calling ClassA::$_name;
03:25
you do understand that this way, there will always only be one name available through the whole app?
Since its a copy of a private member that will not be modified, im assuming that is okay.
what I mean is, only one instance of the class is allowed to be instantiated, since the static member is updated to reflect the __construct value.
if you were to build a list of users, the static name would be the last one of the list
It seems a bit brittle
This is for a telegram bot. That processes one request at a time, it would contain the array of one user data and one message.
What i mean is, there is no possibility of the value of name to change
The only worry is, if the members is modified from inside the class. Is there a magic method i can use to change the static value too
__clone(); perhaps?
03:31
Honestly, what I would do is make the user class a requirement of all functions that need the name, and forget the static method
If I were to realize it's needed in a lot of places, I'd think about the design
an inheritance?
no
function needsUser(User $user) {}
a method that returns required values?
ok wait. I think we're getting off tracks here
you want to have, in your application, a mean to share the name of the user requesting the thing
that mean, for now, is a static member reflecting an instantiated property, which is a somewhat frowned upon way to do it
(it mixes static and instantiated and you can't really count on it as the pricate member can change without notifying the static one)
03:36
What I'm saying is, I would typehint the user class into the functions that need the name (or just ask for the name) then design the app in a way to always pass the instance of the user (or it's name) to the functions or methods that need it
like
$user = new User;
$messages = new Messages;
$messages->sendMessage($user)
is this what you mean
function sendMessage(User $user, MessageSender $messageSender, $message)
{
    $messageSender->setFrom($user)->send($message);
}
The User keyword before $user is a reference to the class? an initialization?
Im quite new to oop, sorry.
03:51
so basically i pass the initialized object to the method
But, since the members i need are private, dont you think that'd be a problem?
no. we got getters for that
so i should define a magic method inside my first class
that it is private means that others can't change it, but they still can ask for what it is
a good old getName() { return $this->name; } would do it
03:54
Okay, i have an idea somewhat. I'll ask again after a bit if i get stuck :) thank you
Have a good day, bye.
Guys, if you're an ubuntu user please help me at askubuntu.com/questions/717928/… ..
 
1 hour later…
05:02
@JoeWatkins are you free either this morning (UTC) or early evening tonight?
Would have to be next week otherwise.
good morning...
@AnmolRaghuvanshiVersion1.0
@Gordon
@PeeHaa
@Danack
@MadaraUchiha
and kick muted again …
@SagarNaliyapara we have asked you numerous times not to randomly ping people. I get a feeling you are doing this just to annoy us. For the last time now: please stop it.
if this happens again, I'll ask a mod to ban you for a week
Happy Thursday :-)
05:18
tiny'd ?
I'm not retired
took another sup of wine
Hey felix how are you?
A bit drunk, just concluded a trade in my fantasy hockey pool so... pretty well, tbh
what about you?
nothing new I got hangover from last night
you know i am too dumb in communicating :P
https://en.wikipedia.org/wiki/Janus
http://www.calvin.edu/~adams/professional/publications/Janus.pdf
lol
@AnmolRaghuvanshiVersion1.0
@AnmolRaghuvanshiVersion1.0 aap hindustan se he?
@AnmolRaghuvanshiVersion1.0 aap ne to gtu me hi study kiya he
05:52
@SagarNaliyapara
@SagarNaliyapara please
@SagarNaliyapara stop
@SagarNaliyapara that
english you have been warned numerous time @SagarNaliyapara don't be annoying
"aap ne to gtu me hi study kiya he" <- is that even a language
lol
anmol can understand that
you can't
obviously
but hey, gj, you managed to not ping me on each response.
oh i see i can manage!!!!!!!!!!!!!!!!!!!!
AHMEDABAD INSTITUTE OF TECH.,OGNAJ ROAD, AHMEDABAD
i suspect you are retarded @SagarNaliyapara
I suspect he is master troll
I'd like lessons
100020109041
hey... that's actually really not nice @Sagar. You're slowly getting from troll to asshole grade.
06:18
sigh I'll do the necessary on the next incident
oh... sorry for drawing you to it Gordon.
Does anyone know if you can disable output buffering in PHPUnit?
but for the records, if some mod were to look into this, I'd suspect there's some collusion between sagar and cisco. kthxbai
@Wes I recall you trying to do that some time ago.
you mean like, the script you are testing enables it, and you want to stop it?
Wes
Wes
06:23
@rtheunissen i tried indeed but i couldnt find a solution
I'm not sure if output buffer is the right name for what I'm trying to disable.
When you run a script which has memory leaks with a debug build you get messages like these: === Total 1 memory leaks detected ===
Wes
Wes
phpunit collects output internally, it doesn't use php's automatic output buffering imho
But if you run tests using PHPUnit, those don't show up at all.
Yeah, it swallows everything.
Wes
Wes
06:26
yeah i had a similar problem too. php7 wasn't fully supported yet, the script crashed and with nothing showing on screen
/me quickly downgraded to the league of people who code thing so simple they've never seen memory leaks warnings
good morning
Wes
Wes
@rtheunissen try --debug ?
@FélixGagnon-Grenier it's an extension so it's my doing, not PHP :p
06:27
That prints every single test and data from providers which isn't ideal.
Might be better to just rely on something like valgrind.
Wes
Wes
idk sorry :(
06:40
oh ffs I finally found this
06:50
how do you put that line over text
hmmm...
definitely click and read the link I finally managed to find
so... my freshly compiled php complains it doesn't have a php.ini file. where should I actually put it?
07:25
@rtheunissen can't do today, sorry ... any other day ...
No worries. :)
my partner and I, we're in our thirteenth year together this year, we're going to registry office to give notice to marry, we'll be married in the next couple of months ...
24
if I make appointments, or can't concentrate because I'm thinking about code, I'll never hear the end of it ...
Congratulations, more time to come up with good questions anyway.
thnx :)
Will that be summer?
07:29
Congratulations @JoeWatkins Wish you a great life ahead... :-)
Wait no.. end of winter?
I'm in the UK, so there is no such thing as summer ... we're going to get it done quite quickly, this is something we have been talking about for ten years ... no more procrastination ...
you can get married on a summers day, and it'll still rain ... we're not so bothered about weather ...
Morn
Having never been to the UK, I can only imagine.
@JoeWatkins Isn't that just because you drink so much tea?
07:31
I like rain though so maybe I'll like it.
I genuinely have memories of doing barbecues in the rain ... it even looks wrong in my minds eye ... but it happens ...
@Epodax actually no, it's because our summer air is carried over Atlantic or Indian ocean, very warm climates, but above the uk is the Arctic Circle ... what happens when warm air meets extremely cold air ... so it can literally be in the thirties and still rain ...
s/air/atomisphere||weather systems/
I still place my bet on the tea thing :(
but that's basically how it works ... we are taught this really young, in preparation for the reality of summer, I think ...
So that you don't get disappointed and wonder what the sun looks like?
yeah ...
Wes
Wes
07:40
\o
when air pressure is high, it slows weather systems, when that happens in summer it can be hot for a couple of weeks at a time ... but when it is, everything breaks down anyway, planes can't take off, infrastructure fails - railways, grid etc, it might as well be snowing ...
the UK only really works when it is raining ...
All it takes is some getting use to ;) I personally don't mind the rain, I find it refreshing.
sorry for starring, but congratulations :)
I'm picturing a mad scramble as everyone tries to figure out where they can buy shorts.
07:46
Ooooh, Congrats Joe
And o/ @FélixGagnon-Grenier Are you still alive? :P
Wes
Wes
Still???? Y U NO DEAD YET :P
well, still got one or two things to do before dying yet
s/well/wes
/puny puns
Do please do them now, we don't want to accidentally start the zombie Apocalypse pre-marurely
@FélixGagnon-Grenier thnx
@Epodax thnx
Wes
Wes
07:49
like? :P i always said "before dying i just want to see national football team winning a world cup" then they won it and i started worrying about my life
Wes
Wes
i said it like "it will never happen, will live forever"
at some point I heard some witty guy say "before dying I want to live 80 year with a marvelous wife and have many children"
sooo.. yeah I'll do those one or two things
we have some time before the apocalypse
Wes
Wes
i want so many ferraris that i shouldn't be worried to crash one or two of them
@SagarNaliyapara You've been warned before about pinging people and about writing message in non-English.
Let this be a bit more than just a warning to you.
that was sooooo like sasuke
Dang, I can't remember what rustles @MadaraUchiha's jimmies
What happened?!
I think it was some sort of video...
07:53
@FélixGagnon-Grenier No, Sasuke is soooo like me.
@Ocramius Do your worst. I have a rebecca detector 5000 script installed.
There should be a reward for getting mods to click on a Rebecca link
Last time someone caught me off-guard was (IIRC) @FlorianMargaine with a perfectly executed one.
maybe a hat, for next winter bash
Wes
Wes
07:54
@Ocramius i know what.
I am a big doodoo head.
4
lol that's so latino
Wes
Wes
the story is that a guy entered the html room, wrote "ENRIQUE Iglaesias"
and immediately left
it kinda lack the punch line
Wes
Wes
so we adopted that as a greeting
07:56
there it is
Wes
Wes
and reading it really makes @MadaraUchiha upset
@Epodax when I was a mod, I didnt just click on them, I made them … like every good mod should ;)
@Epodax Worth noting that it's part of the reason he isn't a mod anymore. "No time" is really just an excuse.
you went entirely overboard, all week long on me
oh wow. when I must get back 40 commands back in the cli history to remember where my nginx config is... is the sign I should stop coding.
Wes
Wes
07:59
Madara Uchiha 7:55 AM edited: I am a big doodoo head.
Wes 7:54 AM said: ENRIQUE Iglaesias!
just for the record.
hey where did you get those 30 rep @wes?
@Wes Guilty as charged.
Wes
Wes
@FélixGagnon-Grenier i have no idea
@Gordon Hehe, Gordon, King of Rebecca's.
08:01
@MadaraUchiha Figured ^^ Gordon properly has a basement where he brews up plans on how to create perfect Rebecca links.
Wes
Wes
rofl thank you
next life goal: defined
-1
Q: PHP Fatal error: Out of memory, even php.in updated (server restarted)

Yogesh SaroyaI have a VPS server ( with Apache server ). using WHM (PHP Configuration Editor) i have update php.ini. ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 3000 max_input_time = 6000 memory_limit = 3000M upload_max_filesize = 1024M post_max_size = 1024M and after...

Should be closed?
I'd say edited
@MadaraUchiha A retired mod is still a mod :P
08:18
@MadaraUchiha can't find a proper duplicate. it's a matter of misplaced php.ini I'd say
https://stackoverflow.com/questions/5229501/how-get-all-values-in-a-column-using-php/
All the top voted answers for this question are still using the old mysql methods that are removed in php 7, can we do anything about this?
meurning!
@ferrybig you can upvote answers that promote non-deprecated methods
Morning.
@ferrybig and downvote those that are no longer good answers. however, just because they are deprecated doesnt mean you can no longer use them. you can still install the extension.
user924016
08:37
@rdlowrey new episode of always sunny(!!!!) \o/
Mornignign
@PeeHaa o/
Wes
Wes
twitter bots. clearly all pretending to be hot women i.imgur.com/MufKxFw.jpg
@PeeHaa \o yo!
had a good break?
@ferrybig In this particular case, I'd rewrite the Q&A with a (hopefully much) better version, and close this one as a duplicate of that one.
08:48
@Wes Yo man
Because the question is old and established but outdated.
2 days ago, by PeeHaa
@Naruto tbh I've done lots of drugs and booze so no not really :P
@Wes Do you think they'd even have a chance of ANY form of success if they where pretending to be ANYTHING else than hot women?
Another option, since the author of the answer is still an active SO user, drop them a comment on their post
@MadaraUchiha he already did. not to the author, but on the question itself
08:49
Most of the time, they'll be happy to edit it themselves, or allow you to edit it for them.
@Gordon I meant on the answer.
Not on the question.
Wes
Wes
@Epodax in fact that's the only choice :P
true
Commenting on the question doesn't notify the author of the answer
Wes
Wes
@PeeHaa i wouldn't consider "booze and drugs" a failure :P
@Wes Exactly, with hot women they can at least bait desperate less fortunate people in.
08:51
@Wes It isn't :P the no not really was an answer on whether I have done anything useful
A more aggressive approach but usually works well, is to just edit the answer, and then drop a comment and say "I've edited because mysql is gone bla bla bla"
Wes
Wes
@PeeHaa end of the year booze is useful. it balances the subsequent 360 days of the year :B
@MadaraUchiha would be too much of an edit imo
if someone edits one of my answers and replaces mysqli with pdo or similar things, I'd roll it back
Wes
Wes
08:53
@Epodax i've also spotted a bot with a bug, i can make it retweeting itself in a loop, forever
@Gordon Meh, asking for forgiveness rather than permission usually gets things done a lot faster.
@Gordon I wouldn't replace.
I'd go with
@Wes ;-)
"Here's how you do it in PDO <.......>, and here's the original (albeit outdated) version with mysql_* <......>"
@MadaraUchiha yeah, adding would be less changing
@MadaraUchiha That seems like a reasonable edit, yes.
08:55
then its not like: hey, you completely rewrote my answer
Yeah, it's a little more subtle :)
I probably wouldn't roll back if it was my answer, but I can totally understand if people would. It's quite a rehaul of the answer.
But just adding additional up-to-date information doesn't do much harm. In fact, I'd appreciate that myself.
That's the power of community moderation at work.
@Gordon I don't really like your edit on the top answer :P
JUST LET MYSQL_* DIE DAMMIT
@MadaraUchiha ?
@MadaraUchiha not everyone has the option to rewrite loads of code, though I'd guess those also wouldn't upgrade to php7 either. feel free to add snippets for pdo and mysqli
@MadaraUchiha LOL, agreed. It's been deprecated for like 3-4 years now. Although it still amazes me how many questions on SO still reference them.
09:03
@Oldskool That's the power of bad documentation.
And bad initial APIs.
posted on January 07, 2016 by nlecointre

/* by SynxS */

"Let's make everything global! It's noob friendly!" Right, until you have to deal with it :P
@MadaraUchiha Well, the original docs have those fancy screaming red boxes saying "don't use this piece of **** anymore". The main problem is all those homemade tutorials written back in 2005 that people still use as if they're useful.
@Oldskool That's the meaning of a "noob friendly" language.
You don't see many crap C++ or Common Lisp tutorials out there
Because people who write tutorials about those generally know what they're doing.
And their experience amounts to a bit more than "I watched a video on YouTube about how to install WordPress"
09:07
@Wes Do it!
@MadaraUchiha or they've just discovered templates and decided to use them for goddamn everything holy crap what is this code even doing anymore gahhhh
09:21
@MadaraUchiha too lazy to rewrite the question, so I just posted an answer stackoverflow.com/a/34651320/576767
@FélixGagnon-Grenier That's not very helpful since practically no one looks past the checkmark.
well... I'll hold faith in time then.
is dv on the top answer mean in that case?
@MadaraUchiha I wouldn't be so sure about C++
@FlorianMargaine Well, not even on the same order of magnitude as PHP's (relative to the total amount of tutorials)
@MadaraUchiha well, how about you put a bounty so it get's more attention
09:24
@MadaraUchiha look at where this answer is stackoverflow.com/a/16751601/851498
@Gordon The bottom-most answer wouldn't get reputation.
(and when it was answered compared to the other answers)
@MadaraUchiha where it shows up depends on how you order answers
@Gordon Which, by default which 99.9% of the users use, is by votes.
besides you can give a reason for the bounty which could/should say that all of the answers are deprecated
@MadaraUchiha do we have hard numbers for that? because I am not so sure it's 99,9%.
09:26
@Gordon In practice, it doesn't work. I know, I've been there.
It doesn't get the attention you think it does, and the 4 liner PDO wouldn't get 10+ votes to even be in second place after the checkmark
And even if it does, the absolute majority of visitors only look at the checkmark.
oh well. you got me. here's a question and answer
not sure about the marking as duplicate part, I'll leave that to the higher ops
@FlorianMargaine I'm honestly considering downright deleting that first answer :/
And the eval one too
Seriously, then you hear people saying that Stack Overflow is full of crap
stackoverflow.com/questions/34609907/… <- I flagged this as primarily opinion-based, the flag was declined but I can't seem to understand why, to me it looks like the OP is looking for opinions / review / confirm of an idea which seems unsuited for so? (Disclaimer: not trying to bring attention to question, simply understand so I can get better at flagging more correctly).
@MadaraUchiha the eval one is worse
09:31
@FélixGagnon-Grenier I don't think this is a good way of solving that problem. Since @MadaraUchiha cannot be bothered to put up a bounty, I am putting one up.
@Gordon Feel free. If it works, I'll match you
the pdo answer is back on
Is there a "proper" way of checking if an instance of an Object exists and if not create a new one without using if clause?
@TiagoMatos why is with an if not proper?
also, why do I smell Singletons?
@Gordon because you didn't take a shower
09:34
@FlorianMargaine Can you open a meta about it?
"It contains outdated answers which are full of bad practices" etc
@FlorianMargaine that's actually true for today. not yet. I am in my Home Office.
on one side, I want to
on the other side, effort
@Gordon same
@FlorianMargaine Think of all the upvotes to your answer!
but that's because I took care of the little guy while mommy was grabbing some sleep :)
@Gordon Sorry, I meant outside the class declaration. For instance in the View if the object we are talking is an Model
09:36
@MadaraUchiha effort
@FlorianMargaine quite similar here. The little one woke up at 4. Took me until 5 to convince him to sleep again. Then I couldn't sleep anymore and went straight to the PC
@Gordon heh
@TiagoMatos you can still use an if there, can't you?
last night he did something funny
he went to take a nap after the bath, before dinner
he frequently does it
this time though, he decided it was night time.
so he skipped dinner.
then at 4am he was like "I'm hungry!"
I'd be the same^^
09:38
he usually wakes up at 8am :(
it was my son's bday yesterday. he had four pieces of cake, so he didnt have dinner either :)
afk for a bit now. l8ers
@MadaraUchiha fine? ^
@FlorianMargaine LGTM
@Gordon yep no problem using an If. Just second guessing myself here. Thank you.
0
Q: Can we do something about old/outdated/terrible highly upvoted answers?

Florian MargaineThis question has 3 answers with >100 upvotes. The 3rd answer is very fine (obviously, since I'm the author), but the 1st and 2nd answers are terrible by all accounts. The first one relies on jQuery to do a loop (wut?), the 2nd one relies on eval to do a sum. Let that sink in. eval to do a sum.

09:42
NUKE THE LIZARDS \m/ (-_-) \m/
^^ along with the aliens
from orbit
anyone experience with embedded software development?
@FlorianMargaine I agree with you, but the problem is - the answers are community chosen
So I suppose it merely reflects the communities' intelligence :D
@Jimbo to be fair it doesn't reflect the current intelligence, we're weighed down by the sins of our past
PHP multiplies that weight :P
09:49
yeah, but only by 0.5 times jquery
Create a Chrome extension that switches top answer to most voted
lol

« first day (1909 days earlier)      last day (3265 days later) »