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
class QueueWithTimeout | |
def initialize | |
@mutex = Mutex.new | |
@queue = [] | |
@recieved = ConditionVariable.new | |
end | |
def <<(x) | |
@mutex.synchronize do | |
@queue << x |
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
/dts-v1/; | |
/ { | |
videocore { | |
clock_routing { | |
vco@PLLD { freq = <2000000000>; }; | |
chan@DPER { div = <8>; }; // APER will be 500MHz | |
}; // clock routing | |
pins_bplus { | |
pin_config { |
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
/* automatically generated by rust-bindgen */ | |
#![crate_type="staticlib"] | |
#[derive(Copy)] | |
pub struct StructUnnamed9 { | |
pub _bindgen_bitfield_1_: u32, | |
pub _bindgen_bitfield_2_: u32, | |
pub _bindgen_bitfield_3_: u32, | |
pub _bindgen_bitfield_4_: u32, |
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
def read_with_timeout(io_like, read_len, timeout) | |
timeout_time = Time.now + timeout | |
data = "" | |
loop do | |
begin | |
result = io_like.read_nonblock(read_len - data.length) | |
puts data | |
data += result | |
if block_given? |
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
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import System.Timeout | |
import Control.Monad | |
import Control.Concurrent | |
import Control.Concurrent.MVar | |
send msg = do | |
--dummy stub | |
print msg |
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 Data.Tree | |
import Data.Traversable | |
import Control.Monad.State hiding (mapM) | |
import Prelude hiding (mapM) | |
test :: (Tree Integer, Integer) | |
test = markOrdering (Node undefined [Node undefined [Node undefined []], Node undefined []]) 0 | |
markOrdering :: (Num t1) => Tree t -> t1 -> (Tree t1, t1) |
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 Control.Applicative | |
import Control.Monad | |
import Data.Foldable | |
import Data.Traversable | |
import Data.Monoid | |
import Data.Maybe | |
import Prelude hiding (head, tail) |
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
{-# LANGUAGE FlexibleContexts #-} | |
module Main where | |
import Language.Gator hiding (sequence, mapM) | |
import Data.FixedList | |
import qualified Data.FixedList | |
import Control.Applicative | |
import Data.Traversable | |
import Prelude hiding (sequence, mapM) |
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
module Main where | |
import Control.Monad | |
import Data.IORef | |
--import Debug.Trace | |
import System.Mem.Weak | |
import qualified Data.Map as M | |
import Prelude hiding (lookup) |
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
class GameTcpSocket : public QTcpSocket | |
{ | |
const int timeout = 2 * 1000; | |
GameTcpSocket(QObject* parent = 0) : QTcpSocket(parent) | |
{ | |
} | |
template<class T> GameTcpSocket& operator<< (T data) | |
{ | |
QByteArray block; |
OlderNewer