Skip to content

Instantly share code, notes, and snippets.


Anoop Kumar optimistanoop

Block or report user

Report or block optimistanoop

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import logging
sysdate = str(
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
level=logging.DEBUG)'anp main')
optimistanoop /
Created Jul 23, 2019
Offline sqlite python
import sqlite3
class Offline:
def __init__(self):
print('hello offline')
self.conn = sqlite3.connect('offline.db')
c = self.conn.cursor()
c.execute('''CREATE TABLE IF NOT EXISTS visitors (id INTEGER PRIMARY KEY, clientId text, locationId text, cameraNumber text, frame text)''')
c.execute('''CREATE TABLE IF NOT EXISTS errors (id INTEGER PRIMARY KEY, clientId text, locationId text, cameraNumber text, frame text, errors text, er_cat text)''')
# sql1 = 'DELETE FROM Frames_and_Scores'
# c.execute(sql1)
optimistanoop /
Last active Jun 24, 2019
running wesense app

Running wesense app

nohup python <file name>.py &

to see the output from a file

tail -f <file name>

optimistanoop /
Last active May 8, 2019
python modules installed in local folder

pip3 install numpy -t py_modules/

pip3 install -r requirements.txt -t py_modules/

Use this below lines for referencing your local py_modules

import os
import sys
where_am_i = os.path.dirname(os.path.abspath(__file__))
optimistanoop /
Last active Jun 24, 2019
generate exe from pyinstaller

To generate .exe file

pyinstaller -F --add-data <path of open cv file>;. <main file of codebase>


pyinstaller -F --add-data C:\Users\Anoop\AppData\Local\Programs\Python\Python35\Lib\site-packages\cv2\opencv_ffmpeg410_64.dll;.

other commands

pyinstaller -F

optimistanoop /
Last active Apr 9, 2019
AI python issues

ImportError: numpy.core.multiarray failed to import

pip install -U numpy

ImportError: DLL load failed: The specified procedure could not be found.

pip install protobuf==3.6.0

View manifest.json
"name": "Commonfloor",
"short_name": "CF",
"display": "minimal-ui",
"start_url": "/",
"theme_color": "#673ab6",
"background_color": "#111111",
"icons": [
"src": "cf_logo.png",
optimistanoop / app.js
Created Apr 25, 2018
web form validator.
View app.js
function trim(str) {
str = str.replace(/\s+/g, ' ');
str = str.replace(/^\s|\s$/g, '');
return str;
function isValidPassword(str) {
let returnValue = false;
// check for null string
optimistanoop /
Last active Apr 24, 2018
running node on android.

Download and install the Termux android application from google playstore. The system requirement for installing it is Android version 5.0+. Open the Termux app. It will show you a Command Line Interface. Type these commands:

  • First check it for updates and upgrades:

    $ apt update && apt upgrade
  • Termux comes with minimal base system, so consider installing coreutils for full fledged commands of CLI:

optimistanoop / app.MD
Created Apr 17, 2018
my bash profile
View app.MD
### Aliases

# Open specified files in Sublime Text
# "s ." will open the current directory in Sublime
# alias s='open -a /Applications/Sublime\ Text\'
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# Color LS
alias ls="ls ${colorflag}"
You can’t perform that action at this time.