This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.concurrent.LinkedBlockingQueue; | |
| import java.util.concurrent.TimeUnit; | |
| import java.util.concurrent.locks.Condition; | |
| import java.util.concurrent.locks.ReentrantLock; | |
| public class PausableExecutor extends ThreadPoolExecutor { | |
| private boolean isPaused; | |
| private ReentrantLock pauseLock = new ReentrantLock(); | |
| private Condition unPaused = pauseLock.newCondition(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport --disassociate | |
| sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/./0/2; s/.$//') | |
| networksetup -detectnewhardware |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.skazemy; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| /** | |
| * This example shows that after calling wait() on an object, it will release that object's monitor lock, | |
| * so that other threads can enter the synchronized block. It also shows once notifyAll() | |
| * is called, first that thread has to exit the synchronized block, then each waiting thread starts | |
| * doing their work one by one, each has to exit their synchronized block so the other can wake up |