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 SocketServer | |
SocketServer.TCPServer.allow_reuse_address = True | |
class PingHandler(SocketServer.StreamRequestHandler): | |
""" | |
Simple ping service. | |
Dziedziczysz po StreamRequestHandler i potem mozesz robic | |
self.rfile.readline(). |
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
def singleton(cls): | |
instances = {} | |
def getinstance(): | |
if cls not in instances: | |
instances[cls] = cls() | |
return instances[cls] | |
return getinstance | |
@singleton | |
class MyClass: |
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
TODO: reprezentacja krawędzi w model i network musi umożliwiać jednoznaczne | |
mapowanie portów. Jak nazwać krawędzie? Czy wprowadzić porty już w | |
konfiguracji model? | |
TODO: a jak w model przedstawić port, w sytuacji, kiedy trzeba na nim założyć | |
jakąś konfigurację (np. packet-loss). | |
#v+ | |
model Foo | |
{ |
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
def read(self, model, network, mapping, schedule): | |
# local variables for each configuration file | |
ctx_model = {} | |
ctx_network = {} | |
ctx_mapping = {} | |
ctx_schedule = {} | |
# resources can be defined in any configuration part | |
glob_resources = Resources.public_functions | |
def setup_glob(module): |
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
#include <iostream> | |
#include <string> | |
template <typename T, typename T_Infix> | |
struct InfixProxy { | |
T const & lhs_; | |
T_Infix const & oper_; | |
InfixProxy(T const & lhs, T_Infix const & oper) | |
: lhs_(lhs), oper_(oper) |
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
#include <iostream> | |
namespace ns1 { | |
template <typename T, typename U> | |
int operator+(const T&, const U&) | |
{ | |
std::cout << "ns1::operator+" << std::endl; | |
return 1; | |
} |
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
\documentclass[00-praca-magisterska.tex]{subfiles} | |
\begin{document} | |
\chapter{Moduł Arete Master} | |
Prezentujemy tutaj szczegółowy opis modułu Master. Jest to moduł zarządzający | |
definicją i wykonywaniem testów. Jest on też interfejsem użytkownika do naszego | |
narzędzia -- za jego pomocą użytkownik wykonuje testy. |
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
type Disc = Int | |
type Tower = [Disc] | |
data Towers = Towers | |
{ towerA :: Tower | |
, towerB :: Tower | |
, towerC :: Tower | |
} deriving (Show) | |
data TowerName = A | B | C | |
deriving (Show) |
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.Monad.State | |
type Disc = Int | |
type Tower = [Disc] | |
data Towers = Towers | |
{ towerA :: Tower | |
, towerB :: Tower | |
, towerC :: Tower | |
} deriving (Show) |
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.Monad.State | |
type Disc = Int | |
type Tower = [Disc] | |
data Towers = Towers | |
{ towerA :: Tower | |
, towerB :: Tower | |
, towerC :: Tower | |
} deriving (Show) |
OlderNewer