在AWS里用Elastic Map Reduce 开一个Cluster然后登陆master node并编译以下程序:import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
...
分类:
其他好文 时间:
2014-07-22 23:01:32
阅读次数:
405
表
a = { }
b = { x = 1, ["hello, "] = "world!" }
a.astring = "ni, hao!"
a[1] = 100
a["a table"] = b
function foo()
end
function bar()
end
a[foo] = bar
--分别穷举表a和b
for k, v in pairs(a) do
print(k, "=>",...
分类:
其他好文 时间:
2014-07-22 23:00:33
阅读次数:
261
函数环境
function foo()
print(g or "No g defined!")
end
foo()
setfenv(foo, { g = 100, print = print }) --设置foo的环境为表{ g=100, ...}
foo()
print(g or "No g defined!")
--No g defined!
--100
--No g defined!...
分类:
其他好文 时间:
2014-07-22 22:59:54
阅读次数:
338
函数闭包
function createCountdownTimer(second)
local ms=second * 1000;
local function countDown()
ms = ms - 1;
return ms;
end
return countDown;
end
timer1 = createCountdownTimer(1);
for...
分类:
其他好文 时间:
2014-07-22 22:59:53
阅读次数:
307
1.操作符offset
操作符offset在汇编语言中是由编译器处理的符号,他的功能是取得标号的偏移地址
比如下面程序:
assume cs:codesg
codesg segment
start:mov ax,offset start
相当于mov ax,0
s:mov ax,offset s
相当于mov ax,3
codesg ends
end start
在上...
分类:
其他好文 时间:
2014-07-22 22:59:34
阅读次数:
506
输入:表名、每页显示的记录数、当前页输出:总记录数、总页数、结果集--首先,创建一个包,定义游标类型CREATE OR REPLACE PACKAGE
fenye_package ISTYPE fenye_cursor IS REF CURSOR;END fenye_package; --输入:表名...
分类:
数据库 时间:
2014-05-02 22:02:04
阅读次数:
411
//字符串全排列package com.demo.acm;public class
AllSortChar { public static void allSort(char[] buf,int start,int end){
if(start==end){ ...
分类:
其他好文 时间:
2014-05-02 19:43:21
阅读次数:
256
本文主要针对广告检索领域的查询重写应用,根据查询-广告点击二部图,在MapReduce框架上实现SimRank++算法,关于SimRank++算法的背景和原理请参看前一篇文章《基于MapReduce的SimRank++算法研究与实现》。
SimRank++的矩阵形式的计算公式为:
算法主要步骤如下:
Step1: 计算权值矩阵,并获取最大Query编号和最大广告编号;
Step2:...
分类:
其他好文 时间:
2014-05-01 08:21:53
阅读次数:
527
void GameLayer::ccTouchEnded(CCTouch *touch,CCEvent *event){
CCLog("end %f,%f",touchStartP.x,touchStartP.y);
if (openTouch) {
CCPoint touchEndP=touch->getLocation();...
分类:
其他好文 时间:
2014-04-30 22:33:40
阅读次数:
359
最近在练习win8的一个小应用的时候,要求打开电脑上的文件以及保存文件到电脑上的功能。对于还属于菜鸟的我来说,着实有点无助呀。后来查了很多资料,才好不容易做好了,但是还是有很多不懂和做的不到位的地方。
还有就是较之之前微软的知识,那些filestream之类的在win8应用中没有作用了。win8好像新推出了storage这一类方法,stream流也几乎把io的方法淹没了,表示很头疼,知识更新是没...