Skip to content

Instantly share code, notes, and snippets.

View mactkg's full-sized avatar
💭
I may be slow to respond.

mactkg mactkg

💭
I may be slow to respond.
View GitHub Profile
@mactkg
mactkg / gist:825381
Created February 14, 2011 01:48
//
// The TURTLE interpreter / javascript
//
//
/**
* String trim method (for IE)
*/
if (!String.prototype.trim) {
String.prototype.trim = function() {
@mactkg
mactkg / gist:845907
Created February 27, 2011 04:39
mod_write
<VirtualHost *>
ServerName www.makerbox.net
</VirtualHost>
<VirtualHost *>
ServerName plone.makerbox.net
RewriteEngine On
RewriteRule ^/(.*) http://192.168.0.253:8080/plonetest/VirtualHostBase/http/plone.makerbox.net:80/VirturalHostRoot/$1 [L,P]
</VirtualHost>
@mactkg
mactkg / gist:856564
Created March 5, 2011 18:17
httpd.conf
<VirtualHost *>
ServerName www.makerbox.net
RewriteEngine On
RewriteRule ^/plonetest(.*) http://localhost:8080/VirtualHostBase/http/www.makerbox.net:80/plone
test/VirtualHostRoot/_vh_plonetest/$0 [L,P]
</VirtualHost>
<VirtualHost *>
ServerName plone.makerbox.net
RewriteEngine On
RewriteRule ^(.*) http://localhost:8080/VirtualHostBase/http/plone.makerbox.net:80/plonetest/Vir
#include<stdio.h>
main(){
int c;
while((c=getchar())!='z'){
if(96 < c && c < 123) c = c - 32;
printf("%c", c);
}
return 0;
}
@mactkg
mactkg / techhub_intent.java
Created April 2, 2011 05:52
techhub_intent.java
Intent intent = new Intent(helloworld.this.hogehoge.class);
intent.setAction(Intent_ACTION_VIEW);
startActivity(intent);
// if you want return some information, you should use startActivityForResult().
#include <math.h>
#define _USE_MATH_DEFINES
#include <iostream>
double LengthCos(double t1,t2,t3,f1,f2,f3) {
return sqrt(((t1-f1)*(t1-f1)+(t3-f3)*(t3-f3)))/sqrt(((t1-f1)*(t1-f1)+(t2-f2)*(t2-f2)+(t3-f3)*(t3-f3)));
}
double LengthDegree(double t1,t3,f1,f3) {
return sqrt((t1-f1)*(t1-f1))/sqrt(((t1-f1)*(t1-f1)+(t3-f3)*(t3-f3)));
@mactkg
mactkg / hoge.py
Created April 23, 2011 06:38
hoge.py
import time, urllib
end = 0
for i in range(5):
url = "http://www.switch-science.com/products/detail.php?product_id=" + str(i)
time.sleep(1)
if(url != IOError):
f = urllib.urlopen(url)
print str(i) + ":read"
syntax enable
filetype plugin indent on
" neocomplcache
let g:neocomplcache_enable_underbar_completion = 1
" neocomplcache
let g:NeoComplCache_EnableAtStartup = 1
" 大文字小文字を区別する
let g:NeoComplCache_SmartCase = 1
" キャメルケース補完を有効にする
\begin{table}[hbtp]
\caption{使用機器一覧}
\label{table:whatuse}
\begin{center}
\begin{tabular}{cccc}
\hline
使用機器 & 製造メーカー & 型番 & 製造番号 \\
\hline \hline
ステッピングモータ & - & - & - \\
ステッピングモータIC & - & LSI8255 & - \\