Skip to content

Instantly share code, notes, and snippets.

View oneSIX's full-sized avatar

Kent Sinclair oneSIX

View GitHub Profile
@oneSIX
oneSIX / ExampleAdapter.kt
Created December 6, 2020 01:53
This gist can be used as an example of a multi-item RecyclerView adapter using ViewBinding and a Sealed Class to represent the ViewHolder types.
package com.mobile.devpackage.bll.adapters
import android.content.Context
import android.view.LayoutInflater
import android.view.View.*
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.mobile.devname.R
import com.mobile.devname.databinding.GenericTransactionRowFooterLayoutBinding
import com.mobile.devname.databinding.GenericTransactionRowHeaderLayoutBinding
Set-ExecutionPolicy RemoteSigned
# Install Chocolatey https://chocolatey.org/install
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install Boxstarter:
. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
@oneSIX
oneSIX / gist:ec2772f7b5f8d92b0639
Created January 26, 2015 21:16
Part 3 python code
len([(x, y) for x in range(1,1000) for y in range(1,1000) if x <= y])
len([(x, y) for x in range(1,1000) for y in range(1,1000) if (x + y == 1000)])
len([(x, y) for x in range(1,1000) for y in range(1,1000) if (x + y <= 1001)])
@oneSIX
oneSIX / gist:8bcd8a8cf3ff153fe155
Created January 26, 2015 20:38
D o P vs P o D test
D = {1:[1,2,3,4,5,6,7,8,9,10,11,12]
,2:[2,4,6,8,10,12]
,3:[3,6,9,12]
,4:[4,8,12]
,5:[5,10]
,6:[6,12]
,7:[7]
,8:[8]
,9:[9]
,10:[10]
@oneSIX
oneSIX / gist:366f0a8fdf4d4eb254be
Created January 26, 2015 18:43
P = {(a, b) | a, b are relatively prime}
{(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10),(1,11),(1,12) (2,1),(2,3),(2,5),(2,7),(2,9),
(2,11) (3,1),(3,2),(3,4),(3,5),(3,7),(3,8),(3,10),(3,11) (4,1),(4,3),(4,5),(4,7),(4,9),(4,11) (5,1),(5,2),(5,3),(5,4), (5,6),(5,7),(5,8),(5,9),(5,11),(5,12) (6,1),(6,5),(6,7),(6,11) (7,1),(7,2),(7,3),(7,4),(7,5),(7,6),(7,8),(7,9),(7,10), (8,1),(8,3), (8,5),(8,7),(8,9),(8,11) (9,1),(9,2),(9,4),(9,5),(9,7),(9,8),(9,10),(9,11),(9,12) (10,1),(10,3),(10,7),(1 (11,1),(11,2),(11,3),(11,4),(11,5),(11,6),(11,7),(11,8),(11,9),(11,10),(11,12) (12,1),(12,5),(12,7),(12,11)}
@oneSIX
oneSIX / gist:e43ef14cc4f34c31ca3d
Created January 26, 2015 18:35
D = {(a,b)|a divides b}
{(1,1),(1,2)(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(2,2),(2,4),(2,6),(2,8),(2,10)
,(2,12),(3,3),(3,6),(3,9),(3,12),(4,4),(4,8),(4,12),(5,5),(5,10),(6,6),(6,12),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12)}
@oneSIX
oneSIX / site
Created October 23, 2013 15:05
package project3;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
/**
* @author Kent Sinclair
* Date: 10/9/13
* Time: 2:04 PM
package project3;
import javax.swing.table.AbstractTableModel;
import java.util.ArrayList;
import java.util.Collections;
/**
* User: Kent
* Date: 10/9/13
* Time: 2:13 PM
@oneSIX
oneSIX / gist:6787328
Created October 2, 2013 00:27
PanelClass.java
package project2;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
package project2;
import java.awt.BorderLayout;
public class ConnectFourPanel extends JPanel {
private JLabel[][] board; // gridArray
private JButton[] selection;
private static int BRDSIZE = 10; // default board size
private JButton quit; // quit button