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.
| # DO NOT PUT THE WIFI DONGLE IN THE DEVICE BEFORE MENTIONED EXPLICITLY BELOW | |
| # Brief note, after this the UI will not show the usb dongle, | |
| # the wifi does work and I get an IP address, so all works, | |
| # but I don't go into detail of making it show on the Raspbian UI. | |
| # (for this purpose I don't care about the UI) | |
| # For the use of this I connected my device to an ethernet connection and through the Router could see the IP which I can SSH into. | |
| ## STEP 1: Prepare machine and install packages needed |
| 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 = |