Skip to content

Instantly share code, notes, and snippets.

@martin0258
martin0258 / BUILD
Last active November 17, 2018 07:16
Updated pipeline config, BUILD, and DetectorActivity.java for custom object detection model (detecting dogs n cats)
# Description:
# TensorFlow camera demo app for Android.
load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"])
@martin0258
martin0258 / index.html
Created October 19, 2016 16:22
New pen based on Live stream
<div data-live="true"
data-ratio="0.5625"
class="flowplayer fixed-controls">
<video data-title="Live stream">
<source type="application/x-mpegurl"
src="http://waaarplive05-lh.akamaihd.net/i/stemi_1@66843/master.m3u8">
</video>
</div>
@martin0258
martin0258 / youtube.html
Created February 9, 2016 13:54
Play a YouTube video on website
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction(){
var iframe = document.getElementById('youtube');
iframe.src = iframe.src;
}
</script>
</head>
@martin0258
martin0258 / generate_issue_link.py
Created February 25, 2014 02:19
Generate issue links for release note.
@martin0258
martin0258 / gist:8712186
Created January 30, 2014 16:14
NTU CSIE Master Graduation Roadmap

Implementation

Semester Course Credit
101-1 資訊工程理論基礎 3
101-1 軟體工程 3
101-2 軟體設計 3
Summer 抵免 6
102-1 軟體測試 3 undone
102-1 專題討論 1 (Not include) undone
  1. pip uninstall scikit-learn (if previous version is installed)
  2. download/install scikit-learn
  3. download/install pylab
@martin0258
martin0258 / gist:6730169
Created September 27, 2013 15:13
Load Microsoft queries into command texts of connections.
Dim queryFolderFullPath As String
Public Const queryFolderRelativePath = "Microsoft Query" 'Relative to the workbook
Sub LoadMSQueries()
Dim queryFiles() As String
Dim i As Integer
queryFiles = ListQueryFiles()
For Each conn In ActiveWorkbook.Connections
For i = LBound(queryFiles) To UBound(queryFiles)
If conn.Name = RemoveFileExtension(queryFiles(i)) Then
@martin0258
martin0258 / QueryToCSV.bat
Created July 30, 2013 01:11
Get a CSV file from database query result.
:: -U, user name
:: -P, password
:: -h-1 [removes column name headers from the result]
:: -s"," [sets the column seperator to ,]
:: -w 1000 [sets the row width to 1000 chars (need to be as wide as the longest row or it will wrap to the next line)]
:: -W [remove trailing spaces from each individual field]
:: set nocount on; set ansi_warnings off; [in SQL file to remove additional messages] >
:: extract source file
sqlcmd -S %SERVER% -d %DB_NAME% -U %ARG1% -P %ARG2% -h-1 -s"," -W -w 1000 -i "%SQL_FILE%" -o "%RAW_FILE%"
@martin0258
martin0258 / gist:5671572
Created May 29, 2013 16:19
Time series plotting
# Plot multiple time series at one time
# Trick 1: use cut to rotate label values of y-axis
# Trick 2: use auto.key=list(space="inside") to make the legend be inside the panel.
ratings <- read.csv("Chinese_Weekday_Drama.csv", fileEncoding="utf-8")
xyplot(ts(ratings),superpose=TRUE,strip=FALSE,cut=1,
ylab="Rating",type="b",lwd=2,main="TV Rating Actual Data",
auto.key=list(space="inside"))