Skip to content

Instantly share code, notes, and snippets.

@ugorji
ugorji / settings.gradle
Last active May 6, 2019 04:07
settings.gradle file for my multi-project gradle repositories
include ':java-common',
':java-facade',
':java-web',
':java-markup',
':web-common',
':collab-wiki',
':collab-forum'
package github_107
import (
"encoding/json"
"io/ioutil"
"reflect"
"runtime"
"testing"
"github.com/ugorji/go/codec"
package main
import (
"strconv"
"time"
"github.com/ugorji/go/codec"
"encoding/json"
)
func main() {
@ugorji
ugorji / msgpack-timestamp-type.md
Last active March 5, 2018 20:51
MsgPack: Support timestamp as new spec-defined inter-operable extension type

Timestamp is a data type that represents an instant in time and space. It is supported by most programming languages. However, it is not defined in the msgpack spec. The lack of built-in support for timestamp is a constant issue brought up while evaluating encodings.

The proposal is to include timestamp support in the new spec as an inter-operable extension type, defined by the spec along with Binary. It will have extension tag -2.

A timestamp is composed of 3 components:

  • secs: signed integer representing seconds since unix epoch
  • nsces: unsigned integer representing fractional seconds as a nanosecond offset within secs, in the range 0 <= nsecs < 1e9
  • tz: signed integer representing timezone offset in minutes east of UTC, and a dst (daylight savings time) flag
@ugorji
ugorji / msgpack-new-spec-ideas.md
Last active December 14, 2015 11:09
msgpack-new-spec-ideas

My thinking is summarized as :

There is old data already stored with the Raw ambiguity. In lieu of having all old data be re-written, the solution is to keep that ambiguity and add new explicit types.

Any old code that comes in touch with newly serialized data will break, and will have to update their libraries.

However, the old serialized data will not need to change or have its interpretation change, regardless of assumption made on how to handle Raw previously.

Beyond that, we add new native type for Timestamp and PrivateExtensions.