Skip to content

Instantly share code, notes, and snippets.

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import express from "express";
import axios from "axios";
import java.util.Scanner;
/**
*
* @author Ranajoy Saha
*/
class Node {
int data;
Node next;
@tigerjoy
tigerjoy / csv_splitter.py
Created January 8, 2023 10:09 — forked from jrivero/csv_splitter.py
A Python CSV splitter
import os
def split(filehandler, delimiter=',', row_limit=10000,
output_name_template='output_%s.csv', output_path='.', keep_headers=True):
"""
Splits a CSV file into multiple pieces.
A quick bastardization of the Python CSV library.
Arguments:
// Create Google Calendar events from sending an email in Gmail
// Author: Ranajoy Saha (ranajoy123saha@gmail.com)
// Last Updated: November 17th, 2022
//////////////// Setup and global variables ////////////////////////////////
GMAIL_LABEL = 'Adda Notification'
PROCESSED_LABEL = 'Calendar Event Added'
PROCESSED_LABEL_ID = createGmailLabel(PROCESSED_LABEL)
DEFAULT_EVENT_TIME = 30
from datetime import datetime
from app import db, login_manager
from flask_login import UserMixin
# from sqlalchemy import CheckConstraint
@login_manager.user_loader
def load_user(user_id):
return Voter.query.get(int(user_id))
from datetime import datetime
from app import db, login_manager
from flask_login import UserMixin
# from sqlalchemy import CheckConstraint
@login_manager.user_loader
def load_user(user_id):
return Voter.query.get(int(user_id))
import java.util.Scanner;
public class UniqueString
{
boolean isUnique(String str)
{
// The following array holds the frequency or the count
// of the letters that are present in str
// As we have 26 letters from a to z, the size of the array is thus
// 26. Because we can have, both upper case and lower case letters
// we need not store the counts of upper and lowe case seperately, thus
def push(item):
global top, STACK
# We are inserting for the first time
# Hence, set top to 0
# if top is None:
if is_empty():
top = 0
# When inserting elements from second time
# onwards, we increment top by 1
else:
from dataclasses import dataclass
import mysql.connector
# Create Database
mydb = mysql.connector.connect(
host="localhost",
user="root",
password = "123456"
)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
class JComboBoxApp implements ItemListener {
JLabel jl;
public JComboBoxApp(){
// Create a new JFrame container