Skip to content

Instantly share code, notes, and snippets.

@rf0444
rf0444 / HelloExcelSplit.fs
Last active August 18, 2019 09:22
エクセルのシートに記入されたリストを分割するのを ExcelDNA & F# でやってみるやつ
module HelloExcelSplit
open ExcelDna.Integration
let splitIndex (group: int) (total: int): seq<seq<int>> =
let d = total / group
let m = total % group
let counts = seq { for i in 0 .. group - 1 do yield d + if i < m then 1 else 0 }
let (_, xs) = Seq.fold (fun (a, xs) x -> (a + x, Seq.append xs (Seq.singleton (seq { a .. a + x - 1 })))) (0, Seq.empty) counts
xs
@rf0444
rf0444 / Program.cs
Last active October 29, 2016 08:14
MT4 Child Process
// outer.exe
using System;
namespace ConsoleApplication1
{
public class Program
{
public static void Main(string[] args)
{
@rf0444
rf0444 / dialog.mq4.cpp
Last active October 9, 2016 02:49
MT4 Dialog
// property省略
#include <Controls\Dialog.mqh>
CAppDialog dialog;
int OnInit() {
dialog.Create(ChartID(), "Test Dialog", 0, 100, 100, 600, 400);
dialog.Run();
return INIT_SUCCEEDED;