Skip to content

Instantly share code, notes, and snippets.

View emsesc's full-sized avatar
:shipit:

Emily Chen emsesc

:shipit:
View GitHub Profile
@emsesc
emsesc / hw.c
Created February 2, 2024 16:53
#include <stdio.h>
#include <stdlib.h>
int main( int argc, char** argv) {
char toLower[1000];
fgets(toLower, sizeof(toLower), stdin);
for (int i = 0; toLower[i] != '\0'; i ++) {
if (toLower[i] > 64 && toLower[i] < 91) {
printf("%c", toLower[i] + 32);
#include <stdio.h>
int main() {
// initialize input array and int array holding offending lines
char lines[1000];
int offend[100] = {0};
// initialize counter for number of offending lines and the current lineNum
int oLines = 0;
int lineNum = 0;
const AWS = require('aws-sdk');
// Configure the AWS SDK with your IAM user's credentials
AWS.config.update({
accessKeyId: 'YOUR_ACCESS_KEY_ID',
secretAccessKey: 'YOUR_SECRET_ACCESS_KEY',
region: 'us-east-1' // Replace with your desired AWS region
});
const sts = new AWS.STS();
package a6;
import java.util.*;
public class GraphImpl implements Graph {
Map<String, Node> nodes; //Do not delete. Use this field to store your nodes.
// key: name of node. value: a5.Node object associated with name
private int n;
private int e;
public void insert(int p){
//Hint: remember to update size. Also, remember that we skip index 0 in the array.
/*Your code here */
if (this.size == 0) {
// if array is empty
elts[1] = p;
} else if (this.size != max) {
// if the size isn't already at max
// set spot at the end of heap to new value
package a3;
public class Main {
public static void main(String[] args){
/*
* You will test your own bst implementation in here.
* Do what you wish to in Main, as we will not be running it.
* The grader uses its own Main and calls the methods of your other classes.
package a3;
public class Tester {
public void merge (BST ot) {
BST nt = new BSTImpl();
int[] v1 = new int[]{55,25,105,45,1135,15};
for (int v:v1) { ot.insert(v); }
int[] v2 = new int[]{5,3,8,2,6,1,9,4};
for (int v:v2) { nt.insert(v); }
import json
def lambda_handler(event, context):
# Get the RGB value from the event object (parameter)
rgb = event["queryStringParameters"]["rgb"]
# Split the RGB value into separate red, green, and blue values
split_rgb = rgb.split(',')
# Access each hex value by indexes
@emsesc
emsesc / output.md
Last active February 10, 2023 20:43
Output of YouTube API

Python Script

from youtube_api import YouTubeDataAPI

# Set the API key
API_KEY=""

yt = YouTubeDataAPI(API_KEY)

# Channel IDs
@emsesc
emsesc / twitter_handles.py
Last active December 3, 2022 22:23
Reads web sources from "input.csv" and outputs websites with corresponding Twitter handles.
import csv
import urllib.request
import re
import time
rows = []
# regex function (finds twitter handle)
def getHandle(pattern, html):
result = re.findall(pattern, html)
return result[0][1]