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 JodaTimeTest { | |
@Test | |
void somethingTest() { | |
//2013-09-15T10:00:00+04:00 | |
def dt = new DateTime(2013, 9, 15, 10, 0) | |
DateTimeFormatter fmt = ISODateTimeFormat.dateTimeNoMillis() | |
assert fmt.print(dt), '2013-09-15T10:00:00+04:00' | |
assert fmt.parseDateTime('2013-09-15T10:00:00+04:00'), dt | |
} | |
} |
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
/** @brief Write a buffer of data to a selected endpoint. | |
* | |
* @param[in] bEpAddr | |
* The address of the non control endpoint. | |
* | |
* @param[in] pBufferPointer | |
* The pointer to the buffer of data to be written to the endpoint. | |
* | |
* @param[in] wBufferSize | |
* Number of data to be written (in bytes). |
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
void TIM3_IRQHandler(void) | |
{ | |
if (TIM_GetITStatus(TIM3, TIM_IT_Update)) { | |
TIM_ClearITPendingBit(TIM3, TIM_IT_Update); | |
// И т.д. что ты собирался делать внутри прерывания | |
} | |
} |
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
@ECHO OFF | |
exit 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
<pupillary_light_reflex delayed="0|1"> | |
<left enabled="1" diameter="2" /> | |
<right enabled="1" diameter="2" /> | |
</pupillary_light_reflex> |
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
typedef struct ObjectTag { | |
// Данные и методы | |
} Object; | |
int InitObject(Object* io_pObject); | |
int UseObject(Object* io_pObject); | |
int ClearObject(Object* io_pObject); | |
void ObjectsInC() { | |
Object* pObject; |
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
std::string TcpJson::GetConfigurationString() | |
{ | |
if (auto conf_child = GetChild(0)) { | |
auto conf_str = static_cast<Aco_StringChannel*>(conf_child)->GetString(); | |
if (conf_str) { | |
return std::string(conf_str); | |
} | |
} | |
return std::string(); |
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
void TcpJson::CallChannel() | |
{ | |
// Канал с конфигурационной строкой должен быть подцеплен к 0й ножке TcpJson. | |
// Формат конфигурационной строки (JSON. Пробелы и переводы строки не имеют значения): | |
// { | |
// "id": "RP3-00-{123}", // GUID комплекта оборудования | |
// "addr": "127.0.0.1", // Адрес сервера | |
// "port": 22000, // Порт сервера | |
// "input": // Список имен каналов, из которых берутся данные | |
// { |
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 <boost/range/adaptor/transformed.hpp> | |
#include <boost/range/adaptor/filtered.hpp> | |
#include <boost/range/algorithm/for_each.hpp> | |
using boost::adaptors | |
boost::for_each ( vp_entries_ | transformed([&root](const auto & parser){return parser->parse(root);}) | |
| filtered([](const auto & actor){return bool(actor);}), [](const auto & actor){actor();}) |
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 <boost/range/adaptor/transformed.hpp> | |
#include <boost/range/adaptor/filtered.hpp> | |
#include <boost/range/algorithm/for_each.hpp> | |
using boost::adaptors | |
std::map<std::string, sev::severity_level> severity_per_channel; | |
boost::insert(severity_per_channel, severity_per_channel.end(), | |
p_ptree->get_child("logging") | transformed([](const auto & kv){ | |
return std::make_pair<std::string, sev::severity_level>( |