This file contains hidden or 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
procedure MyForm.AfterConstruction; | |
var | |
expr: TExpressionItem; | |
begin | |
inherited; | |
BindList2 := TBindControlList.Create(Self); | |
BindList2.SourceComponent := AdapterBindSource1; | |
BindList2.SourceMemberName := 'ColorsName1'; |
This file contains hidden or 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
program RecGenerics; | |
uses | |
System.SysUtils; | |
type | |
IHogeClass<T> = interface; | |
TTest<T> = record | |
Value: T; |
This file contains hidden or 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
// OK | |
IEnexArraycollection = interface(ICollection<TArray<integer>>) | |
function Op: TEnexExtOps<TArray<integer>>; | |
end; | |
// NG | |
IEnexArrayCollection<T> = interface(ICollection<TArray<T>>) | |
function Op: TEnexExtOps<TArray<T>>; | |
end; |
This file contains hidden or 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
unit ExampleTest; | |
interface | |
uses | |
DUnitX.TestFramework; | |
type | |
[TestFixture] | |
TMyTestObject = class(TObject) |
This file contains hidden or 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 Enter-Using-Undisposable($receiver, [scriptblock]$body, [scriptblock]$finally) { | |
try { | |
return $receiver | % { & $body } | |
} | |
finally { | |
& $finally | |
} | |
} | |
function Enter-Using-Excel([scriptblock]$block) { |
This file contains hidden or 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 Get-ExcelData([parameter(Mandatory=$true, ValueFromPipeline=$true)]$files, [switch]$withHeader) { | |
function Get-ExcelData-Header([ref]$rowsRef) { | |
if (($withHeader) -and ($rowsRef.Value.Count -gt 0)) { | |
$row = $rowsRef.Value.item(1) | |
try { | |
$columns = $row.columns | |
try { | |
for ($c = 1; $c -le $columns.Count; ++$c) { | |
$col = $columns.item($c) |
This file contains hidden or 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 sample.converters; | |
import java.sql.SQLException; | |
import org.joda.time.Period; | |
import org.postgresql.util.PGInterval; | |
import org.seasar.doma.ExternalDomain; | |
import org.seasar.doma.jdbc.domain.DomainConverter; | |
@ExternalDomain |
This file contains hidden or 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 ; | |
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
using Lambda; | |
class ShortLambda { | |
public static function build(): Array<Field> { | |
var fields = Context.getBuildFields(); |
This file contains hidden or 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 outer() { | |
$n = 10; | |
$m = 200; | |
my_func(function($i, $x) use($n) { return $n + $n }, [10, 20, 30]); | |
my_func(function($i, $x) use($n, $m) { return $n + $n * $m }, [10, 20, 30]); | |
} | |
This file contains hidden or 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 outer() { | |
$n = 10; | |
my_func($n, function($i, $x) { return $x + $i }, [10, 20, 30]); | |
} | |
function my_func($i, closure $callback, array $a) { | |
foreach ($a as $x) { |