This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup | |
val rejectionHandler = RejectionHandler.default | |
val logDuration = extractRequestContext.flatMap { ctx => | |
val start = System.currentTimeMillis() | |
// handling rejections here so that we get proper status codes | |
mapResponse { resp => | |
val d = System.currentTimeMillis() - start | |
logger.info(s"[${resp.status.intValue()}] ${ctx.request.method.name} ${ctx.request.uri} took: ${d}ms") | |
resp | |
} & handleRejections(rejectionHandler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Silly: | |
@property | |
def silly(self) | |
print("You are getting silly") | |
return self._silly | |
@silly.setter | |
def silly(self, value): | |
print("You are making silly {}".format(value)) | |
self._silly = value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define __USE_GNU | |
#include <search.h> | |
#include <sys/time.h> | |
#define NEL 512 | |
typedef struct | |
{ | |
char keyword[256]; |