(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import java.lang.annotation.Retention; | |
| import java.lang.annotation.RetentionPolicy; | |
| import java.lang.annotation.Target; | |
| @Retention( RetentionPolicy.RUNTIME ) | |
| @Target( { | |
| java.lang.annotation.ElementType.METHOD | |
| } ) | |
| public @interface Repeat { | |
| public abstract int times(); |
| // load error messages from a log into memory | |
| // then interactively search for various patterns | |
| // base RDD | |
| val lines = sc.textFile("log.txt") | |
| // transformed RDDs | |
| val errors = lines.filter(_.startsWith("ERROR")) | |
| val messages = errors.map(_.split("\t")).map(r => r(1)) | |
| messages.cache() |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| 2014-03-04 | 15dfb8e6cc4111e3a5bb600308919594 | 11 | |
|---|---|---|---|
| 2014-03-06 | 81da510acc4111e387f3600308919594 | 61 |
| #!/bin/bash | |
| # | |
| # Bash script to setup headless Selenium (uses Xvfb and Chrome) | |
| # (Tested on Ubuntu 12.04) trying on ubuntu server 14.04 | |
| # Add Google Chrome's repo to sources.list | |
| echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list | |
| # Install Google's public key used for signing packages (e.g. Chrome) | |
| # (Source: http://www.google.com/linuxrepositories/) |
| $ ./bin/spark-shell | |
| 14/04/18 15:23:49 INFO spark.HttpServer: Starting HTTP Server | |
| 14/04/18 15:23:49 INFO server.Server: jetty-7.x.y-SNAPSHOT | |
| 14/04/18 15:23:49 INFO server.AbstractConnector: Started [email protected]:49861 | |
| Welcome to | |
| ____ __ | |
| / __/__ ___ _____/ /__ | |
| _\ \/ _ \/ _ `/ __/ '_/ | |
| /___/ .__/\_,_/_/ /_/\_\ version 0.9.1 | |
| /_/ |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| ; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
| global start | |
| section .text | |
| start: | |
| push dword msg.len | |
| push dword msg | |
| push dword 1 | |
| mov eax, 4 |