- Стандартные контейнеры C++.
- Алгоритмы в стандартной библиотеке C++ (#include ).
- Конструктор копирования. Перегрузка оператора присваивания. Ключевое слово explicit.
- Перегрузка операторов в C++.
- Принцип RAII. Умные указатели в C++. Мотивация и реализация.
- Паттерн Singleton («одиночка»). Варианты его реализации в C++.
- Принцип COW.
- RTTI в C++.
- Паттерны Singleton, Prototype и Builder.
- Паттерны Abstract Factory и Factory Method.
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
source 'https://rubygems.org' | |
gem 'activerecord', '4.2.0' | |
gem 'sqlite3' | |
gem 'bcrypt', '~> 3.1.7' |
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
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | |
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="GPS TrackMaker" version="1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"> | |
<metadata> | |
<link href="http://www.gpslib.ru"> | |
<text>GPSLib tracks collection</text> | |
</link> | |
<time>2014-11-24T10:29:38+03:00Z</time> | |
<bounds minlat="45.011369" minlon="41.946345" maxlat="45.015844" maxlon="41.954083" /> | |
</metadata> | |
<trk> |
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 "circle.h" | |
#include "new.h" | |
static void *Circle_ctor(void *_self, va_list *app) { | |
struct Circle *self = ((const struct Class *)Point)->ctor(_self, app); | |
self->rad = va_arg(*app, int); | |
return self; | |
} |
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
if ENV['INSTRUMENT_CACHE_KEYS'] | |
class CacheKeyInstrumenter | |
include Singleton | |
def hit(payload) | |
record :hits, payload | |
end | |
def miss(payload) |
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 <vector> | |
#include <iostream> | |
using namespace std; | |
template <typename T> | |
class Initializer { | |
public: | |
Initializer(T &_array) | |
: array(_array) {} |
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
ExifTool Version Number : 9.47 | |
File Name : IMG_0021.JPG | |
Directory : /Volumes/RedStore/Tanya/fotos/14_02_20_start_d20 | |
File Size : 2.5 MB | |
File Modification Date/Time : 2014:02:20 17:23:02+07:00 | |
File Access Date/Time : 2014:02:20 17:23:02+07:00 | |
File Inode Change Date/Time : 2014:02:20 17:23:02+07:00 | |
File Permissions : rwxr--r-- | |
File Type : JPEG | |
MIME Type : image/jpeg |
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
1. Find the row (i-th) with max total width | |
2. Sort the images, so that widest goes first and narrowest last. | |
3. Loop for all images in i-th starting from widest (image A): | |
4. For each other row (j-th): | |
5. Try to move image A to j-th row. That is, if TotalSize[j] + width[A] < TotalSize[i], move and stop. Improvement done. |
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
dp_development=# \d transport_stations | |
Таблица "public.transport_stations" | |
Колонка | Тип | Модификаторы | |
------------+-----------------------------+----------------------------------------------------------------- | |
id | integer | NOT NULL DEFAULT nextval('transport_stations_id_seq'::regclass) | |
name | character varying(255) | | |
lng | double precision | | |
lat | double precision | | |
code | character varying(255) | | |
details | character varying(255) | |
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 paginate(scope, default_per_page = 20) | |
collection = scope.page(params[:page]).per((params[:per_page] || default_per_page).to_i) | |
current, total, per_page = collection.current_page, collection.num_pages, collection.limit_value | |
return [{ | |
pagination: { | |
current: current, | |
previous: (current > 1 ? (current - 1) : nil), | |
next: (current == total ? nil : (current + 1)), |