原创 spring http 請求的數據傳輸的幾種格式
/* 請求格式:url?參數1=值1&參數2=值2... 同時適用於GET和POST方式 spring 處理查詢參數的方法又有幾種寫法 */ public class HttpTestApi { //方法參數名和請求參數名可以不
原创 linux後臺服務器開發環境部署配置和驗證(nginx+apache+php-fpm+FASTCGI(C/C++))
linux後臺服務器開發環境部署配置 引言 背景 隨着互聯網業務的不斷增多,開發環境變得越來越複雜,爲了便於統一服務器端的開發部署環境,特制定本配置文檔。 使用軟件 CentOS 6.3(Linux version 2.6.32-279
原创 linux eventfd 應用案例
#include <sys/eventfd.h> #include <sys/timerfd.h> #include <unistd.h> #include <stdio.h> #include <stdint.h> #include
原创 google protocl buffer 序列化和反序列化的一個例子
google protocl buffer 序列化和反序列化的一個例子 需要先定義協議文件 relation.proto,文件內容如下: package example.rpc; option cc_generic_services =
原创 PHP(xml轉成json)樣例
<?php $content = file_get_contents("d:\\aaa.xml"); print_r($content); prin
原创 C/C++指針的指針(**p)和指針的引用(*&)使用案例分析
#include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <stdlib.h> int func1(int *a) { a = new int;
原创 算法實現: 在二叉樹中找到兩個節點的最近公共祖先
該題目來自一次面試。。。 /* 在二叉樹中找到兩個節點的最近公共祖先(進階) 給定一棵二叉樹,多次給出這棵樹上的兩個節點 o1 和 o2,請對於每次詢問,找到 o1 和 o2 的最近公共祖先節點。 輸入描述 第一行輸入兩個整數 n 和
原创 LINUX 64位下運行32位程序加載和讀取大數據段共享內存
LINUX 64位下運行32位程序加載和讀取大數據段共享內存 1. 查看當前機器共享內存 1073741824 = 1024 * 1024 * 1024 [root@six shm]# ipcs ------ Shared Memory
原创 網絡通信之--accept死循環
網絡通信之--accept死循環 1. 發生背景 通信服務器一直運行,每次成功 accept ,都會分配新的 socket 資源,但是因爲未能有效的檢測和處理socket 的關閉事件,導致未能釋放 socket,最後,socket 資源
原创 LINUX C 輸出重定向例子
#include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <stdlib.h> int main(int argc,char *argv) { F
原创 最新版本 PHP (windows)開發環境配置
本次配置軟件 Eclipse 4.3 Apache 2.4.7 php 5.5.9 Xdebug 2.2.3-5.5 php 安裝 軟件準備http://windows.php.net/download/ 官網下載版本,php-5.5.
原创 protocol buffer C(linux)安裝
下面描述了在 GNU/Linux x86_64(centeros)下安裝 protocol buffer,支持 C 和 C++ 。 1. google protocol buffer 下載 下載 google protocol buffe
原创 linux 上使用外接設備(光驅) 安裝和更新庫
1. 掛載光驅(目錄不存在,創建) mount -t auto /dev/cdrom /mnt/cdrom 2. 修改索引文件,指定讀取本地文件 v
原创 nginx-rtmp(直播點播)配置
1. 安裝 a. 環境選擇,linux [root@200 software]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [root@200 softwa
原创 hadoop2.3安裝和wordcount運行驗證
以下描述了centos linux(2.6.32-279.el6.x86_64)位機器下,安裝32位hadoop 2.3,並通過運行 系統自帶的 WordCount 例子來驗證服務正確性的步驟。 建立目錄 /usr/local/hado