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
var onsuccess; | |
Object.defineProperty(req, "onsuccess", { | |
get: function () { | |
return onsuccess; | |
}, | |
set: function (onsuccess_internal) { | |
req.removeEventListener('success', onsuccess); | |
onsuccess = function onsuccess(event) { | |
var db = event.target.result; | |
db.kage_kageDB = self; |
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
var panel = document.getElementById("panel"); | |
panel.addEventListener("MSPointerDown", function (event) { | |
panel.msSetPointerCapture(event.pointerId); | |
WinJS.UI.Animation.pointerDown(event.target); | |
}); | |
panel.addEventListener("MSPointerUp", function (event) { | |
panel.msReleasePointerCapture(event.pointerId); | |
WinJS.UI.Animation.pointerUp(event.target); | |
}); |
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
(function () { | |
/* */ | |
/* EXAMPLE */ | |
/* */ | |
//var db = new KageDB({ | |
// name: "db", | |
// version: 1, | |
// migration: { | |
// 1: function (ctx, next) { |
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
type Animal = { Name: string; Bark: unit -> string } | |
let newDog name = { Name = name; Bark = fun _ -> "Bow wow" } | |
let newCat name = { Name = name; Bark = fun _ -> "meow" } | |
let newCheetah name = | |
let cat = newCat name | |
{ Name = name; Bark = cat.Bark >> (fun a -> a + " " + a)} | |
let dog = newDog "Pochi" | |
let cat = newCat "Tama" |
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
group Js; | |
program(vars, text) ::= << | |
(function () { | |
var <vars : {var | <var> = 0}; separator=", ">; | |
<text> | |
})(); | |
>> | |
if(cond, thenBlock, elseBlock) ::= << |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | |
</startup> | |
<runtime> | |
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |
<dependentAssembly> | |
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"> | |
</assemblyIdentity> |
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.Dynamic; | |
using System.Data.SqlClient; | |
using System.Configuration; | |
using System.Data; | |
namespace DbConsole | |
{ | |
public class Db |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var value = new Celsius(10); | |
Fahrenheit result; | |
if (TryChangeType(value, typeof(Fahrenheit), out result)) | |
{ | |
Console.WriteLine(result.Degrees); // 50 | |
} |
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
package org.seasar.doma.jdbc.domain; | |
public interface DomainConverter<D, V> { | |
// Java to DB | |
V fromDomainToValue(D domain); | |
// DB to Java | |
D fromValueToDomain(V value); | |
} |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var method = typeof (Program).GetMethod("Hello"); | |
try | |
{ | |
method.Invoke(null, new object[] {}); | |
} catch(TargetInvocationException e) | |
{ |