Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Lesson 1 SUMMARY | |
1. The cursor is moved using either the arrow keys or the hjkl keys. | |
h (left) j (down) k (up) l (right) | |
2. To start Vim from the shell prompt type: vim FILENAME <ENTER> | |
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes. | |
OR type: <ESC> :wq <ENTER> to save the changes. |
'''A few notes before we begin | |
I'll separate my notes into three types, docstrings like this, whole line comments, and | |
inline comments. Docstrings will discuss the ideas behind the objects. What's the intent, | |
and what programming concepts do they present that are worth discussing. Full line comments | |
will discuss the details of the implementation. What the code is doing and why. Inline | |
comments will comprise a small portion of my notes, and are mostly to point out examples | |
mentioned in the rest of my notes, or return values. Another convention that I use is | |
backticks, which will be used to refer to an actual object in the code. If I say the word | |
one, it's just a word, but `one` is a reference to some object in code. |
Not all random values are created equal - for security-related code, you need a specific kind of random value.
A summary of this article, if you don't want to read the entire thing:
Math.random()
. There are extremely few cases where Math.random()
is the right answer. Don't use it, unless you've read this entire article, and determined that it's necessary for your case.crypto.getRandomBytes
directly. While it's a CSPRNG, it's easy to bias the result when 'transforming' it, such that the output becomes more predictable.uuid
, specifically the uuid.v4()
method. Avoid node-uuid
- it's not the same package, and doesn't produce reliably secure random values.random-number-csprng
.You should seriously consider reading the entire article, though - it's
initialize
: once, when the controller is first instantiatedconnect
: anytime the controller is connected to the DOMSo there were a few threads going around recently about a challenge to write the longest sequence of keywords in Javascript:
There are, however, a few problems:
If you want resources offline to learn about programming and web technologies MDN is for you! and I recommend to use MDN over w3school because w3school is outdated.
Download it offline (2.1gb) at https://mdn-downloads.s3-us-west-2.amazonaws.com/developer.mozilla.org.tar.gz