Skip to content

Instantly share code, notes, and snippets.

View MahraibFatima's full-sized avatar
:fishsticks:
striving

Mahraib Fatima MahraibFatima

:fishsticks:
striving
View GitHub Profile
@MahraibFatima
MahraibFatima / HelloWorld.asm
Created December 9, 2023 12:16
print "Hello World!" in Assembly language
org 100h
.model small
.stack 100h
.data
bval db 'Hello, World!$'
.code
main proc
@MahraibFatima
MahraibFatima / printIntegerArray.asm
Created December 9, 2023 13:33
print integer array in assembly language
org 100h
.data
array db 1h, 2h ,3h ,4h
.code
main proc
mov ax, @data
mov ds, ax
@MahraibFatima
MahraibFatima / printStringUsingLoop.asm
Last active December 9, 2023 13:42
print a string using loop in asm
org 100h
.data
array db 'Hello World!$'
.code
main proc
mov ax, @data
mov ds, ax
mov si, offset array
@MahraibFatima
MahraibFatima / fabonacci.asm
Created December 22, 2023 07:56
calculate fabonacci series of numbers in assembly code
.data
num dw 8 ; Variable to store the number of Fibonacci sequence terms
sum dw 0 ; Variable to store the sum of Fibonacci sequence terms
res dw 0 ; Variable to store the result of the Fibonacci sequence
.code
main proc
mov ax, 0 ; Initialize first Fibonacci term to 0
mov bx, 1 ; Initialize second Fibonacci term to 1
@MahraibFatima
MahraibFatima / LineCorrector.py
Created February 7, 2024 08:36
This code will attempt to correct spelling, basic grammar, and some common punctuation errors in the input line.
from textblob import TextBlob
line = input("Enter any incorrect phrase: ")
corrected_line = TextBlob(line).correct()
print("Original line:", line)
print("Corrected line:", corrected_line)
@MahraibFatima
MahraibFatima / langDectector.py
Created February 16, 2024 13:16
So the user can enter text in whatever language the user likes, program will detect that language but it will give the short form of that language as output.
from langdetect import detect
text = input("Enter any text in any language: ")
print(detect(text))
@MahraibFatima
MahraibFatima / ageCalculator.py
Last active February 27, 2024 17:17
A program where a user enters his date of birth as an input, and the application gives his age as an output.
import datetime
def get_valid_date(prompt):
while True:
try:
date_str = input(prompt)
date = datetime.datetime.strptime(date_str, '%Y-%m-%d').date()
return date
except ValueError:
print("Please enter a valid date in the format YYYY-MM-DD.")
@MahraibFatima
MahraibFatima / CreateQR.py
Created February 25, 2024 15:14
create QR.png file of given url (if valid)
import pyqrcode
try:
link = input("Enter your link: ")
qr_code = pyqrcode.create(link)
qr_code.png("your_qr_code.png", scale=5)
print("QR code generated successfully!")
except Exception as e:
print("An error occurred:", e)
@MahraibFatima
MahraibFatima / DecodeQR.py
Created February 26, 2024 14:36
This code will decode the QR code or barcode data from the PNG image using "pyzbar" and then print the decoded data as ASCII. In this we have to replace "your_image.png" with the path to our actual PNG file.
from PIL import Image
from pyzbar.pyzbar import decode
image = Image.open("your_image.png")
decoded_objects = decode(image)
for obj in decoded_objects:
print(obj.data.decode('ascii'))
@MahraibFatima
MahraibFatima / printMonth.py
Created February 27, 2024 17:09
We can use the calendar module in Python to easily print a calendar in just a few lines of code.
import calendar
print(calendar.month(2024, 5))