Skip to content

Instantly share code, notes, and snippets.

@Test
void testSignal() throws InterruptedException, IOException {
AtomicReference<Thread> threadRef = new AtomicReference<>();
Thread thread = new Thread(() -> {
Signal.handle(new Signal("USR2"), new SignalHandler() {
@Override
public void handle(Signal sig) {
System.out.println("Received signal: " + sig.getName());
var stackTrace = threadRef.get().getStackTrace();
for (var el : stackTrace) {
use std::{io, net};
trait RawSysCallsTraitOrSomething {
fn bind_udp(&self, addr: net::SocketAddr) -> io::Result<UdpSocket> {}
fn set_ttl_udp(&self, socket: usize, ttl: u32) -> io::Result<()> {}
fn read(&self, socket: usize, buf: &mut [u8]) -> io::Result<usize> {}
}
cfg_syscall! {
use std::{io, net};
trait RawSysCallsTraitOrSomething {
fn bind_udp(&self, addr: net::SocketAddr) -> io::Result<UdpSocket> {}
fn set_ttl_udp(&self, socket: usize, ttl: u32) -> io::Result<()> {}
fn read(&self, socket: usize, buf: &mut [u8]) -> io::Result<usize> {}
}
cfg_syscall! {
type UdpSocket = udp::UdpSocket;
//! Shim to allow using Rusoto with the new Hyper
use bytes::Bytes;
use futures::future::TryFutureExt;
use futures::TryStreamExt;
use futures::{compat::*, lock::Mutex};
use futures01;
use http::header::{HeaderName, HeaderValue};
use http::{HeaderMap, Method};
use hyper;
use rusoto_core::{
(ns routing
(:require [goog.History :as h]
[om.next :as om]
[taoensso.timbre :as log]
[fulcro.client.mutations :as m]
[goog.events :as e]
[fulcro.client.core :refer [FulcroApplication]]
[clojure.string :as s])
(:import [goog History]))
17-01-10 21:26:17 pyroclast-peer.master-3254141342-g965r ERROR [onyx.peer.peer-group-manager:209] - Error applying log entry: {:fn :prepare-join-cluster, :args {:joiner #uuid "1052ab86-7768-48f5-addb-b098e0566104"}, :peer-parent #uuid "1052ab86-7768-48f5-addb-b098e0566104", :entry-parent 498, :message-id 500, :created-at 1484083577513} to {:exempt-tasks {#uuid "b3214b61-a47b-4638-a2ed-9db4c8fd042d" [], #uuid "bbd12879-e1f4-4aa6-86ad-99be25375ec1" [], #uuid "ad3be636-8f8b-490c-a955-77e842b4cbb2" [], #uuid "a1d53b4f-1ede-400b-b656-211ae2f9e41a" [], #uuid "c3344dd0-a939-45cc-9467-0ff43d4ed84c" [], #uuid "2e1000fc-8321-4f1e-93a1-a8c6fa48adc2" [], #uuid "400d54df-812e-46c5-95b6-60d680662e0b" [], #uuid "cfddbdb8-9bc9-4b73-b543-f40a6a142b06" [], #uuid "5e5da10e-86fb-4a1d-9145-81ab0b899074" [], #uuid "8dc017d3-1133-4f70-996f-6b52d05b2d1e" [], #uuid "fbdfe33b-d3eb-439b-8fae-5294a71beb24" [], #uuid "0f445b13-a4a5-4491-8feb-dc3215d3e101" [], #uuid "909256b5-00bf-4736-8e04-6675778524e7" [], #uuid "0a3bf02d-ff1a-4408-aafd
{:fn :prepare-join-cluster, :args {:joiner #uuid "1052ab86-7768-48f5-addb-b098e0566104"}, :peer-parent #uuid "1052ab86-7768-48f5-addb-b098e0566104", :entry-parent 498, :message-id 500, :created-at 1484083577513}
=>
{:exempt-tasks {#uuid "b3214b61-a47b-4638-a2ed-9db4c8fd042d" [], #uuid "bbd12879-e1f4-4aa6-86ad-99be25375ec1" [], #uuid "ad3be636-8f8b-490c-a955-77e842b4cbb2" [], #uuid "a1d53b4f-1ede-400b-b656-211ae2f9e41a" [], #uuid "c3344dd0-a939-45cc-9467-0ff43d4ed84c" [], #uuid "2e1000fc-8321-4f1e-93a1-a8c6fa48adc2" [], #uuid "400d54df-812e-46c5-95b6-60d680662e0b" [], #uuid "cfddbdb8-9bc9-4b73-b543-f40a6a142b06" [], #uuid "5e5da10e-86fb-4a1d-9145-81ab0b899074" [], #uuid "8dc017d3-1133-4f70-996f-6b52d05b2d1e" [], #uuid "fbdfe33b-d3eb-439b-8fae-5294a71beb24" [], #uuid "0f445b13-a4a5-4491-8feb-dc3215d3e101" [], #uuid "909256b5-00bf-4736-8e04-6675778524e7" [], #uuid "0a3bf02d-ff1a-4408-aafd-93023441ef53" [], #uuid "af4270a7-09da-4fae-bc97-1be4b7e037f9" [], #uuid "ef31f32c-62c3-49f6-8c65-f5278d2fbd08" [], #uuid "b
const webpack = require('webpack');
const path = require('path');
const BUILD_DIR = path.resolve(__dirname, 'resources', 'public', 'webpack');
const APP_DIR = path.resolve(__dirname, 'src', 'js');
const config = {
entry: `${APP_DIR}/main.js`,
module: {
loaders: [
(ns cards.query-key-appstate-bug
(:require [untangled.client.cards :as uccards :include-macros true]
[devcards.core :as dc :refer-macros [defcard]]
[untangled.client.core :as uc :refer [initial-state InitialAppState]]
[om.next :as om :refer [defui]]
[om.dom :as dom]
[untangled.client.mutations :as m]
[clojure.string :as string]
[untangled.client.logging :as log]))
(let [s (re-seq #"\d+" "401-477-0248")]
(println (reduce (fn [acc v]
(if (and (seq acc)
(every? (fn [pastv]
(= pastv ["" nil])) (take-last 10 acc)))
(reduced acc)
(conj acc v))) [] s)))