This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
type Button struct { | |
Clicked *sync.Cond |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
type MyError string | |
func (e MyError) Error() string { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are a great Elasticsearch expert. | |
I will provide an SQL query on a table named "ES_TABLE". | |
You will convert that SQL query to an ElasticSearch query. | |
SQL Query: | |
``` | |
SELECT f1, f2, SUM(f3) | |
FROM ES_TABLE | |
WHERE f1 BETWEEN 'a' AND 'b' | |
GROUP BY f1, f2 | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestOptional { | |
private sealed interface MyOptional<T> { | |
MyOptional<?> EMPTY = new MyEmpty<>(); | |
boolean hasValue(); | |
T get(); | |
static <T> MyOptional<T> of(T t) { | |
return new MyJust<>(t); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AlonzoGenesisFile": "testnet-alonzo-genesis.json", | |
"AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874", | |
"ApplicationName": "cardano-sl", | |
"ApplicationVersion": 0, | |
"ByronGenesisFile": "testnet-byron-genesis.json", | |
"ByronGenesisHash": "96fceff972c2c06bd3bb5243c39215333be6d56aaf4823073dca31afe5038471", | |
"LastKnownBlockVersion-Alt": 0, | |
"LastKnownBlockVersion-Major": 3, | |
"LastKnownBlockVersion-Minor": 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.Text as T | |
import Playground.Contract | |
import Plutus.Contract | |
import PlutusTx.Prelude | |
import qualified Prelude as Haskell | |
-- | A 'Contract' that logs a message. | |
hello :: Contract () EmptySchema T.Text () | |
hello = logInfo @Haskell.String "Hello, world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newtype MyCont r a = MyCont ((a -> r) -> r) | |
mycont :: MyCont r a -> (a -> r) -> r | |
mycont (MyCont f) = f | |
instance Functor (MyCont r) where | |
fmap f (MyCont ma) = undefined | |
instance Applicative (MyCont r) where | |
pure a = undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "org.apache.commons.logging.impl.LogFactoryImpl", | |
"allDeclaredConstructors": true, | |
"allPublicConstructors": true, | |
"allDeclaredMethods": true, | |
"allPublicMethods": true, | |
"allDeclaredClasses": true, | |
"allPublicClasses": true | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.mirko; | |
public class Main { | |
static volatile boolean condition = true; | |
public static void main(String ... args) throws Exception { | |
new Thread(new AnotherThread()).start(); | |
if (condition) { | |
methodA(); | |
} | |
} |
NewerOlder