I am building bazel
for aarch64 on Amazon A1 platform. This flow is
pretty nice and much easier than the QEMU flow which is prone to QEMU
bugs.
- An Amazon A1 platform running Ubuntu 18.04.
brew install pandoc | |
brew tap homebrew/cask | |
brew install --cask basictex | |
eval "$(/usr/libexec/path_helper)" | |
# Update $PATH to include `/usr/local/texlive/2022basic/bin/universal-darwin` | |
sudo tlmgr update --self | |
sudo tlmgr install texliveonfly | |
sudo tlmgr install xelatex | |
sudo tlmgr install adjustbox | |
sudo tlmgr install tcolorbox |
I am building bazel
for aarch64 on Amazon A1 platform. This flow is
pretty nice and much easier than the QEMU flow which is prone to QEMU
bugs.
# Example uses GDELT dataset found here: https://aws.amazon.com/public-datasets/gdelt/ | |
# Column headers found here: http://gdeltproject.org/data/lookups/CSV.header.dailyupdates.txt | |
# Load RDD | |
lines = sc.textFile("s3://gdelt-open-data/events/2016*") # Loads 73,385,698 records from 2016 | |
# Split lines into columns; change split() argument depending on deliminiter e.g. '\t' | |
parts = lines.map(lambda l: l.split('\t')) | |
# Convert RDD into DataFrame | |
from urllib import urlopen | |
html = urlopen("http://gdeltproject.org/data/lookups/CSV.header.dailyupdates.txt").read().rstrip() |
# The initial version | |
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi | |
# My favorite from the comments. Thanks @richarddewit & others! | |
set -a && source .env && set +a |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
from numpy.random import choice as random_choice, randint as random_randint, rand | |
MAX_INPUT_LEN = 40 | |
AMOUNT_OF_NOISE = 0.2 / MAX_INPUT_LEN | |
CHARS = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .") | |
def add_noise_to_string(a_string, amount_of_noise): | |
"""Add some artificial spelling mistakes to the string""" | |
if rand() < amount_of_noise * len(a_string): | |
# Replace a character with a random character | |
random_char_position = random_randint(len(a_string)) |
#time "on" | |
#load "Bootstrap.fsx" | |
open System | |
open Akka.Actor | |
open Akka.Configuration | |
open Akka.FSharp | |
open Akka.TestKit | |
// #Using Actor |
// Simple counter | |
type cell = { mutable content : int } | |
let new_counter n = | |
let x :cell = { content = n } | |
fun () -> | |
(x.content <- x.content+1; x.content) | |
// The same, using F# refs | |
let new_counter' n = |
Country | Alpha-2 code | Alpha-3 code | Numeric code | Latitude (average) | Longitude (average) | |
---|---|---|---|---|---|---|
Afghanistan | AF | AFG | 4 | 33 | 65 | |
Åland Islands | AX | ALA | 248 | 60.116667 | 19.9 | |
Albania | AL | ALB | 8 | 41 | 20 | |
Algeria | DZ | DZA | 12 | 28 | 3 | |
American Samoa | AS | ASM | 16 | -14.3333 | -170 | |
Andorra | AD | AND | 20 | 42.5 | 1.6 | |
Angola | AO | AGO | 24 | -12.5 | 18.5 | |
Anguilla | AI | AIA | 660 | 18.25 | -63.1667 | |
Antarctica | AQ | ATA | 10 | -90 | 0 |