Skip to content

Instantly share code, notes, and snippets.

@jacks205
jacks205 / Card.java
Last active December 17, 2015 07:38
A simulation of the card game "War." You enter the amount of games you want to simulate and it will give you: Average Wars, Average Double Wars, Average Battles, Max/Min Battles per game, Max/Min Wars per game, Max/Min Double Wars per game Uses LinkedLists to keep track of decks and exchanges of cards.
public class Card {
private int value; //didnt include suit because it messed with calculations (not important for the War game, but in the future I will try to include things like that for reuse-ability)
public Card(int i){
value = i;
}
public int getCardValue(){
return value;
@jacks205
jacks205 / FileBrowser.java
Last active December 17, 2015 07:38
This is a File Browser program that can be used to locate, append, and display files, also has an option of creating a log file that updates and prints everything that is shown to the user. Option (4) is the one thing I can't get working at the moment but it doesn't crash the program.
import java.util.Scanner;
import java.io.*;
public class FileBrowser{
private static String logName;
public FileBrowser(){
logFile();
run();
//: Playground - noun: a place where people can play
import UIKit
let view = UIView(frame: CGRectMake(0,0,286,54))
view.backgroundColor = UIColor.clearColor()
let label = UILabel(frame: CGRectMake(24,8,238,32))
label.textColor = UIColor.redColor()
label.text = "That email address is already taken! Try a different email address."
package com.jacks205.mediadatasourceexample;
import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import java.io.IOException;
public static String VIDEO_URL = "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear1/fileSequence0.ts";
private volatile byte[] videoBuffer;
private volatile VideoDownloadListener listener;
private volatile boolean isDownloading;
Runnable downloadVideoRunnable = new Runnable() {
@Override
public void run() {
try{
package com.jacks205.mediadatasourceexample;
import android.media.MediaDataSource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
public class VideoDataSource extends MediaDataSource {
//
// CirclePieView.swift
// CirclePieViewExample
//
// Created by Mark Jackson on 10/8/15.
// Copyright © 2015 Mark Jackson. All rights reserved.
//
import UIKit
//
// ViewController.swift
// CirclePieViewExample
//
// Created by Mark Jackson on 10/8/15.
// Copyright © 2015 Mark Jackson. All rights reserved.
//
import UIKit
//
// InflatingCircleIndicatorView.swift
// Spots
//
// Created by Mark Jackson on 9/24/15.
// Copyright © 2015 Mark Jackson. All rights reserved.
//
import UIKit
@jacks205
jacks205 / XMLtoFile.cs
Created June 11, 2015 18:58
Write to XML File C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
namespace JanteqTestConsoleApplication
{
public class Program