Datomic is ACID.
Single writer.
| interface MyCustomType<T> { | |
| prop: Promise<T> | |
| } | |
| interface MyBlaBlaType { | |
| prop: string | |
| } | |
| interface MyObj { | |
| [key: string]: (...args: any) => any |
| var fs = require('fs'); | |
| var csv = require('fast-csv'); | |
| var math = require('mathjs'); | |
| var R = require('ramda'); | |
| var colors = require('colors/safe'); | |
| var process = require('process'); | |
| var stream = fs.createReadStream("wines.csv"); | |
| var yKey = 'Class'; |
| import React, { Component } from "react"; | |
| export default class EventViewer extends Component { | |
| constructor() { | |
| super(); | |
| this.state = { events: [] }; | |
| } | |
| componentDidMount() { |
| version: '3' | |
| services: | |
| rabbitmq: | |
| container_name: rabbitmq | |
| image: rabbitmq:3.6.10-management-alpine | |
| environment: | |
| RABBITMQ_DEFAULT_USER: rmq | |
| RABBITMQ_DEFAULT_PASS: pass | |
| restart: on-failure |
| module Main where | |
| import Control.Monad.ST | |
| import qualified Data.STRef as STR | |
| import qualified Data.Array.ST as STArray | |
| import qualified Data.Array as Arr | |
| import qualified Data.Array.MArray as MA | |
| untilM :: (Monad m) => m Bool -> m a -> m () |
| etcd2 --name node1 --initial-advertise-peer-urls 'http://207.154.233.166:2380' \ | |
| --listen-peer-urls 'http://207.154.233.166:2380' \ | |
| --listen-client-urls 'http://207.154.233.166:2379,http://127.0.0.1:2379' \ | |
| --advertise-client-urls 'http://207.154.233.166:2379' \ | |
| --initial-cluster-token etcd-cluster-1 \ | |
| --initial-cluster 'node1=http://207.154.233.166:2380,node2=http://207.154.237.27:2380' \ | |
| --initial-cluster-state new |
| func cycle<A>(coll: [A]) -> AnyIterator<A> { | |
| var cursor = 0 | |
| let infiniteItems = AnyIterator { () -> A in | |
| let itemToReturn = coll[cursor] | |
| cursor += 1 | |
| if (cursor > coll.count - 1) { | |
| cursor = 0 | |
| } | |
| return itemToReturn | |
| } |
Datomic is ACID.
Single writer.
| When a generator is good solution for repetitious code, a better solution is to abstract it into a simpler API. |
| var queue = function () { | |
| var tasksToExecute = [], | |
| lastExecutedIndex = -1, | |
| $deferred, taskFailed = false; | |
| function reset() { | |
| lastExecutedIndex = -1; | |
| taskFailed = false; | |
| } | |
| function pop() { | |
| lastExecutedIndex = lastExecutedIndex + 1; |