Value | Color |
---|---|
\e[0;30m | Black |
\e[0;31m | Red |
\e[0;32m | Green |
\e[0;33m | Yellow |
\e[0;34m | Blue |
\e[0;35m | Purple |
This file contains hidden or 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<time.h> | |
#define MAXLEVEL 7 | |
typedef struct node{ | |
int key; | |
int value; | |
struct node **next; |
This file contains hidden or 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
#!/usr/bin/env bash | |
#usage: | |
#first step: generate the output | |
# nm -S --size-sort xxx1 > nm_output1 | |
# nm -S --size-sort xxx2 > nm_output2 | |
#second step: generate the count or diff | |
# ./nmcmp.sh nm_output1 nm_output2 | |
# ./nmcmp.sh -d nm_output1 nm_output2 ##this will output with diff format. |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"log" | |
"os" | |
"strconv" | |
"strings" | |
) |
This file contains hidden or 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<string.h> | |
#define DEFLINES 10 | |
#define MAXLEN 100 | |
int getlines(char *s, int len){ | |
int c, i; |
This file contains hidden or 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
#!/bin/awk | |
# input: a:=10 | |
# output: the value is 10 | |
BEGIN{ PrintRes() } | |
function parse() { | |
if(tok == "(eof)") return "(eof)" | |
while(length(line) == 0) | |
if(getline line == 0) |
This file contains hidden or 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
e.g. man -t bash | ps2pdf - bash.pdf | |
But sometimes ps2pdf may encounter an error, the reson is that '-' is not a filename, that's so weird. And i use the following | |
command to fix this error | |
e.g. man -t bash > temp | |
ps2pdf temp bash.pdf | |
It's temperaly way to solve this problem. |
This file contains hidden or 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
//easy way | |
void quicksort(int v[], int n) | |
{ | |
int i, last; | |
if(n <= 1) | |
return; | |
swap(v,0, rand()%n); | |
last = 0; |
This file contains hidden or 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 <string.h> | |
#define NLEN 5 | |
#define NVAL 5 | |
typedef struct Nameval Nameval; | |
typedef void(*func)(Nameval *, void *); | |
struct Nameval |
This file contains hidden or 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 <string.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <dirent.h> /*some functions option on dir*/ | |
#include <sys/stat.h> | |
NewerOlder