Skip to content

Instantly share code, notes, and snippets.

@AlexTalker
AlexTalker / mock_open.pl
Created April 7, 2017 18:02 — forked from ernix/mock_open.pl
Mock(override) built-in `open` function in perl.
#
# http://perldoc.perl.org/CORE.html#OVERRIDING-CORE-FUNCTIONS
# > To override a built-in globally (that is, in all namespaces), you need to
# > import your function into the CORE::GLOBAL pseudo-namespace at compile
# > time:
# >
# > BEGIN {
# > *CORE::GLOBAL::hex = sub {
# > # ... your code here
# > };
use std::sync::mpsc::{channel, Sender};
use std::sync::Mutex;
use std::thread;
#[derive(Debug)]
enum Message { A, B }
struct Request;
struct Response;
struct IronError;
@AlexTalker
AlexTalker / main.cpp
Last active August 29, 2015 14:02 — forked from anonymous/main.cpp
int main()
{
ifstream in1("in1.txt");
vector<int> mas;
int m=0;
while(!in1.eof())
{
in1>>m;
mas.push_back(m);
}