Skip to content

Instantly share code, notes, and snippets.

View yuikns's full-sized avatar

Yu yuikns

  • 15:26 (UTC +08:00)
View GitHub Profile
@yuikns
yuikns / gethostbyname.cc
Created August 24, 2013 14:53
linux socket programming
#include <cstring> //memset
#include <sys/socket.h>
#include <netdb.h> //hostent
#include <arpa/inet.h>
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
/* The MIT License
Copyright (c) 2008, by Attractive Chaos <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
@yuikns
yuikns / copyright.php
Last active December 20, 2015 08:08
WP_COPYRIGHT
@yuikns
yuikns / c语言结构体排序——qsort函数
Created July 14, 2013 17:59
感觉博主代码还有些改进的地方,所以手痒改了一番.gcc编译测试通过.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// 硬编码就不说什么了,不过真的环境中随意使用硬编码绝对是不可取的
#define N 208
// 命名规则习惯,你这儿说的是1个student,请不要加s
typedef struct
{
void storeIntoCSV(hashmap *phmap)
{
pNode np;
int plen;
int i;
int j;
unsigned long count;
pAlist ap = getAuthorList();
FILE *fp;
if((fp = fopen("CoAuthor.csv","w")) == NULL)
@yuikns
yuikns / 1004.c
Last active December 16, 2015 13:29
#include <iostream>
#include <string.h>
#define LEN 110
using namespace std;
char s[200]; // 输入串
int k; // 输入参数
int result[LEN] ; // 存放结果
void M2AA(int a[], int b[], int b1, int c[],int c1)
<?php
/**
*Plugin Name: Wikipedia_Entry_Inserter
*Version: 0.1
*Plugin URI: http://argcandargv.com
*Description: insert wikipedia entry with [wiki] and [/wiki]
*Author: Yu Jing
*Author URI: http://argcandargv.com/
*/