This file contains hidden or 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 Publisher struct { | |
mutex sync.RWMutex |
This file contains hidden or 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
do | |
balanceA <- newTVarIO (400 :: Int) | |
balanceB <- newTVarIO (900 :: Int) | |
replicateM_ 100 . forkIO $ do | |
atomically $ do | |
modifyTVar balanceA (\x -> x + 2) | |
modifyTVar balanceB (\x -> x - 2) | |
readTVarIO balanceA >>= print | |
readTVarIO balanceB >>= print |
This file contains hidden or 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 Control.Applicative | |
import System.Environment | |
import System.Exit | |
import System.Random | |
main = getArgs >>= parseArgs | |
-- Exit with success. | |
exit :: IO a | |
exit = exitWith ExitSuccess |
This file contains hidden or 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 NotifyCollectionChangedEventArgs<T> | |
{ | |
private readonly NotifyCollectionChangedEventArgs _args; | |
public NotifyCollectionChangedEventArgs(NotifyCollectionChangedEventArgs args) | |
{ | |
_args = args; | |
} | |
public IEnumerable<T> NewItems => _args.NewItems?.Cast<T>() ?? Enumerable.Empty<T>(); |
This file contains hidden or 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
using System; | |
using System.Reactive.Disposables; | |
using System.Reactive.Linq; | |
internal sealed class ObservableAdresses : IDisposable | |
{ | |
private readonly IDisposable _connection; | |
private bool _disposed; | |
public ObservableAdresses(IPoller poller) |
This file contains hidden or 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
{-# LANGUAGE GADTs, TypeOperators, ScopedTypeVariables #-} | |
import Data.Eq.Type | |
import Unsafe.Coerce | |
data Expr e a where | |
Sum :: Expr [x] Int -> Expr [x] Int | |
-- | This is almost ADT, x is existetial. | |
data Expr' e a where |
This is the full version of the thread for opencart#1286, archived from notification emails.
The discussion has since been deleted almost entirely by OpenCart's developer.
Everyone who posted in it has also been blocked from the OpenCart repo.