Skip to content

Instantly share code, notes, and snippets.

View rischanlab's full-sized avatar
💭
I may be slow to respond.

Rischan Mafrur rischanlab

💭
I may be slow to respond.
View GitHub Profile
@rischanlab
rischanlab / latexSubtable.tex
Last active November 24, 2021 08:35
Sub Table in Latex
%Rischan Mafrur
%Sub Table in Latex
% May 20, 2014
\begin{table}[h]
\begin{subtable}[h]{0.16\textwidth}
\centering
\begin{tabular}{|l|l|}
XXX & YYY\\
@rischanlab
rischanlab / subfigure_span.tex
Created May 23, 2014 19:04
Subfigure span the two columns in IEEEtrans style
\begin{figure*}%
\centering
\begin{subfigure}{.95\columnwidth}
\includegraphics[width=\columnwidth]{tolakpartaipoligami_pie3D.png}%
\caption{\#TolakPartaiPoligami hashtag}
\label{fig:sub1}
\end{subfigure}\hfill%
\begin{subfigure}{.95\columnwidth}
\includegraphics[width=\columnwidth]{sayapilihpks_pie3D.png}%
\caption{\#SayaPilihPKS hashtag}
@rischanlab
rischanlab / matlab.desktop
Created May 20, 2014 06:27
Create Shortcut application in Desktop Ubuntu
#in this case I use matlab application in Ubuntu
sudo wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png
#download image for matlab
#go to this path
/usr/share/applications/matlab.desktop
#Insert this content to the matlab.desktop
[Desktop Entry]
@rischanlab
rischanlab / cbers.py
Created January 19, 2017 05:32
Ingest new cbers catalogue
__author__ = 'rischan - <--rischan@kartoza.com-->'
__date__ = '3/4/16'
import os
import sys
import glob
from cmath import log
from datetime import datetime
from xml.dom.minidom import parse
import traceback
@rischanlab
rischanlab / tweet_dumper.py
Created May 29, 2016 01:53 — forked from yanofsky/LICENSE
A script to download all of a user's tweets into a csv
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
@rischanlab
rischanlab / delete_all_tweets.py
Created May 24, 2016 17:31 — forked from vik-y/delete_all_tweets.py
This script will delete all of the tweets in a specified account.
# -*- coding: utf-8 -*-
"""
This script is forked originally from Dave Jeffery. The original implementation
was very slow and deleted around 2 tweets per second. Making it multithreaded I
am able to delete 30-50 tweets per second.
@author: vik-y
----------------------------------------------------------------------------
This script will delete all of the tweets in the specified account.
__author__ = 'rischan'
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand
from agri_mapper.utilities.script import CallWMS, CallWFS, UpdateModel
import logging
logger = logging.getLogger(__name__)
@rischanlab
rischanlab / preprocessing2.R
Last active September 16, 2015 04:00
Second Preprocessing for Personal user behavior data
### Author Information #####
### Coded by Rischan Mafrur ###
### 01/01/2015 ###
### For Thesis Purpose ###
### Language : R ###
### Dataset : Private Data ###
#Function for loading data
f_load_data <- function(path){
library(shiny)
@rischanlab
rischanlab / preprocessing_data.R
Last active September 16, 2015 04:00
This source code is for preprocessing our research data (personal user data behavior data)
### Author Information #####
### Coded by Rischan Mafrur ###
### 01/01/2015 ###
### For Thesis Purpose ###
### Language : R ###
### Dataset : Private Data ###
#Function for loading data
f_load_data <- function(path){
library(shiny)
#to make the final table, I changed manually the n size every trial by: 1e3, 1e4, 1e5, 1e6, 1e7. Then I also chnaged the benchmark object 'res'
n <- 1e7
set.seed(51)
process <- data.frame(id=sample(100, n, rep=T), x=rnorm(n), y=runif(n), z=rpois(n, 1) pexp(2, rate=1/3) )
all <- multicore:::detectCores(all.tests=TRUE)
if(!require(rbenchmark)){
install.packages("rbenchmark")
} else{