npm v3.10 - ◾
npm install -g npm
# Downgrade to a specific version
npm install -g npm@2
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| # aecho.py | |
| from socket import * | |
| import asyncio | |
| loop = asyncio.get_event_loop() | |
| async def echo_server(address): | |
| sock = socket(AF_INET, SOCK_STREAM) | |
| sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) |
| Latency Comparison Numbers | |
| -------------------------- | |
| 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 | |
| Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
| Read 4K randomly from SSD* 150,000 ns 0.15 ms |
| import org.junit.Test; | |
| public class BetterProgrammer05122012Test extends junit.framework.TestCase { | |
| public static int[] numbers = new int[] {5, 10, -5, 0, 25, 35}; | |
| public static int[] numbers2 = new int[] {5, 10, -5, -2, 0, 25, 35}; | |
| public static int[] noNegativeNumbers = new int[] {5, 10, 15, 25, 35}; | |
| @Test | |
| public void testBetterProgrammer05122012 () { |
| def yes_or_no(question): | |
| reply = str(raw_input(question+' (y/n): ')).lower().strip() | |
| if reply[0] == 'y': | |
| return True | |
| if reply[0] == 'n': | |
| return False | |
| else: | |
| return yes_or_no("Uhhhh... please enter ") |
| # Built application files | |
| /*/build/ | |
| # Crashlytics configuations | |
| com_crashlytics_export_strings.xml | |
| # Local configuration file (sdk path, etc) | |
| local.properties | |
| # Gradle generated files |
npm install -g npm
# Downgrade to a specific version
npm install -g npm@2
[EN-US] Object Calisthenics outlines 9 basic rules to apply when performing the exercise: