Skip to content

Instantly share code, notes, and snippets.

View hydai's full-sized avatar
🐈

hydai hydai

🐈
View GitHub Profile
@hydai
hydai / SoftwareStudioMid-7.java
Created November 11, 2013 16:46
modify the code so that it can compile correctly.
class Test {
public static void main (String[] args) {
Test t = new Test();
/*
System.out.println(t.xmethod(7));
// Error: t.xmethod is void type, so we cannot put it in println
*/
t.xmethod(7);
}
public void xmethod(int t) {
class XIII {
public static void main (String[] args) {
StringBuffer s1, s2, s3;
s1 = new StringBuffer("Hello");
s2 = s1;
s1.append(" the Java master!");
s3 = new StringBuffer("Hello the Java master!");
// 比較法一
System.out.println(s1.toString().compareTo(s2.toString()) == 0);
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
class MyProgramA {
private int port=8000;
private ServerSocket server;
class MyProgramA {
private int port=8000;
private DataInputStream in;
private DataOutputStream out;
private ServerSocket server;
private Socket socket;
public MyProgramA() throws Exception
{
server = new ServerSocket(port);
class MyProgramB {
private int port=8000;
private DateInputStream in;
private DataOutputStream out;
private Socket socket;
public MyProgramB() throws Exception {
socket = new Socket("127.0.0.1");
// 建立與 "127.0.0.1" 的連線
in = new DataInputStream(socket.getInputStream());
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
git clone git://github.com/wbond/sublime_package_control.git Package\ Control
cd Package\ Control
git checkout python3
# restart Sublime Text 3 and you should have Package Control working
@hydai
hydai / zsh.md
Created March 13, 2014 11:21 — forked from tsabat/zsh.md
@hydai
hydai / 2-D array function2.cpp
Last active August 29, 2015 13:59
2-D array
#include <cstdio>
void func2(int arr[10][10]) {
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
printf(" %03d", arr[i][j]);
}
printf("\n");
}
}
@hydai
hydai / test.sh
Created April 23, 2014 03:31
Archi-project1 test all test case
#!/bin/bash
#single_cycle in current folder
#test case is in the path ../../valid_testcase/archiXX
for i in {1..9}
do
if [ -d ../../valid_testcase/archi0${i} ]
then
sh ./clean.sh
cp ../../valid_testcase/archi0${i}/*.bin ./
./single_cycle
//
// main.cpp
// smallgame
//
// Created by Apple on 2014/4/21.
// Copyright (c) 2014年 Apple. All rights reserved.
//
#include<cstdio>
#include<cstdlib>