Skip to content

Instantly share code, notes, and snippets.

Avatar

Kracekumar kracekumar

View GitHub Profile
View datastructure.py
"""
Datastructures
1. Tuple
2. List
3. Set
4. Dictionary
5. Class
"""
import datetime
View rust.txt
Rust is a multi-paradigm, general-purpose programming language designed for performance and safety,
especially safe concurrency.
Rust is syntactically similar to C++, but can guarantee memory safety by using a borrow checker to validate references.
Rust achieves memory safety without garbage collection, and reference counting is optional.
Rust has been called a systems programming language and in addition to high-level features
such as functional programming it also offers mechanisms for low-level memory management.
First appearing in 2010, Rust was designed by Graydon Hoare at Mozilla Research, with contributions from
Dave Herman, Brendan Eich, and others.
The designers refined the language while writing the Servo experimental browser engine
View python.txt
Python is an interpreted high-level general-purpose programming language.
Its design philosophy emphasizes code readability with its use of significant indentation.
Its language constructs as well as its object-oriented approach aim to help programmers write clear,
logical code for small and large-scale projects.
Python is dynamically-typed and garbage-collected.
It supports multiple programming paradigms, including structured (particularly, procedural),
object-oriented and functional programming. It is often described as a "batteries included" language
due to its comprehensive standard library.
@kracekumar
kracekumar / pyproject.toml
Created Jun 13, 2021
poetry unable to load sqlalchemy stubs
View pyproject.toml
[tool.poetry]
name = "flask-sqlalchemy"
version = "0.0.1"
description = ""
authors = ["kracekumar <>"]
license = "MIT"
readme = ""
repository = ""
[tool.poetry.dependencies]
@kracekumar
kracekumar / collect_tweet.py
Last active May 21, 2020
A simple twiiter program to collect a tweet on a query using tweepy.
View collect_tweet.py
import tweepy
import json
from sqlite_utils import Database
def authenticate():
# twitter API credentials
cred = json.load(open('.cred.json', 'r'))
auth = tweepy.OAuthHandler(consumer_key=cred['api_key'], consumer_secret=cred['api_secret_key'])
auth.set_access_token(key=cred['access_token'], secret=cred['access_token_secret'])
api = tweepy.API(auth)
View response.json
{
"cropHintsAnnotation": {
"cropHints": [
{
"boundingPoly": {
"vertices": [
{
"x": 89
},
{
View custom_predict_mnist_cnn.py
import torch
import torch.nn.functional as F
import torchvision
import torchvision.models as models
import mlflow
import mlflow.pytorch
import numpy as np
class Model(mlflow.pyfunc.PythonModel):
@kracekumar
kracekumar / Analysis.ipynb
Last active May 25, 2019
2019 General and Bye-Elections votes analysis
View Analysis.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View lmdb.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View psql.sql
annotation=> explain (analyze, timing off) select label, value from data limit 10000;
QUERY PLAN
------------------------------------------------------------------------------------------------
Limit (cost=0.00..322.22 rows=10000 width=8) (actual rows=10000 loops=1)
-> Seq Scan on data (cost=0.00..33860.40 rows=1050840 width=8) (actual rows=10000 loops=1)
Total runtime: 5.994 ms
(3 rows)
Time: 6.801 ms