Skip to content

Instantly share code, notes, and snippets.

Avatar
🙀
Probability^C. not A and not B

MacTaylor hpcslag

🙀
Probability^C. not A and not B
  • Industrial Technology Research Institute.
  • Taiwan, Kaohsiung
View GitHub Profile
@hpcslag
hpcslag / inference.py
Last active Sep 6, 2020
給定模型、圖片,告訴我結果
View inference.py
import os
import sys
import random
import math
import re
import time
import numpy as np
import cv2
import tensorflow as tf
import matplotlib
@hpcslag
hpcslag / readfile.py
Last active Aug 13, 2019
FIx ram problem
View readfile.py
soundbinarary = bytearray()
with open("test.m4a", 'rb') as f:
while True:
#for i in range(44):
# f.read(1) #do not thing jsut pop out
character = f.read(1)
if not character:
break
@hpcslag
hpcslag / shell.sh
Created Feb 23, 2019
Move all subfolder files to parent folder
View shell.sh
//go to target folder and run this.
find . -mindepth 2 -type f -print -exec mv {} . \;
@hpcslag
hpcslag / main.go
Created Aug 28, 2018
每日關心 telegram bot
View main.go
package main
import (
"log"
"regexp"
"strings"
"github.com/go-telegram-bot-api/telegram-bot-api"
)
@hpcslag
hpcslag / Client.java
Created Aug 18, 2018
TodoList Web Assembly Apps by TeaVM
View Client.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.teavm.flavour;
import org.teavm.flavour.templates.Templates;
/**
@hpcslag
hpcslag / main.go
Last active Jun 7, 2018
Golang Implement for Generate "FastlyCDN" URL Token Validation.
View main.go
package main
import (
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"encoding/hex"
"io"
"strconv"
"time"
@hpcslag
hpcslag / index.html
Last active Mar 21, 2021
Image Recognize in Golang
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<form action="/recognize" method="post" enctype="multipart/form-data">
@hpcslag
hpcslag / guessNumber.m
Created Nov 19, 2017
Matlab homework 1
View guessNumber.m
function guessNumber(m,n)
%call guessNumber(m,n) to play the game
%example:
%guessNumber(1,10) to play the game in range 1 to 10
%
r = randperm(n);
ans = r(m);
range_x = m;
range_y = n;
@hpcslag
hpcslag / Decoder.java
Created Nov 8, 2017
Put byte arrays to hex string decoder.
View Decoder.java
public static String bytesToHex(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for ( int j = 0; j < bytes.length; j++ ) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
@hpcslag
hpcslag / Install Cloud9 on local or remote computer, server, or raspberry pi This gist will help you install Cloud9 on your local or remote computer, server, or even your raspberry pi. Many people are having issues at the time of this Gist's creation.
View Install Cloud9 on local or remote computer, server, or raspberry pi
Complete installation process:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev
sudo apt-get update
sudo apt-get upgrade
cd ~
mkdir git
cd ~/git