Skip to content

Instantly share code, notes, and snippets.

// Boost result_of library
// Copyright Douglas Gregor 2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// For more information, see http://www.boost.org/libs/utility
#ifndef BOOST_RESULT_OF_S_HPP
#define BOOST_RESULT_OF_S_HPP
// Boost result_of library
// Copyright Douglas Gregor 2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// For more information, see http://www.boost.org/libs/utility
#if !defined(BOOST_PP_IS_ITERATING)
# error Boost result_of - do not include this file!
@hwada
hwada / gist:633842
Created October 19, 2010 08:34
redmine-diff-patch
Index: lib/redmine/unified_diff.rb
===================================================================
--- lib/redmine/unified_diff.rb (revision 4232)
+++ lib/redmine/unified_diff.rb (working copy)
@@ -38,9 +38,78 @@
end
end
self << diff_table unless diff_table.empty?
+
+ each do |table|
@echo off
if "%1" == "" goto end
msbuild /p:configuration=%1 %2
:end
fizzbuzz n
| mod n 15 == 0 = "FizzBuzz"
| mod n 5 == 0 = "Buzz"
| mod n 3 == 0 = "Fizz"
| otherwise = show n
main = print $ map fizzbuzz [1..100]
public static class StringExtensions
{
public static string Join<T>(this T[] self, string separator)
{
return string.Join(separator, self.Select(x => x.ToString()).ToArray());
}
}
#include "stdafx.h"
#include "gtest/gtest.h"
#pragma comment(lib, "gtestd.lib")
int Factorial(int n) {
int result = 1;
for (int i = 1; i <= n; i++) {
result *= i;
}
namespace CaptureSaver
{
class Program
{
[STAThread]
static void Main(string[] args)
{
if(args.Length == 0) { return; }
var img = Clipboard.GetImage();
@hwada
hwada / say.cs
Last active April 17, 2018 14:48
using GoogleCast;
using GoogleCast.Channels;
using GoogleCast.Models.Media;
using System.Linq;
using System.Threading.Tasks;
namespace SayGoogleHome
{
class Program
{
#coding:utf-8
import csv
from janome.tokenizer import Tokenizer
from wordcloud import WordCloud
from collections import defaultdict
import datetime
exclude_words = [u'これ', u'こと', u'そう', u'それ', u'ところ', u'みたい', u'よう', u'さん',
'http', 'https', 'www', 'to', 'htn', 'co', 'com', 'jp', 'ly', 'tw', 'RT', 'tinyurl', 'Bookmarking']