Skip to content

Instantly share code, notes, and snippets.

View Gateswong's full-sized avatar

Gates_ice Gateswong

View GitHub Profile
@Gateswong
Gateswong / manifest.json
Created December 28, 2012 08:11
Open link in a new popup window in Chrome.
{
"name": "Poput it up!",
"version": "1.0",
"description": "Open the link in a new popup window instead of new tab",
"permissions": ["contextMenus", "tabs"],
"background": {
"scripts": ["menu.js"]
},
"manifest_version": 2
}
@Gateswong
Gateswong / template1.cue
Created March 27, 2013 12:06
CUE Sheet Templates
FILE "" WAVE
TRACK 01 AUDIO
INDEX 01 00:00:00
TRACK 02 AUDIO
INDEX 01 00:05:00
//////////////////////////////////////////////////////////////
// 魔兽世界 自动钓鱼脚本
// 版本:1.1
// 作者:Gates_ice
// 说明:
// 1. 屏幕右下角设置为钓鱼图标
// 2. 使用白色背景判断鱼漂说明的方框
// 3. 利用系统的音量判断是否上钩
//////////////////////////////////////////////////////////////
The convict Jean Valjean is released from a French prison after serving nineteen years for stealing a loaf of bread and for subsequent attempts to escape from prison. When Valjean arrives at the town of Digne, no one is willing to give him shelter because he is an ex-convict. Desperate, Valjean knocks on the door of M. Myriel, the kindly bishop of Digne. Myriel treats Valjean with kindness, and Valjean repays the bishop by stealing his silverware. When the police arrest Valjean, Myriel covers for him, claiming that the silverware was a gift. The authorities release Valjean and Myriel makes him promise to become an honest man. Eager to fulfill his promise, Valjean masks his identity and enters the town of Montreuil-sur-mer. Under the assumed name of Madeleine, Valjean invents an ingenious manufacturing process that brings the town prosperity. He eventually becomes the town’s mayor.
Fantine, a young woman from Montreuil, lives in Paris. She falls in love with Tholomyès, a wealthy student who gets her pregnant a
#include <mpi.h>
main() {
int my_rank, num_proc;
int a, b, i; // it depends
}

HPF Data Mapping

Two-phase data mapping: ALIGN, DISTRUBUTE

Goals

Avoid contention: for rows data, the can be updated in parallel.

Locality of reference: two data always works on the same instructor.

@Gateswong
Gateswong / CS546-Lecture23.md
Created April 29, 2014 20:05
Design Parallel Algorithms (2)

Gauss Elimination

First let's make some assumptions:

one base op (+, *, -, /) takes 1 unit of time
hypercube SF (ts, tw)
    
// ### Send and Receive
int MPI_Send(void *buf, int count, MPI_Datatype datatype,
int dest, int tag, MPI_Comm comm);
int MPI_Recv(void *buf, int count, MPI_Datatype datatype,
int source, int tag, MPI_Comm comm, MPI_Status *status);
// ### Size and Rank
int MPI_Comm_size(MPI_Comm comm, int *size);
int MPI_Comm_rank(MPI_Comm comm, int *rank);
#include "MPI.h" // 扣分点!
float a[200][200], b[200][200], PROD = 1;
int myrank, numproc;
MPI_Init();
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
MPI_Comm_size(MPI_COMM_WORLD, &numproc);
// MPI-Scatter
// =================================================
// ¶¨ÒåÔ¤Éè°´¼ü
// =================================================
Dim KEY_OPEN_BAG
Dim KEY_MOUNT
Dim KEY_TARGET_VENDOR
Dim KEY_INTERACT_TARGET
KEY_OPEN_BAG = "1"