Skip to content

Instantly share code, notes, and snippets.

Bodong Chen meefen

Block or report user

Report or block meefen

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
@meefen
meefen / server.R
Created Jun 22, 2014
A (to-be-fixed) demo of integrating rCharts' timeline within Shiny.
View server.R
library(shiny)
library(rCharts)
shinyServer(function(input, output) {
output$timelineDemo <- renderChart({
### Copied from https://github.com/ramnathv/sachin100s
require(XML)
require(RCurl)
View fsm.Rmd
Frequent Sequence Mining
========================================================
```{r knitr-options}
library(knitr)
options(width=200, digits=2)
opts_chunk$set(comment = "", warning = FALSE, message = FALSE, echo = TRUE, tidy = FALSE, size="small")
```
## Data preparation
@meefen
meefen / TwitterLoop.java
Last active Dec 30, 2015
This gist contains Java code for archiving tweets in MongoDB, and R code for retrieving tweets for analysis. Please note that there're a couple of dependencies: (1) You should setup your MongoDB (I used the free plan at https://mongolab.com/); (2) You should have setup your Twitter api (check https://dev.twitter.com/); (3) Java code: include twi…
View TwitterLoop.java
package twitter_loop;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.Mongo;
import com.mongodb.MongoException;
import java.net.UnknownHostException;
import java.util.List;
@meefen
meefen / Makefile
Created Nov 13, 2013
Makefile and LaTeX templates for compiling Markdown documents for job application. Applicable to other situations where you need to compile a bunch of Markdown files to PDF or Word/ODT formats.
View Makefile
# Makefile used to compile job application documents from MarkDown to PDF or ODT
# Bodong Chen
## Files
SRC = $(wildcard *.md)
PDFS = $(SRC:.md=.pdf)
ODTS = $(SRC:.md=.odt)
## Targets
all: $(PDFS)
@meefen
meefen / lsa_mds.R
Last active Jan 13, 2019
Analyze Text Similarity in R: Latent Semantic Analysis and Multidimentional Scaling
View lsa_mds.R
# load required libraries
library(tm)
library(ggplot2)
library(lsa)
# 1. Prepare mock data
text <- c("transporting food by cars will cause global warming. so we should go local.",
"we should try to convince our parents to stop using cars because it will cause global warming.",
"some food, such as mongo, requires a warm weather to grow. so they have to be transported to canada.",
"a typical electronic circuit can be built with a battery, a bulb, and a switch.",
View archiveTwitter.py
'''
@author Michael J Bommarito II
@date Feb 26, 2011
@license Simplified BSD, (C) 2011.
This script demonstrates how to use Python to archive historical tweets.
'''
import codecs
import csv
View archiveHashtag.r
#@author Michael J Bommarito
#@contact michael.bommarito@gmail.com
#@date Feb 20, 2011
#@ip Simplified BSD, (C) 2011.
# This is a simple example of an R script that will retrieve
# public tweets from a given hashtag.
library(RJSONIO)
# This function loads stored tag data to determine the current max_id.
View TAGS_Stats.R
#------------------------
# Load libraries
require(stringr)
require(RCurl)
require(ggplot2)
#------------------------
# Read and return Google Spreadsheet as csv
You can’t perform that action at this time.