Skip to content

Instantly share code, notes, and snippets.

View jaybo's full-sized avatar

Jay Borseth jaybo

View GitHub Profile
@jaybo
jaybo / gist:94131caf81e34cf5f9d6
Created July 10, 2014 08:37
On the way to WP8.1 CustomMapTileDataSource
var im = new byte[100];
var ms = new MemoryStream(im);
var rs = RandomAccessStreamReference.CreateFromStream(ms.AsRandomAccessStream());
// http://msdn.microsoft.com/en-us/library/windowsphone/develop/windows.ui.xaml.controls.maps.custommaptiledatasource.aspx
@jaybo
jaybo / gist:c5591b0aef99b027f2aa
Created September 24, 2014 17:00
Cesium nautical charts
var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider : new Cesium.ArcGisMapServerImageryProvider({
url : '//server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer'
}),
baseLayerPicker : false
});
var layers = viewer.scene.imageryLayers;
var provider = new Cesium.TileMapServiceImageryProvider({
url : '//localhost/NOAA/',
@jaybo
jaybo / gist:51e2f34952466dae4dc6
Created December 28, 2014 18:21
bash, count files in subdirectories
find . -maxdepth 1 -mindepth 1 -type d | while read dir; do
printf "%-25.25s : " "$dir"
find "$dir" -type f | wc -l
done
@jaybo
jaybo / gist:2d2b64e67f9bb71d5e47
Created March 18, 2015 08:07
Leaflet: _initPathRoot
_initPathRoot: function () {
if (!this._pathRoot) {
this._pathRoot = L.Path.prototype._createElement('svg');
this._panes.overlayPane.appendChild(this._pathRoot);
if (this.options.zoomAnimation && L.Browser.any3d) {
L.DomUtil.addClass(this._pathRoot, 'leaflet-zoom-animated');
this.on({
'zoomanim': this._animatePathZoom,
@echo off
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe
rem add it for all file types
REM @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
REM @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
REM @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Directory\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
opencv_calib3d300d.lib; opencv_core300d.lib ;opencv_features2d300d.lib; opencv_flann300d.lib; opencv_hal300d.lib; opencv_highgui300d.lib; opencv_imgcodecs300d.lib; opencv_imgproc300d.lib; opencv_ml300d.lib; opencv_objdetect300d.lib; opencv_photo300d.lib; opencv_shape300d.lib; opencv_stitching300d.lib; opencv_superres300d.lib; opencv_ts300d.lib; opencv_video300d.lib; opencv_videoio300d.lib; opencv_videostab300d.lib;
@jaybo
jaybo / 2DBoundary.py
Last active August 11, 2016 03:53
2D boundary interpolation in numpy
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
x = [0, 1, 1, 0, 0]
y = [0, 0, 1, 1, 0]
orig_len = len(x)
t = np.arange(len(x))
@jaybo
jaybo / settings.json
Created April 15, 2017 22:34
VSCode settings.json
// Place your settings in this file to overwrite the default settings
{
"python.pythonPath": "C:/WinPython/WinPython-64bit-2.7.10.3/python-2.7.10.amd64/python.exe",
"typescript.check.tscVersion": false,
"workbench.colorTheme": "Visual Studio Dark",
"editor.minimap.enabled": true,
"python.linting.pylintArgs": [
"--disable=C0301", // Line too long
"--disable=C0103", // Invalid function name"
"--disable=C0303", // Trailing whitespace
let colormap = require('colormap')
var fs = require('fs');
let map_name = 'bluered';
let file_name = map_name + ".json"
let colors = colormap({
colormap: map_name,
nshades: 100,
format: 'hex',
@jaybo
jaybo / SematicSeg.txt
Last active July 19, 2018 00:27
Semantic Segmentation Notes
Background:
http://cs231n.github.io/convolutional-networks/#convert
Converting classification net to sematic:
https://blog.goodaudience.com/using-convolutional-neural-networks-for-image-segmentation-a-quick-intro-75bd68779225
Environnment:
conda create --name tf pip