Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tomrock D'souza tomrockdsouza

🏠
Working from home
View GitHub Profile
View sqlite_worker.py
import sqlalchemy
import sqlite3
def get_engine_conn(dbx):
return sqlalchemy.create_engine(f'sqlite:///{dbx}')
def get_conn(dbx):
return sqlite3.connect(dbx)
@tomrockdsouza
tomrockdsouza / create_sqlite3_db.py
Created Feb 27, 2022
Create a SQLite database within seconds without 3rd party libraries.
View create_sqlite3_db.py
import sqlite3
import re
if __name__ == '__main__':
database_name=input('Enter Database Name: ')
database_name=re.sub(r'\W+', '', database_name)
conn = sqlite3.connect('./'+database_name+'.db')
conn.close()
View dc.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://cdn.rawgit.com/ricmoo/aes-js/e27b99df/index.js"></script>
<script>
function decryptAES(encryptedHex){
// An example 128-bit key
var key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ];
@tomrockdsouza
tomrockdsouza / tommy.py
Last active Nov 27, 2017
Stack based Flood Fill algorithm in Python
View tommy.py
row=int(input())
col=int(input())
xpoint=int(input())
ypoint=int(input())
mult = row * col
p=[]
def isPrime(num):
for x in reversed(range(2,num)):
if num%x==0 and num>1 :
@tomrockdsouza
tomrockdsouza / tom_scraper.py
Last active Nov 25, 2017
Create a web scrapper which will take Consumer Number as input and crawl payment detail
View tom_scraper.py
'''
Create a web scrapper which will take Consumer Number as input and crawl payment detail from here.
https://www.mgvcl.in:7013/.../LaunchPortal/LaunchDesktop...
Eg.
Input:
(Consumer No) 41102
Output:
{"consumer_no":41102,"consumer_name":"D.E.E. Western Railway Loco Work Shop","bill_date":"AUG-2017","bill_amount":"1351462.58","amount":1351462.58}
@tomrockdsouza
tomrockdsouza / palidrome-number.js
Created Jul 5, 2017
Small program to find if a number is a palindrome string in it's decimal form.
View palidrome-number.js
function palinum(a){
b=a;
c=0;
while(b!=0){
c*=10;
c+=b%10;
b/=10;
b=Math.floor(b);
}
console.log(c==a);
@tomrockdsouza
tomrockdsouza / manage-files.bat
Created Jun 28, 2017
Segregates files based on their type. This helps to manage important folders Like Desktop and Downloads and reduces their load time.
View manage-files.bat
@echo off
if exist "*.aif" mkdir "data/Music"
echo no | move /-Y "*.cda" "data/Music"
if exist "*.cda" mkdir "data/Music"
echo no | move /-Y "*.cda" "data/Music"
if exist "*.mid" mkdir "data/Music"
echo no | move /-Y "*.mid" "data/Music"
if exist "*.midi" mkdir "data/Music"
echo no | move /-Y "*.midi" "data/Music"
if exist "*.mp3" mkdir "data/Music"
@tomrockdsouza
tomrockdsouza / adversarial.c
Created Jun 2, 2017
C Implementation of adversarial search ( MIN-MAX )
View adversarial.c
/**
* Implementation of adversarial search
* Example To Use Program :https://s15.postimg.org/yyh4lhdsr/Adversial.png
*
* Email: engineer.rc1@gmail.com
* @author Tomrock D'souza, St. Francis Institute Of Technology, University of Mumbai, 2017
* @copyright GNU General Public License v3.0
* No reproduction in whole or part without maintaining this copyright notice
* and imposing this condition on any subsequent users.
*/
@tomrockdsouza
tomrockdsouza / PUZZ8.C
Created Jun 2, 2017
C Implementation of 8puzzle problem using Heuristic Function
View PUZZ8.C
/**
* Implementation of 8puzzle problem using Heuristic Function
* Needed matrix can be changed by altering variable array[9]
* 1 2 3
* 8 0 4
* 7 6 5
*
* Input at the start Example
* Enter values:2 8 3 1 6 4 7 0 5
*
@tomrockdsouza
tomrockdsouza / Scm_matrix.c
Created Jun 2, 2017
C Implementation for Matrix Method using Transportation Problem SCM
View Scm_matrix.c
/**
* @main-author Tomrock D'souza, St. Francis Institute Of Technology, University of Mumbai, 2017
* Email: engineer.rc1@gmail.com
* No reproduction in whole or part without maintaining this notice
* and imposing this condition on any subsequent users.
* Example: https://postimg.org/image/y55004t9z/
*/
#include<stdio.h>
#include<conio.h>