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
open System | |
open System.Text.RegularExpressions | |
// http://msdn.microsoft.com/en-us/library/ms228595(v=vs.80).aspx#Y300 | |
let regexIsMatchSample lines pattern = | |
// for line in | |
List.iteri(fun i line -> | |
if Regex.IsMatch(line,pattern,RegexOptions.IgnoreCase) then | |
printfn"%3d : %s" i line) lines | |
regexIsMatchSample |
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
module GetHomeTimeline | |
open System | |
open System.IO | |
open System.Text | |
open System.Net | |
open System.Web.Script.Serialization | |
open FSharp.Data.Json | |
open FSharp.Data.Json.Extensions |
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
// This program executes 6502_functional_test.bin from https://github.com/Klaus2m5/6502_65C02_functional_tests | |
// It successes almost all the tests and fails the tests for decimal mode. | |
open System.IO | |
open System | |
open System.Collections.Generic | |
let hasBit i v = v &&& (1uy <<< i) <> 0uy | |
type Addr = Accumulator | Implied | Immediate of uint8 | Bus of int | |
type Addressing = Acc | Impl | Sharp | Rel | Zpg | ZpgX | ZpgY | Abs | AbsX | AbsY | Ind | XInd | IndY |
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
// TODO: Test2's destructor does not work | |
open System | |
open System.IO | |
open System.Net | |
type Test2() = | |
// static variable | |
[<DefaultValue>] | |
static val mutable private i:int | |
// static constructor |
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 Size : Int = 40 | |
var cells = [Array<Bool>]() | |
func min(a:Int, b:Int) -> Int { | |
if a > b {return b } else { return a } | |
} | |
func max(a:Int, b:Int) -> Int { | |
if a > b { return a } else { return b } | |
} |
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
open System | |
open System.Drawing | |
open System.Windows.Forms | |
let mutable startTime = new DateTime() | |
let timerLabel = new Label(Text="0",Location=Point(0,0)) | |
let startButton = new Button(Text="Start",Location=Point(0,24)) | |
let stopButton = new Button(Text="Stop",Location=Point(0,48)) | |
let clearButton = new Button(Text="Clear",Location=Point(0,72)) |
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
open System | |
type Html = | |
| Tag of string * Html list | |
| Attribute of string * string | |
| Content of string | |
override __.ToString() = | |
match __ with | |
| Tag (tag,htmls) -> | |
let mutable attributes = "" |
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
(* | |
My training.Translating C# code to F#. | |
http://www.fincher.org/tips/Languages/csharp.shtml | |
*) | |
open System | |
open System.IO | |
open System.Net | |
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
module WinTab | |
open System | |
open System.Runtime.InteropServices | |
open System.Text | |
// types | |
type EWTICategoryIndex = | |
| WTI_INTERFACE = 1 | |
| WTI_STATUS = 2 |
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.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; |
NewerOlder