(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This guide provides updated instructions for pairing Bluetooth devices (such as keyboards or mice) in a dual-boot environment with Linux Ubuntu and Windows 10/11, incorporating community feedback and suggestions.
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.
This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea
gatsby-config.js
first.require('ts-node').register()
which registers a TypeScript evaluator that will be used when Gatsby
reads all other API Javascript files. In other words, we only need to do
this once in our entire codebase and not in other Gatsby files like
gatsby-node.js
.gatsby-config.js
re-exports all the exported variables available
in gatsby-config.ts
.// Example: | |
JavaScript.load("/javascripts/something.js"); | |
// With callback (that’s the good thing): | |
JavaScript.load("http://www.someawesomedomain.com/api.js", function() { | |
API.use(); // or whatever api.js provides ... | |
}); |
-- | A “flushing” 'stream', with an additional coalgebra for flushing the | |
-- remaining values after the input has been consumed. This also allows us to | |
-- generalize the output away from lists. | |
fstream | |
:: (Cursive t (XNor a), Cursive u f, Corecursive u f, Traversable f) | |
=> Coalgebra f b -> (b -> a -> b) -> Coalgebra f b -> b -> t -> u | |
fstream ψ g ψ' = go | |
where | |
go c x = | |
let fb = ψ c |
Every application ever written can be viewed as some sort of transformation on data. Data can come from different sources, such as a network or a file or user input or the Large Hadron Collider. It can come from many sources all at once to be merged and aggregated in interesting ways, and it can be produced into many different output sinks, such as a network or files or graphical user interfaces. You might produce your output all at once, as a big data dump at the end of the world (right before your program shuts down), or you might produce it more incrementally. Every application fits into this model.
The scalaz-stream project is an attempt to make it easy to construct, test and scale programs that fit within this model (which is to say, everything). It does this by providing an abstraction around a "stream" of data, which is really just this notion of some number of data being sequentially pulled out of some unspecified data source. On top of this abstraction, sca
import java.util.concurrent.atomic.AtomicInteger | |
import java.util.concurrent.{Executors, TimeUnit} | |
import akka.actor.{ActorSystem, Props} | |
import akka.routing.ConsistentHash | |
import akka.stream.actor._ | |
import akka.stream.scaladsl.{Flow, GraphDSL, RunnableGraph, Sink, Source} | |
import akka.stream.{ActorMaterializer, ClosedShape, ThrottleMode} | |
import com.kifi.franz.{MessageId, SQSMessage} |