Skip to content

Instantly share code, notes, and snippets.

View ymhuang0808's full-sized avatar
🌊
Experiencing in rough sea

YMHuang ymhuang0808

🌊
Experiencing in rough sea
View GitHub Profile
@ymhuang0808
ymhuang0808 / StationHashMap.java
Created February 19, 2014 04:37
StationHashMap
public class StationHashMap implements Parcelable {
private HashMap<String, Station> mStationMap = new HashMap<String, Station>();
public StationHashMap() {
}
public void setStationMap(HashMap<String, Station> stationMap) {
mStationMap = stationMap;
}
@ymhuang0808
ymhuang0808 / Station.java
Created February 19, 2014 04:40
Station
public class Station implements Parcelable {
private int mId;
private int mNo;
private String mName;
public Station() {
}
// getters and setters...
private HashMap<String, Station> mStationMap;
...
@Override
public void onSaveInstanceState(Bundle outState) {
StationHashMap stationHashMap = new StationHashMap();
stationHashMap.setStationMap(mStationMap);
outState.putParcelable(SAVE_INSTANCE_KEY_SATION_MAP, stationHashMap);
}
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main() {
int r;
int i;
for (i = 0 ; i < 11 ; i++) {
srand(time(NULL)+i);
@ymhuang0808
ymhuang0808 / admin.php
Last active August 29, 2015 14:05
controller/admin.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Base_Controller extends CI_Controller
{
public function index()
{
// ignore
$this->_render_view('admin_view', '狗寶');
@ymhuang0808
ymhuang0808 / header_view.php
Last active August 29, 2015 14:05
view/header_view.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php echo $title ?></title>
<meta name="description" content="狗寶">
<meta name="author" content="yiming">
<div class="container">
<ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
<li <?php echo (empty($tab)) ? ' class = "active tab-pane"' : ''; ?>><a href="#events" data-toggle="tab">活動列表</a></li>
<?php
if($this->cmrdb_auth->logged_in()) {
$new_event = '<li ';
$new_event .= ($tab == 'create') ? ' class = "active tab-pane"' : '';
$new_event .= '><a href="#creat_event" data-toggle="tab">新增活動</a></li>';
echo $new_event;
@ymhuang0808
ymhuang0808 / EventTest.php
Created October 28, 2014 12:04
EventTest
<?php
class EvnetTest extends \PHPUnit_Framework_TestCase
{
public function eventsProvider()
{
return [
[
[
[
@ymhuang0808
ymhuang0808 / Docker 101
Last active August 29, 2015 14:10
Docker
Docker 入門
=====================
**Docker** 是一個開源專案,支援多平台,從筆電到公、私有雲上能進行快速部署輕量、獨立的作業環境。**Docker** 使用 Linux 核心中的功能,像 Namespace 及 Control Groups (cgroups) 等,來達到建置獨立的環境及控制 CPU 、Memory 、網路等資源。
![Docker logo](https://lh5.googleusercontent.com/-i5itJJ2tfaY/VGmdrNgDHQI/AAAAAAAADj0/QTalLMbSc08/s500/small_v.png "small_v.png")
> **專案網址:** http://www.docker.com/
@ymhuang0808
ymhuang0808 / Docker 入門
Last active August 29, 2015 14:10
Docker-01.md
Docker 實作入門
=====================
## 目的
主要介紹 Docker 的實作,會提到以下幾個部分:
1. 快速的建立 Docker container
2. 管理 Docker 上的 container
3. 下載 image 、commit 建立新的 image