原创 半小時實現一個 go 爬蟲

1、Quick Start 只需三步,你就可以部署一個爬取 gocn 網站的所有新聞的爬蟲 第一步,你需要去 github 上生成一個自己的 token Settings ——> Developer settings ——> Pe

原创 使用 gorpc 開發 http 服務

gorpc 是一款非常簡單、易用、高性能的微服務框架,使用 gorpc 可以 分分鐘開發出 http 服務。gorpc 源碼非常簡單,可以參考:gorpc 一、server 創建 1、第一步,創建 gorpc server ,vi

原创 使用 Velocity 模板引擎快速生成代碼

Velocity 是一個基於 Java 的模板引擎,它允許任何人僅僅簡單的使用模板語言來引用由 Java 代碼定義的對象,從而實現界面和 Java 代碼的分離,使得界面設計人員可以和 Java 程序開發人員同步開發一個遵循 MVC

原创 Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, leve

原创 實戰 Jetty

  Jetty 是一個用 Java 實現、開源、基於標準的,並且具有豐富功能的 Http 服務器和 Web 容器,可以免費的用於商業行爲。Jetty 這個項目成立於 1995 年,現在已經有非常多的成功產品基於 Jetty,比如

原创 java 用兩個棧實現隊列

題目: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queu

原创 Maven install 報Fatal error compiling: tools.jar not found錯誤的處理

maven編譯項目時出現了Fatal error compiling: tools.jar not found的問題,在Google上找了一下,發現以下方法可以解決。所以直接貼上來: 在Eclipse環境下,使用Maven進行d

原创 java 動態規劃問題(2)

題目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money

原创 Tair-淘寶自主開發的一個分佈式key/value存儲系統

1.簡介 tair 是淘寶自己開發的一個分佈式 key/value 存儲引擎. tair 分爲持久化和非持久化兩種使用方式. 非持久化的 tair可以看成是一個分佈式緩存. 持久化的 tair 將數據存放於磁盤中. 爲了解決磁盤

原创 maven pom.xml報錯解決

maven pom.xml報錯 Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources f

原创 java數組去重

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new

原创 java 交換鏈表中所有相鄰結點的順序

題目: Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you sho

原创 maven install 報錯解決

[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 第一次解決方式是項目

原创 TDDL:來自淘寶的分佈式數據層

淘寶根據自身業務需求研發了TDDL(Taobao Distributed Data Layer)框架,主要用於解決分庫分表場景下的訪問路由(持久層與數據訪問層的配合)以及異構數據庫之間的數據同步,它是一個基於集中式配置的JDBC

原创 java 判斷一個二叉樹是不是平衡二叉樹

題目: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is de