This file contains hidden or 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 <stdlib.h> | |
#define STREAM (256 * 8) | |
/* short program to understand linear feed shift register | |
* and its use in stream ciphers. | |
*/ | |
int |
This file contains hidden or 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 OutArg { | |
T * operator ->() const | |
{ | |
return &_t; | |
} | |
T & operator*() const | |
{ | |
return _t; |
This file contains hidden or 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
// level 1 | |
#pragma warning (default : 4546) // function call before comma missing argument list | |
#pragma warning (default : 4547) // operator before comma has no effect; expected operator with side-effect | |
#pragma warning (default : 4548) // expression before comma has no effect; expected expression with side-effect | |
#pragma warning (default : 4549) // operator before comma has no effect; did you intend 'operator'? | |
#pragma warning (default : 4555) // expression has no effect; expected expression with side-effect | |
#pragma warning (default : 4906) // string literal cast to 'LPWSTR' | |
#pragma warning (default : 4946) // Do not use reinterpret_cast to cast between related types. Use static_cast instead, or for polymorphic types, use dynamic_cast. | |
// level 4 | |
//#pragma warning (default : 4242) // conversion from 'type1' to 'type2', possible loss of data |
This file contains hidden or 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 detail | |
{ | |
template <typename Res = void, typename ... Args> | |
class Lambda { | |
public: | |
virtual Res operator()(Args ... args) = 0; | |
virtual ~Lambda() noexcept = default; | |
}; | |
template <typename T, typename Res, typename ... Args> |
This file contains hidden or 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
#pragma once | |
// -------------------------- USAGE INFO ---------------------------- | |
/* | |
// T.h: | |
class T { | |
private: | |
OBJECT_TRACKER(T); | |
}; |
This file contains hidden or 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
const auto & font = app->_fonts[0]; | |
auto prev_view = tgt->getView(); | |
// GetPos() gets the unit's world position (shape world position for you) | |
auto world_pos = GetPos(); | |
world_pos.y -= 11 + font.size; | |
auto screen_pos = tgt->mapCoordsToPixel(world_pos); | |