Skip to content

Instantly share code, notes, and snippets.

View tinvaan's full-sized avatar
🏠
Working from home

Harish Navnit tinvaan

🏠
Working from home
View GitHub Profile
@tinvaan
tinvaan / arrays.cpp
Last active January 26, 2017 14:46
Store days
/**
Opening and closing hours for a store:
Given two arrays of si*ze seven that respectively indicate opening and closing hours over days of week for a store, print the store hours in friendly format.
Special Conditions:
1. If opening hours are greater than closing hours, the store is assumed closed on that day.
2. If opening/closing hours are greater than 2400 hours or for any other error condition, the store is assumed closed that day.
3. If opening hours are equal to closing hours, the store is open for 24 hours.
Example:
Open - [900,1000,1000,1000,2700,1200,800]
@tinvaan
tinvaan / scraper.py
Created January 15, 2017 20:14
web scraping example in python
#! /usr/bin/env python
import os, sys, dropbox
from bs4 import BeautifulSoup
from urllib.request import urlopen
errorStrings = []
def formulateErrorStrings(tin):
errorStrings.append('Dealer Not Found for the entered TIN ' + tin)
#! /bin/bash
# Qt unsigned integer types to STL unsigned integer types
sed -e 's/quint64/uint64_t/g' $* -i &&
sed -e 's/quint32/uint32_t/g' $* -i &&
sed -e 's/quint16/uint16_t/g' $* -i &&
sed -e 's/quint8/uint8_t/g' $* -i &&
# Qt integer types to STL integer types
sed -e 's/qint64/int64_t/g' $* -i &&