« first day (1304 days earlier)      last day (3644 days later) » 

9:01 AM
@Jitendra because it's crap, most questions don't make sense, or it's about basic debugging, OP too lazy to check the manual and the list goes on
 
CI is an orphan :p
 
@SecondRikudo yes
1 website 2 subdomains 2 databases.
 
@Jack no clue, bob will tell you all about it ;)
 
2 db connections should do it
 
don't matter.. just help me. because my default controller not load.
 
9:03 AM
ahahahaha
 
I'm so glad that I gave up on CodeIgniter after 10 minutes in the tutorial and went for another one instead. I can thank you guys for that... $future++
$indian-- // wait what :D
 
Which one was that?
 
We should add this somewhere:
Now, if you lurk for a while, you might realize that we have no problem in answering questions asked by a regular. So what's going on? Well, we are a small community after all, and now it seems you have to earn your "right to ask" in the Lounge by becoming part of that community. If you don't have time for that, or don't care for that, then go on Stack Overflow instead. And please, for the love of all that is nice and fluffy, don't act like we owe you something. You'll get flamed to death.
 
@iroegbu hmm fcourse but in this case I have to set that up .
 
Symfony and Silex ftw (Y)
 
9:05 AM
Oh cool.
 
No way. I don't think C++ guys are that nice.
Not even a single swear word? Definitely not them :-P
 
C++ sucks, JavaScript is almost as bad
 
PHP rules them all.
/me goes hiding
 
@Duikboot that should be simple enough, I guess. Are you using the exact same code for both subdomains?
 
9:07 AM
@Jimbo So tempted...
 
@DaveRandom Haha...
It's E_MONDAY, why not
 
that is the question how to use that same code for 2 subdomains?
 
@DaveRandom Must... resist...the urge ... :-D
 
@HamZa I cannot believe those guys set up a PHP powered website :-O
 
@DaveRandom ahahahaha
 
9:08 AM
@Duikboot just route both addresses to same folder, then select a db connection based on the request uri
 
@HamZa Its not bad to be a newbie. at your answer to @reikyoushin
 
Bless 'em, those guys who use C++ are too old and forgetful now to realise there are significantly superior languages out there
 
What now is setup is the following:
subdomain.xyz.foobar.com with a database and the website files. ( Wich is working )

What the next approach is
sudomain-demo.xyz.foobar.com with the same files from above but an other database.
 
Wait what. There are two @Hamza's?
 
@AmalMurali Apparently there are.
 
9:10 AM
@AmalMurali ask a regex question to know the original
4
 
@AmalMurali ya you can say that.
 
@HamZa Good idea :-P
 
@Hamza please use the arrow instead of pinging with @. I don't have any idea what you're talking about
 
STAR IT!!1
 
@HamZa I demand you write a regex that matches only you, even if you change your name.
 
9:11 AM
@Duikboot setup second one the same way you did the 1st, only this time you need to change the db connection based on the uri
 
okay .
 
But,... then I have the files twice?
 
@DaveRandom preg_match('~^1401975$~D', $user->ID);
 
#http://stackoverflow.com/users/1401975/(.*)#
ah he beat me to it, probably better too :P
 
@Duikboot nope, use the same dir as before
 
what a title
 
@Jimbo Since it's ungreedy, you need to add $ so that it will match until end of string, so adding the s modifier is also mandatory. On that note, .* should do the job
 
How to do that? htaccess?
 
@HamZa I believe you have won today's round of "the internet". We can all go home now everyone, there's no point any more.
 
@DaveRandom lol, wasting my time here
 
9:15 AM
:')
 
I mean in real life
got a boring meeting ><
 
@Duikboot I don't think you'll have to go that far, using virtual servers.
 
Sigh. Why is it always sods law to get ill on Friday and start feeling better Monday
Fuck that shit.
 
Im setting up nothing with virtual servers currently. Im using the alias and subdomain parts of DirectAdmin.
 
@HamZa uh? what kinda meeting? I thought you were a student ;-P
 
9:17 AM
@HamZa For some reason, I just can't get the image out of my head of a bunch of guys in a meeting room, drilling holes in things
 
how do i suppress a php warning?
 
@JoshC. You fix it.
 
@JoshC. Don't suppress it in the first place.
 
its technically out of my hand on this one. and its in the phppass stuff
 
@Duikboot That's what I meant, sorry.
 
9:19 AM
@JoshC. well, what does the error say?
 
@JoshC. then you dont use broken libraries
 
Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/dev/urandom) is not within the allowed path(s):
 
But what if: I make a redirect/alias from : sudomain-demo.xyz.foobar.com ( wich hold no files ) to : sudomain.xyz.foobar.com wich hold the files.
 
lol
 
its not a broken library
 
9:19 AM
yeah , your system is broken instead
 
@tereško fucking university policies has done nothing but cause me headaches
 
first of all, you should be using php's new Password API or the password_compat library
 
i cant because of this wonderful fact....they are running PHP 5.2.14
 
of course, that assumes that the system on which you are working has been updated in this decade
 
hints my headache comment
 
9:22 AM
@JoshC. then go to our university and tell them that you cannot implement anything because their syustem is 7 years our of date
 
Or torch it.
That works too.
 
you can also go directly to the dean
 
argh
 
like @tereško did when he was young. right @tereško? :P
 
@Duikboot that is what, I'm asking you to do. You have to update the project though
 
9:23 AM
@tereško they will tell me sucks to suck
 
@SecondRikudo actually , I did
 
so, you can change connection config
 
@tereško I knew it!
 
students are clients of the university
 
9:23 AM
hmmmmm
 
your university is giving you 7 year old "product"
 
@tereško funny story lol this is a Grad project that the university is paying me to do...and yeah
 
if they are paying you, then you could push on the "known critical security flaws"
 
im just a no body in their eyes
 
@iroegbu
the 'demo' subdomain should be aliased to the normal one?
 
9:26 AM
plus i really put this off for a little to long so i am kind of screwed on pushing for new shit
 
yep... that is what I will do
no!
 
@AmalMurali I am a student. I have this crappy project where I'm in 3 subteams. So 3 projects. One of those projects is to work with a crappy wordpress website. I'm so mad atm
 
that's not what I will do
 
So I'm now with this client
@DaveRandom hehe
 
I would have built the original project such that there is a 'demo' mode
 
9:27 AM
soo once again how do i suppress this warning haha
 
that warning is telling to that the library is not working because it has no source for entropy
 
it did work though
 
And what's the difference between Data Mapper and Table Gateway?
 
hmmm
 
@JoshC. Well, it probably got its source from elsewhere.
 
9:28 AM
im looking at the database and it updated
 
@djay With Data Mapper, the focus is on the object. With Table Gateway, it's the table.
 
@djay you build table gateway for saving to a table , you build mapper for saving of an object
 
i mean i can even login to the acount i just made
 
        // Try reading from /dev/urandom, if present
        $output = '';
        if (is_readable('/dev/urandom') && ($fh = fopen('/dev/urandom', 'rb'))) {
            $output = fread($fh, $count);
            fclose($fh);
        }

        // Fall back to a locally generated "random" string
        if (strlen($output) < $count) {
            $output = '';
            for ($i = 0; $i < $count; $i += 16) {
                $this->_randomState = md5(microtime() . $this->_randomState);
                $output .= md5($this->_randomState, true);
That is what happens in PHPass, so it does get a different randomness source.
 
9:32 AM
So when working with MySQL, then a gateway kinda becomes a mapper?
 
no
 
It's suboptimal, and the university will be vulnerable to attacks, but you can just erase the entire first condition, and it'll use the second one.
 
@tereško how would you call this: When a class deals with one table and implement methods like fetchById(), deleteById(), fetchAll(), insert()?
 
This is now going live and is subject to our copyright. Could you please delete the code above? — DoJoChi 4 mins ago
 
@djay That's a TableGateway
 
9:34 AM
and the state is initialized by prepared $pdo instance
 
^ Dudes I think this is nonsense, what do you think?
 
@djay mapper implements methoids save($object), delete($object) and fetch($object)
 
Code submitted on Stack Overflow and on Stack Exchange in general is not subject to your copyright. You have no right requesting it to be deleted. See the copyright at the footer of this page. Actually, you must give attribution to @HamZa and to Stack Overflow if you are planning to use this code in your product. — Second Rikudo 47 secs ago
Rasmus style :D
 
@SecondRikudo woah. Is attribution required?
 
Yup, see the footer of every page on Stack Overflow.
 
9:37 AM
@SecondRikudo Feel a little sorry for him though - perhaps he didn't realise this. I wouldn't want someone losing their job over it and would perhaps consider it as a gesture of good will...
 
@tereško $object is kinda prepared container of some data, right? It just contain values?
 
@Jimbo Bitch please, if you didn't write the code, you should not get credit or copyright over it.
 
@SecondRikudo Was none of it arbritrary code or did you write it all?
 
@Jimbo I didn't write any of it, @HamZa did.
 
9:38 AM
@SecondRikudo oops sorry wrong ping ... @HamZa
 
And it does seem like he wrote all of it.
 
If HamZa wrote it all, then this guy of course has no right lol. But if half of it is his, I would question it morally :-)
 
no matter who you ping we both will get notification @Jimbo
 
lol
 
@Hamza This drama won't end until one of you changes their nicknames.
 
9:40 AM
hehehe
 
^^
 
ya i will change it at 6june @SecondRikudo
 
phpdbg.com/docs/pwn @JoeWatkins why?
 
@Hamza If that's because you are not currently allowed to because of the 1mth thing, go to your account on ServerFault, and change it there, and click "save and copy to all sites" and it will update you name on SO and bypass the timer
(assuming your not subject to time there as well)
 
9:43 AM
Morning.
 
@DaveRandom i will try it.
 
Why did this try to allocate around 600 MB on HHVM?
 
@Hamza you don't actually have to change your username there if you don't want to change it, just update something else about your profile and it should copy your username there to SO
@PeeHaa ping
 
@Jimbo He already tried to edit and remove the code I wrote with a suggested edit I think
 
@Hamza If you want to change your nickname now, you could contact a moderator to change it for you.
 
9:46 AM
@Leri lol, I suggest you report that as a bug, it clearly is one
 
The docs are looking shit with the black background, when did they changed that?
 
@Mr.Alien They = @LeviMorrison
Also, I think they look better.
 
I dont want to change my name now but i will @SecondRikudo
 
the previous one was way better, that color is hitting on my eyes
 
I'm both disgusted and amazed by how easy it was to plugin @rdlowrey's Artax in to Drupal 7 modules. I feel like Dr. Frankenstein.
 
9:52 AM
@HamZa Considering making a meta post asking what the best way forward for something like that is. Although he has no right to ask, what if it meant his job was on the line because of proprietary code (his own fault but still)...
 
hai
can any one help me out
Warning: require_once(__DIR__/db_connect.php) [function.require-once]: failed to open stream: No such file or directory in in resolving this error
 
@bwoebi Is there a way to let Zend show the contents of the memory that's leaked?
 
@Jimbo I can't even delete it lol
 
Hello everyone
 
what would you call a decorator, which makes the elements output cachable ?
 
9:58 AM
@dileep here
and you are from India, aren't you?
 
@Mr.Alien from india
 
I got that.
 
@Jimbo also, I'm not in the mood to create a meta now. Thanks for the suggestion though
 
0
Q: How should questions containing proprietary code be handled when OP asks for deletion

JimboWhen a user asks for help without reading the FAQ first, and posts code that they are working with from their day job - how should the situation be handled when the OP requests that the code be taken down because it is proprietary? An example question here resulted in the following (well up-vote...

 
so ... why is google blocked in India ?
 
9:59 AM
@HamZa No worries, I did state that what you put is entirely correct
 
@Jimbo oh, thanks :D
 
@Mr.Alien whr r u from
 
same country
 
@Jack set a breakpoint where the info about the memleak is output and look at the pointer...
 
@Mr.Alien whr r u from
 
10:01 AM
Fair enough I guess :)
 
place
 
@dileep Look at my profile please
 
@Jimbo inb4 someone edits to change "StackOverflow" to "Stack Overflow" :-D
 
@tereško I have a question about $mapper->fetch( $account ); from this answer
 
@Mr.Alien the issuue not resolved
 
10:05 AM
@HamZa Can't OP just delete his own question and that in essence deletes the answer too?
 
have someone used jmsBundle ?
 
@Jimbo Not if there is an answer with X votes AFAIK. Also I can't delete mine because it's accepted
 
i used it with FOSRestBundle and i need to set a field as Array because when the index is 1 i get the result as Object !!
 
I can have $account->setUsername( $username ); or $account->setUserId( $userid ); and use the same fetch fn from $mapper. How then do I implement fetch() knowing that there is a possibility the user can set different unique id.
previously, I used to just pass the unique id to fetch. So, I have fetchById($id), fetchByUsername($username) instead of passing the type as arg
 
@Hamza can you help me out ?
 
10:10 AM
@HamZa You can flag it for mod attention to have it deleted
(I've done that before...)
 
I want to add a note as the owner of the answer: If I remember correctly the user has suggested an edit to remove the code. I rejected it because IMO if you asked for help on SO and you got your answer then the Q&A should remain for future visitors. Otherwise, I might as well start a paid support helpdesk. A solution for the asker is to not provide identical code but a replication of the problem. The OP could as well just change my code in production instead of asking me to remove it. — HamZa 2 mins ago
I don't care about the rep, it's just a matter of principle as stated in my comment
@AbdellahSELASSI what's the problem?
 
0
Q: repeat event by days with occurences

Steve Bals<?php function getDateOfWeekDay($day) { $weekDays = array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ); $dayNumber = array_search($day, $weekDays); $currentDayNumber = date('w', strtotime('today')); ...

 
@HamZa I think he didn't word his request well - it seems he doesn't care about the code being in the public because of his job. He just wants to legally own the work which you did, which is something different
 
@HamZa The way he made his "request", I wouldn't delete it.
 
It's still awesome to see how php internals still believe in the sanctity of md5() :)
 
10:13 AM
@Jimbo I don't care, same decision
 
@HamZa I don't know, morals come into it when we're talking about a guy losing his job. When it's all about him wanting the £££ instead... I think it's "less moral" and "more business"? :)
I think there's less of a reason to delete it if he merely wants the code for himself, not because he might lose his job
 
@HamZa i use JMSBundle with FOSRestBundle and i have a problem with the json response , i get the same field as object/array, the question how can i force it to be array ?
 
@bwoebi I was being an idiot; I had put some testing code in place during investigation of the zend_is_callable() function ... and then I forgot to remove it >.<
That was the memory leak ...
 
@Jimbo Like I said in my comment " A solution for the asker is to not provide identical code but a replication of the problem. The OP could as well just change my code in production instead of asking me to remove it." So the first option isn't viable now, the OP could always go for the second option. Change my solution so it won't be recognisable
@AbdellahSELASSI somewhere you use json_decode?
 
@Jack happens...
 
10:19 AM
i don't use json_decode if i m not wrong it's done by JMSBundle !!
 
@SteveBals What??? foreach($ronS as $ronS) {?
 
@HamZa i don't use json_decode if i m not wrong it's done by JMSBundle !!
 
@AbdellahSELASSI you might search for that and use the second parameter and set it to true. json_decode($json, true);
 
@HamZa thank you
 
10:25 AM
welcome
 
1 message moved to bin
@SteveBals please don't post your question more than once in such a short time
 
@SteveBals Why aren't you using DateTime class? What PHP version do you use?
Also your code contains many logical errors. I'd suggest you rewrite it from scratch, @SteveBals
 
@AmalMurali have worked with JMSBundle ?
 
[Mon May 12 12:29:12 2014]  Script:  '-'
Zend/zend_vm_execute.h(30941) :  Freeing 0x110AC0FB0 (32 bytes), script=-
=== Total 1 memory leaks detected ===
huh. I was writing PHP 5.3 valid code…
 
@AbdellahSELASSI No, sorry. I don't even know what that is. But what's your question anyway?
 
10:31 AM
please help me:
http://www.codeproject.com/Questions/772195/Warning-shell-exec-has-been-disabled-for-security
 
@iroegbu the main issue here is that you latter case you end up with mapper which also acts as a factory. You end up violating SRP.
 
@UmarFarooq lolwut, you got the answer
 
as for ways to know by which value you need to select the data, yes, it can be a problem, but in practice you will have a very small number of such keys and you can easily build the query as needed
 
Anyone else feel the number of "pls help me <code dump>" messages has gone up these days?
 
@AmalMurali yes
 
10:33 AM
@HamZa I am sorry
 
yes
 
Bring back too localized
 
@AmalMurali i m based to this tutorial to implement a REST Webservice welcometothebundle.com/symfony2-rest-api-the-best-way-part-3
 
ok, thanks. I was already running into problems, having multiple instances of stuff... Separating Factory functions will help me a whole lot. Thanks again.
 
@Jimbo sadly, it's gone (forever, I think) :((((
"minimal understanding" close reason would've been nice as well
 
10:34 AM
@iroegbu keep in mind that factories should be a separate instance, not just functions.
"factory method" is considered to be an architectural antipattern
 
So many questions that would've been closed with "minimal understanding" reason are floating around now, OPEN.
 
is there some tool that can be easily used to produce PHP boilerplate code for a decorator of an existing type?
Perhaps with PHPStorm integration?
 
oh, yes. I was talking of functions as abilities not really function(){...}
 
all is good , but recently i had a problem with a json response (build by JMSBundle) , the problem that i get a field as object/array
@AmalMurali
 
@AbdellahSELASSI I don't see how getting array/object is a problem.
 
10:36 AM
@AmalMurali from the first page, only 20% of question are asked by people with more then 100 reputation point
 
Well, if you're using json_decode to decode it, you will only get an array/object (or NULL)
 
and only one question was asked by a guy with more then 1000
 
^ rep. has nothing to do with question quality ..
 
@AlmaDo so, how many good quality question have you seen from users with 1 rep ?
 
10:37 AM
SIGH ^ look at above question
 
@hakre Pretty sure you could write that in about 50 lines...
 
@tereško well, I don't know. But it certainly works this way: users with 100 or 1000 rep also are asking stupid questions (mainly)
 
@AlmaDo Ks don't matter. Even someone with 10K could ask stupid questions
 
the reputation signifies how much user participates in the site
fact that more then 50% of "new questions" are made by people with 1 rep, is a significant problem
 
10:40 AM
Well, most of the times. But not always. A user could remain with 200 rep forever if they choose not to answer/ask questions...
-1
Q: PHP decode josn array string using json_decode

dhardyI have the following json encoded string: a:3:{i:641;a:18:{s:9:"is_delete";s:0:"";s:13:"previous_type";s:9:"drop_down";s:14:"previous_group";s:6:"select";s:2:"id";s:3:"641";s:9:"option_id";i:641;s:5:"title";s:5:"Brand";s:4:"type";s:9:"drop_down";s:10:"is_require";s:1:"1";s:9:"view_mode";s:1:"1";...

 
@tereško (off this thread). How do you think - if I came to the point where I'm stuck because PHP doesn't support multiple inheritance, does that mean that my breakdown is wrong? (however, parent classes 100% have non-intersecting methods)
 
Look at this question for example. Two 25K+ users already answered the question :)
 
@tereško Not necessarily, through creative use of hn/twitter etc you can get 1000+ rep for one answer, not necessarily even a good one :-(
 
^ cv, then delv. Let's punish repwhores !
 
@AmalMurali What's the reason for 25k+ user to start rep-whoring?
 
10:42 AM
^ 20k is the reason to end repwhoring
 
@Leri Huh. I don't know? Ask them? :P
 
@AlmaDo as rule of thumb: multiple inheritance is a flaw of design. But it can be actually implemented in PHP with traits ... but you really should rethink your design
 
@Leri How do you think they got to 25K? They just haven't stopped...
How do you think Jon Skeet got 1trn rep or whatever he has by now
 
@tereško so my feeling is correct (as I thought) .. well, don't know how to do it another way.. I'll think more. Thanks
 
@DaveRandom Is that a new unit? :-P
Same here. Whoever downvoted is a monkey. — briosheje 27 secs ago
hehe lol
(I'm not the one who downvoted though. I reserve my downvotes for STUPID answers)
and questions with very little to no research efforts...
 
10:45 AM
@AmalMurali No, it's "trillion", the one below "squillion"
 
In other words, incomprehensibly large numbers
All this talk of national debt just doesn't scare me at all, the numbers are so big they just don't mean anything any more.
 
1 more to go
 
haha lol, I have -4 del-votes .. such a sh*t
 
Fuck, someone wiped the comments.
@tereško that was fun. lol.
 
probably Shog9
he always applies "scorched earth policy"
also
 
I bet fucking Shankar flagged.
 
10:59 AM
@DanLugg Wow, it has 3 reopen votes
 
so kill it
 
i can only cast one delete one one question, sorry :p
If you think the question is a duplicate, please flag it as such. As it's currently written, this is just a link pointing elsewhere. — Amal Murali 1 min ago
 
What would you guys`n`gals call a "caching decorator" ?
 
@tereško CachingDecorator
 
=/
 
11:05 AM
Depends on what the decoration is.
 
@tereško do you like Slipknot?
 
no
 
metallica?
 
good morning
 
also, no
 
11:06 AM
@Alex morning
 
@DanLugg look here: stackoverflow.com/a/18682856/727208 (for the "non-invasive" part).. replace logger with cache
 
@DanLugg lol
the new kolink?
 
@tereško Hmm, so a caching proxy, basically?
 
no, it is not a proxy
 
Okay, CachingWrapper (honestly, CachingDecorator is fine to me)
Is it going to be interface specific, or are you using __call?
@HamZa He's certainly not new; and Kolink ain't gone.
 
11:11 AM
i'm gonna go with CachingDecorator for now
and no, it is not interface-specific
 
Really, that sounds fine to me. I mean; especially given it's not implementing and forwarding for a specific interface, it's too generic to name otherwise.
 
I taught a co-student about !important in css. Guess what he's saying now "I will use important everywhere!"
 
Holy fucking shit. Seriously. We should get a feed of Shankar's answers, and just populate the CV queue with them; does he answer anything other than "HOW I FOREACH?" and "I HAVE JSON I WANT TO DECODE HOW?"
 
Actually I decided to call it Membrane
 
@DaveRandom yo?
 
11:16 AM
@tereško Call it CacheBrane to fit the theme of LogBrane ;-)
 
yeah
 
@DanLugg it looks like a revenge.. guess who is downvoting your posts?
 
lol, I don't really give a shit. He's the asshole for constantly answering dupes, and he knows it.
 
lol
 
And, it'll get reversed, probably.
 
11:18 AM
@DanLugg otherwise room11 to the rescue :P
 
lol Aww, gee. Thanks.
Seriously though, IDGAF really, he's a fuck (presumably over the DV, but definitely over the dupe answering)
 
@DanLugg flag for moderators .. maybe he will have an account lock
 
I will if I dip below -13 today.
What about +2 rep to close-voters when the question is closed? Maybe specifically to those who voted on the majority close reason?
 
@djay if you are so interested, currently I am listening to this
 
OK so you remember a couple of weeks ago we were talking about a Chrome extension to let you change the Accept-Language header based on the URL being requested? Well that kind of snowballed into a thing that lets you add/change/remove arbitrary headers in the request (plus a layer for cookies, the ability to block the request and will probably end up being able to manipulate form data posts as well) with rule-based conditions including URL, request method, other headers, request source (xhr, page, top frame, inner frame etc) and other stuff as well. It's actually probably going to be quite
 
11:21 AM
@tereško That's a sweet album.
 
wtf, bitbucket. I transferred a repo and it did 'copy' instead of 'move' :s
 
@DanLugg hehe that would be nice. I mean I got +2000 reviews in the review queue. Add the CV's I casted without the queue I would be a 10K user in no time :P
 
@DanLugg sounds nice, but cv repwhores sounds even worse than current repwhores..
 
@AlmaDo Nope. At least the site will be clean.
I'd rather way less content that's canonical, than shit spread around like dirty butter.
 
11:26 AM
@HamZa I think I have something like 5K in the queue
 
@tereško you're a trusted user :P
Also I kind of lost hope in the rescue of SO from bad questions
 
@HamZa Same...
 
I should do something productive instead
 
When I see questions like this, the answer pops to my mind and I have a tendency to answer, but I've mostly resorted to commenting these days
Slight variation: preg_replace_callback('/([a-z]+)-?/', function ($m) { return ucfirst($m[1]); }, strtolower($str));Amal Murali 15 mins ago
 
@AmalMurali there should be a dupe somewhere
 
11:32 AM
It's certainly an answerable question, probably not a duplicate, not too broad and not off-topic either. I don't know which close reason to use any more :P
@HamZa Maaaybe, but I'm not motivated enough to crawl through millions of post and find a duplicate for it anyway.
 
1
A: Effective way to replace the text with some pattern

HamZaIf you want a regex solution, you will need a callback. So here you go: $input = 'abc_def_ghi_jkl'; $output = preg_replace_callback('~([^_]+)_?~', function($m){ return ucfirst($m[1]); }, $input); var_dump($output); Regex explanation: ~ are regex delimiters in this case. ([^_]+) match a...

 
yay , got hit by revenge votes too ... flagged for mods
 
ahahahahaha
 
Because 12 people will have answered by then. And why would closing matter anyway?
@HamZa i have a similar answer too, but too lazy to find it :-P
 
@tereško I'm still stuck :\ Can you participate in this fiddle? I'll type there, it's real-time
 
11:39 AM
@DaveRandom As long as the name is short relativity doesn't matter. Look at Charles for instance.
 
Hey guys... :)
 
Nice album @tereško. Not heard them before.
 
I cannot recall how I stumbled upon that band. But it's nice. Especially when you are driving somewhere.
@PraveenKumar mornin'
anyway ... back to the code issues
can someone think of good reasons why not to wrap configuration in an object?
 
Good morning teresko.. Nice album...
 
hi all
 
11:51 AM
WHy dosn't work
` /**
* @ORM\OneToMany(targetEntity="Genius\ProfileBundle\Entity\Actualite", mappedBy="profil",cascade={"persist"}, cascade={"persist", "remove"})
* @Type("array")
*/
private $actualites;`
??
 
naah .. I will have to abstract the configuration as an instance anyway, because, if at some point I decide to change the configuration format, I would be forced to rewrite every class which uses said config
on a side note: am I the only one who thinks that logic in the comments is terribly broken idea to begin with
 
@Fabien So what are you suggesting then? I call it Bernard?
 
@DaveRandom Yes.
 
St. Bernard.
 
Well not strictly but I am saying naming is only as important as not fucking up.
 
11:55 AM
Annoyingly, it does more than just terminate requests, otherwise I would call it Arnie
 
lol
 
I could call it fur-q, see if Google will let me get away with that
 
Please tell me check if a place falls in the route path between 2 places
Actually my requirement is that, I have a one route A to B and i have a place (C) with lat and lon and i want to check this place (C) is lie on the route A and B. How i can check this?
Any one tell me please
?
@Fabien help me
 
@hakre stackoverflow.com/a/23595247/2153758 why simple when you can do it complicated too?
 

« first day (1304 days earlier)      last day (3644 days later) »