Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sajid Rahman sajidrahman

🎯
Focusing
Block or report user

Report or block sajidrahman

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
@sajidrahman
sajidrahman / gpt-2-wikitext-103.py
Created Jul 31, 2019 — forked from thomwolf/gpt-2-wikitext-103.py
A very small and self-contained gist to train a GPT-2 transformer model on wikitext-103
View gpt-2-wikitext-103.py
# Copyright (c) 2019-present, Thomas Wolf.
# All rights reserved. This source code is licensed under the MIT-style license.
""" A very small and self-contained gist to train a GPT-2 transformer model on wikitext-103 """
import os
from collections import namedtuple
from tqdm import tqdm
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from ignite.engine import Engine, Events
@sajidrahman
sajidrahman / google-playstore-scraper.js
Created Jun 11, 2019
A sample code snippet to use google-play-scraper API with 'Promise' values.
View google-playstore-scraper.js
/**
Author: Sajid
A sample code snippet to use google play scraper API
with Promise values.
Prerequisite: please install the following libraries first
before testing the code:
npm install franc
@sajidrahman
sajidrahman / tomcat-guide.md
Last active Oct 17, 2018
How to access Tomcat Manager Web Interface
View tomcat-guide.md

Tomcat users are defined in the file $TOMCAT_HOME/conf/tomcat-users.xml, by default, there is NO user, it means no one can access the Tomcat manager page.

To enable users to access the Tomcat manager page, add a user as the role manager-gui.

Step 0. Shutdown Tomcat if it is running. Stop Java process as well, just to be safe.

Step 1. Open tomcat-users.xml file, originally it should contain a commented out part for tomcat-users.

<tomcat-users>
@sajidrahman
sajidrahman / CSVReader.java
Created Apr 4, 2017
Read, cleanup, stem Stack Overflow posts from csv file
View CSVReader.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
@sajidrahman
sajidrahman / lda.R
Created Oct 30, 2016 — forked from abelsonlive/lda.R
topic modeling in R
View lda.R
# Brian Abelson @brianabelson
# Harmony Institute
# December 5, 2012
# lda is a wrapper for lda.collapsed.gibbs.sampler in the "lda" package
# it fits topic models using latent dirichlet allocation
# it provides arguments for cleaning the input text and tuning the parameters of the model
# it also returns alot of useful information about the topics/documents in a format that you can easily join back to your original data
# this allows you to easily model outcomes based on the distribution of topics within a collection of texts
You can’t perform that action at this time.