Skip to content

Instantly share code, notes, and snippets.

View xtpor's full-sized avatar

Tintin Ho xtpor

View GitHub Profile
@xtpor
xtpor / Test.java
Last active November 21, 2016 17:38
public class Test {
public static void main (String[] argv) {
B b = new B("hello world");
b.bar();
}
}
class A {
@xtpor
xtpor / State.java
Last active February 6, 2017 08:31
import java.util.List;
import java.util.ArrayList;
public class State {
// This class represent a valid game state
private char[] _state;
private char _player;
private char _winner;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class TicTacToeFrame extends JFrame implements ActionListener {
private JButton newGameButton = new JButton("New Game");
private JButton exitButton = new JButton("Exit");
private JButton[][] buttons = new JButton[3][3];
private JLabel statusLabel = new JLabel();
private String[] symbol = { " ", "O", "X" };

Keybase proof

I hereby claim:

  • I am xtpor on github.
  • I am xtpor (https://keybase.io/xtpor) on keybase.
  • I have a public key ASBazCqV9B0MxOLJIrlwGEsmuSfnJydJCWzjlV8aJcc3Iwo

To claim this, I am signing this object:

@xtpor
xtpor / tmux-cheatsheet.markdown
Created May 18, 2017 09:16 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
import java.net.*;
import java.io.*;
import java.util.*;
public class EchoClient {
public static void main(String[] args) throws IOException {
Scanner scanner = new Scanner(System.in);
System.out.println("Connecting to server ...");
Socket sock = new Socket("localhost", 12345);
import java.io.*;
import java.net.*;
import java.util.Scanner;
public class Q3Test {
public static void main(String[] argv) throws IOException {
Scanner scanner = new Scanner(System.in);
System.out.println("Connecting ...");
import java.io.*;
import java.net.*;
import java.util.*;
public class Q3Server extends Thread {
public static void main(String[] argv) {
try {
Buffer buf = new Buffer();
<?php
function exec_query($sql, $params = []) {
$username = 's1165683';
$password = '11656830';
$conn_info = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) " .
"(HOST = oracleacademy.ouhk.edu.hk)(PORT=8998)) " .
"(CONNECT_DATA=(SERVER=DEDICATED) " .
"(SID=db1011)))";
$conn = oci_connect($username, $password, $conn_info);
if (!$conn) {

266 Revision Checklist

Note: The page numbers are for the PDF version.

Data Number Systems

  • Positive Binary Representation (P.19)
  • Binary Coded Decimal (P.20)
  • Sign-Magnitude Binary Representation (P.20)
  • 1's Complement Representation (P.21)