Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
this is awe |
<!-- Declare the permission for body sensor --> | |
<uses-permission android:name="android.permission.BODY_SENSORS" /> |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
In Flipboard's article[1], they kindly divulge their interpretation | |
of the summarization technique called LexRank[2]. | |
While reading Flipboard's article, you can, if followed point by point, | |
reimplement their summarization algorithm. | |
Here are the steps/excerpts that stood out to me: |
angular.module('globalmodule') | |
.config(['$provide', '$httpProvider', function($provide, $httpProvider){ | |
$provide.factory('GlobalAjaxInterceptor', ['$q', '$rootScope', function($q, $rootScope){ | |
var currentRequests={http: {}, ajax: {}}; | |
function addHttpRequest(conf){ | |
currentRequests.http[conf.url] = conf.promiseObj; | |
} |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
elem.clientLeft
,elem.clientTop
,elem.clientWidth
,elem.clientHeight
elem.getClientRects()
,elem.getBoundingClientRect()
Mind expanding programming languages
- C
- Common Lisp (via LISP)
- Dedalus (via Datalog)
(by @andrestaltz)
So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {
“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important
or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”
You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?
This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.
Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma