React hooks and “setInterval”

If you've ever come across having to use setInterval within react hooks you probably hit a wall where the component just doesn't act as it should... For example, we might naively code something like this: import React, { useState } from "react"; import "./styles.css"; export default function App() { const [counter, changeCounter] = useState(0); setInterval(() … Continue reading React hooks and “setInterval”

Singleton patterns in Python’s AIO-HTTP

AIO-HTTP is a web server framework built on python 3's async capabilities. The performance benefits of using async are widely documented online - but suffice to say you can get performance from Python which is on par with NodeJS! If you're coming from a Java (or similar) background, one of the questions you'll probably come … Continue reading Singleton patterns in Python’s AIO-HTTP

Nugget Post: Running NiFi behind an SSL reverse proxy

Scenario User --- (HTTPS) ---> NGINX Reverse Proxy --- (HTTP) ---> NiFi Typical NGINX Reverse Proxy config: location /nifi { proxy_set_header Host $http_host; add_header "Access-Control-Allow-Credentials" "true"; proxy_pass http://127.0.0.1:9900; } Note: the proxy_set_header Host is necessary otherwise NiFi will return "localhost" or "127.0.0.1" in it's links and you'll end up with a bunch of HTTP 404 … Continue reading Nugget Post: Running NiFi behind an SSL reverse proxy

Practical use case for Javascript Function Properties (ReactJS)

TL;DR : Function properties are useful when meta-programming, specifically avoiding minification and mangling of function names The new UI for CyberSift consists of a number of "widgets" which are interchangeable and can be moved around the screen to cater for a user's preferred layout. Heavily inspired by Elastic's Kibana, you can see the end result … Continue reading Practical use case for Javascript Function Properties (ReactJS)

Kotlin Coroutines – Flow parallel processing

Meant as an alternative to the Kotline Coroutine "Channel", a "Flow" is another way of enabling communication between two co-routines. The difference between the two is essentially that a channel is "hot" (i.e. starts as soon as it is declared), while a flow is "cold" (i.e. only starts when required (or "subscribed to" in reactive … Continue reading Kotlin Coroutines – Flow parallel processing

Machine Learning: Oversampling vs Sample Weighting

How do you "influence" a ML model? For example, imagine a scenario where you'd like to detect anomalies in a given data set. You reach for your favourite algorithm - in my case Isolation Forest: Our example output from Isolation Forest It does fine for most cases, except that one data point which invariably gets … Continue reading Machine Learning: Oversampling vs Sample Weighting

Speeding up Spring MVC with CompletableFuture

Recently we're beginning to see a shift towards asynchronous/reactive workloads within the Spring ecosystem, especially since the release of WebFlux and the more recent support for Kotlin co-routines. However, both these require moving towards monos, fluxes, and libraries that support these reactive constructs. Support for reactive paradigms is steadily increasing however many of us are … Continue reading Speeding up Spring MVC with CompletableFuture