??xml version="1.0" encoding="utf-8" standalone="yes"?> 1?/span>http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html挑一?/span>jdk下蝲下来。因为需?/span>accept licenseQ不?/span>wget直接下蝲 2?/span>tar zxvf xxxx 3?/span>mkdir /usr/local/jdk/jre-xx 4?/span>mv xxx /usr/local/jdk/jre-xx 修改环境变量 # vi /etc/profile #set java env JAVA_HOME=/usr/local/jdk/ JRE_HOME=/usr/local/jdk/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin export JAVA_HOME JRE_HOME CLASS_PATH PATH # source /etc/profile 验证java #java -version java version "1.8.0_144" Java(TM) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode) 1?/span>wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz 2?/span>tar zxvf apache-maven-3.5.0-bin.tar.gz 3?/span>mv apache-maven-3.5.0-bin.tar.gz /usr/local/apache-maven 4?/span># vi /etc/profile export M2_HOME=/usr/local/apache-maven export PATH=$PATH:$M2_HOME/bin # source /etc/profile 5、验证是否安装成?/span> # mvn -version Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00) Maven home: /usr/local/apache-maven Java version: 1.8.0_144, vendor: Oracle Corporation Java home: /usr/local/jdk/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-358.el6.x86_64", arch: "amd64", family: "unix" 6、配|?/span>maven国内镜像 修改maven根目录下?/span>conf文g夹中?/span>setting.xml文gQ内容如下: <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> Before sending/receiving messages, we need to tell clients the location of name servers. RocketMQ provides multiple ways to achieve this. For simplicity, we use environment variable 1 安装jdk
2 安装mvn
<mirrors>3 安装rocketmq
Clone & Build
> git clone https://github.com/apache/incubator-rocketmq.git > cd incubator-rocketmq > mvn -Prelease-all -DskipTests clean install -U > cd distribution/target/apache-rocketmq如果服务器内存不够,可以修改runserver.sh脚本Q?/span>mqnamesrv文g中通过runserver.sh脚本调用Name Server的主函数com.alibaba.rocketmq.namesrv.NamesrvStartup启动Name ServerQ中?/span>JAVA_OPT_1参数Start Name Server
> nohup sh bin/mqnamesrv & > tail -f ~/logs/rocketmqlogs/namesrv.log The Name Server boot success...Start Broker
> nohup sh bin/mqbroker -n localhost:9876 & > tail -f ~/logs/rocketmqlogs/broker.log The broker[%s, 172.30.30.233:10911] boot success...Send & Receive Messages
NAMESRV_ADDR > export NAMESRV_ADDR=localhost:9876 > sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer SendResult [sendStatus=SEND_OK, msgId= ... > sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer ConsumeMessageThread_%d Receive New Messages: [MessageExt...Shutdown Servers
>
sh bin/mqshutdown brokerThe mqbroker(36695) is running...Send shutdown request to mqbroker(36695) OK >
sh bin/mqshutdown namesrvThe mqnamesrv(36664) is running...Send shutdown request to mqnamesrv(36664) OKMore
https://rocketmq.incubator.apache.org/docs/quick-start/
没心情再写了Q浪Ҏ_以后量不用q破博客记录东西了?br />单记录下
jsoncpp?br />
Json::Value value;
Json::Reader reader;
string str = {\"aa\":{\"bb\":\"cc\"}, \"bb\":\"dd\"};
reader.parse(str, value);
value["aa"].asString(); //q个会崩溃,原因 aa是objectQ不是string
value["bb"].asString(); //q个ok
value["cc"] = "aa"; //q个创徏ccQ?br />string str2 = value["dd"].asString(); //q个Q返回nullQ然后会ddd节点?br />
仅作Z录,代码写的很不规范Q请高手勿喷。如果有错误Q欢q指正!
大家qx在用cM鲁大师之cY件的时候,会看到鲁大师之类的Y件能够获取到PC机的g的详l信息,有时候自己在写Y件的时候也需要获取PCg的详l信息,q个时候你会发现有的硬件信息通过pȝ的API函数无法获取到或者获取的不准。所以这个时候就要通过WMI~程来获取硬件信息了。WMI是windows操作pȝ用来理软g和硬件的核心。其它的不再多讲了,下面来看最主要的,通过WMI获取g信息?/span>
整体来说Q通过WMI获取计算机硬件信息有以下几个步骤
1?span style="font-size: 7pt; font-family: 'Times New Roman'; "> ?/span>CoInitializeEx函数初始化COM参数。因为WMI中的c都是基于COM技术的?/span>
2?span style="font-size: 7pt; font-family: 'Times New Roman'; "> ?/span>CoInitializeSecurity函数初始化COMq程的安全,因ؓWMI的进E和应用E序q程不在同一个别?/span>
3?span style="font-size: 7pt; font-family: 'Times New Roman'; "> 获取IWbemServices指针Q通过函数IWbemLocator::ConnectServer获取?/span>
4?span style="font-size: 7pt; font-family: 'Times New Roman'; "> 通过CoSetProxyBlanket讄IWbemServices代理安全QWMI服务可以模拟客户端?/span>
5?span style="font-size: 7pt; font-family: 'Times New Roman'; "> 使用IWbemServicesq行WMI查询Q主要用WQL语句?/span>
6?span style="font-size: 7pt; font-family: 'Times New Roman'; "> 清理COM对象?/span>
例子Q?span style="font-size: 7pt; font-family: 'Times New Roman'; "> 查询操作pȝ信息的一个例?/span>
When using the WinNT provider, the IsAccountLocked property can only be set to FALSE, which unlocks the account. Attempting to set the IsAccountLocked property to TRUE will fail. Only the system can lock an account.
The following code example demonstrates how to use Visual Basic with ADSI to unlock a user account.
With the WinNT provider, the IsAccountLocked property can be used to determine if an account is locked out. If an account is locked out, the IsAccountLocked property will contain TRUE. If an account is not locked out, theIsAccountLocked property will contain FALSE.
The following code example demonstrates how to use Visual Basic with ADSI to determine if an account is locked out.