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 | |
#ifndef FILELOCKER_H | |
#define FILELOCKER_H | |
#include <Windows.h> | |
#include <string> | |
#include <tchar.h> | |
#include <iostream> | |
#if UNICODE |
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 | |
#ifndef PREFLIGHTCHECK_HPP | |
#define PREFLIGHTCHECK_HPP | |
/* References for this implementation: | |
https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-globalmemorystatusex | |
https://stackoverflow.com/questions/20119643/stringizing-operator-in-c-c | |
https://stackoverflow.com/questions/46794133/how-to-perform-arthemetic-with-ularge-integer | |
*/ | |
#include "stdafx.h" | |
#include <Windows.h> |
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 InferenceTest { | |
matches(nodeContent) { | |
throw new TypeError('This method should be overridden by inheriting classes.'); | |
} | |
get parsedValue() { | |
throw new TypeError('This method should be overridden by inheriting classes.'); | |
} | |
} | |
class IsEmpty extends InferenceTest { |
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
public static List<string> GetFileNamesWithoutExtensionAsList(string dir, string pattern) | |
{ | |
if (Directory.Exists(dir)) | |
{ | |
return new DirectoryInfo(dir).GetFiles(pattern, SearchOption.TopDirectoryOnly) | |
.Select(file => Path.GetFileNameWithoutExtension(file.Name)).ToList(); | |
} | |
return new List<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
var xDoc = new XmlDocument(); | |
var declarationNode = xDoc.CreateXmlDeclaration("1.0", "", ""); | |
xDoc.AppendChild(declarationNode); | |
var comment = xDoc.CreateComment(string.Format("This file contains information about {0} - {1}", BookName, BookName)); | |
xDoc.AppendChild(comment); | |
var docRoot = xDoc.CreateElement("Books"); | |
XmlNode ndBookISBN = xDoc.CreateElement("BookISBNCode"), | |
ndBookName = xDoc.CreateElement("BookName"), | |
ndAuthorName = xDoc.CreateElement("AuthorName"), | |
ndReleaseDate = xDoc.CreateElement("ReleaseDate"); |
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
var xDoc = XDocument.Load(filePath); | |
string bookISBN = xDoc.Descendants("BookISBNCode").First().Value, | |
bookName = xDoc.Descendants("BookName").First().Value, | |
authorName = xDoc.Descendants("AuthorName").First().Value, | |
releaseDate = xDoc.Descendants("ReleaseDate").First().Value; |
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
public string ToHTMLTable(string CSVFilePath, string tableCaption) | |
{ | |
if (!File.Exists(CSVFilePath)) | |
{ | |
return "<div>--CSV file not found--</div>"; | |
} | |
var sbHTable = new StringBuilder(); | |
var curLine = string.Empty; | |
sbHTable.AppendFormat("<table><caption>{0}</caption>", tableCaption); | |
foreach (var line in File.ReadLines(CSVFilePath)) |
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
document.querySelectorAll("#timeline .stream ol#stream-items-id li div.content div.js-tweet-text-container") |