By Zachary Thomas ([email protected], Twitter, LinkedIn)
**Tip: **See the Table of Contents (document outline) by hovering over the vertical line on the right side of the page
By Zachary Thomas ([email protected], Twitter, LinkedIn)
**Tip: **See the Table of Contents (document outline) by hovering over the vertical line on the right side of the page
group: travis_latest | |
language: python | |
cache: pip | |
python: | |
#- 2.7 | |
- 3.6 | |
#- nightly | |
#- pypy | |
#- pypy3 | |
matrix: |
# This file contains fish universal variable definitions. | |
# VERSION: 3.0 | |
SETUVAR ZO_CMD:zo | |
SETUVAR Z_CMD:z | |
SETUVAR Z_DATA:/home/hoa/\x2elocal/share/z/data | |
SETUVAR Z_DATA_DIR:/home/hoa/\x2elocal/share/z | |
SETUVAR Z_EXCLUDE:/home/hoa | |
SETUVAR __fish_classic_git_prompt_initialized:\x1d | |
SETUVAR __fish_init_2_39_8:\x1d | |
SETUVAR __fish_init_2_3_0:\x1d |
# https://github.com/harterrt/cookiecutter-python-etl/blob/master/README.md#benefits | |
# https://github.com/mozilla/python_mozetl/tree/master/tests | |
import pytest | |
from pyspark.sql import SparkSession | |
import json | |
@pytest.fixture(scope="session") | |
def spark(): | |
spark = ( |
// Guava 14.0 - bundled with Spark | |
// https://github.com/google/guava/blob/v14.0/guava/src/com/google/common/io/Resources.java#L191 | |
/** | |
* Returns a {@code URL} pointing to {@code resourceName} if the resource is | |
* found in the class path. {@code Resources.class.getClassLoader()} is used | |
* to locate the resource. | |
*/ | |
public static URL getResource(String resourceName) { | |
URL url = Resources.class.getClassLoader().getResource(resourceName); | |
checkArgument(url != null, "resource %s not found.", resourceName); |
import java.util.EnumSet | |
import java.nio.file.{Files, Path, Paths} | |
import java.nio.file.StandardCopyOption | |
import java.nio.file.attribute.{PosixFilePermission, PosixFilePermissions} | |
// Exception handling omitted for brevity | |
def createTempRedisBinary(binaryName: String = "redis-server-2.8.19"): Path = { | |
val classLoader = Thread.currentThread.getContextClassLoader | |
val inputStream = classLoader.getResourceAsStream(binaryName) | |
val tempBinary = Files.createTempFile("binaryPrefix-", "-binarySuffix") |
Useful when you want to do cross-domain testing with a single machine
root:~# lsmod
root:~# modinfo dummy
filename: /lib/modules/3.12.8-1-ARCH/kernel/drivers/net/dummy.ko.gz
alias: rtnl-link-dummy
127.0.0.1 download.nus.edu.sg |
Open dialog for font and style selection
:set guifont=*
Display current font selection will be display, for example:
" <font> <type> <size>
" guifont=MonacoB Bold 9
Create a runner shell script in host -> init with:
#!/bin/sh
SPICE_PORT=5924
SPARK_IMG=/home/hoa/spark-training.qcow2