noise dept.

★
Keni

Discoholic 🪩

PR's Tumblrdome
Show & Tell

Andulka

#extradirty

祝日 / Permanent Vacation
Misplaced Lens Cap
Game of Thrones Daily
Three Goblin Art
No title available
ojovivo
Stranger Things

izzy's playlists!
Not today Justin
Mike Driver
Peter Solarz
Aqua Utopia|海の底で記憶を紡ぐ
seen from United States
seen from United States
seen from Germany
seen from United States

seen from United Kingdom
seen from Brazil

seen from Pakistan

seen from Malaysia
seen from Portugal

seen from T1
seen from France

seen from United Kingdom
seen from United States
seen from United Kingdom
seen from Netherlands

seen from United States

seen from United States

seen from Spain
seen from Brazil

seen from United States
@compute-info
Typical job.
Class Envy
Android vs. iPhone
Why you shouldn’t interrupt a programmer.
Growth of Functions
- Θ notation -
f(n) = Θ(g(n))
There exist positive constants c1, c2, and n0 such that
0 ≤ c1g(n) ≤ f(n) ≤ c2g(n) for all n ≥ n0.
We say g(n) is an asymptotically tight bound for f(n) if f(n) = Θ(g(n)). Informally we can say, as far as time complexity or order of growth, these functions are equal.
- O notation -
f(n) = O(g(n)) There exist positive constants c and n0 such that
0 ≤ f(n) ≤ cg(n) for all n ≥ n0.
We say g(n) is an asymptotic upper bound for f(n) if f(n) = O(g(n)).
- Ω notation -
f(n) = Ω(g(n)) There exist positive constants c and n0 such that
0 ≤ cg(n) ≤ f(n) for all n ≥ n0.
We say g(n) is an asymptotic lower bound for f(n) if f(n) = Ω(g(n)).
- o notation -
f(n) = o(g(n)) For any positive constant c > 0, there exists a constant
n0 > 0 such that 0 ≤ f(n) < cg(n) for all n ≥ n0.
We say f(n) is asymptotically smaller than g(n) if f(n) = o(g(n)). We can also express this as the following limit
limn→∞(f(n)/g(n)) = 0
- ω notation -
f(n) = ω(g(n)) For any positive constant c > 0, there exists a constant
n0 > 0 such that 0 ≤ cg(n) < f(n) for all n ≥ n0.
We say f(n) is asymptotically bigger than g(n) if f(n) = ω(g(n)). We can also express this as the following limit.
limn→∞(f(n)/g(n)) = ∞
- Properties -
Transitivity:
f(n) = Θ(g(n)) and g(n) = Θ(h(n)) ⇒ f(n) = Θ(h(n)) f(n) = O(g(n)) and g(n) = O(h(n)) ⇒ f(n) = O(h(n)) f(n) = Ω(g(n)) and g(n) = Ω(h(n)) ⇒ f(n) = Ω(h(n)) f(n) = o(g(n)) and g(n) = o(h(n)) ⇒ f(n) = o(h(n)) f(n) = ω(g(n)) and g(n) = ω(h(n)) ⇒ f(n) = ω(h(n))
Reflexivity:
f(n) = Θ(f(n)) f(n) = O(f(n)) f(n) = Ω(f(n))
Symmetry:
f(n) = Θ(g(n)) iff g(n) = Θ(f(n))
Transpose symmetry:
f(n) = O(g(n)) iff g(n) = Ω(f(n)) f(n) = o(g(n)) iff g(n) = ω(f(n))
- Informal Comparison -
f(n) = O(g(n)) ≈ a ≤ b f(n) = Ω(g(n)) ≈ a ≥ b f(n) = Θ(g(n)) ≈ a = b f(n) = o(g(n)) ≈ a < b f(n) = ω(g(n)) ≈ a > b
- Note -
From the definitions of Θ, O, and Ω notations we can conclude the following: * For any two functions f(n) and g(n), we have f(n) = Θ(g(n)) iff f(n) = O(g(n)) and f(n) = Ω(g(n)). * If f(n) = O(g(n)) then g(n) = Ω(f(n)) and vice versa.
Powershell TCP Listener
tcplistener.ps1:
function tcplisten ($port) { $endpoint = new-object System.Net.IPEndPoint ([ipaddress]::any, $port) $listener = new-object System.Net.Sockets.TcpListener $endpoint $listener.start() $listener.AcceptTcpClient() $listener.stop() } tcplisten($args[0])
Extract Hostname of Machine in KD
Extract hostname of the machine being debugged either in live KD or from a kernel dump.
1: kd> x srv!SrvComputerName fffff800`19851f98 srv!SrvComputerName = struct _UNICODE_STRING "TEST1"
Windows Settings
Make a folder with the following name to access all available settings on Windows 8.x.
Settings.{ED7BA470-8E54-465E-825C-99712043E01C}
The Corporate Ladder
Test Remote Port
Powershell one-liners to see if a remote port is open. The target port is open if the command returns with no errors.
#Check TCP port (New-Object Net.Sockets.TcpClient).Connect("remote_machine", port) #Check UDP port (New-Object Net.Sockets.UdpClient).Connect("remote_machine", port)
Binary Tree to Array Conversion
Given a binary tree, convert it to an array and vice versa.
int *BinaryTreeToArray(Node *root) { int *arr = new int[8]; // Skipping index 0 for simplicity BinaryTreeToArrayHelper(root, arr, 8, 1); return arr; } void BinaryTreeToArrayHelper(Node *n, int *arr, int size, int index) { if (!n || index > size - 1) return; arr[index] = n->value; BinaryTreeToArrayHelper(n->left, arr, size, index * 2); BinaryTreeToArrayHelper(n->right, arr, size, index * 2 + 1); }
Node *ArrayToBinaryTree(int *arr, int size) { if (!arr || 1 > size) return nullptr; Node *root = new Node(arr[1]), *curr = nullptr; queue<Node*> q; q.push(root); int index = 1; while (!q.empty()) { curr = q.front(); if (index < size / 2) { curr->left = new Node(arr[index * 2]); q.push(curr->left); curr->right = new Node(arr[index * 2 + 1]); q.push(curr->right); } q.pop(); index++; } return root; }