Skip to content

Instantly share code, notes, and snippets.

💭
<tod-fod-code>

Anoop Kumar optimistanoop

💭
<tod-fod-code>
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
View logging.py
import logging
sysdate = str(datetime.date.today())
logging.basicConfig(filename=sysdate+'.log',
filemode='a',
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
datefmt='%H:%M:%S',
level=logging.DEBUG)
logging.info('anp main')
@optimistanoop
optimistanoop / offline.py
Created Jul 23, 2019
Offline sqlite python
View offline.py
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
optimistanoop / app.md
Last active Jun 24, 2019
running wesense app
View app.md

Running wesense app

nohup python <file name>.py &

to see the output from a file

tail -f <file name>

@optimistanoop
optimistanoop / app.md
Last active May 8, 2019
python modules installed in local folder
View app.md

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
optimistanoop / pyinstallerWithMxnet.md
Last active Jun 24, 2019
generate exe from pyinstaller
View pyinstallerWithMxnet.md

To generate .exe file

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

example

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

other commands

pyinstaller -F getface.py

@optimistanoop
optimistanoop / readme.md
Last active Apr 9, 2019
AI python issues
View readme.md

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
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
optimistanoop / app.md
Last active Apr 24, 2018
running node on android.
View app.md

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
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\ 2.app/Contents/SharedSupport/bin/subl'
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# Color LS
colorflag="-G"
alias ls="ls ${colorflag}"
You can’t perform that action at this time.