Skip to content

Instantly share code, notes, and snippets.

View rsmahmud's full-sized avatar

Rasel Mahmud rsmahmud

View GitHub Profile
@rsmahmud
rsmahmud / CSE330ETP.cpp
Created November 12, 2018 11:02
CSE330 ETP
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int comparefun (const void *a, const void * b) {
return ( *(int *)a - *(int *)b );
}
#pip pyenchant
import enchant, itertools
characters = input("Enter the letters : ")
min_length = int(input("Enter min length : "))
max_length = int(input("Enter max length : "))
print()
D = enchant.Dict("en_US")
words = set()
from tkinter import *
from tkinter import messagebox
#global constants are named in ALLCAP by convention
global USERID, PASSWD
global STUDENT_NAME, STUDENT_REGI, STUDENT_SPEC, STUDENT_MOBI, STUDENT_MAIL
global SUPERVISER_UID, SUPERVISER_PWD
global SUPERVISER_NAME, SUPERVISER_REGI, SUPERVISER_SPEC, SUPERVISER_MOBI, SUPERVISER_MAIL
def student_login():
@rsmahmud
rsmahmud / .py
Created May 27, 2018 09:09 — forked from siraajul/.py
Calculator
from tkinter import*
def iCalc(source, side):
storeObj = Frame(source,borderwidth = 1, bd= 4,bg="powder blue")
storeObj.pack(side=side,expand=YES,fill=BOTH)
return storeObj
def button (source, side, text, command=None):
storeObj = Button(source, text=text, command=command)
storeObj.pack(side=side,expand=YES,fill=BOTH)
@rsmahmud
rsmahmud / Andrew_and_code_out.py
Created April 30, 2018 08:20
HackerRank Problem 1: find how many times "code out" can be printed from given string. can't use same character twice.
n,st = int(input()),input()
letters = ["c","d","e"," ","u","t"]
print(min(min(list(map(lambda x:st.count(x),letters))),st.count("o")//2))
"""
Andrew loves programming and simply immerses himself in all programming problems he could lay his hands on. He sat in a contest recently and came across an interesting problem. The problem was that he was given a string of random letters and his job was to find the maximum number of times he could spell the word "code out" using all the letters.
@rsmahmud
rsmahmud / recursive_ftp_local_remote.py
Created April 27, 2018 09:13 — forked from subhashdasyam/recursive_ftp_local_remote.py
Recursive FTP with Local and remote paths
import sys,os,zipfile,ftplib, configargparse
from os.path import basename
def ftp_login(user,passwd,host,port=21,timeout=30):
try:
ftp = ftplib.FTP()
ftp.connect(host, port, timeout)
ftp.login(user, passwd)
return ftp
except ftplib.all_errors as e:
@rsmahmud
rsmahmud / sclg4.c
Created April 23, 2018 01:23 — forked from aktau/sclg4.c
A simple WinAPI GetAsyncKeyState()-based keylogger, written a very long time ago. I dug it out of the archives because of a Hacker News post (https://news.ycombinator.com/item?id=7607082). For educational purposes only, of course.
/**
* Copyright (c) 2006, Nicolas Hillegeer
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@rsmahmud
rsmahmud / kernel
Created April 16, 2018 16:49 — forked from willscripted/kernel
Because sometimes in business, your goals are tied to fiscal quarters
Linux - elitist attitude - only considers patche of real-world problems. Marketing bullets or one-off requests, such as pageable kernel memory, have received no consideration
Kernel Development
Introduction
==============
History
-----------
@rsmahmud
rsmahmud / pid_man.c
Last active February 22, 2020 03:45
OS Assignment - PID Manager
/********************************************************************************************
Create a Process Id (PID) manager that keeps track of free PIDs and ensures
that no two active processes are having the same pid. Once a process terminates
the PID manager may assigns its pid to new process.
Use the following constants to identify the range of possible pid values:
#define MIN PID 100
#define MAX PID 1000
You may use any data structure of your choice to represent the availability
of process identifiers. One strategy is to adopt what Linux has done and use
@rsmahmud
rsmahmud / q9.c
Created April 15, 2018 21:47
OS Assignment Q9 - Write a program in C which reads input CPU bursts from a the first line of a te xt file named as CPU_BURST.txt. Validate the input numbers whether the numbers are positive intergers or not. Consider the numbers as CPU burst.If there are 5 positive integers in the first line of the text file then the program treat those argumen…
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#define FILE_NAME "CPU_BURST.txt"
struct Process{
int at,bt,wt,tat;
char name[4];
};