Skip to content

Instantly share code, notes, and snippets.

View cmgchess's full-sized avatar

Chathulanka Gamage cmgchess

View GitHub Profile
@cmgchess
cmgchess / chesscom_tournament_pgn.ipynb
Created December 3, 2023 10:11
chesscom_tournament_pgn.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function maxSubarrayCrossingSum(arr, left, right, mid) {
let leftSum = -Infinity;
let currentSum = 0;
for (let i = mid; i >= left; i--) {
currentSum += arr[i];
if (currentSum > leftSum) leftSum = currentSum;
}
let rightSum = -Infinity;
This file has been truncated, but you can view the full file.
[
{
"id": 1,
"c": "B03",
"n": "Alekhine's Defense: Balogh Variation",
"f": "rnbqkb1r/ppp1pppp/3p4/3nP3/2BP4/8/PPP2PPP/RNBQK1NR b KQkq",
"u": "Alekhines-Defense-Balogh-Variation",
"m": "1.e4 Nf6 2.e5 Nd5 3.d4 d6 4.Bc4",
"fm": 13,
"f6": "rnbqkb1r/ppp1pppp/3p4/3nP3/2BP4/8/PPP2PPP/RNBQK1NR b KQkq - 2 4",
//maxHeapify time complexity O(logn)
//i starts from 1
const maxHeapify = (A, heapsize, i) => {
let largest;
let l = 2 * i
let r = 2 * i + 1
if (l <= heapsize && A[l - 1] > A[i - 1]) {
largest = l
} else {
largest = i
@cmgchess
cmgchess / config.csv
Created November 13, 2021 07:02
Continuous assessment 02 - Protection of information based on sensitivity and privilege levels
username password user_type privilege_level
s_jayasuriya 173f8c9e191df4966a18b3c13df6d284 patient L1
m_atapattu 57cad64a96c9acfbc70e31695853ade5 hospital_staff L2
k_sanga 10bb685ecbf5b934b3ba1ce4f7a38d6d hospital_staff L3
dilshan 472f9349d7bfee9bc46be6a1d5047d2a hospital_staff L4
arnold 49a30d03c669a09f2c01c3655032af3e hospital_staff L5
r_herath de4755d2df989e3956ca54a17c7c9de4 patient L1
c_vaas 28a3d00c7c2bd2165059c11f8119f555 patient L1
murali 34cc2d6881fa3b48cf5de52384755dd7 patient L1
tharanga 4be696c0421a7d5c3e15eafe77472369 hospital_staff L3