Skip to content

Instantly share code, notes, and snippets.

View re4388's full-sized avatar
🎯
Focusing

re4388 re4388

🎯
Focusing
  • Taipei,Taiwan
View GitHub Profile
@re4388
re4388 / index.html
Created June 22, 2019 07:32
Matrix digital rain (animated version)
<main></main>
@re4388
re4388 / index.html
Created August 31, 2019 07:41
Quasar Framework v1
<div id="q-app">
<div class="q-ma-md">
Fork and make your own!
Do NOT use self-closing tags here on Codepen.
</div>
<div class="q-ma-md">
<q-btn label="Notify" color="primary" @click="notify"></q-btn>
</div>
@re4388
re4388 / gist:44376939247930fbcf982d605b4d02fb
Created October 4, 2019 14:21
private_hub/anaconda3/Dockerfile
FROM nvidia/cuda:9.2-cudnn7-devel-ubuntu16.04
ARG PYTHON_VERSION=3.6
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
# Install basic packages for Ubuntu
RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \
libglib2.0-0 libxext6 libsm6 libxrender1 \
git mercurial subversion && \
@re4388
re4388 / Promodoro.py
Created October 10, 2019 13:50
My First PyQt5 app
import sys
from PyQt5.QtWidgets import QApplication, QWidget,QLabel, QMessageBox, QPushButton
from PyQt5.QtGui import QIcon, QPixmap
from PyQt5.QtCore import pyqtSlot, QTimer, QDateTime, QDate, QTime
from Ui_Pomodoro import Ui_Dialog
from PyQt5 import QtCore
import time
@re4388
re4388 / usb_encrpyt_get_timestamp.py
Last active December 19, 2019 03:56
ElementTree
def get_expire_date(fid):
tree = ET.fromstring(info_s)
for root in tree.iter():
for child_of_root in root:
if child_of_root.tag == 'feature':
print(child_of_root.attrib['id'])
@re4388
re4388 / string1.py
Last active December 19, 2019 06:50
ms100-not-sure-which-one
''' 给定一个字符串,
要求把字符串前面的若干个字符移动到字符串的尾部,如把字符串“abcdef”前面的2个字符'a'和'b'移动到字符串的尾部,
使得原字符串变成字符串“cdefab”。
请写一个函数完成此功能,
要求对长度为n的字符串操作的时间复杂度为 O(n),空间复杂度为 O(1)。 '''
@when('I start to train')
def start_train(tmpdir, mocker, context, qtbot, monkeypatch):
model_folder = os.path.join(tmpdir, 'model_folder')
mocker.patch.object(window.main_view.dialog_train, 'model_folder', return_value=(model_folder, None))
# click the train
window.main_view._ui.actionTrain.trigger()
# begin to train
@re4388
re4388 / gist:7168df37b89830fc7b6b4b828e1ad622
Last active January 24, 2020 06:15
universal-sentence-encoder-classfier
!pip3 install --quiet "tensorflow>=1.7"
!pip3 install --quiet tensorflow-hub
!pip3 install seaborn
import tensorflow as tf
import tensorflow_hub as hub
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
@re4388
re4388 / a1
Created January 24, 2020 06:29
a1
!wget https://raw.githubusercontent.com/Tony607/Keras-Text-Transfer-Learning/master/train_5500.txt
!wget https://raw.githubusercontent.com/Tony607/Keras-Text-Transfer-Learning/master/test_data.txt
def get_dataframe(filename):
lines = open(filename, 'r').read().splitlines()
data = []
for i in range(0, len(lines)):
label = lines[i].split(' ')[0]
@re4388
re4388 / a2
Last active January 24, 2020 07:00
a2
module_url = "https://tfhub.dev/google/universal-sentence-encoder-large/3"
embed = hub.Module(module_url)
embed_size = embed.get_output_info_dict()['default'].get_shape()[1].value