Skip to content

Instantly share code, notes, and snippets.

View yuikns's full-sized avatar
🎯
Focusing

Yu yuikns

🎯
Focusing
View GitHub Profile
<?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/
*/
@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)
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 / 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
{
@yuikns
yuikns / copyright.php
Last active December 20, 2015 08:08
WP_COPYRIGHT
/* 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 / 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;
float f_sqrt(float x)
{
float xhalf = 0.5f*x;
int i = *(int*)&x; // get bits for floating VALUE
i = 0x5f375a86- (i>>1); // gives initial guess y0
x = *(float*)&i; // convert bits BACK to float
x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy
x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy
x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy
return 1/x;
package util;
import java.util.ArrayList;
import java.util.List;
public abstract class MinHeap<T> {
private int sizeLimit;
private int size;
private List<T> heap;
@yuikns
yuikns / rsync_back.sh
Last active August 29, 2015 13:56
backup & rsync a remote project
#!/bin/sh
DIR_LIST=`cat filelist`
EXC_PATTERN=`cat exclude`
tar -czvf .bak.src.`date "+%Y%m%d%H%M%S"`.tar.gz $DIR_LIST
rsync -avh --progress --exclude=$EXC_PATTERN [email protected]:xdatacenter_load/ proj/