sudo su apt-get update apt-get install default-jdk
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
// Inspired from https://gist.github.com/khenidak/49cf6f5ac76b608c9e3b3fc86c86cec0 | |
// Enqueue: O(log n), because we might need to "bubble up" the new element to its proper place in the heap. | |
// Dequeue: O(log n), because we remove the top element and then "bubble down" the swapped element to its proper place. | |
// Peek: O(1), since we're just returning the top element. | |
public class ThreadSafePriorityQueue<TItem, TPriority> where TItem : class where TPriority : IComparable<TPriority> | |
{ | |
private IComparer<TPriority> comparer; | |
private List<KeyValuePair<TItem, TPriority>> list = new List<KeyValuePair<TItem, TPriority>>(); | |
private ReaderWriterLockSlim rwLock = new ReaderWriterLockSlim(); |
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
// ==UserScript== | |
// @name Volume to speed | |
// @author Satan | |
// @namespace youtube.com | |
// @description YouTube videos change playback speed based on the current volume. Fun. | |
// @include https://www.youtube.com/watch?v=* | |
// @version 1.0 | |
// @grant none | |
// ==/UserScript== |