Skip to content

Instantly share code, notes, and snippets.

View wkdalsgh192's full-sized avatar
🏠
Working from home

Blue_Avocado wkdalsgh192

🏠
Working from home
View GitHub Profile
// 1. create a sub class inherent to Thread class
static class MyThread extends Thread {
@Override
public void run() {
System.out.println("Hello : "+Thread.currentThread().getName());
}
}
MyThread myThread = new MyThread();
myThread.start();
import java.util.function.BinaryOperator;
public class MethodReferencesExamples {
public static <T> T mergeThings(T a, T b, BinaryOperator<T> merger) {
return merger.apply(a, b);
}
public static String appendStrings(String a, String b) {return a+b;}
package dataStructure;
public class CustomLinkedList<E> {
// Linked List Node
private CustomNode<E> head; // head node
private CustomNode<E> tail; // tail node
private int size;
public int size() {
return size;
public class OS_Critical_Section_Solution {
public static void main(String[] args) {
boolean[] flag = new boolean[2]; // flag[0] -> Process A, flag[1] -> Process B
// Strict Alternation
int cnt = 0;
while(true) {
flag[0] = true;
while (flag[1]==true);
System.out.println("V");
python manage.py runserver
python manage.py startapp blog
django-admin startproject first_project
pip install django
# install spotipy in your command line
pip install spotipy --upgrade
# import spotipy to set up your client account
from spotipy.oauth2 import SpotifyClientCredentials
import spotipy
# copy your client id and secret key on your spotify dashboard
# set them up using spotipy client credentials object to let spotipy retrive data by your query
client_id="your_id"
public class UserBean {
// fields to construct a bean. Recommended to make all private in singleton design pattern.
private String name;
private int age;
private boolean male;
// bean must have its default constructor.
public UserBean() {}
public UserBean(String name, int age, boolean male) {