Skip to content

Instantly share code, notes, and snippets.

View sabapathygithub's full-sized avatar
🏠
Working from home

Sabapathy Kathiresan sabapathygithub

🏠
Working from home
View GitHub Profile
@sabapathygithub
sabapathygithub / logic_gate.py
Last active September 13, 2022 17:54
Logic gate code with dynamic image updation
from PyQt5.Qt import *
class TestDialog(QDialog):
def __init__(self, is_poisson=False,
flag=Qt.WindowSystemMenuHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint):
super(TestDialog, self).__init__(None, flag)
self.setGeometry(0, 0, 400, 300)
grid_layout = QGridLayout()
@sabapathygithub
sabapathygithub / background_worker_sample.py
Created July 14, 2021 08:15
Code to achieve multithreading with pyqt5 framework.
import sys
from time import sleep
import traceback
from PyQt5.QtCore import *
from PyQt5.QtWidgets import (
QApplication,
QLabel,
QMainWindow,
QPushButton,
@sabapathygithub
sabapathygithub / pandas_notes.py
Created July 13, 2021 02:11
Pandas important notes
# Concating numpy arrray and form pandas data frame.
import pandas as pd
points = np.asarray(self.pcd_data.points, dtype=np.float32)
pd_points = pd.DataFrame(data=points, columns=["X", "Y", "Z"])
colors = np.asarray(self.pcd_data.colors, dtype=np.float32)
pd_colors = pd.DataFrame(data=colors, columns=["R", "G", "B"])
normals = np.asarray(self.pcd_data.normals, dtype=np.float32)
pd_normals = pd.DataFrame(data=normals, columns=["NX", "NY", "NZ"])
test_dataframe = pd.concat([pd_points, pd_colors, pd_normals], axis=1)
@sabapathygithub
sabapathygithub / Autoscroll.js
Last active July 12, 2024 04:06
Auto scroll to bottom of the page in JavaScript with smooth scrolling based on time delay.
function scrollToBottom(timedelay=0) {
var scrollId;
var height = 0;
var minScrollHeight = 100;
scrollId = setInterval(function () {
if (height <= document.body.scrollHeight) {
window.scrollBy(0, minScrollHeight);
}
else {
clearInterval(scrollId);