- There are some situations that are difficult to distinguish mechanically, so I now consider all of those cases problematic, even when they are not obviously wrong.
- You should be coding for readability and error resistance.
- The place to express yourself in programming is in the quality of your ideas, and the efficiency of execution. The role of style is the same as in literature. A great writer doesn't express himself by putting the spaces before his commas instead of after, or by putting extra spaces inside his parentheses.
- Many people think they have good reasons for doing things badly.
- [The purpose of JSLint is not to make you feel good about inadequate coding standards.](http://tech.groups.y
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
function remoteActionDeferredWrap(remoteActionMethod, paramArr, escape){ | |
//Create the deferred object | |
var deferredObj=$j.Deferred(); | |
//Create the callback method, this will manipulate the deferred object to show when complete | |
var callback = function(result,status){ | |
if(status.status==true){ | |
deferredObj.resolve(result); | |
} | |
else{ | |
deferredObj.reject('Error: '+status.message); |
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
def distinct(iterable, keyfunc=None): | |
seen = set() | |
for item in iterable: | |
key = item if keyfunc is None else keyfunc(item) | |
if key not in seen: | |
seen.add(key) | |
yield item | |
if __name__ == '__main__': | |
x = [0, 0, 1, 0, 1, 2, 2, 1, 0] |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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
template <typename Predicate, typename Head, typename... Tail> | |
struct typelist_sort_t<Predicate, typelist<Head, Tail...>> | |
{ | |
using predicate = meta_partial_apply<Predicate, Head>; | |
using notpredicate = meta_negate<predicate>; | |
using smaller_than = typelist_filter<notpredicate, typelist<Tail...>>; | |
using greater_than = typelist_filter<predicate, typelist<Tail...>>; | |
using type = typelist_cat< | |
typelist_sort<Predicate, smaller_than>, | |
typelist<Head>, |
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
#include <functional> | |
#include <iostream> | |
using namespace std; | |
template <typename F> | |
struct Y | |
{ | |
Y(F f) : m_f(f) {} | |
template <typename T> |
Summary of and excerpts from chapter 9 and 10 of On Lisp. Examples are mainly in Common Lisp.
- [Variable capture] (https://gist.github.com/nimaai/2f98cc421c9a51930e16#variable-capture)
- [Macro argument capture] (https://gist.github.com/nimaai/2f98cc421c9a51930e16#macro-argument-capture)
- [Free symbol capture] (https://gist.github.com/nimaai/2f98cc421c9a51930e16#free-symbol-capture)
- [Multiple evaluation] (https://gist.github.com/nimaai/2f98cc421c9a51930e16#multiple-evaluation)
- [Order of evaluation] (https://gist.github.com/nimaai/2f98cc421c9a51930e16#order-of-evaluation)