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 / choco_errors.log
Created August 4, 2018 21:35
Chocolatey package install errors
$ choco uninstall pdftk-server
Chocolatey v0.10.10
Uninstalling the following packages:
pdftk-server
pdftk-server v2.02
WARNING: pdftk-server has already been uninstalled by other means.
Running auto uninstaller...
Skipping auto uninstaller - The uninstaller file no longer exists. ""C:\Program Files (x86)\PDFtk Server\unins000.exe""
pdftk-server has been successfully uninstalled.
@atiq-cs
atiq-cs / choco_install_uninstall.log
Last active December 16, 2018 04:05
Choco successful operation log
# Even though it does not say so, it does install to proper location
$ choco install keepass -ia "'/DIR=D:\PFiles_x64\choco\keepass'"
Chocolatey v0.10.11
Installing the following packages:
keepass
By installing you accept licenses for the packages.
Progress: Downloading keepass.install 2.39.1... 100%
Progress: Downloading keepass 2.39.1... 100%
keepass.install v2.39.1 [Approved]
@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
@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 / 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 / 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 / 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 / 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 / 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 / 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++) {