JavaScript NodeList

Seems like you can use the same Array.prototype.slice.call that makes the args array-like object become an array. (See here) var inputs = document.getElementsByTagName(‘input’); var selects = document.getElementsByTagName(‘select’); inputs = Array.prototype.slice.call(inputs); selects = Array.prototype.slice.call(selects); var res = inputs.concat(selects); alert(res.length);

MySQL select with CONCAT condition

The aliases you give are for the output of the query – they are not available within the query itself. You can either repeat the expression: SELECT neededfield, CONCAT(firstname, ‘ ‘, lastname) as firstlast FROM users WHERE CONCAT(firstname, ‘ ‘, lastname) = “Bob Michael Jones” or wrap the query SELECT * FROM ( SELECT neededfield, … Read more

Merge (Concat) Multiple JSONObjects in Java

If you want a new object with two keys, Object1 and Object2, you can do: JSONObject Obj1 = (JSONObject) jso1.get(“Object1”); JSONObject Obj2 = (JSONObject) jso2.get(“Object2”); JSONObject combined = new JSONObject(); combined.put(“Object1”, Obj1); combined.put(“Object2”, Obj2); If you want to merge them, so e.g. a top level object has 5 keys (Stringkey1, ArrayKey, StringKey2, StringKey3, StringKey4), I … Read more

tech