Skip to content

Instantly share code, notes, and snippets.

@sarthoksarik
sarthoksarik / gits.txt
Created July 4, 2024 09:23
kabir teaching
git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
mkdir my-project
cd my-project
git init
# adding files
git add .
gdsgg gdsfgdf gfdsfg
@sarthoksarik
sarthoksarik / tideman.c
Created October 19, 2020 17:20
my attempt for completing the tideman problem
/**
* Sarik Sadman
* started 17-10-2020
* took almost three days to reach here
*/
#include <cs50.h>
#include <stdio.h>
#include <string.h>
@sarthoksarik
sarthoksarik / merge_by_sarik.c
Created October 17, 2020 11:23
merge sort for pset3
#include <stdio.h>
void sort(int arr[], int start, int end);
void merge(int arr[], int start, int middle, int end);
int main(void)
{
const int SIZE = 10;
int arr[] = {120, 69, 28, 22, 22, 35, 102, 239, 1001, 7};
sort(arr, 0, SIZE - 1);
@sarthoksarik
sarthoksarik / readability.c
Created October 11, 2020 18:47
cs50x 2020
/** cs50x 2020
* sarik sadman
* started: 23:11 11/11/2020
*/
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
@sarthoksarik
sarthoksarik / credit.c
Created October 11, 2020 06:57
credit of pset1 of cs50
/** 11-10-2020 12:56 pm
sarik sadman
biwta office
*/
#include <cs50.h>
#include <stdio.h>
int get_length(long);
int check_luhns(long, int);
@sarthoksarik
sarthoksarik / mario.c
Created October 10, 2020 17:25
cs50 mario submission
/* 10 - 10 - 2020
mario submission */
#include <stdio.h>
#include <cs50.h>
void charprinter(int, string);
int main(void)
{
@sarthoksarik
sarthoksarik / previous_credit.c
Created October 10, 2020 17:14
previous_credit.c
#include <stdio.h>
#include <cs50.h>
/**
* 2015-08-16
*12-52
*/
int main(int argc, char *argv[])
{
//use input
long long int input;
from PIL import Image
import os
IMAGE_PATH = "./images/"
print(os.listdir(IMAGE_PATH))
for img in os.listdir(IMAGE_PATH):
filename, ext = img.split(".")
imfile = Image.open(IMAGE_PATH+img)
imfile = imfile.convert('L') # use '1' for pure black and white
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char *argv[]){
clock_t start, end;
double cpu_time_used;
start = clock();
int n = 0;
int h = atoi(argv[1]);