Is it possible to check a bash script syntax without executing it?
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Monday, June 4, 2012
How do I check syntax in bash without running the script?
Friday, May 25, 2012
Can you explain why ++[[]][+[]]+[+[]] = 10
++[[]][+[]]+[+[]]
is valid and return "10" in JavaScript (more example here: http://sla.ckers.org/forum/read.php?24,33349,33405 ).
Thursday, May 24, 2012
What does "use strict' do in JavaScript, and what is the reasoning behind it?
Recently, I ran some of my JavaScript code through Crockford's JSLint , and it gave the following error:
Wednesday, May 16, 2012
New/strange Java 'try()' syntax?
While messing around with the custom formatting options in Eclipse, in one of the sample pieces of code, I saw code as follows:
Sunday, May 13, 2012
+ operator before expression in javascript: what does it do?
I was perusing the underscore.js library and I found something I haven't come across before:
Monday, May 7, 2012
What is the performance difference, if any, between if(!foo) and if(foo == false) in Java?
Logically, if(!foo) and if(foo == false) are equivalent. How are they represented in Java? Is there any difference between the two after compilation, either in the bytecode or in performance? I was unable to find an answer in the JLS, and searching brought up a lot of results about = vs. == typos and ==/equals() behavior. (In this case, the symbols hampered my searching; for future searchers, negation operator, equals false, equal to false, not condition).
Friday, May 4, 2012
Anonymous recursive PHP functions
Is it possible to have a PHP function that is both recursive and anonymous? This is my attempt to get it to work, but it doesn't pass in the function name.
Thursday, April 12, 2012
What is the PHP ? : operator called and what does it do?
Can someone please explain what the "?" and ":" operators are in PHP?
Sunday, April 8, 2012
var x, y = "foo"; Can this be accomplished?
Since it is possible to do:
var x = 'foo', y = 'foo';
Would this also be possible?
var x, y = 'foo';
I tried it, however x becomes undefined.
I know this may seem like a silly or redundant question, but if I'm curious about something, why not ask? Also you will probably wonder why I would need two variables equal to the same thing in scope . That is not the point of the question. I'm just curious.
Source: Tips4all
What does | in this code mean?
function foo() {}
var bar = foo <| function() {};
This is the first time I've seen something like this. What does <| mean?
Source: https://github.com/allenwb/ESnext-experiments/blob/master/ST80collections-exp1.js
Source: Tips4all
Sunday, January 29, 2012
PHP if else - proper use of "else”
A professor told me long ago to use else when "chaining" multiple conditions in a series (I was still learning). Now that I've been tinkering with several frameworks and CMS years later, I find it quite amusing that what I was taught to do isn't necessarily so.
Monday, January 16, 2012
Thursday, January 12, 2012
Set variable within another context
I have the following function
"use strict";
function Player
{
this.width;
this.height;
this.framesA = 5;
this.image = new Image();
this.image.onload = function ()
{
width = this.width;
height = this.height / framesA;
}
this.image.src = "Images/angel.png";
}