Skip to content

Instantly share code, notes, and snippets.

View Mistat's full-sized avatar

Misato Mistat

  • Tailor
  • Tokyo
View GitHub Profile
@Mistat
Mistat / test
Created February 25, 2011 14:05
<?
echo 'test';
?>
@Mistat
Mistat / .npmrc
Created December 19, 2010 00:37
npmの設定
root = ~/.node_libraries
binroot = ~/bin
manroot = ~/share/man
@Mistat
Mistat / libevent2_sigint.c
Created December 11, 2010 12:59
libevent2 Catch SIGINT signal
/**
* libevent2 sample code
* Catch SIGINT signal
*/
#include <event2/event.h>
#include <stdio.h>
#include <stlib.h>
void sigint_event_function(evutil_socket_t fd, short what, void *arg)
{
/*
* Customized by Misato Takahashi <[email protected]>
* - fix if Html document has "<!DOCTYPE>" then parse error.
* - fix if Attribute name includes "-" then parse error
* - fix if Unmatch case start tag and end tag then parse error
* - add function "getElementById"
*
* HTML Parser By John Resig (ejohn.org)
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
// design view
{
"_id": "_design/select",
"_rev": "13-d3471506dd8836f5438a6af58b7f4ee4",
"language": "javascript",
"views": {
"all": {
"map": "function (doc) { if (doc.type == \"car\") { emit(null, null);} }"
},
"count": {
#include<stdio.h>
/**
* 自然対数の底eは無理数で、その値は下記の無限級数で表される。
* 小数点3桁までの精度でeの近似値を計算するプログラムを作成
* e=1+1/1!+1/2!+1/3!・・・・・・+1/n!・・・・・
*/
void main()
{
double sum,sum0;
int i,k,kai;
/**
* 課題3
*
* 実数xをキーボードから入力し、a[0]=1,a[1]=2,a[2]=3として
* y=a[0]x^2+a[1]x+a[2]を 計算し、yを出力するプログラム
*/
#include <stdio.h>
#include <math.h>
int main(int argc, char** argv) {
/**
* 課題4
*
* キーボードからnの値を入力し、配列にn個分のデータを入力して、
* それらの合計と平均を求めるプログラム(ただし、nの最大値は100
*/
#include<stdio.h>
void main()
{
double data[100],sum=0,ave=0;
/**
* 課題1
*
* 5つの配列を格納する配列aに5つの数字{10,20,30,40,50}を格納(初期設定値)し、
* 格納させた値をfor文を使って表示させるプログラムを作成
*/
#include<stdio.h>
void main()
{
/**
* 課題2
*
* 5つの配列を格納する配列Dataに任意の5つの数字を格納(初期値設定)して、
* 合計と平均を求めるプログラムを作成
*/
#include<stdio.h>
void main()
{