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
/** | |
* 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"; |
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.Scanner; | |
/** | |
* | |
* @author Ranajoy Saha | |
*/ | |
class Node { | |
int data; | |
Node next; |
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 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: |
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 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 |
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
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)) |
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
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)) |
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.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 |
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
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: |
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
from dataclasses import dataclass | |
import mysql.connector | |
# Create Database | |
mydb = mysql.connector.connect( | |
host="localhost", | |
user="root", | |
password = "123456" | |
) |
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.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 |
NewerOlder