This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
var Promise = require('bluebird'); | |
var funcs = Promise.resolve([500, 100, 400, 200].map((n) => makeWait(n))); | |
funcs | |
.each(iterator) // logs: 500, 100, 400, 200 | |
.then(console.log) // logs: [ [Function], [Function], [Function], [Function] ] | |
funcs | |
.mapSeries(iterator) // logs: 500, 100, 400, 200 |
import java.util.Arrays; | |
/** | |
* quickselect is a selection algorithm to find the kth smallest element in an | |
* unordered list. Like quicksort, it is efficient in practice and has good | |
* average-case performance, but has poor worst-case performance. Quickselect | |
* and variants is the selection algorithm most often used in efficient | |
* real-world implementations. | |
* | |
* Quickselect uses the same overall approach as quicksort, choosing one |
Nice answer on stackoverflow to the question of when to use one or the other content-types for POSTing data, viz. application/x-www-form-urlencoded
and multipart/form-data
.
“The moral of the story is, if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data
. Otherwise, use application/x-www-form-urlencoded
.”
Matt Bridges' answer in full:
The MIME types you mention are the two Content-Type
headers for HTTP POST requests that user-agents (browsers) must support. The purpose of both of those types of requests is to send a list of name/value pairs to the server. Depending on the type and amount of data being transmitted, one of the methods will be more efficient than the other. To understand why, you have to look at what each is doing
% Some people asked the LaTeX template for http://pluskid.org/assets/chiyuan-resume.pdf | |
% So I put a sample here. Feel free to use / modify it. Note you need to use xelatex to | |
% compile it and change the fonts to the ones you prefer and have on your system. | |
\documentclass[11pt]{article} | |
\usepackage{color} | |
\definecolor{ColorURL}{rgb}{0.1,0.12,0.45} | |
\usepackage[colorlinks=true,urlcolor=ColorURL]{hyperref} | |
\usepackage{fontspec,xunicode,xltxtra} | |
\usepackage[left=.8in,right=.8in,top=.9in,bottom=.7in]{geometry} | |
\usepackage{setspace} |
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository | |
$ git ls-files | xargs wc -l |
Below are the Big O performance of common functions of different Java Collections. | |
List | Add | Remove | Get | Contains | Next | Data Structure | |
---------------------|------|--------|------|----------|------|--------------- | |
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array |
- create tasks T{NNNN} asign them
- create a branch with name like "T{NNNN}-boo-hoo"
git checkout -b T1234-boo-foo
- commit changes on that branch until it gets ready to be reviewed
git commit -am 'first'
git commit -am 'now it works'
- check if it's lint free (NOTE: it runs lint against only modified files)
arc lint
- push a review request to the server. This will create a diff with id D{NNNN}
arc diff
var | |
// Local ip address that we're trying to calculate | |
address | |
// Provides a few basic operating-system related utility functions (built-in) | |
,os = require('os') | |
// Network interfaces | |
,ifaces = os.networkInterfaces(); | |
// Iterate over interfaces ... |