Skip to content

Instantly share code, notes, and snippets.

View potatowagon's full-sized avatar
🌈
http://www.biotele.com/qualia.htm

Sherry potatowagon

🌈
http://www.biotele.com/qualia.htm
View GitHub Profile
@potatowagon
potatowagon / winsetup.bat
Last active March 19, 2023 08:38
right click cmd > run as admin
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
refreshenv
choco install googlechrome
choco install python3
choco install vscode
choco install git
refreshenv
start chrome
start code
choco install telegram
@potatowagon
potatowagon / iterative.md
Last active October 17, 2021 17:00
binary tree iterative traversal

Goal

  • Pooja's list
  • Arrays: Sorting
  • Combination and Permutation (recursion and backtracking)
  • Trees
  • Graphs
  • Heaps
  • Union Find (disjoint sets)
  • Knapsack problem

Code

Array not inplace

better done with linked list

class Solution:
    def sortArray(self, nums: List[int]) -> List[int]:
        def merge_sort(nums_list, start, end):
            if (start == end):
                return [nums_list[start]]
            mid = ((end + 1 - start) // 2) + start

Code

class Solution:
    def sortArray(self, nums: List[int]) -> List[int]:
        def partition(nums, start, end):
            i = start
            p = nums[end]
            j = end - 1
            while i < j:
 while nums[i] &lt; p:

brief

Nums = [5,3,1,2,4,6]
[[3,5],1,2,4,6]
[3,[1,5],2,4,6]
[3,1,[2,5],4,6]
[3,1,2,[4,5],6]
[3,1,2,4,[5,6]]

[[1,3],2,4,5,6]
@potatowagon
potatowagon / study.md
Last active July 29, 2021 03:27
study plan

Goal

  • Jul - Aug: revise school stuff
    • networking
    • RTOS
    • dist systems
    • Computer Architecture
    • Trees
    • Graphs
    • Arrays: Sorting
  • Heaps

Well, if you scrap the bulk of the bible and everything else and look at the 10 commandments, you actually have something solid to work with. But lets take the religion out of it?

Don't worship false idols: people are people, things are things and they do not deserve to be put on a pedestal for being rich or famous etc. Don't be an asshole towards people. Take time to rest and reflect. Respect those that come before you - parents, grand parents, teachers and the like. Don't kill people. Don't take other people's belongings. Don't lie, especially about the actions of other people. Respect your partner, respect the relationships of other people.

@potatowagon
potatowagon / halp-hhvm-composer.md
Last active April 14, 2020 03:26
Halp : hhvm composer install hangs with no output