Skip to content

Instantly share code, notes, and snippets.

@goog
goog / showif.c
Last active August 29, 2015 14:28 — forked from OrangeTide/showif.c
example to list network interfaces on linux/bsd/osx/etc
/* showif.c : PUBLIC DOMAIN - Jon Mayo - August 22, 2006
* - You may remove any comments you wish, modify this code any way you wish,
* and distribute any way you wish.*/
/* finds all network interfaces and shows a little information about them.
* some operating systems list interfaces multiple times because of different
* flags, modes, etc. if you want to use this code you should be aware that
* duplicate interfaces is a possibility */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*************************************************
Version: 0.1@20141202
Function:
Description: 函数功能等的描述
Author: Jay
Input:
-----------------------------------------------------
parameter | Description
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <string.h>
#include <unistd.h>
#include "c_dbg.h"
#define MAX_PATH_LEN 1024
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct sockaddr_in localSock;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
vita@goldMINER:/vita/initramfs$ find . | cpio -o -H newc | gzip -9 > /vita/sysroot/boot/initrd.img
联想A850这款机子挺漂亮的,,屏幕很大,就是有一点缺陷是屏幕的分辨率稍微有一点儿低,像素有一点儿低,哈哈,,还是很满意的啦!
@goog
goog / gist:7366050
Created November 8, 2013 03:54
a trie
using namespace std;
#include <iostream>
#include <cstring>
#define NUM 26
class Node
{
public:
int count; // occurrence times
import numpy,timeit
def filter2d(image, filt):
M, N = image.shape
Mf, Nf = filt.shape
Mf2 = Mf // 2
Nf2 = Nf // 2
result = numpy.zeros_like(image)
for i in range(Mf2, M - Mf2):
for j in range(Nf2, N - Nf2):
@autojit(locals=dict(array=double[:, :], scalar1=double))
def func(array):
scalar1 = array[0, 0] # scalar is declared double
scalar2 = double(array[0, 0])