Skip to content

Instantly share code, notes, and snippets.

(defn question-seq
([] (question-seq 1)) ;start from page 1
( [x]
(lazy-seq (cons (question x) (question-seq ( inc x)) ) ) ))
(take 5 (filter #(> (:favorite_count %) 5) questions))
(ns stackoverflow.questions
(get stackoverflow.common :use)
)
(defn question [page-num]
(first (:questions
(get-json (str "http://api.stackoverflow.com/1.0/questions?pagesize=1&page=" page-num)))))
(defn questions
([] (questions 1)) ;start from page 1
1 . Big O notation , what is it measuring ( rate of change) , why ?
a) calculate O for any of ur fav algorithm , think out loud ( binary search ?)
b) why dont we just choose the algorithm with lowest O and forget about the rest ?
2. Infix vs Postfix notation in math ? how does it relate to programming ?
3. Recursion vs Iteration ( function calling itself is not the exact answer )
a) why would u use one over the other ?
b) Fibonacci numbers , recursive and iterative versions .
bindingContext.bindValue(SWTObservables.observeText(name,SWT.Modify),XmlObservables.observeElementText(element),null, null);
public class XmlElementAttributeObservableValue extends AbstractObservableValue{
Element element;
String propertyName;
public XmlElementAttributeObservableValue( Element element, final String propertyName) {
this.element = element;
this.propertyName = propertyName;
addListner(this.element, this.propertyName);
}
private void addListner(final Element element, final String propertyName) {
public class EnumMappingType : IEnhancedUserType , IParameterizedType
{
private Type enumClass;
public string Name
{
get { return "enumstring - " + enumClass.Name; }
}
public Type ReturnedClass
jQuery.fn.params2Object = function(){
var d = this.serializeArray()
var data = {};
for (var i = 0; i < d.length; i++) {
var tokens = d[i].name.split('.');
_setValue(data, tokens, d[i].value);
}
return data;
function _setValue(obj, tokens, value, index){
var order = $('#myform').params2Object();
test(order.customerName ==='john');
test(order.orderItem.qty > 0 );
<input name="order.customerName" />
<input name="order.orderItem.qty" />