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
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 |
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
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 |
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
import bpy | |
import redis | |
import json | |
r = redis.StrictRedis(host='localhost', port=6380, db=0) | |
last1 = None | |
last2 = None | |
def worker(): |
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
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", |
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
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 |
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
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!'); |
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
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 |
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
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; |
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
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', |
NewerOlder