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
#pragma once | |
#include <windows.h> | |
#include <string> | |
// Converts a binary array to a hex string. | |
inline std::string bin2hex(unsigned char* buffer, int bufferSize) | |
{ | |
std::string hex; | |
hex.reserve(bufferSize * 2 + 1); |
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
#pragma once | |
#include <windows.h> | |
#include <string> | |
// Helper functuion used by hex2bin() function. | |
inline int hex2byte(char c) | |
{ | |
if ((c >= '0') && (c <= '9')) | |
{ |
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> | |
// Reads binary file and returns its content in a byte array. | |
// NOTE: it's caller responsibility to free returned array with "delete[]". | |
inline unsigned char* readFile(const char* fileName, long* fileSizeToReturn) | |
{ | |
// open file | |
FILE* file = fopen(fileName, "rb"); | |
if (NULL == file) | |
{ |
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
#pragma once | |
#include <string> | |
class AdobeSdkString | |
{ | |
ADOBESDK_StringSuite1* _stringSuite; | |
ADOBESDK_String _string; | |
BOOL _dispose; |
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 Vurdalakov | |
{ | |
using System; | |
using System.Security.Principal; | |
public static class CurrentUser | |
{ | |
public static Boolean IsAdministrator() | |
{ | |
using (var windowsIdentity = WindowsIdentity.GetCurrent()) |
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 Vurdalakov | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
class Program | |
{ | |
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] |
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 Vurdalakov | |
{ | |
using System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
public static class DateTimeApi | |
{ | |
public static String GetCurrentTimeString(Boolean shortTime) |
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
-- Removes (and returns) a table element by its key, moving down other elements to close space and decrementing the size of the array | |
function table.removeKey(table, key) | |
local element = table[key] | |
table[key] = nil | |
return element | |
end | |
-- Test | |
printf = function(s, ...) return io.write(s:format(...)) end |
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 | |
echo ----------------------------------------------- increment.bat script ----------------------------------------------- | |
rem ======================================================================================== | |
rem == This script automatically increments build number in "version.h" file. | |
rem == Instructions and more information: | |
rem == http://codeblog.vurdalakov.net/2017/04/autoincrement-build-number-in-arduino-ide.html | |
rem ======================================================================================== | |
setlocal |
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
#ifndef __COUNTS_PER_MINUTE_H__ | |
#define __COUNTS_PER_MINUTE_H__ | |
class CountsPerMinute | |
{ | |
int m_currentCpm; | |
int m_maximumCpm; | |
int m_intervalsPerMinute; | |
int* m_intervalCounts; | |
int m_currentInterval; |
OlderNewer