UPD: задачи и решения переехали:
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 com.sun.net.httpserver.HttpExchange; | |
import com.sun.net.httpserver.HttpHandler; | |
import com.sun.net.httpserver.HttpServer; | |
import java.io.*; | |
import java.net.InetSocketAddress; | |
import java.nio.charset.StandardCharsets; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.*; |
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 gettext | |
lang = gettext.translation("wtf") | |
_ = lang.gettext | |
print(_("Program started")) # prints translated message | |
def work_hard(): | |
print(_("Working hard")) # raises UnboundLocalError: local variable '_' referenced before assignment | |
# |
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 java.util.Iterator; | |
import java.util.NoSuchElementException; | |
final class Tree<T> { | |
private final T elem; | |
private final Tree<T> parent; | |
private Tree(T elem, Tree<T> parent) { | |
this.elem = elem; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <stdbool.h> | |
typedef enum eChildKind { | |
LEFT, | |
RIGHT, | |
} ChildKind; |
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
if [[ -z "$1" ]]; then | |
echo No input file | |
exit | |
fi | |
input=$1 | |
middle=`mktemp -t pdf_2on1`.pdf | |
if [[ -z "$2" ]]; then | |
name="${input%.*}" |
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
@echo OFF | |
REM watch is a GNU command-line tool that runs the specified command repeatedly | |
REM and displays the output on stdout so you can watch it change over time. | |
REM By default, the command is run every two seconds, although this is adjustable with the -n secs argument. | |
if x%1==x (call :usage %0 %* && exit /b 1) | |
if x%1==x-n ( | |
if x%2==x (call :usage %0 %* && exit /b 1) |
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
for f in "$@" | |
do | |
if [ "`GetFileInfo -ae "$f"`" == "0" ] | |
then | |
SetFile -a E "$f" | |
else | |
SetFile -a e "$f" | |
fi | |
done |
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
REM Usage example: | |
REM | |
REM | A | B | | |
REM --+-----+-----+ | |
REM 1 | 111 | aaa | | |
REM 2 | 222 | bbb | | |
REM 3 | 222 | ccc | | |
REM 4 | 333 | ddd | | |
REM 5 | 333 | eee | |
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
// Solution for http://haskell98.blogspot.ru/2014/10/blog-post_10.html | |
// Results at http://haskell98.blogspot.ru/2014/10/blog-post_20.html | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
typedef unsigned long long int bigint; |
NewerOlder