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
(function(x/**/) { | |
(function(f){ | |
(function a(){ | |
try { | |
function b(i) { | |
if( | |
(''+(i/i)).length !== 1 || | |
i % 20 === 0 | |
) { | |
(function(){}).constructor('debugger')(); |
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
# habraproxy.py — это простейший http-прокси-сервер, запускаемый локально (порт на ваше | |
# усмотрение), который показывает содержимое страниц Хабра. С одним исключением: после | |
# каждого слова из шести букв должен стоять значок «™». Примерно так: | |
# | |
# http://habrahabr.ru/company/yandex/blog/258673/ | |
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
# Сейчас на фоне уязвимости Logjam все в индустрии в очередной раз обсуждают проблемы и | |
# особенности TLS. Я хочу воспользоваться этой возможностью, чтобы поговорить об одной из | |
# них, а именно — о настройке ciphersiutes. | |
# |
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
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<script> | |
var getTextWidthDOM = function(text, fontStyle) { |
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
fibonacci :: Integer -> Integer | |
fibonacci 0 = 0 | |
fibonacci 1 = 1 | |
fibonacci (-1) = 1 | |
fibonacci (-2) = (-1) | |
fibonacci n | n > 0 = helper (fibonacci 0) (fibonacci 1) (n - 2) | |
| n < 0 = helper (fibonacci (-1)) (fibonacci (-2)) (n + 3) | |
helper :: Integer -> Integer -> Integer -> Integer | |
helper a b n | n == 0 && a > b = a - b |
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
integration :: (Double -> Double) -> Double -> Double -> Double | |
integration f a b | a == b = 0 | |
| otherwise = coeff * dx * ((f begin + f end) / 2 + helper (begin + dx) 0 (numberOfSteps - 1)) | |
where | |
begin = min a b | |
end = max a b | |
numberOfSteps = 1000 | |
coeff = if end == a then (-1) else 1 | |
dx = (end - begin) / numberOfSteps | |
helper x sum n | n == 0 = sum |
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
for f in aaa*; do mv $f $(echo $f | sed 's/^aaa/bbb/g'); done |
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
Array.apply(null, {length: N}).map(Number.call, Number) |
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
# @see https://www.hackerrank.com/challenges/fractal-trees-all | |
# Creating a Fractal Tree from Y-shaped branches | |
# | |
# This challenge involves the construction of trees, in the form of ASCII Art. | |
# | |
# We have to deal with real world constraints, so we cannot keep repeating the pattern infinitely. | |
# So, we will provide you a number of iterations, and you need to generate the ASCII version | |
# of the Fractal Tree for only those many iterations (or, levels of recursion). A few samples are provided below. | |
# | |
# Input Format |
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
var gcd = function(a, b) { | |
var coef = 1; | |
while ( | |
a !== b && | |
a !== 0 && | |
b !== 0 && | |
a !== 1 && | |
b !== 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
#include <iostream> | |
#include <stdio.h> | |
using namespace std; | |
class cStack | |
{ | |
private: | |
int A[255]; | |
int ptr; | |
public: |
OlderNewer