config/server.properties
broker.id = 1
listeners=PLAINTEXT://:9093
log.dirs=/tmp/broker1_logs
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
* Install Java8 | |
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer | |
** Install SBT | |
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 |
/** | |
The MIT License (MIT) | |
Copyright (c) 2013 Jean Helou | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
1) install boost | |
brew install boost | |
it will ask to create link. just follow the instruction | |
2) install libevent | |
brew install libevent | |
Array.prototype.flatMap = function(lambda) { | |
return Array.prototype.concat.apply([], this.map(lambda)); | |
}; | |
Example | |
[0, 1, 2, 3, 4, 5].flatMap(function(x) { | |
return [x, x + 1]; | |
}); |
package com.agilogy.spray.cors | |
import spray.http.{HttpMethods, HttpMethod, HttpResponse, AllOrigins} | |
import spray.http.HttpHeaders._ | |
import spray.http.HttpMethods._ | |
import spray.routing._ | |
// see also https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS | |
trait CORSSupport { | |
this: HttpService => |
{"help": "https://catalog.data.gov/api/3/action/help_show?name=package_search", "success": true, "result": {"count": 48, "sort": "views_recent desc", "facets": {}, "results": [{"license_title": "License not specified", "maintainer": "New Media", "relationships_as_object": [], "private": false, "maintainer_email": "[email protected]", "num_tags": 5, "id": "59694770-b6b6-4ae0-a4b9-4ae69c0be2f6", "metadata_created": "2016-07-02T10:06:26.199575", "metadata_modified": "2016-07-02T10:06:26.199575", "author": null, "author_email": null, "state": "active", "version": null, "creator_user_id": "47303a9e-1187-4290-85a3-1fc02dc49e4a", "type": "dataset", "resources": [{"cache_last_updated": null, "package_id": "59694770-b6b6-4ae0-a4b9-4ae69c0be2f6", "webstore_last_updated": null, "id": "3a8a0ad1-19e7-4153-bb2f-d70cf88aaaf8", "size": null, "state": "active", "hash": "", "description": "", "format": "CSV", "tracking_summary": {"total": 32, "recent": 1}, "last_modified": null, "url_type": null, "no_real_name": "True", |
var hexcase = 0; | |
var b64pad = ""; | |
var chrsz = 8; | |
function hex_md5(A) { | |
return binl2hex(core_md5(str2binl(A), A.length * chrsz)) | |
} | |
function b64_md5(A) { | |
return binl2b64(core_md5(str2binl(A), A.length * chrsz)) | |
} | |
function str_md5(A) { |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Paths; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
public class ReadCSV { |