Skip to content

Instantly share code, notes, and snippets.

View VincentTatan's full-sized avatar

vincentkernn VincentTatan

View GitHub Profile
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package practice;
import java.io.BufferedReader;
package Thread;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* Created by kevinsteppe on 2/10/15.
*/
public class ThreadDemoSOP
{
@VincentTatan
VincentTatan / output.txt
Last active October 14, 2015 05:22
ThreadDemoSOP
package Thread;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* Created by kevinsteppe on 2/10/15.
*/
public class ThreadDemoSOP
{
package Thread;
import java.util.Random;
import java.util.concurrent.locks.*;
/**
* Created by kevinsteppe on 2/10/15.
*/
public class ThreadDemoExc {
package Thread;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class ThreadDemoCounter implements Runnable
{
private static Lock lock = new ReentrantLock();
private int counter;
public int getCounter()
{
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.io.*;
/**
* The Account class:
* 1) has a current balance and a name
* 2) allows transfers to another account
*
* Important properties:
package queues;
import java.util.*;
import java.util.concurrent.locks.ReentrantLock;
/**
* Modify the code to have different numbers of threads removing tasks from the
* queue. Launch threads before you exceed the service level agreement (greater
* than 10000 milliseconds). Stop threads before you start processing tasks
* faster than the SLA (less than 5000 milliseconds). Do not remove or alter the
package aa.race;
import aa.StopWatch;
import java.util.Random;
import java.util.concurrent.locks.*;
/**
*
* This is testing code with different scenarios to test the Account class.
def create_pie(df,target_variable,figsize=(10,10)):
print(df[target_variable].value_counts())
fig, ax = plt.subplots(figsize=figsize)
ax.pie(df[target_variable].value_counts().values, labels=df[target_variable].value_counts().index,autopct = '%1.2f%%',textprops={'fontsize': 20})
ax.axis('equal')
plt.title(target_variable)
plt.show()