look, nobody in here has installed memcache on windows (it seems) so I would suggest using google further to drill down to the core of the problem or find alternative solutions
Suppose that we have this code (simplified example):
$propertyName = 'items';
$foo = new \stdClass;
$foo->$propertyName = array(42);
At this point I 'd like to write an expression that evaluates to a reference to the value inside the array.
Is it possible to do this? If so, how?
An answer...
@SmootQ virtual box helps you to run 'virtual' (actually real) OSes of any flavour on your windows machine
teresko tells you to install virtual box and then install any unix os on that virtual box and use that system as your development environment. best idea would be to use an image similar to the one of your live environment
os if your server runs CentOS you'd install a centos image on virtual box
People are talking about characters when one can compress an IP address into raw data.
So in principle, since we only use IPv4 (32bit) or IPv6 (128bit), that means you need at most 128 bits of space, or 128/8 = 16 bytes!
Which is much less than the suggested 39 bytes (characters).
That said, y...
Development, testing, staging and production — this is how most people devide up different environments for application development. Maintenance and setup of these environments is often not a trivial goal to achieve. Having worked with a couple different code bases and setups over the last decade, I often noticed things like environment specific hacks (if ($env == 'testing') { ... }) in appli…
@Christian: That's technically correct, but it trades convenience for storage space (I don't think 16 vs 39 bytes would make a perf difference for sane numbers of addresses). Should explain why it's not popular.
I need to call this room to order a bit... there have been complaints, which are clearly evidenced by a quick review of this room, of... shall we say... close/down-vote irregularities?
@Jon Not only does it save storage space, but it also makes address manipulations (like determining whether the address is on a given network) considerably easier; indeed, if done right there should never be a need to convert the address into string form in the first place - it will just stay in binary until it needs to be displayed to a human.
But: if something is a bad answer, then calling for a mass pile-on of downvotes, especially if you don't leave any feedback, is ... not in the spirit of things.
The problem you are facing is due to variable scope. In PHP, when you are inside a function or a class, you can't access global variables/objects without explicitly saying that you are using the global one. For example :
$DB = 'This is my DB object'; //global variable
class Controller
{
fu...
@Jon Aye. I'd have thought the fact that the answer being only 25 minutes old versus the rest at 2.5 years has more bearing on its lack of popularity? :)
Ok so I answered a question about PHP global variables, and my answer was right to the point and solved the OP's problem. I had two upvotes and the OP accepted my answer. However, maybe 3 hours later (when the question would have been burried deep below the newer ones) I got downvoted like crazy:...
@BilltheLizard I'm here very often and I have never seen a request for downvotes, we have close requests but nothing like requests for downvotes obviously
But my point, to re-iterate: if there is a problem with an answer, drawing attention to it is perhaps not unreasonable - but if you are going to do that, which could incur a sudden slew of votes: PLEASE SAY CLEARLY WHAT THE PROBLEM IS
@RepWhoringPeeHaa That's fine. I don't have a problem with downvoting. But if you're going to call for everyone in chat to downvote an answer, leave a correct answer so people know what it's about.
@BilltheLizard If I remember that right, there is a link called "delete" below an answer you can cast your vote with. But I think you know the procedure.
again, whether downvote or delete-vote is moot; if you're going to pile-on, you are going to cause confusion and angst with people. So please say what the reason is why it is suddenly getting all that attention.
seriously, if the question/answer really is bad enough that it needs deleting, then that can be valid self-monitoring of the system - just keep it .... straight, eh?
@MarcGravell annoyance about the crazy influx of the same dangerous low quality stuff can maybe sometimes turn into a sort of impatient attitude which can be interpreted as hostile
I'm not a PHP person, so I have no idea if there is something really bad in there. But if I was new to PHP, I would genuinely want to know why it was -6 ... so that I understand whether it is good or bad code.
well some self criticism: it was a vandetta. maybe for a reason, but a vandetta. I took part in it passively (not doing any votes). That poor answer guy, I have to admit.
@MarcGravell it has been discussed on meta before that we do not need to comment when we downvote. its nice to do but not mandatory. dv-pls happens very rarely and the ones i saw (not all) have been fairly obvious candidates for downvoting. as for delv-pls and cv-pls, there is a question on it on meta. we are doing the site a service with it.
@BenBrocka, I'm using 1.3 for this project, got the same problem on my project and a fresh install, that is why I think something is fishy on the config side =/
@petervaz I've had that problem before...but I thought I had just forgotten to enable mod_rewrite. I don't think Cake requires any other configuration in apache
@php-chat maybe a read up about group think would bring some additional perspective into this whole thing too... I think this room tends to suffer from it a bit at times
@petervaz that should be the right URL, doesn't sound like it's hitting the right folder though. If you change index.php in /app/webroot does the /site/ page change?
@BoltClock it is fairly disappointing to see a SO mod present himself so unprofessionally. i think the circle jerk you're referring to is a collective group of programmers who are TRYING to make SO a better place for people to come and learn the right way. there are other forums that people can go to that do not strive to make their answers clear, concise, and RIGHT. isn't that one of the ways that SO separates itself from those subpar resources? (serious question)
I think @MarcGravell 's points are valid. people should a. comment when they downvote or b. upvote a comment that explains their reasoning behind a downvote. But I think coming in cursing up a storm about people who are genuinely trying to help is a bit over the top.
@CarrieKendall: Trying to make anything better in the wrong way does not justify the intent (obligatory Hitler reference here). What the regulars of this room do every so often is OK by the letter of the law, but for what it's worth I too find it not constructive. At times you could also attach heavier adjectives. Agree with you that BoltClock should strive to not offend with his words, but agree with him on the deep down.
@BenBrocka, I made it, I needed to allow override on the sites-enabled dir, which I didn't know because it is different from what I did before, also one of my .htaccess didn't came from svn and was missing.
@MarcGravell I wonder how many of the downvotes on that answer really came from us in here, because I just checked it and I didnt dv it because it technically answers the question. Just because something is requested in here doesnt mean all of us follow that request. Unless db say different, we should get the benefit of doubt here, too.
@Jon I think 9 times out of 10 there is ONE person to be held accountable. Not a circle jerk. Also, what both of you are referencing has little to do with the problem that i think @MarcGravell intended to address.
@CarrieKendall: You mean there's usually a single abettor? I don't spend much time here, but if people take turns being this hypothetical abettor -- wouldn't then it be a fair assessment?
In the end, there are no scripts to cv or dv or del-v. It still up to the individual voters to decide to do it or not. I don't have any problem with cv-pls or delv-pls. I think they are great concepts as it helps moderate by community. dv-pls I don't care for, because it's not moderation, but punishment. Instead, I prefer to just post the answer and let others decide what to do (flag, dv, etc)
There is a lot of cool history with the transit of venus, especially considering Captain Cook's voyage for it, which took him to the east coast of Australia (at least if you are an Australian).
yes, but downvoting doesn't really indicate that. It just punishes the poster. A series of comments as to why it's wrong is far better than an arbitrary -1
Just to complement Marc's answer from the point of view of someone who actually has some knowledge of PHP:
The original answer (which was later edited) was correctly describing scoping in PHP, but proposed to solve the problem by importing global variables into the function. This is considered v...
This question is stemming from the post I thought I posted a good answer. This user was obviously targeted by chat users who didn't like the answer or disagreed with it and decided to down-vote without providing feedback, etc.
I know this was corrected for this user but is there any mechanism...
I was one of the people who downvoted your answer (as well as the other answer) as well as I am one of the regulars in PHP chat.
Let's start with the why: because the answer basically is wrong. I mean the answer works, but it isn't considered best practice (understatement). The use of the global...
I think that this indicates a deeper problem with a lot of SO answers. The point of the site is not to help individuals, but to help the community. That's why the Not Constructive and Too Localized close-vote types exist. The power of the site is not in helping an individual, but in helping the c...
I didn't dv, but really, mysql_* depreciation is talked about a lot here...
user895378
14:56
"I posted an answer that directly contradicts the number one rule of good programming. It was very poor advice. Now I really want my rep back." ... Really?
user895378
What's lost in that discussion is that the answer was TERRIBLE.
@rdlowrey Oh if that burns you read this guys responses to what I had to say: http://meta.stackoverflow.com/questions/134581/i-thought-i-posted-a-good-answer/134601#comment374551_134601