Skip to content

Instantly share code, notes, and snippets.

View mcdlee's full-sized avatar

Sin-Di Lee mcdlee

View GitHub Profile
@mcdlee
mcdlee / column_of_singles.md
Created February 25, 2019 07:41
column_of_singles.md

Singles files : gateSingles.dat(.bin) The system is set as a SPECT system. Each line is a single and the columns are :

  • Column 1 : ID of the run (i.e. time-slice) (4-bytes, G4int)
  • Column 2 : ID of the event (4-bytes, G4int)
  • Column 3 : ID of the source (4-bytes, G4int)
  • Column 4, 5, 6 : XYZ position of the source in world referential (8-bytes, G4double)
  • Column 7 to 9 : Volume IDs*(cf. columns 5-10 of sec 11.) (4-bytes, G4int)
  • Column 10 : Time stamp of the single (8-bytes, G4double)
  • Column 11 : Energy deposited by the single (8-bytes, G4double)
@mcdlee
mcdlee / error
Last active July 19, 2017 00:24
voxelized_phantom.mac
ERROR: 8 - Floating point invalid operation.
Call Stack:
26: /opt/applications/geant4/geant4.10.01-install/lib/libG4run.so
25: /opt/applications/geant4/geant4.10.01-install/lib/libG4run.so
24: /lib/x86_64-linux-gnu/libpthread.so.0
23: Gate : GateVImage::GateVImage()
22: Gate : GateVImageVolume::LoadImage(bool)
21: Gate : GateImageRegularParametrisedVolume::ConstructOwnSolidAndLogicalVolume(G4Material*, bool)
@mcdlee
mcdlee / Procfile
Created May 30, 2017 10:22
LineBot for Kaohsiung C-boke
web: python app.py
*** G4Exception : GeomMgt0002
issued by : G4SmartVoxelHeader::BuildNodes()
PANIC! - Overlapping daughter with mother volume.
Daughter physical volume hole_phys
is entirely outside mother logical volume collimator_log !!
*** Fatal Exception *** core dump ***
x <- 1:15
y <- x^2
d <- data.frame(x, y) # 另外一種建立 data.frame 的方法
d
dy <- diff(y)
dy <- c(NA, dy) #add a blank NA as the first element
d <- cbind(d, dy)
Hardware Price
Arduino Uno R3 開發版 $139
Arduino 壓克力保護盒 $55
9V 電池盒 $22
杜邦線 20公分,母-公 7條 $10.15
Aosong AM2320 $85
LCD 1602 LCM (已焊 IIC底板) $94
紙盒 $0
合計:$405.15
@mcdlee
mcdlee / osmtw2016report.tex
Last active December 31, 2016 12:10
宅宅用 LaTeX 寫報告
\documentclass[a4paper,12pt]{article}
\usepackage[hidelinks]{hyperref}
\usepackage{sectsty}
\sectionfont{\fontsize{16}{20}\selectfont}
\usepackage{hhline}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{台灣開放街圖社群組織}
import os
import numpy as np
import nibabel as nib
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
%matplotlib inline
path1 = os.path.join('folder', 'a.img') #path of file 1
img1 = nib.load(path1)
@mcdlee
mcdlee / TextMagic.py
Last active April 8, 2020 19:49 — forked from anonymous/TextMagic.py
Send SMS via TextMagic API and Python
# import modules
from textmagic.rest import TextmagicRestClient
def runAPI():
username = <username>
token = <token>
global client
client = TextmagicRestClient(username, token)
def messagetext(name, examDate, examTime):
from lxml import etree
from urllib import request
import csv
import datetime
import os
def getTable():
url = 'http://www.c-bike.com.tw/xml/stationlistopendata.aspx'
response = request.urlopen(url)
xml = response.read()