This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(8124, "127.0.0.1"); | |
console.log('Server running at http://127.0.0.1:8124/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
public class Test { | |
public static void main(final String[] args) { | |
Test t = new Test(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table schema="${schema}" tableName="T_REPORTING_FCT" prefixColumnsByTableName="true"> | |
<property name="useActualColumnNames" value="false" /> | |
<columnOverride column="REPORTING_FCT_O_USABLE" javaType="java.lang.Boolean"/> | |
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo ? bar.doSomething(el) : bar.doSomethingElse(el); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2: what is the faulty logic in the following code? | |
var foo = 'hello'; | |
(function() { | |
var foo = foo || 'world'; | |
console.log(foo); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3: given the following code, how would you override the value of the bar | |
// property for the variable foo without affecting the value of the bar | |
// property for the variable bim? how would you affect the value of the bar | |
// property for both foo and bim? how would you add a method to foo and bim to | |
// console.log the value of each object's bar property? how would you tell if | |
// the object's bar property had been overridden for the particular object? | |
var Thinger = function() { | |
return this; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 4: given the following code, and assuming that each defined object has a | |
// 'destroy' method, how would you destroy all of the objects contained in the | |
// myObjects object? | |
var myObjects = { | |
thinger : new myApp.Thinger(), | |
gizmo : new myApp.Gizmo(), | |
widget : new myApp.Widget() | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 5: given the following array, create an array that contains the contents of | |
// each array item repeated three times, with a space between each item. so, | |
// for example, if an array item is 'foo' then the new array should contain an | |
// array item 'foo foo foo'. (you can assume the library of your choice is | |
// available) | |
var myArray = [ 'foo', 'bar', 'baz' ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 6: how could you improve the following code? | |
$(document).ready(function() { | |
$('.foo #bar').css('color', 'red'); | |
$('.foo #bar').css('border', '1px solid blue'); | |
$('.foo #bar').text('new text!'); | |
$('.foo #bar').click(function() { | |
$(this).attr('title', 'new title'); | |
$(this).width('100px'); | |
}); | |
OlderNewer