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
#!python | |
# A quick utility to fetch the Jummal value of an Arabic string or a series of strings. | |
# -- Abdullah S. A. Alothman. February 19, 2020. | |
import re | |
class Jummal: | |
def __init__(self): | |
self.valueMap = dict() # A dictionary of letters and their values. |
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
#!/usr/bin/env python3 | |
# Find name of week day from a provided date (day/month/year) | |
# Abdalla S. Alothman, 2014 | |
# For details, please see: | |
# https://cs.uwaterloo.ca/~alopez-o/math-faq/node73.html | |
# http://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week#Other_variations | |
############################################################################### | |
import re, math | |
def computeWeekDay(d, m, y): | |
# Map result from formula to possible days |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
//////////////////// Remove Character from String ///////////////////////////// | |
char *removeChar(const char *check, const char remove) | |
{ | |
char *p = malloc(sizeof(char) + 1); | |
unsigned short int f = 0; | |
for(unsigned short int x = 0; check[x] != '\0'; ++x) | |
{ |
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
#!/usr/bin/python3 | |
import time | |
cycles = int() | |
def hanoi(discs, mainTower, target, auxTower): | |
global cycles | |
if discs >= 1: | |
cycles += 1 | |
hanoi(discs - 1, mainTower, auxTower, target) | |
print("[Cycle {:<3}]\tMove disc {:<5} from {:^10} to {:^10}".format(cycles, discs, mainTower, target)) |
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
#!/usr/bin/python3 | |
class ArIdNumberHandler: | |
def __init__(self): | |
self.numMap = {0: "٠", | |
1: "١", | |
2: "٢", | |
3: "٣", | |
4: "٤", | |
5: "٥", |
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
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <tuple> | |
using namespace std; | |
int main() | |
{ | |
vector<tuple<string, unsigned short, unsigned short, string, double>> v2; |
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
#!/usr/bin/python3 | |
# This is downloading class which uses python 3 with PyQt4. It shows how to use the | |
# QT progress bar in python. The downloading takes place in the UrlDownloader class | |
# which inherits from QThread. | |
# | |
# To test the widget: | |
# 1. try copying a URL that points to a large file. | |
# 2. Paste the file url into the combobox's text area, but do nothing more. | |
# 3. Copy another URL pointing to a large file. |