This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mandelbrot.scala without actor by nox, 2011.07.09 | |
import scala.annotation.tailrec | |
import java.io.FileOutputStream | |
import java.awt.image.BufferedImage | |
import java.awt.Color | |
import javax.imageio.ImageIO | |
import scala.testing.Benchmark | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// madelbrot using multi GPU devices by nox, 2011.06.06 | |
// nvcc -lcutil_x86_64 -arch sm_13 -use_fast_math -prec-sqrt=false -keep -L ~/NVIDIA_GPU_Computing_SDK/C/lib -I ~/NVIDIA_GPU_Computing_SDK/C/common/inc -g mandelbrot_multigpu.cu -o mandelbrot_multigpu | |
#include <iostream> | |
#include <fstream> | |
#include "cutil_inline.h" | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
#include <sstream> | |
#include <algorithm> | |
#include <cstring> | |
using namespace std; | |
int base64encode(const char* p, char* buf) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// matching_residue.cpp by nox, 2011.04.18 | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
#include <utility> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Place { | |
int mins; | |
int mon, d, h, m; | |
float x, y; | |
float magnitude; | |
float depth; | |
String name; | |
public Place(int mins, int mon, int d, int h, int m, float x, float y, float magnitude, float depth, String name) { | |
this.mins = mins; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Mandelbrot set using GPGPU by nox, 2011.02.12 | |
// nvcc -lcutil_x86_64 -arch sm_13 -use_fast_math -prec-sqrt=false -keep -L ~/NVIDIA_GPU_Computing_SDK/C/lib -I ~/NVIDIA_GPU_Computing_SDK/C/common/inc -g mandelbrot_thread.cu -o mandelbrot_thread | |
#include <iostream> | |
#include <fstream> | |
#include <cutil_inline.h> | |
#include <multithreading.h> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 指定した重さを量るのに使う錘の組み合わせの数を求めるプログラム. | |
// 錘は 1g, 5g, 10g, 50g, 100g, 500g の6種類. | |
// 重さ 700,000g 程度までなら桁あふれせずに計算できる. | |
#include <iostream> | |
#include <map> | |
#include <algorithm> | |
#include <cstdlib> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import android,urllib,urllib2,simplejson | |
def translator(text,from_lang,to_lang): | |
url='http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=%s&langpair=%s%%7C%s'%(urllib.quote(text.encode('utf-8')),from_lang,to_lang) | |
data=simplejson.loads(urllib2.urlopen(url).read()) | |
return data['responseData']['translatedText'] | |
droid=android.Android() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import android | |
import sys,os,urllib,urllib2,simplejson | |
from BeautifulSoup import BeautifulSoup | |
YAHOO_APP_ID='Yahoo!デベロッパーネットワークのアプリケーションID' | |
KEITAISO_API='http://jlp.yahooapis.jp/MAService/V1/parse?appid=%s&results=ma&sentence=%s' | |
KANA=[u'きゃ',u'きぃ',u'きゅ',u'きぇ',u'きょ', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import cgi,sqlite3,datetime | |
from wsgiref.simple_server import make_server | |
LIMIT=50 # 最大表示記事数. | |
DB_FILE='/sdcard/bbs.sqlite' | |
con=sqlite3.connect(DB_FILE) | |
cur=con.cursor() |