Skip to content

Instantly share code, notes, and snippets.

View balamuruganky's full-sized avatar

Balamurugan Kandan balamuruganky

View GitHub Profile
@NamPE286
NamPE286 / LCABinaryJumping.cpp
Created September 15, 2023 19:15
Lowest common ancestor with binary jumping (binary lifting)
// https://cses.fi/problemset/task/1688/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MAXLOG = 18;
void preCalc(vector<vector<ll>>& parent) {
@Qfl3x
Qfl3x / week3.md
Last active May 30, 2023 07:31
MLOps-Zoomcamp: Workflow Orchestration - Prefect

NOTE: commands and UI are deprecated

Content:

  • Negative Engineering
  • What is workflow orchestration?
  • Introduction to Prefect 2.0
  • First Prefect flow and Basics

Workflow Orchestration

@minprocess
minprocess / Regex for password strings.md
Last active October 23, 2023 20:12
Testing a regex for validating password strings

Testing a regex for validating a password string

Summary

This tutorial shows the result of testing I did of a regular expression (regex) that I found in the following stackoverflow.com question https://stackoverflow.com/questions/2370015/regular-expression-for-password-validation

The user asked for a regular expression for validating a password with the following condition: "Password must contain 8 characters and at least one number, one letter and one unique character such as !#$%&? "

The proposed regex (which will only work with the Latin alphabet) is

@iximiuz
iximiuz / net_lab_simple_vlan.sh
Last active November 20, 2022 23:33
Configure VLAN tagging on a Linux bridge.
#!/usr/bin/env bash
set -euo pipefail
create_bridge() {
local nsname="$1"
local ifname="$2"
echo "Creating bridge ${nsname}/${ifname}"
@donrestarone
donrestarone / config.txt
Created March 17, 2020 19:38
a sample config.txt for dual hdmi raspberry pi 4 (use this fix if your raspberry pi 4 is not sending a video signal to your monitor)
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
@mightymercado
mightymercado / worker.py
Last active June 16, 2024 05:25
Send data to a multiprocessing.Process running an asyncio event loop
# A rare scenario: Communicate to a child process that's running an event loop
import asyncio
from asyncio import StreamReader, StreamReaderProtocol
from multiprocessing import Process
import os
class Worker:
def __init__(self):
self.read_fd, self.write_fd = os.pipe()
@Phaiax
Phaiax / example_dgram.py
Last active January 5, 2024 08:29
Python AF_UNIX socket / socketserver example (datagram and streaming mode)
"""
LICENSE: MIT
Example of using unix socket in SOCK_DGRAM mode.
"""
import socket
import socketserver
import time
@lkluft
lkluft / copy_netcdf_group.ipynb
Created December 11, 2018 09:11
Copy a single group from one netCDF to another.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
const closestEnemy = (arr) => {
let player = [];
let enemy = [];
let distance = 0;
let rowLength = arr[0].length;
let board = arr.length;
for (let i = 0; i < board; i++) {
let row = arr[i].split("");
@baiwfg2
baiwfg2 / CMakeLists.txt
Created September 29, 2018 12:42
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)