Skip to content

Instantly share code, notes, and snippets.

main = do
putStrLn "Hello,World"
sum :: (Num a) => [a] -> a
sum [] = 0
sum (x:xs) = x + sum xs
product :: (Num a) => [a] -> a
product [] = 1
product (x:xs) = x * product xs
factorial :: Integer -> Integer
factorial 0 = 1
@katsuobushiFPGA
katsuobushiFPGA / gist:bda5d565b20ecda86f60
Last active August 29, 2015 14:06
Github for Windows practice

#Github for Windows について

####1.*リポジトリ作成 左上のプラスマークを押して、名前をいれ
「create repository」を押して、ローカルにリポジトリーを作ります。
####2.*Github上にリポジトリ作成 右上の「publish repository」を押すことで、
「Name」と「Description」を入れて、publish「」Github上にリポジトリーを作ります。
(この時にローカルのリポジトリーのファイルが全てGithub上にUPされます。)

@katsuobushiFPGA
katsuobushiFPGA / ForSearch.md
Created September 20, 2014 11:00
This document is to search me.

#For search
####Word:katsuobushiFPGA

#include<iostream>
#include<boost/multiprecision/cpp_int.hpp>
//名前空間定義
namespace mp = boost::multiprecision;
mp::cpp_int multiply(mp::cpp_int& x,int y){
mp::cpp_int tmp = 1;
for (int i = 0; i < y; i++){
tmp *= x;
//Source.cpp
#include "Header.h"
#include <stdio.h>
int main(){
Test<int> *t = new Test<int>();
t->hello();
t->setValue(2);
printf("getValue:%d", t->getValue());
getchar();
//Node.h
//int
class Node{
public:
Node();
Node(int val);
~Node();
void setValue(int val);
int getValue();
public:
//main.cpp
#include<stdio.h>
#include"SingleLinkedList.h"
int main(){
SingleLinkedList *s = new SingleLinkedList();
s->add(new Node(1));
s->remove(0);
printf("Node%d", *s->head);
//templateNode.h
template <class T> class Node{
public:
Node();
Node(T val);
~Node();
void setValue(T val);
T getValue();
public:
T value;
//DLinkedList.h
//Node.h
//main.cpp
#include <stdio.h>
#include "DLinkedList.h"
int main(){
DLinkedList *d = new DLinkedList();