摘要:操作系统:CentOS 6.2虚拟机:VMWare 8.0Master与Slave都需要做:用root登陆,建立hadoop用户useradd hadooppasswd hadoop源机器执行:ssh-keygen -t rsa -P '';cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys;scp ~/.ssh/id_rsa.pub hadoop@目标机器IP:~/;cat ~/id_rsa.pub >> ~/.ssh/authorized_keys目标机器执行:cat ~/id_rsa.pub >&g
阅读全文
摘要:public static string GetData(double value){string result = string.Empty;double temp = 0;for (double i = 0;i <= value;++i){temp = (Math.Pow(i, 3) + 2 * i);if (temp > value){return result;}else{result = i.ToString() + "," + temp.ToString();}}return string.Empty;}string result = GetData
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using Lucene.Net;using Lucene.Net.Analysis;using Lucene.Net.Analysis.Standard;using Lucene.Net.Index;using Lucene.Net.Store;using Lucene.Net.Documents;using Lucene.Net.Search;using Lucene.Net.QueryParse
阅读全文
摘要:内网环境,两台普通机器:1000万数据(1)byte[]毫秒级(2)StringBuilder毫秒级1亿数据:(1)byte[]毫秒级(500毫秒以上)(2)StringBuilder秒级(1秒以上)
阅读全文
摘要:Cache-ControlCache-Control 是最重要的规则。这个字段用于指定所有缓存机制在整个请求/响应链中必须服从的指令。这些指令指定用于阻止缓存对请求或响应造成不利干扰的行为。这些指令通常覆盖默认缓存算法。缓存指令是单向的,即请求中存在一个指令并不意味着响应中将存在同一个指令。cache-control 定义是:Cache-Control = “Cache-Control” “:” cache-directive。表 1 展示了适用的值。表 1. 常用 cache-directive 值Cache-directive说明public所有内容都将被缓存private内容只缓存到私有
阅读全文
摘要:View Code 1 HWND hwnd = FindWindowEx(0, 0, L"StandardFrame", L"淘宝旺旺窗口名称"); 2 if (hwnd) 3 { 4 SetForegroundWindow(hwnd); 5 EnumChildWindows(hwnd, EnumWindowCallback, 0); 6 } 7 8 BOOL WINAPI EnumWindowCallback(HWND hwnd, LPARAM lparameter) 9 {10 TCHAR text[128] = { 0 };11 GetClassN
阅读全文
摘要:View Code 1 (1)创建文件:ServiceConfig.txt 2 3 (2)写如下配置: 4 5 ServiceName=DaemonTask1 6 (3)写一个配置类: 7 8 public class Config 9 {10 public static string GetServiceConfig(string key)11 {12 string[] result = { string.Empty };13 string fileName1 = "ServiceConfig.t...
阅读全文
摘要:public static byte[] ConvertRequestToBytes(audio_search_req requestData){using (MemoryStream memoryStream = new MemoryStream()){BinaryWriter binaryWriter = new BinaryWriter(memoryStream);binaryWriter.Write(requestData.version);binaryWriter.Write(requestData.queryFname);binaryWriter.Write(requestData
阅读全文
摘要:public static object ConvertResponseToObject(byte[] Bytes){if (Bytes == null || Bytes.Length == 0) { return null; }byte[] tempBytes = Bytes.Clone() as byte[];using (MemoryStream memoryStream = new MemoryStream(tempBytes)){BinaryReader binaryReader = new BinaryReader(memoryStream);audio_search_resp r
阅读全文
摘要:1 在根目录下建立root目录2 拷贝/etc/skel目录下的.bash_logout和.bashrc和.bash_profile到root目录即可。
阅读全文
摘要:import com.sun.jna.*;import com.sun.jna.platform.*;import com.sun.jna.platform.win32.WinNT;import com.sun.jna.win32.*;import java.util.ArrayList;public class TestJNA {public interface MyDrivers extends StdCallLibrary {MyDrivers INSTANCE1 = (MyDrivers)Native.loadLibrary("D:\\NCR_JNI\\DLL\\CRT_35
阅读全文
摘要:第一步,写hello.java第二步,执行javac hello.java第三步,执行javah -jni hello(如果写成hello.class会报错),生成hello.h第四步,创建一个C++的dll,比如叫hello第五步,将hello.h,jni.h,jni_md.h拷贝到hello工程目录下,添加进工程里第六步,修改hello工程中的hello.h中的#include <jni.h>成#include "jni.h"第七步,在hello工程中添加hello.cpp,在hello.cpp添加#include "hello.h",把
阅读全文
摘要:操作系统:CentOSHbase版本:0.92.0(1)下载到/opt目录下,解压缩,改名后:/opt/hbase(2)修改配置/opt/hbase/conf/hbase-env.sh,填写JDK目录:export JAVA_HOME=/opt/jdk(3)修改配置/opt/hbase/conf/hbase-site.xml<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configurati
阅读全文