Skip to content

Instantly share code, notes, and snippets.

View mndrake's full-sized avatar
🏠
Working from home

David Carlson mndrake

🏠
Working from home
View GitHub Profile
@mndrake
mndrake / Excel4.fs
Last active March 11, 2020 09:46
A F# wrapper class for the Excel4/Excel12 methods contained in Excel-DNA to mimic basic methods of the COM object model
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
namespace Utility
@mndrake
mndrake / Excel4.cs
Last active December 21, 2015 23:19
A C# wrapper class for the Excel4/Excel12 methods contained in Excel-DNA to mimic basic methods of the COM object model
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
namespace Excel4
{
@mndrake
mndrake / Resizer.cs
Last active June 30, 2018 11:23
Modified version of the Excel-DNA Resize UDF that also accepts a range name argument that will be used to label the resized array. Original version : http://exceldna.codeplex.com/SourceControl/latest#Distribution/Samples/ArrayResizer.dna
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
namespace Utility
{
using System;
@mndrake
mndrake / Utopia.fsx
Created January 15, 2014 17:45
Agent based calculation engine
open System
open System.Collections.Generic
open System.Collections.ObjectModel
open System.ComponentModel
open System.Threading
open Microsoft.FSharp.Control
open Microsoft.FSharp.Reflection
type Value =
| Dirty
namespace Utility
{
using System;
using System.Collections.Generic;
// based on:
//http://stackoverflow.com/questions/2852161/c-sharp-memoization-of-functions-with-arbitrary-number-of-arguments
public static class Memoizer
{
@mndrake
mndrake / fsharp_intro.ipynb
Created February 17, 2014 17:47
intro to F#
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mndrake
mndrake / Include.fsx
Created April 23, 2014 17:01
IFSharp initialization script -- customized for Deedle and RProvider
// include directory, this will be replaced by the kernel
#I "{0}"
// load base dlls
#r "IfSharp.Kernel.dll"
#r "System.Data.dll"
#r "System.Windows.Forms.DataVisualization.dll"
#r "FSharp.Data.TypeProviders.dll"
#r "FSharp.Charting.dll"
#r "fszmq.dll"
@mndrake
mndrake / DeedleFormatter.fsx
Created April 23, 2014 17:03
Deedle Series and IFrame formatter for IFSharp
#I "../lib"
#r "FSharp.Markdown.dll"
#r "FSharp.Literate.dll"
#r "Deedle.dll"
open System.IO
open Deedle
open Deedle.Internal
open FSharp.Literate
open FSharp.Markdown
@mndrake
mndrake / IntellisenseError.ipynb
Last active August 29, 2015 14:00
Example IFSharp notebook that intellisense does not work.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mndrake
mndrake / DeedlePrintExample.ipynb
Created April 30, 2014 15:19
Draft of Formatted Deedle objects in IFSharp notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.