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
public static class ArrayChunker<T> | |
{ | |
public static T[][] Chunk(T[] sourceArray, int chunkLength) | |
{ | |
var numberOfFullBuffers = sourceArray.Length/chunkLength; | |
var lengthOfRemainderBuffer = sourceArray.Length%chunkLength; | |
var hasRemander = lengthOfRemainderBuffer > 0; | |
var numberOfBuffers = numberOfFullBuffers +( hasRemander ? 1 : 0); |
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
(function ($) { | |
$.fn.filtered = function (options) { | |
var roots = this; | |
var displayProperty = $(roots).first().css('display'); | |
var elementContentArrays = []; |
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
#!/usr/bin/xcrun swift | |
import Cocoa | |
import AppKit | |
import CoreGraphics | |
class Spec { | |
let pointSize: Int; | |
let scales: [Int] | |
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.Collections.Generic; | |
using System.Linq; | |
using NUnit.Framework; | |
namespace DIrtyWars | |
{ | |
[TestFixture] | |
public class TestFixture | |
{ |
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
public class Counter | |
{ | |
private readonly string directoryPath; | |
private int count = 0; | |
private static readonly object lockable = new object(); | |
public const string AggregatedCountFilename = "agg_count.txt"; | |
public const string PendingFileExt = "pnd"; |
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
public class BcdCoderTests extends InstrumentationTestCase { | |
private int[][] decimalAndBcd = new int[][]{ | |
{0, 0}, | |
{1, 1}, | |
{2, 2}, | |
{3, 3}, | |
{4, 4}, | |
{5, 5}, | |
{6, 6}, |
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
import android.util.Log; | |
import java.util.ArrayList; | |
import java.util.List; | |
public final class L { | |
public static final String MAGICAL_EXPENSIVE_AUTO_TAG = "JPgpKvpxrnB1zrs8WnGqVNTeK0NgMyY8SXnMEaXPnTY="; | |
public final static List<Println> PRINTLNS = new ArrayList<>(); | |
private final static String[] NAMES_OF_EXCLUDED_CLASSES = new String[]{L.class.getName()}; |
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
import android.os.Handler; | |
import android.widget.TextView; | |
import timber.log.Timber; | |
public class TextViewTimberDebugTree extends Timber.DebugTree { | |
private final static long UNINITIALIZED_DEBUG_START_TIME = -1; |
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
public class FixedCapacityMovingBuffer<T> | |
{ | |
private readonly int _capacity; | |
private readonly T[] _buffer; | |
private int _addCount; | |
public FixedCapacityMovingBuffer(int capacity) | |
{ | |
_capacity = capacity; |
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.IO; | |
namespace jmcd | |
{ | |
public static class StreamExtensions | |
{ | |
public static byte[] ReadToEnd(this Stream stream) | |
{ | |
var result = new byte[0]; |
OlderNewer