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
def calculate_coins(sum): | |
coins = {1: 0, 2: 0, 100: 0, 5: 0, 10: 0, 50: 0, 20: 0} | |
list_of_coins = [100, 50, 20, 10, 5, 2, 1] | |
sum = sum * 100 | |
while sum > 0: | |
for coin in list_of_coins: | |
if coin <= sum: | |
coins[coin] = coins[coin] + 1 | |
sum = sum - coin | |
break |
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 <map> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
vector<string> split(string text) | |
{ | |
vector<string> words; | |
int lastSpaceIx = 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
struct tochka | |
{ | |
float x,y; | |
}; | |
struct otsechka | |
{ | |
tochka m,n | |
}; | |
float duljina(otsechka a) |
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 <string.h> | |
#include <curl/curl.h> | |
#define FROM "<svetlio1994@gmail.com>" | |
#define TO "<dekov94@gmail.com>" | |
static const char *payload_text[] = { | |
"To: " TO "\r\n", | |
"From: " FROM "\r\n", |
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
def quickSort(arr): | |
less = [] | |
equal = [] | |
greater = [] | |
if len(arr) < 2: | |
return arr | |
pivot = arr[len(arr) // 2] | |
for element in arr: | |
if element < pivot: | |
less.append(element) |
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
set shell=/bin/bash | |
set nocompatible | |
filetype off | |
set clipboard+=unnamedplus | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'VundleVim/Vundle.vim' |
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
def validate_row(nonogram, keys): | |
for i, rows in enumerate(nonogram): | |
current_group = keys[i] | |
print("before", current_group) | |
for idx, e in enumerate(rows): | |
if e != 'x': | |
continue | |
if current_group: |
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
return { | |
'low': 'white', | |
'medium': 'green', | |
'high': 'red' | |
}[priority] |
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
<script type="text/html" id="template_holder"></script> | |
<script type="text/javascript"> | |
$('#template_holder').load('templates/a_template.html', function() { | |
alert('Load was performed.'); | |
//knockout binding goes here | |
}); | |
</script> |
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
users_filterm group_filter, user_permission_filter = Q(), Q(), Q() |
OlderNewer