- one
- two
- three
- four
import React, { Component } from "react" | |
import ReactDOM from "react-dom" | |
import { Switch, Case } from "switch_case" | |
class App extends Component { | |
constructor() { | |
super() | |
this.state = { | |
value: false |
#!/bin/bash | |
# hear the md5sum of a file! ♬ ♬ ♬ ♬ | |
# by liam (github.com/liamgriffiths) | |
function beat { | |
tput bel | |
} | |
function beats { |
# osx nasm compile using macho64 | |
NASM=/usr/local/bin/nasm | |
LD=/usr/bin/ld | |
all: hello | |
@./hello | |
hello: hello.o | |
@$(LD) -macosx_version_min 10.0 -o hello hello.o |
/** | |
* timers in action | |
* http://nodejs.org/api/timers.html | |
*/ | |
// lastly this one is called, because it isn't resolved on the queue until ~50ms | |
// long after all the other functions are queued up in the event loop | |
setTimeout(function() { | |
console.log(5); | |
}, 50); |
on the element that you want to transition you can apply the transition css property.
transition-property refers to the css property affected by the transition - for example (top, left, margin, color, etc)
transition-duration refers to the time the animation takes place
transition-timing-funcion refers to the way the transition is applied over the duration - ease
CORS (cross origin resource sharing) is a mechanism to allow client web applications make HTTP requests to other domains. For example if you load a site from http://domainA.com and want to make a request (via xhr or img src, etc) to http://domainB.com without using CORS your web browser will try to protect you by blocking the response from the other server. This is because browsers restrict responses coming from other domains via the Same-Origin-Policy.
CORS allows the browser to use reponses from other domains. This is done by including a Access-Control
headers in the server responses telling the browser that requests it is making is OK and safe to use the response.
Header | Description |
---|---|
Access-Control-Allow-Origin: |
Allow requests from `` to access t |
// sloppy traceroute clone | |
// inpired by https://blogs.oracle.com/ksplice/entry/learning_by_doing_writing_your | |
// and made possible by https://www.npmjs.org/package/raw-socket | |
var raw = require('raw-socket'); | |
var dns = require('dns'); | |
var target = process.argv[2] || '173.230.146.29'; | |
var MAX_HOPS = 64; | |
var TIME_LIMIT = 5000; |
(define (transpose m) | |
(apply map list m)) | |
(define (rotate-90 m) | |
(transpose (reverse m))) | |
(define matrix | |
(list (list 'a 'b 'c 'd) | |
(list 'e 'f 'g 'h) | |
(list 'i 'j 'k 'l) |
The basic idea here is to give programmers a way to compare the performance of algorithms at a very high level in a language/platform/architecture independent way. This becomes particularly important when dealing with large inputs.
Big O notion may consider the worst-case, average-case, and best-case running time of an algorithm.
When describing an algorithm using Big O notation you will drop the lower-oder values. This is because when the inputs become very large, the lower-order values become far less important. For example:
Original | Becomes |
---|