原创 ZooKeeper安裝(單機+僞集羣模式)-LINUX

  ZooKeeper安裝(單機+僞集羣模式)-LINUX 單機安裝 地址:zookeeper發行鏈接 選擇擇所需要的版本,本地選擇 zookeeper-3.4.14 下載 wget https://mirrors.tuna

原创 尖括號轉義-C語言實現版本

需求: 字符串是xml格式的字符串,但是某個標籤值存在尖括號,需要把'<'替換成"&lt",把'>'替換成"&gt" 例如: 0123456789<Root><>r423><432423<<</Root>3gfdgfd 轉換後 012

原创 ZooKeeper基本使用

 ZooKeeper基本使用 啓動 進入安裝主目錄 cd bin ./zkServer.sh start ps -ef|grep QuorumPeerMain CLI使用 創建znode 創建結點:結點分爲:持久結點persiste

原创 go語言入門-常量(const和itoa)

go語言入門-常量(const和itoa) 定義 常量:常量標識恆定不變的值,區別於變量var。var-變量不賦值存在默認值,但是常量聲明是必須顯示賦值。 常量關鍵字:const 常量不能使用 “:=” 語法定義。 聲明方式 普通

原创 GO語言變量作用域-坑記錄

GO語言變量作用域-坑記錄 1、main包的全局變量,其他文件無法使用。 解決辦法: 全局變量放置在其他包中進行引用 2. 同名變量局部變量優先於全局變量,但是在使用 := 進行類型推導時會默認創建一個局部變量,該局部變量若與全局變量同名

原创 Go語言入門-關鍵詞和命名方式

目錄 go語言入門-關鍵字和命名方式   關鍵字 保留字 命名 Go語言入門-關鍵字和命名方式   關鍵字 go語言只有25個關鍵詞 break default func interface select case defer go

原创 Go語言入門-反射

Go語言入門-反射 概述 定義 Reflection in computing is the ability of a program to examine its own structure, particularly thr

原创 Go語言入門-接口

Go語言入門-接口 概述 定義 An interface type specifies a method set called its interface. A variable of interface type can st

原创 Go語言入門-類型

Go語言入門-類型 基本類型 基礎數據類型 類型、長度、默認值、說明介紹 類型 長度 (單位Byte) 默認值 說明 bool 1 false byte 1 0 同uint8 int 4/8 0 默認的整數

原创 Go語言入門-struct結構

Go語言入門-struct結構 關鍵字type Go語言中使用type關鍵字自定義類型。 The new type is called a defined type. It is different from any other

原创 工具庫不是lib開頭該怎麼辦?該如何鏈接

前言: 開發不規範,同事兩行淚 問題: 某位同事提供的公共庫是APP_TESTPUB.so,該如何去鏈接呢? 正文: 在gcc鏈接的過程中一般是使用-L用來指定動態庫存放路徑,可以是相對路徑,也可以是絕對路徑。-l用來表示鏈接那個動態庫或

原创 Go語言入門-方法

Go語言入門-方法 概念 A method is a function with a receiver. A method declaration binds an identifier, the method name, to

原创 Go語言入門-錯誤處理

Go語言入門-錯誤處理 錯誤到底是什麼? 錯誤在go中是一個接口類型,便於自定義錯誤擴展。 // The error built-in interface type is the conventional interface fo

原创 Go語言入門-異常處理-pannic和recover

Go語言入門-異常處理-pannic和recover 簡述 Go語言try…catch結構化的異常機制,但是可以使用panic進行錯誤的拋出,使用recover來進行異常恢復處理。 基礎語法 func panic(interfac

原创 生成16位、8位的pinblock(JAVA實現)

生成16位、8位的pinblock   引言 最近在對接某金融行業的改造需要生成國密的pinblock,網上找不到生成16位的pinblock的實現。只有pinblock8位的生成, 基於此,稍作修改,並增加了pinblock16位生成。