This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"DRINK":["Soda","Water","Something Hot","Tea","Some Wine","Milk","Yorghurt","Beer","Spirit","Porridge","A Herb.","some Fresh Juice","Bushera","Warm Water"],"CALL":["A Girlfriend","A Relative","Your Friend","someone you miss."],"EAT":["A Fruit","Leafy Vegetables","Fish","Nuts","Something Starchy","No meat","Chicken","some Seeds"],"GO TO":["Entebbe","A Forest","The Lake","Kampala","Home","School","a dance floor.","Bed.","work. "],"Summon":["God","Guardian Angel","Allself","Certain","your muse."],"LISTEN TO":["Some Nu Music","A Podcast","Old Hip Hop","Ragga!","Jazz","Some music.","Something you can play yourself, using things around you.","Traffic"],"WATCH":["A Music Video","A Science Video","Some News","A Cartoon","A Movie","A Comedy","Nature","Your Inner World","Something Erotic","The Skies."],"READ":["from SHRINES, by JWL.","a Holy Scripture.","One of your old documents.","Poetry","A Novel","the News","the Clouds","that book. "],"RITE":["Alone","With Someone else. (No more than 5).","With Someone else. (No m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nuchwezi.nulabs; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.View; | |
public class MainActivity extends AppCompatActivity { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat old_db_tables.list.txt |sed -e 's/^/"/;s/$/"/'| tr '\n' ','|sed 's/^/[/;s/$/]/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(openssl) | |
matrix(sapply(c(rand_num(100)), (function(n) (round(n*100)%%2))), nrow=5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nuchwezilabs ## for those times you need a handy utility to preview logs on the way to doing other things... | |
#alias lastlog="tail -n 20 $(ls -d -t -1 "$PWD/logs/"** | sed -n '2p')" | |
#nu method... | |
function lastlog() { | |
tail -n 20 $(ls -d -t -1 $(pwd)/logs/** | sed -n '2p') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Construct a 5x6 matrix | |
X <-matrix(rnorm(30), nrow=5, ncol=6) | |
# Sum the values of each row with `apply()` | |
X2 <- apply(X, 1, sum) | |
NROW(X2) | |
NCOL(X2) | |
# So the same for each row | |
X3 <- apply(X, 2, sum) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias lastlog="tail -n 20 $(ls -d -t -1 "$PWD/logs/"** | sed -n '2p')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CONSIDER THIS AN EXAMPLE ... replace variables with own vals | |
az account set -s <SUBSCRIPTION_ID> | |
az vm deallocate --resource-group TWEBBUILDER --name TWEBBUILDERVM | |
az vm list -g TWEBBUILDER --query '[].{Name:name,DiskName:storageProfile.osDisk.name}' --output table | |
az disk create -g TWEBBUILDER_GALL --name TWEBBUILDER_GALL_disk --source /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/TWEBBUILDER/providers/Microsoft.Compute/snapshots/TWBSnap | |
az disk list -g TWEBBUILDER_GALL --output table | |
az network vnet create -g TWEBBUILDER_GALL --location westeurope --name TWBGALLVNet --address-prefix 192.168.0.0/16 --subnet-name TWBGALLSubNet --subnet-prefix 192.168.1.0/24 | |
az network public-ip create -g TWEBBUILDER_GALL --location westeurope --name TWBGALLIP --dns-name twbgallery --allocation-method static --idle-timeout 4 | |
az network nic create -g TWEBBUILDER_GALL --location westeurope --name TWBGallNic --vnet-name TWBGALLVNet --subnet TWBGALLSubNet --public-ip-address TWBGALLIP | |
az vm create -g TWEBBUILDER_GALL --name TW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### JHW 2018 | |
import numpy as np | |
import umap | |
# This code from the excellent module at: | |
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module | |
import random |