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
| // Top-down in-place merge sort. Complexity: O(n^2) | |
| public class Solution { | |
| public void Merge(int[] nums, int lo1, int mid, int hi) { | |
| int lo2 = mid + 1; | |
| if (nums[mid] <= nums[lo2]) { | |
| return; | |
| } | |
| while (lo1 <= mid && lo2 <= hi) { |
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 int BinarySearch1(int[] nums, int target){ | |
| if (nums == null || nums.Length == 0) { | |
| return -1; | |
| } | |
| int lo = 0, hi = nums.Length - 1; | |
| while (lo <= hi) { | |
| // Prevent (lo + hi) overflow | |
| int mid = lo + (hi - lo) / 2; | |
| if (nums[mid] == target) { |
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
| // Import module | |
| Import-Module ./PSZip.dll | |
| // Create new drive referring to .zip arvhive | |
| New-PSDrive -Name "ZIP" -PSProvider "ZipFile" -Root "D:\files\archive.zip" | |
| // List zip archive contents | |
| Get-ChildItem -Path ZIP: -Recurse | |
| // List only *.txt files |
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.Runtime.InteropServices; | |
| using System.Windows.Input; | |
| namespace KeyboardHooks | |
| { | |
| public static class KeyboardMessage | |
| { | |
| public const uint KEYEVENTF_EXTENDEDKEY = 0x0001; |
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.IO; | |
| using System.Linq; | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace AesCipher | |
| { |
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 AutoMapper; | |
| using AutoMapper.QueryableExtensions; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| public class ClassA | |
| { | |
| public string Name { get; set; } | |
| public string Type { get; set; } |