This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require "stringio" | |
$LOAD_PATH.push "/usr/local/Library/Homebrew" | |
require "global" | |
require "cmd/list" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// builder | |
let fb_return = fun v -> | |
match v with | |
| (x, "") -> x.ToString() | |
| (_, s) -> s | |
type FizzBuzzBuilder() = | |
member this.Return v = fb_return v | |
let fizzbuzz = FizzBuzzBuilder() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\ClassLoader\UniversalClassLoader; | |
class TraitExt { | |
public static $clsLoader; | |
public static function withTraits($class, array $traits) { | |
$cache = self::classLoader()->getNamespaceFallbacks(); | |
if (empty($cache)) { | |
self::registerCacheDir($_SERVER["TMPDIR"] . DIRECTORY_SEPARATOR . "trait_ext_cache"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void TestStart() { | |
var disposer = Observable | |
.Start(() => { | |
System.Threading.Thread.Sleep(3000); | |
return 110; | |
}) | |
.Subscribe( | |
i => Console.WriteLine(string.Format("OnNext: {0}", i)), | |
() => Console.WriteLine("Completed TestStart") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Mono JIT compiler version 2.10.6 (tarball Fri Sep 16 00:13:06 EDT 2011) | |
// Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com | |
// TLS: normal | |
// SIGSEGV: normal | |
// Notification: kqueue | |
// Architecture: x86 | |
// Disabled: none | |
// Misc: debugger softdebug | |
// LLVM: yes(2.9svn-mono) | |
// GC: Included Boehm (with typed GC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
<Page | |
x:Class="APTest.App.BlankPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:APTest.App" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d" | |
xmlns:fw="clr-namespace:AP.Framework;assembly=AP.Framework" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Sample { | |
public static class LimittedStringExtensions { | |
public string LimmitedString(this string inSelf, int inMaxLen) { | |
if (inSelf.Length > inMaxLen) { | |
throw new Exception("長すぎwwwワロタwww"); | |
} | |
return inSelf; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Maximum Duplication String Problem for F# | |
// | |
let dupstr s = | |
// generate suffix list | |
let tails (s:string) = | |
let rec tailsimpl (s:string) i list = | |
match i with | |
| -1 -> list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
namespace Samples { | |
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] | |
public class PropertyCategoryAttribute : System.Attribute { | |
public PropertyCategoryAttribute(Type inTagType) { | |
this.Tag = inTagType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In CUI test runner, to use await syntax at the test code is involved skipping test. | |
// So It nessesary to wait using Task#Wait() method. | |
// In Assert#Throws method for NUnit, threfore, expected exception is not thrown but AggregateException. | |
// Following method is conversion AggregateException to the internal exception. | |
private TestDelegate ResolveAggregateException(Action inTestAction) { | |
return () => { | |
try { | |
inTestAction(); | |
} | |
catch (AggregateException ex) { |
OlderNewer