This file contains hidden or 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
| (defn question-seq | |
| ([] (question-seq 1)) ;start from page 1 | |
| ( [x] | |
| (lazy-seq (cons (question x) (question-seq ( inc x)) ) ) )) |
This file contains hidden or 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
| (take 5 (filter #(> (:favorite_count %) 5) questions)) |
This file contains hidden or 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
| (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 |
This file contains hidden or 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 . 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 . |
This file contains hidden or 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
| bindingContext.bindValue(SWTObservables.observeText(name,SWT.Modify),XmlObservables.observeElementText(element),null, null); |
This file contains hidden or 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
| 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) { |
This file contains hidden or 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
| public class EnumMappingType : IEnhancedUserType , IParameterizedType | |
| { | |
| private Type enumClass; | |
| public string Name | |
| { | |
| get { return "enumstring - " + enumClass.Name; } | |
| } | |
| public Type ReturnedClass |
This file contains hidden or 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
| 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){ |
This file contains hidden or 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 order = $('#myform').params2Object(); | |
| test(order.customerName ==='john'); | |
| test(order.orderItem.qty > 0 ); |
This file contains hidden or 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
| <input name="order.customerName" /> | |
| <input name="order.orderItem.qty" /> |