Skip to content

Instantly share code, notes, and snippets.

View lightondust's full-sized avatar

Sen Zhang lightondust

View GitHub Profile
@lightondust
lightondust / cirq-tuto.ipynb
Created December 9, 2018 06:19
play_network/src/quantum_computing/cirq-tuto.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lightondust
lightondust / d-wave-nlp-article.ipynb
Created December 24, 2018 06:56
quantum_computing/dwave/d-wave-nlp-article.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lightondust
lightondust / coordinate from address
Created November 13, 2020 10:49
get coordinate from address
import requests
import lxml
def get_coordinate_of_address(address):
url = 'http://geocode.csis.u-tokyo.ac.jp/cgi-bin/simple_geocode.cgi?charset=UTF8&addr={}'.format(address)
res = requests.get(url)
res_obj = lxml.etree.fromstring(bytes(res.text, encoding='utf8'))
lng = res_obj.xpath('//longitude/text()')[0]
lat = res_obj.xpath('//latitude/text()')[0]
@lightondust
lightondust / streamlit_slider_bar_and_animation.py
Created February 14, 2021 06:51
modify the hello app of streamlit to enable user to use both animation and slider
import streamlit as st
import numpy as np
# Interactive Streamlit elements, like these sliders, return their value.
# This gives you an extremely simple interaction model.
iterations = st.sidebar.slider("Level of detail", 2, 20, 10, 1)
separation = st.sidebar.slider("Separation", 0.7, 2.0, 0.7885)
m, n, s = 960, 640, 400
x = np.linspace(-m / s, m / s, num=m).reshape((1, m))
import streamlit as st
import pandas as pd
import numpy as np
import altair as alt
import pydeck as pdk
import time
# LOADING DATA
DATE_TIME = "date/time"