This file contains 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
using System; | |
using System.Threading; | |
public class TimeoutAction | |
{ | |
private Thread timerThread; | |
private Thread mainThread; | |
private AutoResetEvent timerStartEvent = new AutoResetEvent(false); | |
private AutoResetEvent timerPreparedEvent = new AutoResetEvent(false); |
This file contains 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
// Define other methods and classes here | |
/// <summary> | |
/// Sample Provider to allow fading in and out | |
/// </summary> | |
public class DelayFadeOutSampleProvider : ISampleProvider | |
{ | |
enum FadeState | |
{ | |
Silence, | |
FadingIn, |
This file contains 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
static class x10 { | |
public static IEnumerable<T> Iter<T>(this IEnumerable<T> list, Action<T> action) { | |
foreach (var n in list) { | |
action (n); | |
yield return n; | |
} | |
} | |
} |
This file contains 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
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; | |
import hudson.FilePath.FileCallable; | |
import hudson.slaves.OfflineCause; | |
import hudson.node_monitors.*; | |
for (node in Jenkins.instance.nodes) { |
This file contains 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
using System; | |
using System.Threading.Tasks; | |
namespace Life | |
{ | |
public class LifeSimulation | |
{ | |
private bool[,] world; | |
private bool[,] nextGeneration; | |
private Task processTask; |