Skip to content

Instantly share code, notes, and snippets.

set number
set autoindent
set tabstop=4
set shiftwidth=4
set expandtab
/* this porgram solves PI by mote carlo method. */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define MAX_NUM 100000
double monte_carlo();
int main()
{
#!/usr/bin/env python
# coding :utf-8
# reverse of 'wizard' is 'wizard'
reverse_wizard = ''
for c in 'wizard'[::-1]:
reverse_wizard += chr((ord('z') - ord(c)) + ord('a'))
print reverse_wizard
# -*- coding:sjis -*-
import sys
argv = sys.argv
argc = len(argv)
if argc < 2:
print("GPSログファイルを指定してください")
exit()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License
#
# Copyright (c) 2010 Yota Ichino
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
import csv
import numpy as np
import matplotlib.pyplot as plt
# M次多項式近似
M = 0
#!/usr/bin/env python
# -*- coding: sjis -*-
import Tkinter as tk
import time
import csv
class Tegaki(tk.Frame):
'''make a stroke order'''
def __init__(self, file_name, master = None):
@nus
nus / pimple.cpp
Created November 26, 2010 13:54
learning Pointer Implemetation
//==================file.h===========
#ifndef FILE_H
#define FILE_H
class file
{
public:
file();
file(const file& rhs);
file& operator =(const file&);
@nus
nus / get_json.js
Created January 24, 2011 17:30
For getting JSON file
// for gitting JSON file
// \brief get JSON file
// \param(file_name) target JSON file name
// \ret JSON file
function get_json(file_name) {
var requester = create_http_request();
requester.open("GET", file_name, false);
requester.send(null);
@nus
nus / gist:805861
Created February 1, 2011 13:40
ライブラリのコンフィグを表示
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import getopt
'''ライブラリのコンフィグを表示'''
conf = {