05 2012 档案

部署Hadoop集群前奏之ssh如何不输入密码在Master与Slave之间访问
摘要:操作系统: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 阅读全文

posted @ 2012-05-31 17:29 哥是技术人 阅读(718) 评论(1) 推荐(0)

让计算机来计算一元二次方程等式
摘要: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 阅读全文

posted @ 2012-05-30 12:13 哥是技术人 阅读(450) 评论(0) 推荐(0)

Lucene.Net v2.9.x + 盘古分词版
摘要: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 阅读全文

posted @ 2012-05-29 10:26 哥是技术人 阅读(209) 评论(0) 推荐(0)

.Net Remoting传输1000万数据,1亿数据测试
摘要:内网环境,两台普通机器:1000万数据(1)byte[]毫秒级(2)StringBuilder毫秒级1亿数据:(1)byte[]毫秒级(500毫秒以上)(2)StringBuilder秒级(1秒以上) 阅读全文

posted @ 2012-05-23 10:26 哥是技术人 阅读(191) 评论(0) 推荐(0)

浏览器缓存
摘要:Cache-ControlCache-Control 是最重要的规则。这个字段用于指定所有缓存机制在整个请求/响应链中必须服从的指令。这些指令指定用于阻止缓存对请求或响应造成不利干扰的行为。这些指令通常覆盖默认缓存算法。缓存指令是单向的,即请求中存在一个指令并不意味着响应中将存在同一个指令。cache-control 定义是:Cache-Control = “Cache-Control” “:” cache-directive。表 1 展示了适用的值。表 1. 常用 cache-directive 值Cache-directive说明public所有内容都将被缓存private内容只缓存到私有 阅读全文

posted @ 2012-05-21 13:23 哥是技术人 阅读(234) 评论(0) 推荐(0)

淘宝旺旺自动发消息
摘要: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 阅读全文

posted @ 2012-05-09 11:50 哥是技术人 阅读(3447) 评论(0) 推荐(0)

动态修改Windows Service名称
摘要: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... 阅读全文

posted @ 2012-05-07 18:00 哥是技术人 阅读(448) 评论(0) 推荐(0)

将对象通过BinaryWriter转换成byte[]
摘要: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 阅读全文

posted @ 2012-05-03 10:29 哥是技术人 阅读(938) 评论(0) 推荐(0)

将byte[]通过BinaryReader转换成对象
摘要: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 阅读全文

posted @ 2012-05-03 10:29 哥是技术人 阅读(615) 评论(0) 推荐(0)

Linux命令行在su root后突然变成bash-4.1$的办法
摘要:1 在根目录下建立root目录2 拷贝/etc/skel目录下的.bash_logout和.bashrc和.bash_profile到root目录即可。 阅读全文

posted @ 2012-05-03 10:28 哥是技术人 阅读(646) 评论(0) 推荐(0)

JNA调用C++的DLL
摘要: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 阅读全文

posted @ 2012-05-03 10:28 哥是技术人 阅读(332) 评论(0) 推荐(0)

JNI,C++,终于调试通过
摘要:第一步,写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",把 阅读全文

posted @ 2012-05-03 10:27 哥是技术人 阅读(236) 评论(0) 推荐(0)

Hbase测试&打补丁(HBASE-5415.patch)
摘要:操作系统: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 阅读全文

posted @ 2012-05-03 10:26 哥是技术人 阅读(719) 评论(0) 推荐(0)

导航