Skip to content

Instantly share code, notes, and snippets.

Sub MoveMail()
On Error Resume Next
Dim ns As Outlook.NameSpace
Dim moveToFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem
ns = Application.GetNamespace("MAPI")
moveToFolder = ns.Folders("資料檔名稱").Folders("資料夾名稱")
For Each objItem In Application.ActiveExplorer.Selection
@fo40225
fo40225 / Script.ps1
Last active September 12, 2020 14:14
Windows 10 add US keyboard in zh-TW
$zhtw = New-WinUserLanguageList zh-TW
$zhtw[0].InputMethodTips.Clear()
$zhtw[0].InputMethodTips.Add('0404:00000409')
$zhtw[0].InputMethodTips.Add('0404:{B115690A-EA02-48D5-A231-E3578D2FDF80}{B2F9C502-1742-11D4-9790-0080C882687E}')
Set-WinUserLanguageList $zhtw
@fo40225
fo40225 / tensorflow-1.3.0-bazel-windows.txt
Created November 5, 2017 14:45
tensorflow 1.3.0 on windows with avx2 & cuda by bazel
tensorflow 1.3.0 on windows with avx2 & cuda by bazel
win 10 1703
msys2-x86_64-20161025.exe
anaconda3 4.4.0
visual studio 2015 update 3 with c++ installed
cuda 8.0.61
cudnn 6
bazel 0.5.3 (C:\msys64\usr\bin\bazel.exe)
@fo40225
fo40225 / tensorflow-1.4.0-cmake-windows.txt
Last active February 20, 2018 14:58
tensorflow 1.4.0 on windows with avx2 & cuda by cmake
tensorflow 1.4.0 on windows with avx2 & cuda by cmake
win 10 1703
git 2.10.2
cmake 3.8.2
anaconda3 4.4.0
visual studio 2015 update 3 with c++ installed
cuda 8.0.61
cudnn 6
swigwin-3.0.10
@fo40225
fo40225 / tensorflow-1.4.0-cuda91-cudnn7-windows.txt
Last active January 29, 2018 11:58
tensorflow 1.4.0 on windows with avx2 & cuda 9.1 & cudnn 7 by cmake
tensorflow 1.4.0 on windows with avx2 & cuda 9.1 & cudnn 7 by cmake
win 10 1703
git 2.14.1
cmake 3.9.6
anaconda3 5.0.0
cuda 9.1.85
cudnn 7.0.5 with cuda9.1
visual studio 2017 15.4 (msvc 1911)
# Note vs 15.5 (msvc 1912) didn't work with cuda 9.1.85
@fo40225
fo40225 / Program.cs
Created March 21, 2018 03:56
detect oledb provider
class Program
{
static void Main(string[] args)
{
using (var reader = OleDbEnumerator.GetRootEnumerator())
{
var colIndex = 0;
for (int i = 0; i < reader.FieldCount; i++)
{
if (reader.GetName(i) == "SOURCES_NAME")
@fo40225
fo40225 / TaiwanBioBankExon.sql
Created March 25, 2018 07:09
使用SQL Server過濾出TaiwanBioBank中UCSC exon區域的資料
USE [master];
GO
CREATE DATABASE [TaiwanBioBank]
CONTAINMENT = NONE
ON PRIMARY (
NAME = N'TaiwanBioBank'
, FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\TaiwanBioBank.mdf'
, SIZE = 8192 KB
, FILEGROWTH = 65536 KB
@fo40225
fo40225 / ubuntu_apt_mirror_setting.sh
Last active March 22, 2020 07:09
台灣apt mirror
# 顯示目前mirror
cat /etc/apt/sources.list | grep main | awk '{ print $2 }' | cut -d'/' -f3 | sed -n '3P'
# 國網中心
sudo sed -i 's/archive.ubuntu.com/tw.archive.ubuntu.com/g' /etc/apt/sources.list
@fo40225
fo40225 / keras_dynamic_vram.py
Created August 11, 2018 09:15
keras dynamic vram
from keras import backend as K
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config)
K.set_session(session)
@fo40225
fo40225 / fdhost_cpu.sql
Last active September 28, 2019 06:06
fdhost cpu
sp_configure 'show advanced options'
go
sp_configure 'show advanced options', 1
go
RECONFIGURE
go
sp_configure 'max full-text crawl range'
go
sp_configure 'max full-text crawl range', 16
go