print('Hello World')
import sys
const csvStringToArray = strData => | |
{ | |
const objPattern = new RegExp(("(\\,|\\r?\\n|\\r|^)(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|([^\\,\\r\\n]*))"),"gi"); | |
let arrMatches = null, arrData = [[]]; | |
while (arrMatches = objPattern.exec(strData)){ | |
if (arrMatches[1].length && arrMatches[1] !== ",")arrData.push([]); | |
arrData[arrData.length - 1].push(arrMatches[2] ? | |
arrMatches[2].replace(new RegExp( "\"\"", "g" ), "\"") : | |
arrMatches[3]); | |
} |
#include <assert.h> | |
#include <array> | |
#include <functional> | |
#include <numeric> | |
template<typename T, int N> | |
class MultiArrayBase | |
{ | |
public: | |
MultiArrayBase(T* data, const std::array<int, N>& dim) |
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim:fenc=utf-8 | |
# | |
# Copyright © 2018 beebird | |
# | |
# Distributed under terms of the MIT license. | |
""" |
# gem install multi_json json yajl-ruby oj benchmark-memory | |
require 'multi_json' | |
require 'json' | |
require 'yajl' | |
require 'oj' | |
require 'benchmark' | |
require 'benchmark-memory' | |
hash1 = { |
type Set struct { | |
list map[int]struct{} //empty structs occupy 0 memory | |
} | |
func (s *Set) Has(v int) bool { | |
_, ok := s.list[v] | |
return ok | |
} |
m = require("./objtest2.js"); | |
h = m.hashobj({ | |
name: "Kent", | |
address: "Somewhere in Space and Time", | |
city: "Specificity", | |
state: "CT" | |
}) | |
console.log(h.hash.slice(0, 4)) |
module ActiveRecord::Tasks::DatabaseTasks | |
class <<self | |
prepend Module.new { | |
def migrate(environment = env) | |
each_current_configuration(environment) { |configuration| | |
begin | |
ActiveRecord::Base.establish_connection(configuration) | |
super() | |
ensure | |
ActiveRecord::Base.establish_connection(environment.to_sym) |
$ cat test.json | |
json='{ "timestamp" : 1484825894873, "test" : "test"}' | |
ab -c 10 -n 1000 -p test.json -T application/x-www-form-urlencoded https://example.com/test | |
#https://prabuddha.me/apache-bench-ab-post-json-api/ |
function returnParsedUrl() { | |
var url = request.url.trim(); | |
var firstArray = url.split('{{'); | |
var listOfProperties = [""]; | |
for (i = 1; i < firstArray.length; i++) { | |
listOfProperties[i - 1] = firstArray[i].substring(0, firstArray[i].indexOf("}}")); | |
} | |
var completeUrl = ""; | |
for (i = 0; i < firstArray.length; i++) { | |
if (firstArray[i].includes("}}")) { |