Skip to content

Instantly share code, notes, and snippets.

View Physium's full-sized avatar
:shipit:
what you looking at?

Wei Jun Physium

:shipit:
what you looking at?
View GitHub Profile
@Physium
Physium / SparkSQLPractice.scala
Created June 11, 2020 16:54
NUS BEAD Submission 1
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql._
import org.apache.spark.sql.functions._
import org.apache.log4j.Level
import org.apache.log4j.Logger
object MoviePractice {
@Physium
Physium / WordCount.scala
Created June 11, 2020 16:24
NUS BEAD Submission 2
package Simple
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.log4j.Level
import org.apache.log4j.Logger
object WordCount {
def main (args: Array[String]){
Logger.getLogger("org").setLevel(Level.OFF)
@Physium
Physium / instance.tf
Created November 17, 2018 20:31
Terraform Sample Configuration
data "vsphere_datacenter" "dc" {
name = "<DC Name>" #e.g Datacenter1
}
data "vsphere_datastore" "datastore" {
name = "<Datastore Name>" #e.g Datastore1
datacenter_id = "${data.vsphere_datacenter.dc.id}"
}
data "vsphere_resource_pool" "pool" {
@Physium
Physium / wordanalysis.py
Created February 12, 2017 15:50
generating wordcloud for school
import os
import json
import pandas as pd
import matplotlib.pyplot as plt
from wordcloud import WordCloud, STOPWORDS
####################### Section 1 ###################
# Read from the file
# Read in ALL the tweets
@Physium
Physium / scrap.py
Created February 12, 2017 14:52
Simple Web Scraping with Beautiful Soup
from bs4 import BeautifulSoup
import json
import urllib.request
#with urllib.request.urlopen("https://www.studyabroad101.com/programs/dis-copenhagen-summer") as url:
# content = url.read()
class AppURLopener(urllib.request.FancyURLopener):
version = "Mozilla/5.0"
@Physium
Physium / API.md
Created July 8, 2016 06:19 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

package aa;
import java.util.Queue;
import java.util.concurrent.BlockingQueue;
import java.util.logging.Level;
import java.util.logging.Logger;
public class Producer implements Runnable {
private Queue<Integer> queue;
package aa;
import java.io.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* The Account class: 1) has a current balance and a name 2) allows transfers to
* another account
*
package aa;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class ThreadDemoCounter implements Runnable
{
private int counter;
private static Lock lock;
public int getCounter()
This is the first line;
The second line starts here.
===== end loop =====
This is the first line;
The second line starts here.
===== end loop =====
This is the first line;
The second line starts here.
===== end loop =====
This is the first line;