Skip to content

Instantly share code, notes, and snippets.

johnboker

Block or report user

Report or block johnboker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View AdventOfCodeDay8.cs
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
namespace AdventOfCodeDay8
{
class Program
{
static void Main(string[] args)
View AdventOfCodeDay7.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AdventOfCodeDay7
{
class Program
View AdventOfCodeDay6.cs
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Drawing;
using System.Drawing.Imaging;
namespace AdventOfCodeDay6
{
View AdventOfCodeDay5.cs
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
namespace AdventOfCodeDay5
{
class MainClass
{
public static void Main (string[] args)
View AdventOfCodeDay4.cs
using System;
using System.Security.Cryptography;
using System.Text;
namespace AdventOfCodeDay4
{
class Program
{
static void Main()
{
View AdventOfCodeDay3.cs
// part 1
var input = "<input here>";
var visited = new List<Point> { new Point(0, 0) };
var x = 0;
var y = 0;
foreach (var d in input)
View AdventOfCodeDay2.cs
var paperNeeded = input.Select(a => new
{
SurfaceArea = 2 * a.Item1 * a.Item2 + 2 * a.Item1 * a.Item3 + 2 * a.Item2 * a.Item3,
Extra = Math.Min(Math.Min(a.Item1 * a.Item2, a.Item1 * a.Item3), a.Item2 * a.Item3)
}).Sum(b => b.SurfaceArea + b.Extra);
var ribbonNeeded = input.Select(a => new
{
Permiter = Math.Min(Math.Min(2 * (a.Item1 + a.Item3), 2 * (a.Item2 + a.Item3)), 2 * (a.Item2 + a.Item1)),
Extra = a.Item1 * a.Item2 * a.Item3
View AdventOfCodeDay1.cs
using System;
using System.Linq;
namespace AdventOfCodeDay1
{
class MainClass
{
public static void Main (string[] args)
{
var input = "(((())))()((((((((())()(()))(()((((()(()(((()((()((()(()()()()()))(((()(()((((((((((())(()()((())()(((())))()(()(()((()(()))(()()()()((()((()(((()()(((((((()()())()((((()()(((((()(())()(())((())()()))()(((((((())(()())(()(((())(()))((())))(()((()())))()())((((())))(()(((((()(())(((()()((()((()((((((((((())(()())))))()))())()()((((()()()()()()((((((())())(((()())()((()()(((()()()))(((((()))(((()(()()()(()(()(((())()))(()(((()((())()(()())())))((()()()(()()(((()))(((()((((()(((((()()(()())((()())())(()((((((()(()()))((((()))))())((())()()((()(()))))((((((((()))(()()(((())())(())()((()()()()((()((()((()()(((())))(()((())()((((((((()((()(()()(((())())())))(())())))()((((()))))))())))()()))()())((()())()((()()()))(()()(((()(())((((())())((((((((()()()()())))()()()((((()()))))))()((((()(((()))(()()())))((()()(((()))()()())())(((())((()()(())()()()(((())))))()())((()))()))(
@johnboker
johnboker / Backoff.java
Created Aug 4, 2015
Schedule a pending intent in android.
View Backoff.java
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.os.SystemClock;
import android.util.Log;
public class Backoff
{
private static String TAG = "Backoff";
View IWebServiceCallback.java
public interface IWebServiceCallback<T> {
void onResponse(T response);
void onErrorResponse();
}
You can’t perform that action at this time.