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 static void PopulateDataArray(this ListObject table, object[,] dataArray) | |
| { | |
| int columns = dataArray.GetLength(1); | |
| int rows = dataArray.GetLength(0); | |
| table.DataBodyRange?.Delete(); | |
| if (rows > 0 && columns > 0) | |
| { | |
| table.ListRows.Add(); | |
| table.ListRows[1].Range[1, 1].Value2 = "Dummy"; | |
| Range range = table.Range.Cells[1, 1].Resize[rows + 1, columns]; |
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 static Microsoft.Office.Interop.Excel.Application xlApp = Globals.ThisWorkbook.Application; |
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
| DateTime timeStart = DateTime .Now; | |
| //Perform Activity | |
| TimeSpan difference = DateTime.Now.Subtract(timeStart); | |
| MessageBox.Show($"Completed in {difference.ToString(@"hh\:mm\:ss\:fff")}"); |
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 static object PopulateIf<T>(this T field, bool condition, object valueIfFalse = null) | |
| { | |
| if (condition) | |
| { | |
| return field; | |
| } | |
| else | |
| { | |
| return valueIfFalse; | |
| } |
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 static IProgress<Tuple<string, string>> InitializeStatusForm(out FormShowStatus statusForm) | |
| { | |
| statusForm = new FormShowStatus(); | |
| statusForm.Show(); | |
| return statusForm.Status; | |
| } |
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
| ExcelHelper.xlApp.CutCopyMode = 0; |
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 XIRR | |
| { | |
| private const Double DaysPerYear = 365.0; | |
| private const int MaxIterations = 100; | |
| private const double DefaultTolerance = 1E-6; | |
| private const double DefaultGuess = 0.1; | |
| private static readonly Func<IEnumerable<CashItem>, Double> NewthonsMethod = | |
| cf => NewtonsMethodImplementation(cf, Xnpv, XnpvPrime); |
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.Text; | |
| public static class NumbersToWords | |
| { | |
| public static string ConvertNumberToWords(decimal value, bool appendOnly = false, string majorCurrency = "rupees", string minorCurrency = "paisa") | |
| { | |
| if (value < 0 || value > decimal.MaxValue) |
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.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| class Levenshtein | |
| { | |
| /// <summary> | |
| /// Computes the Damerau-Levenshtein Distance between two strings, represented as arrays of |
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 Google.Apis.Auth.OAuth2; | |
| using Google.Apis.Gmail.v1; | |
| using Google.Apis.Gmail.v1.Data; | |
| using Google.Apis.Services; | |
| using Google.Apis.Util.Store; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Threading; | |
| using System.Threading.Tasks; |