Skip to content

Instantly share code, notes, and snippets.

As for statements equating MQTT with CoAP style REST and why they're not complete or true:

Statement 1

CoAP URI path == MQTT topic

This appears to be true because they have a lot in common. In reality an MQTT topic is ephemeral (or you could say it's just a convention). You don't create it, you don't delete it, you just use it to synchronize where you're publishing and where you're subscribing.

A CoAP URI is material. Or at least it is with Californium, and I believe it has to be this way as long as CoAP is used in conjunction with CoRE link formats because all resources have to be enumerated so they can be described by the CoRE document.

implicit class BecauseFsharp[T](obj: T) {
/**
* This comes from OCaml/F#; very handy when used with partial function
* application. It's mainly useful for reducing parenthesis nesting.
*
* `foo(bar)` is same as `bar |> foo`
*/
@inline def |>[U](function: T => U): U = function(obj)
}

Keybase proof

I hereby claim:

  • I am tkellogg on github.
  • I am kellogh (https://keybase.io/kellogh) on keybase.
  • I have a public key whose fingerprint is 402D 2BD0 DEF8 57ED DFAA A221 A1B1 2838 7802 BD5E

To claim this, I am signing this object:

module Test.Main where
import Debug.Trace
import Data.Char
import Data.String
parse [] = []
-- Error: unexpected "'"
parse ('h':cs) = cs
parse (c:cs) = c:c:cs
@tkellogg
tkellogg / embedded-db.md
Created December 10, 2014 03:47
Requirements for an embedded database for Windows commandline apps

A couple open source .NET projects have need for a headache-free storage option. [Jump-Location][1] is a command line tool that currently uses flat files to store information about what directories a user has visited. Flat files were great at first, but we need more. Also, PSReadLine is also running into similar problems.

Storage Engine

This will most likely wrap an existing storage engine to take care of the administrative tasks. We'll have to choose a storage engine that meets some basic requirements.

  • Small size -- It will have to be packaged with other apps, especially commandline apps where there is an expectation of small size. The storage engine itself should probably be < 10MB.
  • Easy to use -- Otherwise, what's the point of this project?
@tkellogg
tkellogg / CBOR-objectives.md
Last active August 29, 2015 14:15
I copy & pasted this from RFC 7049 (http://tools.ietf.org/html/rfc7049) because I believe it succinctly embodies many of the goals of IoT. TL;DR - it must be simple, interchangeable, small wire size and small code size

Objectives

The objectives of CBOR, roughly in decreasing order of importance, are:

  1. The representation must be able to unambiguously encode most common data formats used in Internet standards.
    • It must represent a reasonable set of basic data types and structures using binary encoding. "Reasonable" here is
@tkellogg
tkellogg / SiteVisitWorkflow.cs
Created March 8, 2011 16:44
Abstract workflow factory & example usage (SiteVisitWorkflow) for ObjectFlow
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using kpa.mko.dal;
using kpa.common.workflow;
using Rainbow.ObjectFlow.Stateful;
using kpa.common.container;
using kpa.common.interfaces;
@tkellogg
tkellogg / ModelsAndViewModels.cs
Created September 16, 2011 03:05
AutoMapper example for my blog (http://timkellogg.blogspot.com)
public class Account
{
public virtual int AccountId { get; set; }
[Matches(@"[A-Z]{2}\d{5}")]
public virtual string Code { get; set; }
[Required]
public virtual string Name { get; set; }
public virtual int? Age { get; set; }
}
@tkellogg
tkellogg / gist:1221166
Created September 16, 2011 03:58
Another AutoMapper example using polymorphism
public class Account
{
public virtual int AccountId { get; set; }
[Matches(@"[A-Z]{2}\d{5}")]
public virtual string Code { get; set; }
[Required]
public virtual string Name { get; set; }
public virtual int? Age { get; set; }
}
@tkellogg
tkellogg / BDD.cs
Created December 28, 2011 17:44
BDD in C#
[TestFixture]
class when_adding_numbers
{
Maths maths;
void Given_an_object_in_bigint_mode()
{
maths = new Maths();
maths.BigInt = true;
}