Python datetime strptime: unconverted data remains

The datetime conversion function strptime() kept failing until the invisible error got caught!

A Quick Look at Statsd

The idea of application performance monitoring with minimal side-effects brought Statsd to life. It is a daemon service that listens to UDP packets. It expects text payload, aggregates the metrics, and send them over to a metrics server (a time series DB). The metrics data is flushed at regular intervals (default 10 seconds). After every…

K-Messed Array Sort: Python Solution

K-Messed Array Sort Given an array of integers arr where each element is at most k places away from its sorted position Solution from Queue import PriorityQueue def sort_k_messed_array(arr, k): kheap = PriorityQueue() result = [] for num in arr: kheap.put(num, 'num') if kheap.qsize() == (k + 1): item = kheap.get() result.append(item) while not kheap.empty():…

What is Special in HTTP 2.0?

Useful Points: Unlike text protocol HTTP/1.0 & HTTP/1.1, HTTP/2.0 is binary based protocol. So tools like curl are needed to make requests instead of plain telnet. The TCP connection is now multiplexed for multiple requests. So a client should open only one connection. Few browsers support HTTP/2.0 with only TLS. The compression of data is…

go-kit: Sample Code for Function to Log

go-kit: Sample Code for Function to Log func getLogger() log.Logger { var logger log.Logger logger = log.NewLogfmtLogger(log.NewSyncWriter(os.Stderr)) logger = log.With(logger, "instance_id", 123) return logger } The above function is easily usable in a go-kit project to log JSON style data. func myfun() { mylogger := getLogger() mylogger.Log("a key", "a value") } Reference https://github.com/go-kit/kit/tree/master/log Written with…

Reactive Extensions: Asynchronous Reactive Systems

Reactive Extensions: Asynchronous Reactive Systems Reactive Extension is a paradigm to develop systems using the react model. It’s an event-driven state machine for functions. It’s possible to represent either synchronous or asynchronous communication with Reactive Extensions. All we need is a message broker, producer of events (Observable), and consumers(Observer). Typically, the consumer processes an event…

%d bloggers like this: