Skip to content

Instantly share code, notes, and snippets.

View epsi95's full-sized avatar
🎯
Focusing

Probhakar Sarkar epsi95

🎯
Focusing
View GitHub Profile
from .base import Base
import re
import pandas as pd
from pyspark.sql import DataFrame
from functools import reduce
class Base(object):
def __init__(self, spark, host=None, port=None, database=None, username=None, password=None):
self._spark = spark
self._host = host
import json
import cv2
import mediapipe as mp
import redis
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_hands = mp.solutions.hands
import bpy
import redis
import json
r = redis.StrictRedis(host='localhost', port=6380, db=0)
last1 = None
last2 = None
def worker():
import random
import dash
from dash import html, ClientsideFunction, Output, Input
import dash_bootstrap_components as dbc
app = dash.Dash(__name__)
app.config.external_stylesheets = ["https://epsi95.github.io/dash-draggable-css-scipt/dragula.css"]
app.config.external_scripts = ["https://cdnjs.cloudflare.com/ajax/libs/dragula/3.7.2/dragula.min.js",
class Flask:
def __init__(self, import_name):
self.import_name = import_name
self.route_mapping = {} # empty dict to store all the route mapping
def route(self, route_name): # parameterized decorator
def wrapper(view_func):
self.route_mapping[route_name] = view_func
return view_func # here we are just returning the original function not modifying it
return wrapper
import 'package:flutter/material.dart';
import 'package:simple_animations/simple_animations.dart';
class WormAnimationButton extends StatefulWidget {
final Duration animationDuration;
final Function buttonPressedCallBack;
WormAnimationButton(
{this.animationDuration = const Duration(seconds: 1),
this.buttonPressedCallBack});
import 'package:flutter/material.dart';
import 'package:wormmovementanimation/worm_animation_button.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
void buttonPressed(String buttonName) {
print('$buttonName is pressed!');
CustomAnimation(
tween: Tween(begin: 0.0, end: (_screenWidth * 0.8) / 2),
duration: widget.animationDuration,
curve: Curves.easeOut,
control: _control,
builder: (context, child, value) {
return Padding(
padding: EdgeInsets.only(left: value),
child: Container(
width: value <= ((_screenWidth * 0.8) / 2) / 2
import 'dart:math';
import 'package:linalg/linalg.dart';
List calculatePolynomialRegression(List input, List predictionFor) {
// calculate polynomial regression of degree 2
if (input.length == 0) {
return input;
} else {
int sizeOfInput = input.length;
from confluent_kafka import Consumer, KafkaError
import logging
import sys
import json
import datetime
logging.basicConfig(format='%(process)d >> %(asctime)s - %(message)s', level=logging.INFO)
settings = {
'bootstrap.servers': 'localhost:9092',