If callbacks aren't placed on an event queue, multiple threads begin to share access to someObj.
Object someObj = ...;
Runnable callback = new Runnable(){ someObj.doSomething(); };
executor.submit(new Runnable() {
public void run() {
If callbacks aren't placed on an event queue, multiple threads begin to share access to someObj.
Object someObj = ...;
Runnable callback = new Runnable(){ someObj.doSomething(); };
executor.submit(new Runnable() {
public void run() {
#!/usr/bin/env ruby | |
# This Ruby script will extract data from a Basecamp "backup" XML file and import | |
# it into Redmine. | |
# | |
# You must install the Nokogiri gem, which is an XML parser: sudo gem install nokogiri | |
# | |
# This script is a "code generator", in that it writes a new Ruby script to STDOUT. | |
# This script contains invocations of Redmine's ActiveRecord models. The resulting | |
# "import script" can be edited before being executed, if desired. |
(function () { | |
// IndexedDB | |
function BrowserType() { | |
var n = navigator.appName; | |
var ua = navigator.userAgent; | |
var tem; | |
var m = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); | |
if (m && (tem = ua.match(/version\/([\.\d]+)/i)) != null) m[2] = tem[1]; | |
m = m ? [m[1], m[2]] : [n, navigator.appVersion, '-?']; |
<!doctype html> | |
<html> | |
<head> | |
<title>Polymer and RequireJS</title> | |
<script src="http://polymer.github.io/cdn/polymer.min.js"></script> | |
</head> | |
<body> | |
<!-- #foo --> | |
<div id="foo">the foo has no joy.</div> | |
They are not composable. If I use yo webapp
and make some progress, I can't later do yo angular
or yo requirejs
This also leads to a bunch of out of date generators. If the "yeoman style" changes I can't be certain that all the generators that are out there have updated as well.
Generators should be additive. yo angular
should depend on yo webapp
, for example. This way when updates are made to the webapp
generator then the angular
generator (or any generator that builds on webapp
) will also get them.
public class Temp { | |
public static final ScheduledExecutorService s = Executors.newScheduledThreadPool(1); | |
public static void main(String[] args) throws InterruptedException { | |
final ConnectableObservable<Long> source = Observable.create(new OnSubscribe<Long>() { | |
@Override | |
public void call(final Subscriber<? super Long> t1) { | |
final AtomicInteger n = new AtomicInteger(0); | |
s.scheduleAtFixedRate(new Runnable() { |
With the advent of regulation, app development has gotten an order of magnitude more complicated. Every time we interact with a user we have to check that we're not violating any agreements (email opt out, cookie opt out, only using their phone number for 2fac, etc) made with that user. In addition, functions that used to apply to all users now have restrictions inside of them, causing them to only apply to certain users.
Take sending an email to a user as an example. In the infancy of your app it may have been ok to email all of your users but as you grew you needed to give users a way to opt out of emails. The simplest approach here is to add a line in the email out code that checks if the user is allowed to receive emails.
function sendEmailTo(user) {
if (!canReceiveEmails(user)) {
return;
I hereby claim:
To claim this, I am signing this object:
UUIDs
are nice in that they're globally unique. They have problems when it comes to storage (take up > 64 bits)
and performance (id space is random, leading to poor usage of B-trees).
See performance analysis here: https://www.percona.com/blog/2019/11/22/uuids-are-popular-but-bad-for-performance-lets-discuss/
We can, however, generate UUIDs that fit into the unsigned 64 bit integer
space and are prefixed
by timestamp to keep queries on recent data performant.
Below is a method to generate short UUIDs in the browser.
Example of a storage agnostic schema layer that can drive queries, graphql, privacy, mutations and other concerns. We'll call it Ent (short for entity).
A Facebook team from Tel Aviv did open-source an Ent framework for Go. It is heavily inspired by the framework used by the rest of the company except that EntGo:
I never got around to asking them why they didn't use the existing framework.