Skip to content

Instantly share code, notes, and snippets.

View map matching with jupyter.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jiewpeng
jiewpeng / add_anaconda_right_click_menu.md
Last active Oct 10, 2020
Add Anaconda Prompt to Windows right click context menu
View add_anaconda_right_click_menu.md

This gist describes how to add Anaconda Prompt to the Windows right click context menu. This is because at some point, Anaconda no longer adds itself to the PATH after installation.

  1. Run regedit.exe
  2. Navigate to HKEY_CLASSES_ROOT > Directory > Background > shell
  3. Add a key named AnacondaPrompt and set its value to "Anaconda Prompt Here" (or anything you'd like it to appear as in the right click context menu)
  4. Add a key under this key, called command, and set its value to cmd.exe /K C:\Anaconda3\Scripts\activate.bat (may have to change the activate.bat file to whereever Anaconda is installed)
View remove-all-from-docker.sh
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@ishu3101
ishu3101 / reset-wsl.sh
Created Jul 22, 2016
Resetting your Windows Subsystem for Linux (WSL) Environment
View reset-wsl.sh
# Resetting your Windows Subsystem for Linux (WSL) Environment
lxrun.exe /uninstall /full
lxrun.exe /install
View MapMatchingExample1.java
/*
* Licensed to Peter Karich under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* Peter Karich licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the
* License at
*
@PhiBabin
PhiBabin / simulateur.py
Created Feb 15, 2014
Flappy Bird Simulator
View simulateur.py
import pygame, sys, random
from pygame.locals import *
class sim:
# X origin
#DELTA = 0.1
# Windows size#891
WIN_H = 504.
WIN_W = 308 + 600
@rmcgibbo
rmcgibbo / viterbi.py
Created Oct 19, 2012
Viterbi algorithm for a simple class of HMMs
View viterbi.py
"""
Viterbi algorithm for finding the most likely state sequence of a simple
hidden markov model.
# https://en.wikipedia.org/wiki/Viterbi_algorithm
The Model
---------
The HMMs considered in this code are extremely simple. Every hidden state
is uniquely associated with an output symbol, but the link is "fuzzy". That is,
@obscurerichard
obscurerichard / README.md
Created Sep 17, 2012
Simulates a low bandwidth, high-latency network connection
View README.md

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default
slow modem-56k -d eth0    # Simulate a 56k modem on the eth1 device. eth0 is unchanged.
@vgoklani
vgoklani / Viterbi.py
Created Oct 14, 2011
Viterbi algorithm for Hidden Markov Models (HMM) taken from wikipedia
View Viterbi.py
#!/usr/bin/python
# http://en.wikipedia.org/wiki/Viterbi_algorithm
'''
Consider two friends, Alice and Bob, who live far apart from each other and who talk together daily over the telephone about what they did that day. Bob is only interested in three activities: walking in the park, shopping, and cleaning his apartment. The choice of what to do is determined exclusively by the weather on a given day. Alice has no definite information about the weather where Bob lives, but she knows general trends. Based on what Bob tells her he did each day, Alice tries to guess what the weather must have been like.
Alice believes that the weather operates as a discrete Markov chain. There are two states, "Rainy" and "Sunny", but she cannot observe them directly, that is, they are hidden from her. On each day, there is a certain chance that Bob will perform one of the following activities, depending on the weather: "walk", "shop", or "clean". Since Bob tells Alice about his activities, those are the observations. The entire
You can’t perform that action at this time.