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
for file in *.txt; do nkf -w $file > tmp; mv -f tmp $file ;done |
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
// C#のオブジェクトを作る | |
let sut () = | |
let vm = new VendingMachine(new StandardMoneyAcceptor()) | |
vm.SetDrinkSpecification([new PriceSpecification("Cola",110); new PriceSpecification("Soda",150)]) | |
vm | |
// 受け取ったオブジェクトに操作を行い、操作後のオブジェクトを返却する。 | |
let insert_money amount (vm:VendingMachine) = | |
printMethod amount | |
amount |> List.iter vm.InsertMoney |
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
let initially vm = | |
printMethod () | |
vm | |
let total_amount amount (vm:VendingMachine) = | |
printMethod amount | |
vm.TotalAmount = amount | |
let insert_money amount (vm:VendingMachine) = | |
printMethod amount |
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
<Window | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing" | |
x:Class="IroPf.MainWindow" | |
x:Name="Window" | |
Title="MainWindow" | |
Width="640" Height="480"> | |
<Window.Resources> | |
<Storyboard x:Key="speaking" AutoReverse="True" RepeatBehavior="Forever"> |
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
public static void ShowDialog(this Form dlg, int timeout) | |
{ | |
dlg.Shown += (sender, args) => Task.Factory.StartNew( | |
() => Thread.Sleep(timeout)).ContinueWith( | |
_ => dlg.Close(),TaskScheduler.FromCurrentSynchronizationContext()); | |
dlg.ShowDialog(); | |
} |
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
[System.Runtime.InteropServices.DllImport("gdi32.dll")] | |
public static extern bool DeleteObject(IntPtr hObject); | |
public static BitmapSource ToWPFBitmap(this System.Drawing.Bitmap bitmap) | |
{ | |
var hBitmap = bitmap.GetHbitmap(); | |
BitmapSource source; | |
try | |
{ |
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
public class WinFormBitmapConverter : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
var bitmap = value as Bitmap; | |
if (bitmap == null) | |
{ | |
return null; | |
} |
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
[System.Runtime.InteropServices.DllImport("gdi32.dll")] | |
public static extern bool DeleteObject(IntPtr hObject); | |
public static BitmapSource ToWPFBitmap(this System.Drawing.Bitmap bitmap) | |
{ | |
var hBitmap = bitmap.GetHbitmap(); | |
BitmapSource source; | |
try | |
{ |
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
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'oauth' | |
require 'JSON' | |
user = 'user' | |
pass = 'pass' | |
key = 'consumer_key' |
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
#!/usr/bin/ruby | |
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'oauth' | |
require "rexml/document" | |
class YouroomContent | |
def initialize (content, author, created_at, children) | |
@content = content |