Skip to content

Instantly share code, notes, and snippets.

View tomrockdsouza's full-sized avatar
🏠
Busy

Tomrock D'souza tomrockdsouza

🏠
Busy
View GitHub Profile
'''
Most efficient algorithm in python
Get prime numbers upto a given number.
By Tomrock D'souza
'''
from numba import jit
from time import time
@jit(nopython=True)
@tomrockdsouza
tomrockdsouza / expose_local_server.md
Last active December 30, 2023 19:10
Commands and Instruction to expose your local server unlimited on the web with any domain or subdomain
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Hennge Senior Software Engineer (Python Challenge)
#######################################################################
# Mission Description
#
# We want to calculate a sum of squares of some integers, excepting negatives
# * The first line of the input will be an integer N (1 <= N <= 100)
# * Each of the following N test cases consists of one line containing an integer X (0 < X <= 100),
# followed by X integers (Yn, -100 <= Yn <= 100) space-separated on the next line
# * For each test case, calculate the sum of squares of the integers excepting negatives,
# and print the calculated sum to the output. No blank line between test cases
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 February 27, 2022 15:45
Create a SQLite database within seconds without 3rd party libraries.
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()
@tomrockdsouza
tomrockdsouza / main.py
Last active December 27, 2024 15:58
Recursive List Based 8 Flood Fill
# python.exe .\fill.py --rows=9 --cols=9 --x=8 --y=5
import fire
def create_image(rows, cols):
def is_prime(num):
for x in reversed(range(2, num)):
if num % x == 0 and num > 1:
return 1
return 0
@tomrockdsouza
tomrockdsouza / manage-files.bat
Created June 28, 2017 18:16
Segregates files based on their type. This helps to manage important folders Like Desktop and Downloads and reduces their load time.
@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 June 2, 2017 13:59
C Implementation of adversarial search ( MIN-MAX )
/**
* Implementation of adversarial search
* Example To Use Program :https://s15.postimg.org/yyh4lhdsr/Adversial.png
*
* Email: [email protected]
* @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 June 2, 2017 11:27
C Implementation of 8puzzle problem using Heuristic Function
/**
* 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
*