This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
*.ipynb filter=dropoutput_jupyter | |
*.[tc]sv diff=daff-csv | |
*.[tc]sv merge=daff-csv |
by Bjørn Friese
Beautiful is better than ugly. Explicit is better than implicit.
I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.
# Example makefile with some dummy rules | |
.PHONY: all | |
## Make ALL the things; this includes: building the target, testing it, and | |
## deploying to server. | |
all: test deploy | |
.PHONY: build | |
# No documentation; target will be omitted from help display | |
build: |
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
import os | |
import matplotlib | |
from matplotlib.patches import Circle, Wedge, Polygon, Rectangle | |
from matplotlib.collections import PatchCollection | |
import matplotlib.pyplot as plt | |
def karyoplot(karyo_filename, metadata={}, part=1): | |
''' | |
To create a karyo_filename go to: http://genome.ucsc.edu/cgi-bin/hgTables |
#!/usr/bin/env python3 | |
import numpy as np | |
from math import sin, cos, pi, sqrt | |
import svgwrite | |
import itertools | |
def cam(f): | |
""" Returns a camera matrix for the given focal length """ | |
return np.array(((1,0,0,0), | |
(0,1,0,0), |
#!/bin/bash | |
version=1.0.1 | |
versionDate="2014-02-14" | |
function showHelp() { | |
echo "watchfile - monitor file(s)/command and perform action when changed | |
Possible ways of usage | |
---------------------------------------- |
// based on http://avoidtheinevitable.wordpress.com/2013/01/21/instapaper-random-article-bookmarklet/ updated to | |
// Instapaper's latest design. This only picks a random article from the first page of Instapaper items | |
javascript:var l=document.querySelectorAll(".article_item .article_inner_item .host a");l[Math.floor(1+Math.random()*l.length)].click(); |