Skip to content

Instantly share code, notes, and snippets.

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

Vibhu Jawa VibhuJawa

🏠
Working from home
  • Nvidia
  • Santa Clara
View GitHub Profile
Query 01
Find top 100 products that are sold together frequently in given stores. Only products in certain categories
sold in specific stores are considered, and "sold together frequently" means at least 50 customers bought
these productstogether in a transaction.
Query 02
Find the top 30 products that are mostly viewed together with a given product in online store. Note that
the order of products viewed does not matter, and "viewed together" relates to a web_clickstreams
click_session of a known user with a session timeout of 60min.If the duration between two click of a user is
greater then the session timeout, a new session begins. With a session timeout of 60min.
Query 03
@pentschev
pentschev / pynvml_query_memory.py
Last active April 28, 2020 08:22
Query used GPU memory with pynvml
import datetime
import getopt
import os
import sys
import time
import pynvml
def get_printable_util_mem(dev_count, peak_mem):
@VibhuJawa
VibhuJawa / gutenburg_read_tokenize_gv100_run.ipynb
Last active August 26, 2019 18:27
Gutenburg read tokenize gv100_run
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rspeare
rspeare / p_values_for_logreg.py
Last active December 29, 2024 07:04
P values for sklearn logistic regression
from sklearn import linear_model
import numpy as np
import scipy.stats as stat
class LogisticReg:
"""
Wrapper Class for Logistic Regression which has the usual sklearn instance
in an attribute self.model, and pvalues, z scores and estimated
errors for each coefficient in
@ravibhure
ravibhure / git_rebase.md
Last active April 11, 2025 09:30
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@jcrist
jcrist / trace.py
Last active September 27, 2022 15:59
Dask Execution Tracer
import os
from dask.callbacks import Callback
from dask.dot import dot_graph
class Track(Callback):
def __init__(self, path='dasks', save_every=1):
self.path = path
self.save_every = save_every
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 13, 2025 18:32
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j