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
pages = [x.strip() for x in texts.get('register.start_welcome').split('--break--')] | |
if page_id < 0: | |
page_id = 0 | |
if page_id >= len(pages): | |
page_id = len(pages) - 1 | |
if page_id == 0 or from_scratch: | |
if page_id != len(pages) - 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
<?php | |
// (c) CertaiN, http://php.net/manual/en/features.file-upload.php | |
header('Content-Type: text/plain; charset=utf-8'); | |
$path_to_folder = "./uploads/"; | |
$max_file_size = 5000000; // ~ 5 mb | |
try { | |
// Undefined | Multiple Files | $_FILES Corruption Attack |
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
/* | |
* textdetection.cpp | |
* | |
* A demo program of the Extremal Region Filter algorithm described in | |
* Neumann L., Matas J.: Real-Time Scene Text Localization and Recognition, CVPR 2012 | |
* | |
* Created on: Sep 23, 2013 | |
* Author: Lluis Gomez i Bigorda <lgomez AT cvc.uab.es> | |
*/ |
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 Image | |
img = Image.open("lenna.png") | |
img = img.resize((8, 8)) | |
img = img.convert('L') | |
pixels = img.load() | |
avg = 0 | |
result = 0 |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <hunspell/hunspell.h> | |
int main() { | |
Hunhandle *spellObj = Hunspell_create("/home/artem/rude/ru_RU.aff", "/home/artem/rude/ru_RU.dic"); | |
char str[60]; | |
scanf("%s", str); | |
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 Image, random | |
import csv, sys | |
h = 512 | |
w = 512 | |
img = Image.new( 'RGB', (w,h), "black") # create a new black image | |
pixels = img.load() # create the pixel map | |
xyz = [] |
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 <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <cstdlib> | |
#include <string> | |
using namespace std; | |
string result = "hello world!"; |
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 <iostream> | |
#include <cstdlib> | |
#include <cmath> | |
#include <vector> | |
using namespace std; | |
int get_array_len(int n, float p) { | |
return round(-n*log(p)/(log(2)*log(2))); | |
} |
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
/* | |
В нашем зоопарке появился заяц. Его поместили в клетку, и чтобы ему не было скучно, | |
директор зоопарка распорядился поставить в его клетке лесенку. | |
Теперь наш зайчик может прыгать по лесенке вверх, перепрыгивая через ступеньки. | |
Лестница имеет определенное количество ступенек N. | |
Заяц может одним прыжком преодолеть не более К ступенек. | |
Для разнообразия зайчик пытается каждый раз найти новый путь к вершине лестницы. | |
Директору любопытно, сколько различных способов есть у зайца добраться до | |
вершины лестницы при заданных значениях K и N. Помогите директору написать программу, | |
которая поможет вычислить это количество. Например, если K=3 и N=4, то существуют |
NewerOlder