All of the following information is based on go version go1.14.7 darwin/amd64.
(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)
aixandroid
| // Package main is a sample macOS-app-bundling program to demonstrate how to | |
| // automate the process described in this tutorial: | |
| // | |
| // https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5 | |
| // | |
| // Bundling the .app is the first thing it does, and creating the DMG is the | |
| // second. Making the DMG is optional, and is only done if you provide | |
| // the template DMG file, which you have to create beforehand. | |
| // | |
| // Example use: |
| // https://github.com/auth0-community/auth0-xamarin-oidc-samples/tree/master/Quickstart/01-Login/iOS | |
| using System; | |
| using UIKit; | |
| using Auth0.OidcClient; | |
| using System.Text; | |
| using LocalAuthentication; | |
| using Foundation; | |
| using Xamarin.Auth; |
| # http://bytefish.de/blog/first_steps_with_sqlalchemy/ | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy import create_engine | |
| from datetime import datetime, timedelta | |
| from sqlalchemy import Table, Column, Integer, String, DateTime, ForeignKey | |
| from sqlalchemy.orm import relationship, backref | |
| from sqlalchemy.orm import sessionmaker | |
| Base = declarative_base() |
| # Note: it is a copy of great answer by "mgoldwasser" from Stackoverflow | |
| # Check the original answer here: http://stackoverflow.com/a/26018934/1032439 | |
| # Imagine that post1, post5, and post1000 are posts objects with ids 1, 5 and 1000 respectively | |
| # The goal is to "upsert" these posts. | |
| # we initialize a dict which maps id to the post object | |
| my_new_posts = {1: post1, 5: post5, 1000: post1000} | |
| for each in posts.query.filter(posts.id.in_(my_new_posts.keys())).all(): |
| """ | |
| Upsert gist | |
| Requires at least postgres 9.5 and sqlalchemy 1.1 | |
| Initial state: | |
| [] | |
| Initial upsert: |
| from __future__ import absolute_import | |
| try: | |
| import cStringIO as StringIO | |
| except ImportError: | |
| import StringIO | |
| # Standard Library | |
| import re | |
| import string |
Setting up a remote interpreter on PyCharm is awfully unintuitive. I've pared it down to what I think is the minimal number of steps, and leaves the fewest number of deployment configurations and Python interpreters lying around. This is designed for my specific configuration (specifically PyTorch); adapt as needed.
.env, add ";.env" to the "Exclude items by name" field| package main | |
| import ( | |
| "fmt" | |
| "golang.org/x/net/route" | |
| ) | |
| var defaultRoute = [4]byte{0, 0, 0, 0} | |
| func main() { |
| // haversin(θ) function | |
| func hsin(theta float64) float64 { | |
| return math.Pow(math.Sin(theta/2), 2) | |
| } | |
| // Distance function returns the distance (in meters) between two points of | |
| // a given longitude and latitude relatively accurately (using a spherical | |
| // approximation of the Earth) through the Haversin Distance Formula for | |
| // great arc distance on a sphere with accuracy for small distances | |
| // |