Skip to content

Instantly share code, notes, and snippets.

View y-gagar1n's full-sized avatar

Yury Timofeev y-gagar1n

  • Yandex
  • Moscow, Russia
View GitHub Profile
@y-gagar1n
y-gagar1n / gist:8469484
Created January 17, 2014 06:57
DateTime format patterns
DateTime.ToString() Patterns
All the patterns:
0 MM/dd/yyyy 08/22/2006
1 dddd, dd MMMM yyyy Tuesday, 22 August 2006
2 dddd, dd MMMM yyyy HH:mm Tuesday, 22 August 2006 06:30
3 dddd, dd MMMM yyyy hh:mm tt Tuesday, 22 August 2006 06:30 AM
4 dddd, dd MMMM yyyy H:mm Tuesday, 22 August 2006 6:30
5 dddd, dd MMMM yyyy h:mm tt Tuesday, 22 August 2006 6:30 AM
@y-gagar1n
y-gagar1n / gist:5730252
Created June 7, 2013 15:47
LaTeX - Russian text
%Если нужно немного русских слов в английском тексте:
\documentclass[10pt, conference, compsocconf]{IEEEtran}
\fontfamily{cmr}\selectfont
\usepackage[utf8]{inputenc}
\usepackage[russian, english]{babel}
\begin{document}
this is english text
@y-gagar1n
y-gagar1n / exceptions.md
Last active August 28, 2020 07:02
exceptions

Ресурсы

https://www.researchgate.net/profile/Rebecca_Wirfs-Brock/publication/3248431_Toward_Exception-Handling_Best_Practices_and_Patterns/links/0deec52de98c15589e000000/Toward-Exception-Handling-Best-Practices-and-Patterns.pdf

https://habr.com/ru/post/221723/ + хороший комментарий https://habr.com/ru/post/221723/#comment_7555889

тезисы комментария:

  • Ценность исключений в раскрутке стека.
  • Исключения выкидывать только в случае критических ошибок, в остальных случаях - обрабатывать ошибку в той же функции, либо как можно блмже к ней, либо возвращать код ошибки.
/Users/yury-timofeev/projects/shad/cpp/shad-cpp0/cmake-build-asan/test_multiplication
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test_multiplication is a Catch v2.2.3 host application.
Run with -? for options
-------------------------------------------------------------------------------
Advanced
-------------------------------------------------------------------------------
/Users/yury-timofeev/projects/shad/cpp/shad-cpp0/multiplication/test.cpp:8
This file has been truncated, but you can view the full file.
<char>::lookup_collatename<char const*>(char const*, char const*) const::__collatenames' from file '../libcontrib_catch_main.a(catch_main.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
itReporter>::SectionNode> > > > >&)' from file '../libcontrib_catch_main.a(catch_main.cpp.o)' to global weak symbol 'std::__cxx11::regex_traits<char>::lookup_collatename<char const*>(char const*, char const*) const::__collatenames' from file '../libcontrib_catch_main.a(catch_main.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'std::vector<std::shared_ptr<Catch::CumulativeReporterBase<Catch::JunitReporter>::Node<Catch::TestGroupStats, Catch::CumulativeReporterBase<Catch::JunitReporter>::Node<Catch::TestCaseStats, Catch::CumulativeReporterBase<Catch::Jun
python-twitter
@y-gagar1n
y-gagar1n / AssertUtils.cs
Created December 4, 2017 08:53
AssertUtils
using NUnit.Framework;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace TestUtils
@y-gagar1n
y-gagar1n / gist:6742265
Created September 28, 2013 13:49
VisualStudio.gitignore
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
@y-gagar1n
y-gagar1n / gist:6353759
Last active December 21, 2015 19:20
hg grep - Find revision history of specific line of code
hg grep --all "PATTERN" FILENAME
@y-gagar1n
y-gagar1n / gist:5820503
Created June 20, 2013 05:30
jQuery - AJAX call
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: window.location.href + "/SomeMethod",
data: { paramA : valueA, paramB : valueB },
dataType: 'json',
success: function (response) {
...
}
});