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 <NewPing.h> // https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home | |
#include <toneAC.h> // https://github.com/teckel12/arduino-toneac | |
#define SONAR_TRIGGER 3 | |
#define SONAR_ECHO 2 | |
#define SONAR_MAX_DISTANCE 200 // cm | |
#define TONE_FREQ 1000 // hz | |
NewPing sonar(SONAR_TRIGGER, SONAR_ECHO, SONAR_MAX_DISTANCE); |
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
static string MD5HashFile(string path, int readBufferSize = 0xFFFF) | |
{ | |
if (path == null) throw new ArgumentNullException(nameof(path)); | |
if (readBufferSize < 1) throw new ArgumentOutOfRangeException(nameof(readBufferSize), "The read buffer size cannot be less than 1"); | |
var readBuffer = new byte[readBufferSize]; | |
using (var stream = File.OpenRead(path)) | |
using (var hasher = MD5.Create()) | |
{ |
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
// OLED Support | |
#include <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_SSD1306.h> | |
/* | |
* OLED Screen Connections | |
* VCC - 5V |
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
using System; | |
using System.Net; | |
namespace iptest | |
{ | |
public static class IPAddressExtensions | |
{ | |
public static uint IPAddressToUint(this IPAddress address) | |
{ | |
return BitConverter.ToUInt32(address.GetAddressBytes(), 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
static void ScanDirectory(string directoryPath, Action<string> fileAction, Action<string> directoryAction, string fileSearchPattern = "*", Action<string> unauthorizedAccess = null) | |
{ | |
if (directoryPath == null) throw new ArgumentNullException(nameof(directoryPath)); | |
if (fileSearchPattern == null) throw new ArgumentNullException(nameof(fileSearchPattern)); | |
if (string.IsNullOrWhiteSpace(directoryPath)) throw new ArgumentException("Path is required.", nameof(directoryPath)); | |
if (string.IsNullOrWhiteSpace(fileSearchPattern)) throw new ArgumentException("Pattern is required.", nameof(fileSearchPattern)); | |
var directories = new Stack<string>(); | |
directories.Push(directoryPath); |
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
#define AppDisplayName "Simple Cpp Application" | |
; this value will be prefixed with the word "version" in the add/remove programs list | |
#define AppVersion "1.0" | |
[Setup] | |
PrivilegesRequired=poweruser |
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
#define AppDisplayName "Simple Application" | |
; this value will be prefixed with the word "version" in the add/remove programs list | |
#define AppVersion "1.0" | |
[Setup] | |
PrivilegesRequired=poweruser |
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
using Autofac; // Install-Package AutoFac | |
using System; | |
namespace AutoFacTest | |
{ | |
class Program | |
{ | |
static IContainer Container { get; set; } |
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> | |
void show(int arr[], int count) { | |
for (int n = 0; n < count - 1; n++) | |
printf("%d ", arr[n]); | |
printf("\n"); | |
} | |
void bubble_sort(int arr[], int count) { |
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
using Microsoft.EntityFrameworkCore; | |
namespace EFCoreApp1 | |
{ | |
class ApplicationContext : DbContext | |
{ | |
public ApplicationContext() { } | |
public ApplicationContext(DbContextOptions<ApplicationContext> options) : base(options) | |
{ | |
} |