Skip to content

Instantly share code, notes, and snippets.

View scdekov's full-sized avatar
🎯
Focusing

Svetoslav Dekov scdekov

🎯
Focusing
View GitHub Profile
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
#include <iostream>
#include <map>
#include <vector>
#include <string>
using namespace std;
vector<string> split(string text)
{
vector<string> words;
int lastSpaceIx = 0;
struct tochka
{
float x,y;
};
struct otsechka
{
tochka m,n
};
float duljina(otsechka a)
@scdekov
scdekov / c++
Created March 8, 2015 20:18
c++
#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",
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)
set shell=/bin/bash
set nocompatible
filetype off
set clipboard+=unnamedplus
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
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:
return {
'low': 'white',
'medium': 'green',
'high': 'red'
}[priority]
<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>
users_filterm group_filter, user_permission_filter = Q(), Q(), Q()