- Like C, but with garbage collection, memory safety, and special mechanisms for concurrency
- Pointers but no pointer arithmetic
- No header files
- Simple, clean syntax
- Very fast native compilation (about as quick to edit code and restart as a dynamic language)
- Easy-to-distribute executables
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?
I feel like I have a vague understanding of what an amortized analysis is. From what I've noticed, it's the time if the action in consideration is done a large number of times (on a large data set?). I know it's in contrast to worst-case cost analysis but if anyone has any helpful ways to explain it and how to find amortized cost, that would be great.
You can think of amortized a little like "average", but there's a subtle difference.
Average involves a random process. Amortized does not.
// returns first element selected - $('input[name="food"]') | |
var $ = document.querySelector.bind(document); | |
// return array of selected elements - $$('img.dog') | |
var $$ = document.querySelectorAll.bind(document); | |
// Credit: https://twitter.com/wesbos/status/608341616173182977 |
#puts vs. print vs. p ###The 'puts' (short for "put string") and 'print' commands are both used to display the results of evaluating Ruby code. ###Both 'puts' and 'print' call the 'to_s' method on the object AND return nil.
###The primary difference between them is that 'puts' adds a newline after executing, and 'print' does not. ###They don't RETURN anything so the RETURN value is nil. ###Using 'p' calls the 'inspect' method on the object.
print "Milan"
Milan => nil
<?php | |
// words are there | |
// http://www.infochimps.com/datasets/word-list-100000-official-crossword-words-excel-readable/downloads/144625 | |
$handle = @fopen("words.txt", "r"); | |
if ($handle) { | |
while (($buffer = fgets($handle, 4096)) !== false) { | |
$w = str_split(rtrim($buffer)); | |
$sum = 0; | |
foreach ($w as $letter) { | |
$sum += (ord($letter)-96); |
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real