Skip to content

Instantly share code, notes, and snippets.

View atiq-cs's full-sized avatar
💭
Head's on the cloud

Atiq Rahman atiq-cs

💭
Head's on the cloud
View GitHub Profile
@atiq-cs
atiq-cs / GNUWin32_Tools_Versions.txt
Created April 24, 2023 22:34
GNUWin32 Tools Versions
tar (tar from GNUWin32)
$ & "C:\PFiles_x86\PT\GnuWin32\bin\tar.exe" --version
tar (GNU tar) 1.13
Copyright (C) 1988, 92,93,94,95,96,97,98, 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by John Gilmore and Jay Fenlason.
@atiq-cs
atiq-cs / SamplesCultureInfo_log.txt
Created August 7, 2020 08:27
net core culture list
// ref code, https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.displayname
// compiled by https://dotnetfiddle.net/
CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
iv ivl IVL Invariant Language (Invariant Country)
af af afr AFK af Afrikaans
agq agq agq ZZZ Aghem Aghem
ak ak aka ZZZ Akan Akan
am am amh AMH am Amharic
ar ar ara ARA ar Arabic
@atiq-cs
atiq-cs / 0078_subsets.cs
Created March 24, 2019 17:25
ref general-solving/leetcode/0078_subsets.cs
// for leetcode meetup
// O(2^n), O(2^n)
public IList<IList<int>> Subsets(int[] nums, int index = nums.Length) {
if (index == 0)
return new List<IList<int>>(new IList<int>[] { new List<int>() });
var temp = Subsets(nums, index - 1);
int tempLength = temp.Count;
for (int i = 0; i < tempLength; i++) {
@atiq-cs
atiq-cs / 0987_vertical-order-traversal-of-a-binary-tree.cs
Created February 8, 2019 01:52
Vertical Traversal of Binary Tree
// complexity less than n lg n
public class Solution {
List<List<Node>> vertListPos; // for positive
List<List<Node>> vertListNeg; // for negative
List<List<Node>> vertList = null; // pointer
internal class Node {
public int val { get; set; }
public int level { get; set; }
@atiq-cs
atiq-cs / 0200_number-of-islands.cs
Created January 30, 2019 01:57
find num of island using graph search
// O(row*col), O(1), O(row+col) stack space
public class Solution {
char[][] grid;
public int NumIslands(char[,] grid) {
int count = 0;
for (int r=0; r<numRows; r++)
for (int c=0; c<numCols; c++)
if (grid[r][c] == '1') {
@atiq-cs
atiq-cs / 0198_house-robber.cs
Last active January 30, 2019 01:42
do max robbing with DP
// O(N), O(N)
public class Solution {
public int Rob(int[] nums) {
var dp = new int[nums.Length];
for (int i=0; i<nums.Length; i++)
dp[i] = Math.Max((i < 2? 0 : dp[i-2]) + nums[i], i<1? 0 : dp[i-1]);
return nums.Length == 0 ? 0 : dp[nums.Length-1];
}
@atiq-cs
atiq-cs / 0199_binary-tree-right-side-view.cs
Last active January 30, 2019 01:43
Get right side view of a binary tree
// O(N) Time , O(lg N) Space
public class Solution {
IList<int> nodeList = null;
public IList<int> RightSideView(TreeNode root) {
nodeList = new List<int>();
FindRight(root);
return nodeList;
}
@atiq-cs
atiq-cs / UVA-11557-KMP.cpp
Created October 14, 2018 23:29
KMP solution online reference - based on which I solved. Ref: 'online-problem-solving\uva-online-judge\11557_Code_Theft.cpp'
/*
UVA#11557 Reference
Solution Link:
This is the chinese solution acquired from: http://blog.csdn.net/accelerator_/article/details/38783651
referred by Yonghui Wu (http://www.cs.fudan.edu.cn/en/?page_id=2269)
Generates
Complexity:
Generates Pattern string from the input code fragment of repository n times:
P[1...m], P[2...m], P[3...m], P[4...m], ....., P[m..m]
@atiq-cs
atiq-cs / choco-batch-install-upgrade.ps1
Last active February 8, 2021 20:20
choco install upgrade in batch commands
# moved to https://github.com/atiq-cs/Scripts-And-Utilities/wiki/choco-batch-install-or-upgrade
@atiq-cs
atiq-cs / choco_install_default_location.log
Created August 4, 2018 21:54
No matter what CL option we are trying install is going to default location
PS > choco install googlechrome -ia "'INSTALLFOLDER=D:\PFiles_x64\choco\chrome'" -y
Chocolatey v0.10.11
Installing the following packages:
googlechrome
By installing you accept licenses for the packages.
Progress: Downloading GoogleChrome 68.0.3440.8400... 100%
GoogleChrome v68.0.3440.8400 [Approved]
googlechrome package files install completed. Performing other installation steps.
WARNING: Unable to find the architecture of the installed Google Chrome application