Skip to content

Instantly share code, notes, and snippets.

View tejasvi's full-sized avatar
:octocat:
init 5

Tejasvi S. Tomar tejasvi

:octocat:
init 5
View GitHub Profile
@tejasvi
tejasvi / makelog
Last active March 10, 2019 13:45
make log after successful ../configure in xapian/build
h -Wcast-qual -Wcast-align -Wformat-security -fno-gnu-keywords -Wundef -Woverloaded-virtual -Wstrict-null-sentinel -Wshadow -Wstrict-overflow=1 -Wlogical-op -Wmissing-declarations -Wdouble-promotion -Winit-self -Werror -fvisibility=hidden -fvisibility-inlines-hidden -g -O2 -MT api/postingsource.lo -MD -MP -MF api/.deps/postingsource.Tpo -c /home/tejasvi/xapian/xapian-core/api/postingsource.cc -fPIC -DPIC -o api/.libs/postingsource.o
depbase=`echo api/postlist.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I/home/tejasvi/xapian/xapian-core -I/home/tejasvi/xapian/xapian-core/common -I/home/tejasvi/xapian/xapian-core/include -I'./include' -I/home/tejasvi/xapian/xapian-core/languages -Ilanguages -I/home/tejasvi/xapian/xapian-core/queryparser -Wall -W -Wredundant-decls -Wpointer-arith -Wcast-qual -Wcast-align -Wformat-security -fno-gnu-keywords -Wundef -Woverloaded-virtual -Wstrict-null-sentinel -Wshadow -Wstrict-overflow=1 -Wlogical-op -Wmiss
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(57600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
///Libraries///
#include <PID_v1.h>
#include <stdint.h>
// #include "TouchScreen.h"
//#include <SPI.h>
#include <Wire.h>
//#include <wiinunchuk.h>
#include <Servo.h>
#define MODE 0
Data for record #1:
{"MEASUREMENTS": "", "DESCRIPTION": "Ansonia Sunwatch (pocket compass dial)", "PLACE_MADE": "New York county, New York state, United States", "id_NUMBER": "1974-100", "WHOLE_PART": "WHOLE", "TITLE": "Ansonia Sunwatch (pocket compas dial)", "DATE_MADE": "1922-1939", "COLLECTION": "SCM - Time Measurement", "ITEM_NAME": "Pocket horizontal sundial", "MATERIALS": "", "MAKER": "Ansonia Clock Co."}
Term List for record #1: Q1974-100 Sansonia Scompas Sdial Spocket Ssunwatch XDansonia XDcompass XDdial XDpocket XDsunwatch ZSansonia ZScompa ZSdial ZSpocket ZSsunwatch ZXDansonia ZXDcompass ZXDdial ZXDpocket ZXDsunwatch Zansonia Zcompa Zcompass Zdial Zpocket Zsunwatch ansonia compas compass dial pocket sunwatch
@tejasvi
tejasvi / gist:9f36e2cc371b9331ff2b3eec279f1212
Last active March 26, 2019 13:33
PYTHONPATH=/home/tejasvi/xapian/build/xapian-bindings/python/ python2 code/python/script.py data.csv db
_____________________________________________________
# script output
_____________________________________________________
Traceback (most recent call last):
File "code/python/index1.py", line 6, in <module>
import xapian
File "/home/tejasvi/xapian/build/xapian-bindings/python/xapian/__init__.py", line 29, in <module>
from . import _xapian
switch (d.get_type()) {
case DirectoryIterator::DIRECTORY: {
const char * pt = strrchr(d.leafname(), '.');
if (pt)
if (binary_search(dasfile.begin(), dasfile.end(), pt)) {
index_file(file, url, d, mime_map);
break;
}
size_t new_limit = depth_limit;
import os
import string
import math
#import nltk
lis = []
i = 0
ind = {}
def binary_search(array, target):
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
import sys
np.set_printoptions(threshold=sys.maxsize)
ig1 = cv.imread('i2.jpg', 0)
ic1 = cv.imread('i2.jpg', 1)
ig2 = cv.imread('i1.png', 0)
ic2 = cv.imread('i1.png', 1)
@tejasvi
tejasvi / drive.py
Created October 6, 2019 05:17
mass delete drive files
from __future__ import print_function
import httplib2
import os
from oauth2client.file import Storage
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
@tejasvi
tejasvi / speak.py
Created November 19, 2019 15:30
Retrieve Ame pronunciation of words offered by google
import urllib.request
import shutil
...
# Download the file from `url` and save it locally under `file_name`:
with urllib.request.urlopen(url) as response, open(file_name, 'wb') as out_file: