This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.HashMap; | |
| import java.util.Map; | |
| import java.util.concurrent.ThreadLocalRandom; | |
| public class LRU { | |
| // Modulus for HashMap Keys, i.e. Range (0, 9) | |
| final static int LIMIT = 10; | |
| // Evict the least recently used, once the load factor is reached. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const XLSX = require('xlsx'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const { createHash } = require('crypto'); | |
| let overallRowCount = 0; | |
| try { | |
| // Function to count rows in a single .xlsx file | |
| const countRows = (filePath) => { | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE FUNCTION en_cols() | |
| RETURNS trigger AS | |
| $$ | |
| DECLARE | |
| continue_exception BOOLEAN; | |
| assignable text; | |
| BEGIN | |
| continue_exception := TRUE; | |
| PERFORM set_config('log_statement', 'none', true); | |
| BEGIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.SortedMap; | |
| import java.util.TreeMap; | |
| import java.util.concurrent.ThreadLocalRandom; | |
| public class ConsistentHashing { | |
| // Consistent Hashing with Ring having 360 buckets. | |
| private static final int HASH_SPACE = 360; // Represents a circle from 0 to 359 degrees | |
| private static final SortedMap<Integer, String> hashRing = new TreeMap<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Make sure to change this to your own random string of 32 characters (https://docs.typebot.io/self-hosting/docker#2-add-the-required-configuration) | |
| ENCRYPTION_SECRET=hearthathon-1234hearthathon-1234 | |
| DATABASE_URL=postgresql://postgres.gglbffzglevzeshvxmzb:[email protected]:5432/postgres | |
| NEXTAUTH_URL=https://forms.heartfulness.org | |
| NEXT_PUBLIC_VIEWER_URL=https://vform.heartfulness.org | |
| [email protected] | |
| DEFAULT_WORKSPACE_PLAN=UNLIMITED | |
| DISABLE_SIGNUP=false | |
| SMTP_USERNAME=AKIAZ2OBQRS7RGVPCGT7 | |
| SMTP_PASSWORD=BLOivbVa7ajLg+FVfzjEGqz+czMHZ6OOp4YecjQmo4Y7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DELIMITER // | |
| CREATE PROCEDURE Y9_PAYMENTS_SYNC (IN propertyTypeParam VARCHAR(255)) | |
| BEGIN | |
| SET @randNumber = CEILING(RAND() * 100); | |
| SET SQL_SAFE_UPDATES = 0; | |
| IF @randNumber % 2 = 0 THEN | |
| UPDATE `customer_app`.`client_program_configs` SET is_active = NOT is_active WHERE property_type = propertyTypeParam; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE PROCEDURE customer_app.Y9_RECON() | |
| BEGIN | |
| DECLARE trans VARCHAR(30); | |
| DECLARE CONTINUE HANDLER FOR SQLEXCEPTION | |
| -- dont log to the log file | |
| SET GLOBAL general_log = 'OFF'; | |
| SET GLOBAL log_bin = 'OFF'; | |
| SET SQL_SAFE_UPDATES = 0; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import itertools | |
| import psycopg2 | |
| import json | |
| import random | |
| import csv | |
| import time | |
| import sys | |
| import datetime | |
| import pytz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import http from "k6/http"; | |
| import { check } from "k6"; | |
| import { Trend } from "k6/metrics"; | |
| import { htmlReport } from "https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js"; | |
| import { textSummary } from "https://jslib.k6.io/k6-summary/0.0.1/index.js"; | |
| import papaparse from "https://jslib.k6.io/papaparse/5.1.1/index.js"; | |
| const citiesreq_dur = new Trend("zdur_citiesreq"); | |
| const allchoicesreq_dur = new Trend("zdur_allchoicesreq"); | |
| const campaignsreq_dur = new Trend("zdur_campaignsreq"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- public.hfn definition | |
| -- Drop table | |
| -- DROP TABLE public.hfn; | |
| CREATE TABLE public.hfn ( | |
| "InvoiceID" int8 NULL, | |
| "PayerAccountId" float4 NULL, | |
| "LinkedAccountId" float4 NULL, |