« first day (1270 days earlier)      last day (3661 days later) » 

1:00 PM
@AlmaDo first question on so :P
 
that answer from yesterday really took off ;-)
 
it may seems odd, but references or such meta-posts are welcome on SO. Even despite the fact, that efforts there are only "search & format". But I agree - It's hard work. Much more difficult then answering stupid & simple questions, getting +1..2 per answer
 
@HamZa you first got 100 rep before it was made CW :-D
 
@bwoebi Yeah, it was time to gain some rep hehehehe
 
@ircmaxell morning. And - yes.. nice answer (however, sad that people don't know how to test such things by themselves :p )
 
1:03 PM
@HamZa Be very careful with something like that to specify precisely which regex engine you're targetting. Because PCRE behaves very differently from EREG for example
 
@ircmaxell True
 
@webarto lol. my cv was not opinion-based. voted reopen.
 
@webarto it's already re-opened
 
@ircmaxell Mine was 3rd vote when I posted.
@AlmaDo Yes, definitely not opinion, since the correct answer has facts :)
 
1:07 PM
it's nothing to do with "opinion-based". it has certain answer. I thought it's a dupe that's why cv (there was similar question about for & while)
 
user895378
morning
 
user895378
@bwoebi Wait, you do internals stuff??? Just kidding :) Sorry, I was deliriously tired at that point. Your contributions are important too.
 
@Hamza If you want to open reference posts, it's always good to also open a corresponding post on MSO for discussion. otherwise the comment section will explode.
 
@Gordon I see, is it too late or should I open one now ?:
 
guys i need one help... can i ask..
 
1:11 PM
@HamZa do so and link it below your reference
 
$site = "abc/efg/ijk"
i'm having this string...
 
@CJRamki explode()
 
@HamZa i'm not yet finished my question...
 
lol
 
hehehe it was just a guess :P
 
1:12 PM
i want $site = "abc/efg/
 
regex or no regex? Or don't care?
 
@CJRamki see, explode(), pop(), implode()
 
Also I am a little hesitant to ask, but whats the reason for it?
 
@CJRamki str_replace('ijk','',$site);
Now try asking the question properly -_-
 
Creepy pony has come !
 
1:14 PM
@Fabien (^regex$)|(^(?!.*regex).*$)|(.*)
 
lol. Your days are too free.
 
@Fabien i'm getting server uri using $_SERVER[REQUEST_URI]
i just want to remove last string from the uri
 
@Fabien so that's my point (:
 
@Gordon So how should I open the thread ?
"This question is to discuss all problems about this reference ..." ?
 
ex: localhost/community/web/ is my server uri
 
1:16 PM
@CJRamki In the spirit of simplicity, you'll find your answer using substr() strpos() and looking to find the position of the second occurrence of a character in a string.
 
i just want localhost/community/ like this
 
always a trailing slash or no?
use regex
 
@CJRamki preg_replace('~[^/]+/?$~', '', $in);
 
< Just realised that's @Sweetie Belle
 
^ lol
 
1:18 PM
@Fabien Srsly? :P
I changed this like a week ago :(
 
I've been away for the past few days tbf.
 
how could you forget that pony jerk? :D
 
@HamZa thanks... this is what i need...
 
He's not the only pony that has been in here.
 
who's another pony?
 
1:19 PM
@CJRamki but, but, but do you understand it ?
 
@HamZa yes...
 
I dunno, they come and go mystically.
 
@CJRamki So what is ~ ?
 
NOT
 
Can this somehow be improved?
0
A: php regex - strip everything off <a> tags except href

Amal MuraliHTML is not a regular language and cannot be correctly parsed by a regular expression. Use a DOM parser instead, so your code works even if the format of the markup changes in future. Here's one solution using PHP's DOMDocument class: $dom = new DOMDocument; $errorState = libxml_use_internal_err...

 
1:21 PM
@HamZa i don't know that...
i tired to use preg_replace() method..
 
@CJRamki what about [^/]+ ?
 
foreach ($node->attributes as $attr) {
    if ($attr->name !== 'href') {
        $node->removeAttribute($attr->name);
    }
} // ^-- this part specifically.
 
@HamZa string begins with /
is it right?
 
~ is a delimiter
[^/] match anything that's not a forward slash
+ repeat one or more times
/? match a forward slash optionally
$ assert that it's end of string
 
1:27 PM
Heya people would you pls help me figure out if it's a PHP bug or not
0
Q: PHP's assignment by reference is not working as expected

Desmond HumeWhy the following class AClass { public function __construct () { $this->prop = "Hello"; } public function &get () { return $this->prop; } protected $prop; } function func (&$ref) { $ref = &$ref->get(); } $value = new AClass(); func($value); var_...

 
@HamZa why using delimiter in regex?
 
@CJRamki because you need to. But if you really want to know, it's because you want to add regex modifiers sometimes. For example ~test~i will match test case-insensitive. If we didn't have those modifiers, how would you add the i modifier ?
 
MGE
Hello, I have the next code:
public function __construct() {
date_default_timezone_set(DATEZONE);
$this->_view = new View(new Request);
$this->_session = new Sessions;
$this->_cookie = new Cookies;
$this->_request = new Request;
$lang_path = ROOT_PATH. 'libs' . DS . 'lang' . DS . BASE_SUBDOMAIN . DS . BASE_SUBDOMAIN . '.php';
require_once $lang_path;
$this->_view->lang = $lang;
}
is in the Application/Controller.php and it works when I create a new controller that extends this class
the problem is: how can I access to $this->_view->lang information, from a new method in the Controller class?
 
@HamZa /test/i ?
 
@CJRamki lol / in this case is the delimiter :)
 
1:32 PM
@HamZa oh... what are the possible characters can use as delimiter in regex?
 
@CJRamki Well, you don't want to use + since you will most likely need it in your expression. I used ~ instead of / so that I don't need to escape the slashes in my expression ...
 
'~[^/]/?$~'
like this?
@HamZa
 
any best source to learn regex?
 
@CJRamki If you used / as delimiter you would need to write /[^\/]/?$/ (note the escaping)
 
MGE
somebody can help me?? pastebin.com/zdgzZWgb
 
@Amez meh, JS regex isn't powerful enough. Got to learn PCRE :P
 
@HamZa thanks to clarify my doubts....
 
@HamZa a good start if he need to learn
 
1:39 PM
@Amez What I miss about JS regex implementation is the lookbehind.
 
MGE
The main controller construct, load a file with $lang[] array, how can I access to this array from other method of this Controller?? pastebin.com/zdgzZWgb
 
@HamZa You ever use the regex visualisers?
 
@Fabien nope, I can read them on the fly. Complex regexes should ofc be written in multiline (with x modifier)
 
@Fabien this regexper.com ? :d
 
MGE
Nobody knows?
 
1:40 PM
They look so cool (fail link)
 
MGE
The main controller construct, require a file that content $lang[] array, how can I access to this array from other method of the same Controller?? www.pastebin.com/zdgzZWgb
 
yeah cool but I don't really need it. Perhaps with a really big one ?
neeeeein do not star such things here lol
 
your brain is the best regex (or-what-ever) visualizer
 
MGE
Nobody knows?
 
Nobody cares
 
MGE
1:42 PM
you don't know, ok
Somebody knows how to get an array from the construct function of a Class?
 
oh, that's your question
answer: no way
 
MGE
you don't know, ok
 
hehehe
 
@MGE you have to use traits instead of require it will not work as you expect
 
@MGE I'm wondering if $args is an array ?
 
1:45 PM
you cant' return array from constructor
 
MGE
My main controller, load a file that content the lang array
it can be accessed via controllers that extends the main Controller
via $lang[]; because in the main controller, I have:
 
@MGE you call the function as a static function using the :: modifier
 
MGE
$lang_path = ROOT_PATH. 'libs' . DS . 'lang' . DS . BASE_SUBDOMAIN . DS . BASE_SUBDOMAIN . '.php';
require_once $lang_path;
$this->_view->lang = $lang;
the problem is, that I need to get this $lang array from a method of the same main Controller
yes
but, I have to call to self::__contruct?
it will reload all __contruct info
 
@MGE Calling the constructor to get an array, does it make sense to you ?
 
@HamZa you don't know, ok
 
1:49 PM
/me might need to think about the next reference ...
 
@MGE if you want to call it as static you need to add a static var to your class,
```PHP
static $lang = [];
//and then
self::$lang = ['fr', 'en'];
```
then you can call your function statically
 
Trying to get my head around the SOLID principles with #laracasts. Surely there is a version for Dumbies out there? ... #SolidPrinciples
^^ You're going to have a hard time, as Laravel doesn't follow SOLID principles...
 
MGE
@Amez I can't
I can't create static $lange = [];
in the construct
 
@ircmaxell lol. A+ for effort though.
 
user895378
Hate to break it to you but #laracasts is the version for "Dumbies."
3
 
1:57 PM
0
A: PHP's assignment by reference is not working as expected

bwoebiConsider this piece of code (It's the same as your code, just without everything else): $value = new stdClass; $ref = &$value; $var = "Hello"; $ref = &$var; // this is where you write $ref = &$ref->get(); var_dump($value); This gives as expected string(5) Hello and not an empty object. Why? ...

Here you have your answer. It confused me too at the first glance....
 
@MGE well then you need to read a bit about static, your code will work only if you have an instance of the class Controller...
 
creationist propaganda found it's way into php-src ... github.com/php/php-src/blob/master/ltmain.sh#L424
:o
 
MGE
Amez
I have an instance
but it doesn't work
 
@rdlowrey you should post it as an answer/replay
 
@JoeWatkins sadly the OS was meant
 
user895378
1:58 PM
@tereško I'm trying to avoid making enemies just now :)
 
MGE
I can't access to the var in __construct from another new method
its so weird
 
@bwoebi I know !!
 
user895378
Going to a laravel resource to learn about architecture is like visiting the PowerWheels factory to learn how to build a racecar.
 
@JoeWatkins I was not aware of a significant overlap between Apple and Creationist zealot .. though, I am not all that surprised
 
> Assigning references to a variable via another referencing variable is just not possible in PHP. — from stackoverflow.com/a/22939272/2153758
Someone should put that in a big yellow warning box to the references man page…
 
MGE
2:03 PM
How can I share a var from __construct to another static::method?
how can I do it?
construct load a file with the $lang array
I need to share this array with a method in the same class
 
@MGE this var should be static
 
MGE
is static
 
For that you use like public static var-name="val"
@MGE in class method you use in class_name::static variable name
 
MGE
public function __construct() {
$lang_path = ROOT_PATH. 'libs' . DS . 'lang' . DS . BASE_SUBDOMAIN . DS . BASE_SUBDOMAIN . '.php';
require_once $lang_path;
$this->_view->lang = $lang;
}
static function getlang() {
return LANG-VAR-FROM-__CONSTRUCT;
}
I access via Controller::getlang();
@RiteshJoshi in this case is from the same class, so self::staticvar ?
it doesn't work
 
yes for that need a self::staticvar.
 
MGE
2:10 PM
doesn't work
 
@mge try to apply $ before static variable name
 
MGE
??
self::$lang
 
MGE
im using this, of course
 
are you making static variable as public
 
MGE
2:14 PM
?????
im using static
but I can't access
to this $var in __construct
from a new method, I think that its clear whats the problem
I repeated few times, thanks anyway
 
please use this Public static $variable-name
 
why are you using static variables to begin with ?
 
@ircmaxell maybe interesting: eventbrite.com/e/…
 
hook...
 
MGE
public static $lange = 1;
how can I access to this var from construct? for example?
 
2:21 PM
self::$lange
 
Learning about Pointers lol. Wonder what the target audience is.
 
@RiteshJoshi please, do not make language a global variable
 
MGE
@RiteshJoshi
solved, thanks!
 
@MGE Finally your problem is resolve
 
"Yeah sharing... uh.. whatever"
 
2:26 PM
@Fabien Drugs are bad, m'kay?
 
lol
 
If I have a 'feature' branch, and have commit some changes against it's 'parent' branch, generally speaking I want to rebase, not merge; right?
In order to bring the feature branch up to date.
 
@HamZa it's put on hold Oo
 
there is a #git room on FreeNode .. you might be safer using it
 
Hmm, I always merged for branch -> master and rebase for master -> branch. But I am a git noob.
but we're not talking master so ignore
 
2:31 PM
@Fabien <= Also a git noob.
@tereško I don't think I can hit IRC off this box.
 
Bit sad I can't find any more Binky videos to learn C. :(
 
@tereško Thanks for holding my hand through that :-P
 
1
A: PhP how to use arrays correct?

John CondeIt's just a nested array. Access it like you would an other nested array: echo $array[57690]['data']['name'];

 
@Fabien That's what I'm getting thinking; or reading, for that matter.
 
2:34 PM
@Gordon interesting
 
should a 50k+ user be answering this type of questions? — tereško 25 secs ago
 
Man. Apparently Team Fighting is a thing! lol. There's a Team Fighting Championships.
 
inb4 one of @tereško's questions gets downvoted.
 
lol ... yeah, so he's answering 10+ "hello world" questions per day and feeding vamps, because it is not about rep
 
2:41 PM
indeed
 
well .. I found a duplicate
 
github.com/DatingVIP/multi ... because who doesn't need 20 installations of php ...
joe@localhost [returntypehinting-zts-debug] /usr/src/suck $ source php.env list
Available Environments
        5.5.11  no-zts  debug
        5.5.11  no-zts  no-debug
        5.5.11  zts     debug
        5.5.11  zts     no-debug
        5.5.7   no-zts  debug
        5.5.7   no-zts  no-debug
        5.5.7   zts     debug
        5.5.7   zts     no-debug
        5.5.9   no-zts  debug
        5.5.9   no-zts  no-debug
        5.5.9   zts     debug
        5.5.9   zts     no-debug
        5.6     no-zts  debug
 
@JoeWatkins DatingVIP??!!?! wtf.
 
company I work for, well I work for parent company really, firstbeatmedia
I dunno why they chose to use that name ...
 
2:43 PM
Marketing "logic"
 
@JoeWatkins So you are a pr0n baron?
 
YES!
 
user895378
\o/
 
I haven't seen any boobies yet ...
 
It has no real name actually, DatingVIP is a project.
 
2:45 PM
yeah the company is firstbeatmedia ... like fab said, marketing logic, I 'unno ...
 
I mean, money laundry and everything :P
 
Well played.
 
20 hours ago, by Gordon
@PratikJoshi the famous India Asking Pattern and their ability to backsource work to western developers
@Gordon Huh, Pratik Joshi? I see he's been around
 
The very first domain my old company used was "Find Me Love". Suffice to say the acronym was very suitable to how I felt about the general day-to-day activities.
 
@AmalMurali Why should that question be closed?
 
@BoltClock seriously?
Who is it going to help in the future?
OP doesn't know what JSON is, and didn't bother reading the API they are consuming.
 
@BoltClock: Why shouldn't it be? It's too basic and have thousands of duplicates.
 
Oh
I was looking at the wrong question never mind
 
Unfortunately, I can't find the good duplicate.
Meh.
 
3:02 PM
Which is why I chose the option "Unclear what you're asking".
 
Too localized. R.I.P.
 
:'(
 
It's funny that you can tell me exactly what the question is
Yet you vote to close as unclear what is being asked
 
@JoeWatkins what's the current usage of your new multi thingy?
 
@BoltClock: Wasn't there a blog post from Shog about this?
@AlmaDo: Right?
 
3:08 PM
@AmalMurali You mean this?
Jay Hanlon on June 25, 2013

It pains me when I hear people say that our sites are unfriendly, or that we chase new users away. But it’s a hard problem, because our highest priority has always been the quality of content on our sites.  And it still is. We can’t lower our standards. We won’t.

But we have been working hard to make our sites more welcoming, reminding users that feedback can be clear and nice, and helping new users learn the ropes before they get frustrated.  And, as of today, we’ve completely overhauled closing. …

Not by Shog though
I don't recall him writing anything about close reasons recently
 
@BoltClock close reasons suck though.
 
Mostly spearheaded by Jaydles
 
There are plenty of questions that waste the time of people here and push down good questions.
 
@BenjaminGruenbaum 0 up 0 down
 
That's the real problem with SO today, a lot of good questions don't get a lot of visibility while a lot of crap like that question steal visibility.
 
3:10 PM
Yeah I don't deny that problem. I blame humanity
 
I blame close reasons, and being too friendly to bad questions :P
 
@BoltClock: Yeah... right. Sometimes when I see a bad question that should be closed, I click on the 'Close-Vote' button, but then close the dialog. Because I couldn't find a good reason to close the question by.
 
Seriously, we're doing a lot of work to be "friendly to new users". I don't think friendliness to new users was ever a real problem if they don't ask stupid questions.
Lots of people just ask painfully stupid questions. I'm not even talking from a position of knowledge here, even in tags I know nothing about and in languages I never used.
 
"Too Localized" or "Should demonstrate a minimal understanding" were nicer reasons. But they were too vague. But now we have lots of questions that should have been closed with these reasons.
@BenjaminGruenbaum++
 
Just things that are obvious duplicates, not bothering to read the API, or 'debug my code'
It's easier to ask than to google or use a debugger.
 
3:12 PM
They are automatically unfriendly if they insult everyones intelligence by not e.g. RTFM or bother to use search.
 
Average n00b: "Google? What is it? I just post my code on SO and it fixes automagically".
 
I never said you should be friendly to new users. I'm just baffled someone would cv a clear question as unclear.
 
@GeorgeStocker should we take it as an official endorsement for StackOverflow migration from Q&A site to a crowd-sourced google UI? — tereško 7 secs ago
 
Maybe if we had better canonical questions (rather than big bloated list not-even-a-proper-question-and-answer "questions" like that regex reference we just closed that tried to mimic the PHP reference question)
 
@tereško Is that the new moderator or something?
 
3:14 PM
Then duplicates would be much easier to find
@webarto George was from last year's batch I think
 
really ?
 
Haven't seen him by now, thanks.
 
@BoltClock do you REALLY think that we needa cannonical answers for "how to use an array" ?
 
@BoltClock: I thought I did read somewhere on Meta that we should close very poor quality non-duplicate non-broad questions as "Unclear what you're asking". Am I misunderstanding something?
 
Well yeah, if the question is unclear because of its poor quality
 
3:18 PM
it is not unclear
 
So... another RTFM question that can't be closed, thanks...
 
What about a question that's clear but not likely to help a future visitor? Or something really basic that could be easily solved with a TINY RTFM?
 
question is very clear and could be answer by either reading any documentation or even writing a query in google
 
@BoltClock advice?
 
Stackoverflow is acting like it's democratic community but sometimes goes all North Korea on users who actually are trying to keep the integrity of it.
 
3:20 PM
@tereško open a question on meta: "Can we PLEASE, PLEASE, PLEASE add a new close reason: RTFM: <user provided link to manual page>"
 
Also, questions like these get attention from ~100k repwhores.
 
@bwoebi inb4 -1000
 
@AmalMurali 1) You can find a close reason under off-topic (I HATE how that label is used now) 2) I got nothin'. There was going to be a general reference close reason but oh the management was concerned about how it would be abused -_-
 
@AmalMurali ^ that's why I ask @tereško to ask the question :-D
 
3:22 PM
@BenjaminGruenbaum Thanks :)
Why the mod closed it?
 
@bwoebi: AHA. lol I get it now
 
@BoltClock I hope you are aware that this "risk of abuse" has to be weight against "the already existing abuse"
 
@tereško Of course I am. The question is whether they are
 
SO is turning in glorified debugging & search tool for mentally challenged
 
@tereško I do.
Really, "how and when to use an array" is a good canonical question. I'd upvote it.
 
3:24 PM
@bwoebi I don't think they want to spread the "juice" to other pages. Probably a good percentage answers to these questions are contained in PHP Manual.
 
Should explain what arrays are for in php, how are they different from other languages, why they should be used for sequential data and why they're not a replacement for objects, iteration, speed penalties etc.
 
@tereško I don't think anybody could deny that
 
When it's a good idea to use another data structure etc.
 
@webarto just people sometimes are just to dumb to find the answer in the manual.
 
3:25 PM
@BenjaminGruenbaum did you read the question to which I am referring ?
 
When I find such a question, I usually answer them in the comments and then close-vote it (if it should be closed).
 
because you seem to be missing the point
 
Oh, I thought you meant a general canonical answer, not that horrible one.
 
@BenjaminGruenbaum It's quite clearly described in manual, and SO is not a centralized database of refined manuals.
 
@bwoebi refactored quite a bit for you
 
3:26 PM
Have a star!
 
@webarto the meta consensus says it's ok, and even encouraged to ask questions one can find the answer to in the manual.
 
.. which is why I tried to close it with manual link
 
@BenjaminGruenbaum Yes, of course, (I'm not sure) but PHP takes major % in questions and maybe should be an exception, pardon my ignorance, but Javascript doesn't have "official" documentation?
 
@BoltClock yeah, asking nonsensical questions
 
@webarto JavaScript has a language specification and the APIs have the DOM specification. It's very very well documented and specified in these regards since there are multiple implementors.
 
3:28 PM
@Gordon What do you think of the discussion that's ongoing right now
 
There's also MDN, which is also more 'down to earth'
 
@BoltClock which one? I wasnt following along. I in the office
 
@webarto Let Mozilla Dev be the officially unofficial documentation
 
@BoltClock lemme illustrate the opinion that he will have briefly:
 
You forgot w3schools.com? Best documentation evar!
 
3:30 PM
lol
 
well .. technically ecmascript.org/docs.php .. but there are plain-assembly diagrams which are more user-friendly
 
@webarto you mean what is it used for ?
 
@JoeWatkins Yeah, yeah, for your job?
 
@bwoebi it was because of the rewind behavior. If that wasn't needed (if there was a separate "options specifying mechanism"), I could simply make it a callable and be done with it...
 
yes, to build testing environments for php, we only use one version in production but another in debug and everyone uses pretty much whatever they want, while developing uopz I had to have a bunch of configurations and the idea to do this came up ...
 
3:33 PM
@ircmaxell Yes, that's why I deleted my comment. I had checked out only files without these methods before writing this
 
I have 3 versions on my work machine
 
yeah, I'm not 100% happy with it, but it's fairly clean at this point. It was quick to get this built, so if there's a cleaner way I'm all ears
 
also, I dunno who it was but apparently someone took a month to get setup to run unit tests ...
 
lol
 
.. and of course someone is already trying to reopen it : stackoverflow.com/questions/22940129/…
probably the same guy who said that he does not care about rep
 
3:35 PM
 
@Fabien I win, I got 20 something ...
 
@tereško John Conde?
Too bad for him now :D
 
@JoeWatkins lol. I wish I didn't need so many but we have to use older version of PHP for Drupal 6.
 
@JoeWatkins It happens :D
 
3:36 PM
@webarto thanks!
 
OH GOD. I hate backtick abuse
 
Google
New York, NY
@ircmaxell kudos
 
@tereško it's not because it's a RTFM question that it should be deleted. It's because it's a very narrow question that is 1) an exact duplicate of the linked RTFM duplicate and 2) Serves little to no value to people in the future other than detracting from the searchability of the linked RTFM duplicate
 
@JoeWatkins take a look what someone who Goran fired soon after wrote :D
 
3:40 PM
hahahaha gender = 412
 
go to second page, that big ass query was made by someone from @tereško land :D
 
@webarto I have this suspicion, that this query is from Tele2 CRM site
 
:D
 
am I right ?
 
Not sure, this was in DatingVIP Joe is working on right now.
But probably someone reused the idea of creating this here.
 
3:52 PM
-10 24 mins ago removed User was removed <-- arg
 
How did I not know there was a SO chat.
 
@ircmaxell oooh rep caps!
 
Felt like I just crawled out under a rock.
 

« first day (1270 days earlier)      last day (3661 days later) »