Skip to content

Instantly share code, notes, and snippets.

Masakazu Minamiyama minamiyama1994

Block or report user

Report or block minamiyama1994

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View file0.cpp
#include<typeinfo>
#include"CTE/CTE.hpp"
auto main ( ) -> int
{
auto eval1 = CTE_EVAL ( "1+20*10/(5+5)" ) ;
auto eval2 = CTE_EVAL ( "1+20*10/(5+5)+.5" ) ;
auto eval3 = CTE_EVAL ( u8R"*****("Hello"+" "+"World")*****" ) ;
std::cout << eval1 << std::endl ;
std::cout << typeid ( eval1 ).name ( ) << std::endl ;
std::cout << eval2 << std::endl ;
@minamiyama1994
minamiyama1994 / Helper.hs
Created Apr 18, 2014
Yesodのmodelで好きな型をフィールドの型に使えるようにしたい ref: http://qiita.com/minamiyama1994/items/c0c5ca87948601dc0d84
View Helper.hs
module Helper where
import Database.Persist.TH
import UserModule ( UserDefineType )
derivePersistField "UserDefineType"
View lifegame.py
import pygame, sys, random
pygame.init()
size = (800,450)
white = (255, 255, 255)
color = (30, 30, 180)
fps = 30
screen = pygame.display.set_mode(size)
pygame.display.set_caption('lifegame')
cellsize = 8
@minamiyama1994
minamiyama1994 / file0.cpp
Created Mar 19, 2014
型安全なprintf -- 如何にしてコンパイル時に型エラーを検出するか -- ref: http://qiita.com/minamiyama1994/items/95ef490043c495be8c44
View file0.cpp
#include"TSP/TSP.hpp"
auto main ( ) -> int
{
TSP_PRINTF ( "%c\n" , 'a' ) ;
TSP_PRINTF ( "%s\n" , "hoge" ) ;
TSP_PRINTF ( "%d\n" , 1 ) ;
TSP_PRINTF ( "%f\n" , 0.1 ) ;
TSP_PRINTF ( "%%\n%c\n%s\n%d\n%f\nHello! TSP!\n" , 'e' , "piyo" , 1 , 0.25 ) ;
// TSP_PRINTF ( "%f\n" , "hoge" ) ; // <- Compile Error
}
View example1.cpp
case_ < char >::of
<
match < char , long > ,
match < short , int > ,
match < int , short > ,
match < long , char > ,
match < list < pattern < 0 > , double > , list < double , pattern < 0 > > >
>::type // => long
View C++勉強会in広島掲示板.md

C++勉強会in広島掲示板

参加希望者及び発表希望者及び希望日時等適当に書いて行ってください

@minamiyama1994
minamiyama1994 / gist:6171027
Last active Dec 20, 2015
boost::xpressive's bug?
View gist:6171027
#include"boost/xpresaive/xpresaive.hpp"
namespace bx = boost::xpressive ;
auto main ( ) -> int
{
bx::sregex regex1 = bx::bos >> ( "instance" | + ( bx::range ( 'a' , 'z' ) | bx::range ( 'A' , 'Z' ) ) ) ;
bx::smatch result ;
if ( bx::regex_search ( std::string { "instanceof" } , result , regex1 ) )
{
std::cout << result.str ( ) << std::endl ; // output : "instance"
}
You can’t perform that action at this time.