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
#! /bin/bash | |
from= | |
to= | |
if [ -z "$1" ] | |
then | |
echo "Error: no arguments" | |
exit 0 | |
else |
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 <iterator> | |
#include <string> | |
#include <cassert> | |
template<typename T> | |
struct Only | |
{ | |
struct iterator : public std::iterator<std::forward_iterator_tag, T> | |
{ | |
iterator(Only* only, bool isEnd = false) : _only(only), _isEnd(isEnd) { |
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
// Copyright (c) 2016 Roman Chistokhodov | |
// Distributed under the Boost Software License, Version 1.0. | |
// http://www.boost.org/LICENSE_1_0.txt | |
/* | |
* Q: Why? | |
* A: The idea is to use STL iterators to iterate over zero terminated string without calling of strlen to evaluate the end iterator. | |
* | |
* Q: Why not random access? | |
* A: Currently the 'end' iterator is implemented as NULL and it's not obvious how it should work with '-' (minus) operator, |
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
// Copyright (c) 2016 Roman Chistokhodov | |
// Distributed under the Boost Software License, Version 1.0. | |
// http://www.boost.org/LICENSE_1_0.txt | |
#if (defined(__linux__) && !defined __ANDROID__) || defined (__FreeBSD__) || defined (__NetBSD__) || defined(__OpenBSD__) | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <sys/resource.h> | |
#include <unistd.h> | |
#include <fcntl.h> |
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
// Copyright (c) 2016 Roman Chistokhodov | |
// Distributed under the Boost Software License, Version 1.0. | |
// http://www.boost.org/LICENSE_1_0.txt | |
#include <cstring> | |
#include <cstdlib> | |
#include <cassert> | |
#include <iostream> | |
#include <string> |
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
// Copyright (c) 2016 Roman Chistokhodov | |
// Distributed under the Boost Software License, Version 1.0. | |
// http://www.boost.org/LICENSE_1_0.txt | |
#include <stdio.h> | |
#include <stddef.h> | |
#if defined(__unix__) || defined(__APPLE__) | |
#include <unistd.h> | |
#endif |
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
/** | |
* Moving files to trashcan on Windows and Freedesktop. | |
* Copyright: | |
* Roman Chistokhodov, 2016 | |
* License: | |
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0). | |
*/ | |
import std.path; | |
import std.string; |
NewerOlder