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
| ## Powershell method of transfering small (< 1 MB) binary files via Clipboard | |
| ## | |
| ## NB: Unwise to attempt to encode binary files exceeding 1 MB due to excessive memory consumption | |
| ## Powershell 5.0> | |
| # On the transmission end: | |
| $Content = Get-Content -Encoding Byte -Path binaryfile.xxx | |
| [System.Convert]::ToBase64String($Content) | Set-Clipboard | |
| # On the receiving end |
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
| -- Returns the Levenshtein distance between the two given strings | |
| function string.levenshtein(str1, str2) | |
| local len1 = string.len(str1) | |
| local len2 = string.len(str2) | |
| local matrix = {} | |
| local cost = 0 | |
| -- quick cut-offs to save time | |
| if (len1 == 0) then | |
| return len2 |
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
| public class PropertyBag | |
| { | |
| // assume there are a lot of properties in this class | |
| private PropertyInfo[] PropertyInfos { get; set; } | |
| public override string ToString() | |
| { | |
| if (PropertyInfos == null) | |
| { |
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
| using System; | |
| using System.Linq.Expressions; | |
| /// <summary> | |
| /// StaticReflection class to parse a properties name from a lambda expression. | |
| /// <see cref="http://joelabrahamsson.com/getting-property-and-method-names-using-static-reflection-in-c/"/> | |
| /// </summary> | |
| public static class StaticReflection | |
| { | |
| public static string GetMemberName<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
| namespace LearningMoreAutoMapper | |
| { | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Dynamic; | |
| using AutoMapper; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| [TestClass] | |
| public class AutoMapperLearningTests |
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
| It was the best of times | |
| it was the worst of times | |
| it was the age of wisdom | |
| it was the age of foolishness | |
| it was the epoch of belief | |
| it was the epoch of incredulity | |
| it was the season of Light | |
| it was the season of Darkness | |
| it was the spring of hope | |
| it was the winter of despair |
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 MessyCode | |
| { | |
| /// <summary> | |
| /// The following issues were created in the BadCode() example: | |
| /// • Casting fsResultG.BoxFolderId which is a Nullable<long> (or better, long?) to long is a problem. Be sure to use the .Value property! | |
| /// • The only thing in the first call that needs to be cast, is the result of the result of Deserialize(), everything else is properly typed. | |
| /// • There is a possibility that fsResultG or fsResultG.BoxFolderId is null, this must be checked before the call since only a long value is accepted – this is a hidden crash error! | |
| /// • Please use the null propagating operators (?? And ?.) It’s silly to write code like: | |
| /// o finalizeData2 == null || finalizeData2.FolderFormList == null || finalizeData2.FolderFormList.Count < 1 | |
| /// o ReSharper will fix this for you in most cases. |
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
| public class derived | |
| { | |
| #region dateTimePicker1_ValueChanged Event | |
| private void dateTimePicker1_ValueChanged(object sender, EventArgs e) | |
| { | |
| ControlBase.Arg1ExceptionLogging(DtpValueChangedAction, sender, "dateTimePicker1_ValueChanged", "Date Picker Button"); | |
| } | |
| public void DtpValueChangedAction(object sender) |
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 Vastec.Ocr.Evaluator.Wpf | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Reflection; | |
| using Microsoft.Extensions.Logging; | |
| using Autofac; | |
| using Caliburn.Micro; | |
| using Serilog; | |
| using AzureImpl.Parsers; |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel; | |
| using System.Data; | |
| using System.Drawing; | |
| using System.Text; | |
| using System.Windows.Forms; | |
| using System.IO; | |
| using Atalasoft.Annotate; | |
| using Atalasoft.Imaging.WinControls; |
NewerOlder