Skip to content

Instantly share code, notes, and snippets.

View twxia's full-sized avatar
👨‍💻

Wei-Chieh Hsia twxia

👨‍💻
View GitHub Profile
PolyPointer readp()
{/*read in the polynomial */
PolyPointer node = NULL, c, headnode;
float coef=1;
int expon, i=0, count=0;
char str[100], tempc;
scanf("%s", str);
while (str[i] != '\0' ){
#include "stdafx.h"
#include "GUA_OM.h"
#include <math.h>
#include <opencv2/core/core.hpp>
#include <opencv/cv.h>
#include <highgui.h>
using namespace cv;
namespace OMT
for (f_it = faces_begin(); f_it != faces_end(); ++f_it)
{
for (fv_it = fv_iter( f_it ); fv_it; ++fv_it)
{
sp_p data = property(VProp, v_it.handle());
double *d2p = data.pt.data() // this is point (x , y, z);
double *d3p = point(fv_it.handle()).data();
glTexCoord2f(d2p[0] + 0.5,d2p[1] + 0.5);
glVertex3f(d3p[0],d3p[1],d3p[2]);
for (f_it = faces_begin(); f_it != faces_end(); ++f_it)
{
for (fv_it = fv_iter( f_it ); fv_it; ++fv_it)
{
sp_p data = property(VProp, v_it.handle());
double *d2p = data.pt.data() // this is point (x , y, z);
double *d3p = point(fv_it.handle()).data();
glTexCoord2f(d2p[0] + 0.5,d2p[1] + 0.5);
glVertex3f(d3p[0],d3p[1],d3p[2]);
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.8.0-27-generic x86_64 Ubuntu 13.04
auth_mechanisms = plain login
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_privileged_group = mail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace inbox {
inbox = yes
location =
compare:
add $sp, $sp, -4
sw $ra, 0($sp)
jal sub
slti $t1, $v0, 0
beq $t1, $zero, exit
addi $t1, $t1, -2
exit:
add $t1, $t1, 1
<h1>Activity <span>Buzz</span></h1>
<h2 style="text-shadow:3px 3px 20px #070606; font-size:30px; color: #FFBB00">貼心服務,挖掘精彩活動</h2>
@twxia
twxia / D-link 933L
Last active May 27, 2017 04:04
NTUAF Monitor Project
@twxia
twxia / stream_to_youtube.sh
Last active April 30, 2016 03:08 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg (TCP version)
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
1. IIFE, 為了避免污染全域的環境,然後此 funciton 當他建構好後又會立即的執行。
2. 忽略了 javascript closure 的特性, 可以用 let 定義一個新變數,值為 i 。又或者是把 ajax call 那邊建立一個 funciton,把 i 傳入的方式,避免掉 closure。
3. CDN,減少自身流量,快速 (依使用者位置,對應局離近的伺服器。或有可能使用者有 cache 了)等好處大於放本機端。
4. 因為 bind 在 IE8 沒支援,我們可以利用 apply 模擬出類似的作法,簡單方式像以下,也可以用 polyfill 來處理 (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind)
```
function bind(fn, obj){
return function(){
fn.apply(obj, arguments);
}
}