Skip to content

Instantly share code, notes, and snippets.

View bhavul's full-sized avatar
👨‍💻
from sky import *

Bhavul Gauri bhavul

👨‍💻
from sky import *
View GitHub Profile
@bhavul
bhavul / code_server_install_instructions.sh
Last active December 1, 2020 07:59
Installing code-server on server
# Use install script - it's the best idea.
https://github.com/cdr/code-server/blob/v3.7.3/doc/guide.md#1-acquire-a-remote-machine
# For exposing, I've tried 'em all. The SSH forwarding method doesn't work. Caddy requires a domain name.
# Resorted to last option...self-signed certificate
# to run it on https://<instance-ip> you may need to have a self-signed certificate
# understand how to generate one
https://kifarunix.com/how-to-create-self-signed-ssl-certificate-with-mkcert-on-ubuntu-18-04/
# generate one on local
from wordnik import *
wordToFind = "eloquent"
WORDNIK_APIKEY = "df571d345a98541fd4089056ad12ada5715d7998e77ee5111"
wordnikApiUrl = 'http://api.wordnik.com/v4'
client = swagger.ApiClient(wordnikApiKey, wordnikApiUrl)
wordConnection = WordApi.WordApi(client)
definition = wordConnection.getDefinitions(word=wordToFind,sourceDictionaries='wiktionary')
@bhavul
bhavul / test_twython.py
Last active April 8, 2019 11:31
This is an example of how to tweet using Twython
from twython import Twython
tweet_string = "hello, world."
API_KEY = "iHDICWjSK3FXJv6sgCUDwg2hg"
API_SECRET = "VRialcPgfLwey43ryzqSq7R5P6IPVyR3Djty3gKL7HgabqDRNj"
ACCESS_TOKEN = "734117510488854528-iAqT0rHR89Svjdi6ZELvzqmGDFCXNd8"
ACCESS_SECRET = "etLHwcnLcH2NwTlklQc0GPTzrICLulpWtQ2MtYr0WVnwX"
api = Twython(API_KEY, API_SECRET, ACCESS_TOKEN, ACCESS_SECRET)
@bhavul
bhavul / Import
Last active March 22, 2019 21:01
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot
init_notebook_mode(connected=True)
import plotly.graph_objs as go
import plotly.plotly as py
@bhavul
bhavul / Troubleshoot-dcnn.md
Created August 27, 2018 19:20 — forked from zeyademam/Troubleshoot-dcnn.md
Troubleshooting Convolutional Neural Nets

Troubleshooting Convolutional Neural Networks

Intro

This is a list of hacks gathered primarily from prior experiences as well as online sources (most notably Stanford's CS231n course notes) on how to troubleshoot the performance of a convolutional neural network . We will focus mainly on supervised learning using deep neural networks. While this guide assumes the user is coding in Python3.6 using tensorflow (TF), it can still be helpful as a language agnostic guide.

Suppose we are given a convolutional neural network to train and evaluate and assume the evaluation results are worse than expected. The following are steps to troubleshoot and potentially improve performance. The first section corresponds to must-do's and generally good practices before you start troubleshooting. Every subsequent section header corresponds to a problem and the section is devoted to solving it. The sections are ordered to reflect "more common" issues first and under each header the "most-eas

import os
import sys
from datetime import datetime
def main():
for afile in os.listdir(os.getcwd()):
fileBreak = afile.split('.')
extension = fileBreak[1]
if extension == "3gp":
import os
import sys
from sets import Set
def main():
phoneDict = Set()
for afile in os.listdir(os.getcwd()):
print afile
fileBreak = afile.split('.')
datePhoneBreak = fileBreak[0].split('p')
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
if(fork()) //1st child p2 created
{
printf("after first fork. pid : %d\n", getpid());
if(fork()) //2nd child p3 created
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
if(fork()) //1st child p2 created
{
if(fork()) //2nd child p3 created
{