- В понеделник, който е на ред поства задачка. Такава, която може да се реши за по-малко от половин час.
- Който иска да участва, дава решение като отговор на задачата. Един човек може да даде много решения, ако иска. (Принципно може пейст на кода, като коментар, ама по-добре ползвайте ideone или gist или нещо подобно)
- Задалият задачката няма право да участва в този кръг.
- В неделя, решението с най-много лайкове печели (забележете, че това не е задължително най-бързото, или най-елегантното, или най-краткото решение а най-много провокиралото публиката).
- Печелившият от кръга се къпе в гъзария и щастие и за награда измисля и поства задачката за следващата седмица (и си почива).
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 <locale> | |
#include <string> | |
struct cvt32_8 : public std::codecvt<char32_t, char, std::mbstate_t> | |
{}; | |
int main() | |
{ | |
cvt32_8 cvt; |
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
// _ .-. .-. _ | |
// ( \ | | | | / ) | |
// \ \| | | |/ / | |
// This _\ __|_ server _|__ /_ is just a thread in the current process | |
// ( '-(__ \ / __)-' ) | |
// ('-.)' / \ `(.-') | |
// '-<_. < > ._>-' | |
// | |
// _ _ _ _ |
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
// laurel = _Y_et _A_nother i_NI_ file parser | |
// | |
// Copyright (c) 2020 Borislav Stanimirov | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
groups = {} | |
Dir['**/*'].each do |f| | |
s = File.split(f) | |
dir = s[0] | |
groups[dir] = [] if !groups[dir] | |
groups[dir] << s[1] | |
end | |
groups.each do |k, v| |
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
namespace my { | |
template <typename T> | |
class unique_ptr { | |
public: | |
using pointer = T*; | |
unique_ptr() noexcept = default; | |
unique_ptr(std::nullptr_t) noexcept {} | |
explicit unique_ptr(pointer p) noexcept : m_ptr(p) {} |
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
template <typename T> | |
struct fast_static | |
{ | |
// call globally to ensure the constructor is called | |
static T& slow_get() | |
{ | |
static T t; | |
return t; | |
} |
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
# c2md - v1.0 - public domain | |
# authored in 2016 by Borislav Stanimirov | |
# Used to generate dox files from cpp files | |
if ARGV.length == 0 || ARGV[0] == '--help' || ARGV[0] == '-?' | |
puts 'c2md' | |
puts 'Generate markdown doc from a C-like language' | |
puts | |
puts 'Usage:' |
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
class Timer | |
def initialize | |
ObjectSpace.define_finalizer(self, | |
self.method(:finalize).to_proc) | |
@start = Time.new | |
end | |
def finalize(id) | |
p "Time: #{Time.now.to_f - @start.to_f} seconds" |
NewerOlder