This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name="Window"; | |
var Top={ | |
name:"top", | |
Inner:{ | |
name:"inner", | |
getName:function(){ | |
var that=this; | |
var i=0; | |
function increase(){ | |
var rt="this binding:"+this.name+"\n\n"+"number i:"+i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DFA={"A":{0:"B",1:"C"},"B":{0:None,1:"D"},"C":{0:"D",1:None},"D":{0:"A",1:"B"}} | |
def genstr(n,s,inputs): | |
if n==0: | |
inputs.append(s) | |
return | |
genstr(n-1,s+"0",inputs) | |
genstr(n-1,s+"1",inputs) | |
def simulate(): | |
for n in range(1,15): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def makebold(fn): | |
def wrapped(): | |
return "<b>" + fn() + "</b>" | |
return wrapped | |
def makeitalic(fn): | |
def wrapped(): | |
return "<i>" + fn() + "</i>" | |
return wrapped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> /* printf() */ | |
#include <stdlib.h> /* exit(), malloc(), free() */ | |
#include <unistd.h> | |
#include <sys/types.h> /* key_t, sem_t, pid_t */ | |
#include <sys/wait.h> | |
#include <sys/shm.h> /* shmat(), IPC_RMID */ | |
#include <errno.h> /* errno, ECHILD */ | |
#include <semaphore.h> /* sem_open(), sem_destroy(), sem_wait().. */ | |
#include <fcntl.h> /* O_CREAT, O_EXEC */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#include <semaphore.h> | |
int count = 0; | |
int share=0; | |
pthread_t maintid; | |
sem_t roomEmpty; | |
sem_t mutex; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <semaphore.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/wait.h> | |
#include <mqueue.h> | |
#define N 1 | |
#define BUFSIZE 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "chardev.h" | |
#include <linux/kernel.h> | |
#include <linux/module.h> | |
#include <linux/fs.h> | |
#include <linux/uaccess.h> | |
//global varibles | |
static int unused=1; | |
static int number=0; | |
static char msg[N]="13111387\0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import os.path | |
ROOT = "." | |
THEME = "holo_dark" | |
SRC = os.path.join(ROOT, THEME) | |
TO = os.path.join(ROOT, "res") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <ostream> | |
#include <string> | |
#include <vector> | |
//comment this define to see reallocate | |
#define F4 | |
class Test { | |
public: | |
std::string tag; | |
Test(std::string &t) : tag(t) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Base { | |
public: | |
Base() { | |
std::cout << "Base Constructor" << std::endl; | |
ctor(); | |
} | |
virtual ~Base() { | |
std::cout << "Base Destructor" << std::endl; |
OlderNewer