Hello!
Is there an equivalent in JavaScript for PHP's reference passing of variables?
[PHP]:
function addToEnd(&$theRefVar,$str)
{
$theRefVar.=$str;
}
$myVar="Hello";
addToEnd($myVar," World!");
print $myVar;//Outputs: Hello World!
How would the same code look in JavaScript if possible?
...
It's not really about the question, it's more about "some people don't appreciate when we provide the same answer as them, but with the correct explanation. I dunno if this isn't ok or it's just that people don't like it."
I can't edit his question to correct the incorrect information. People told him it was wrong and the answer is still misleading at best and just wrong at worst.
The variable doesn't "hold" the object, it holds a reference. You can assign that reference to another variable, now both reference the same object. It's always pass by value (even when that value is a reference...).
There's no way to alter the value held by a variable passed as a parameter, wh...
These 2 questions have clearly wrong answers with upvotes. And they're still getting votes.
The log file one especially could be tried out, it would fail, but someone still voted it up. A downvote and comment has no effect.
Like we have "vote to close", what about a "vote to delete" for answers...
If i wasn't so busy, I'd just edit vol7ron's answer and up-vote that. But for now, I'll give you a bump @Hox, since you did do a slightly better job of explaining what's going on.
@AidenBell Well, the answer to the question is, "No you can't."
but, "In Javascript there is no passing variable by reference like in PHP. There is a possible workaround to do something similar." is a reasonable approximation.
@HoxLyxVierx careful about saying that... One of my most-upvoted answers was a trivial little "write my jQuery code for me" response that I just kept expanding in response to comments...
Some links in the question Password hash function for Excel VBA are now broken. Here is an updated version of the accepted answer on that question :
You'll find an implementation for VB
and VBScript here:
http://web.archive.org/web/20080526064101/http://www.frez.co.uk/freecode.htm#md5
...
at its core, that question wasn't so much about game programing even, as it was a "why does example code invariably violate the most basic style recommendations?"
(This is related to "Advanced Syntax Ideas" but not quite the same.)
I don't know how many links I add to docs in one day of posting, but it's a lot. I've made this somewhat easier with "smart bookmarks" or whatever you want to call them so that if I open a new tab and type
msdn system.diagnost...
@HoxLyxVierx Heh, my only downvote was for (as far as I can tell) answering someone with a 0% accept rate. On the flip side, my highest voted answer wasn't all that useful, but it was on one of those popular irrelevant questions. People don't always vote as I would, but it doesn't impact what or how I answer, so. :P
I believe the best answer is 9419919379773971911373313179.
Edit: slightly more concise -- appropriate sorting returns the largest number first. Note the reversal shouldn't count against the computation time, if I were less lazy I'd just store the list in that format to begin with...
edit: sligh...
thought that was actually a lot of fun to play with
the code-golf tag got added to the question much later
the original intent was to make something fast, and that Java solution is a good order of magnitude faster
too bad it wasn't terse enough to get all the upvotes of the python solution
Meme: StackExchangeâ„¢ MultiCollider SuperDropdownâ„¢
Originator: radp, made popular by rchern in a comment on this question
First Seen: 27 Sept. 2010
Cultural Height: margin-top: 6px;
Definition:
Completed, to be fully deployed next week.
There are 2 types of notifications you can get:
A batch notification that lets you know you got a bunch of new abilities, that takes you to http://meta.stackoverflow.com/abilities
If you only gained one new ability you will be directed to the actual...
I was actually just looking at the privilege list on Unix; apparently proposing tag synonyms wasn't adjusted for the SE betas, so it amusingly requires 500 more rep than pseudo-mod tools :)
Do you have a screenshot of one? It's too much effort to find a site that I'm near a rep limit on
Chrome is about 10 times faster than Firefox was on my computer, except when it suddenly goes crazy and consumes all memory and swap space in a few seconds and then freezes
So, I wrestled with vim's coloschemes for quite a while yesterday. Finally started to get it looking like my old scheme. So, I pluncked a "coloscheme minenew" line .vimrc, only to have it not work exactly right... =/
talking of vim, you guys got me sufficiently interested to download and install it yesterday... Is there any nice 'brain training' tutorial that you know of?
@GeorgeMarian, thanks, nice. Now I've just got to re-install in English (I just dumbly clicked through the install and it looked at the language of my OS apparently :(
Can you narrow it down? Are you measuring in months, weeks or days?
And I won't hold you to it, I fully understand the concept of things that crop up unexpected :)
What's the holdup actually? You gathering experiences from the other sites before you launch SO? I'm guessing it will be expected to go nuclear in terms of activity
Will there be privileges attached to reputation on chat as well? Not that there's anything I'm missing, but will everybody be able to post pictures from day one?
I guess now is the time you're looking for that "Read the FAQ" button, huh? :)
btw, prefixing "chat." on the url for a SuperUser question didn't work, gave me a page not found with Picard and Riker in funny hats
@LasseVKarlsen I have to confirm but if I recall after a certain number of votes an answer can also be converted. Or it may have been up for discussion at some point.
Why have Community Wiki posts?
One of the goals of the website is to be a continually evolving source of good information. Community Wiki posts help enhance the wiki aspect of the site.
How do Community Wiki posts work?
Community Wiki posts work by transferring ownership of the post from the ...
hmm, how can I change ^http://.*gaming.stackexchange.com/.* to only match ^http://gaming.stackexchange.com/.* and ^http://meta.gaming.stackexchange.com/.*?