原创 數論模板

/* 數論模板 */ #include<iostream> #include<cstdio> #include<cmath> using namespace std; typedef long long LL; const i

原创 JAVA學習記錄—多線程

計算機的CPU可以掌管多進程,JVM可以掌管多線程,一個應用程序就是一個進程,在其中又可以劃分爲多個線程,這些線程都可以獲得CPU資源,而且輪流使用(不是絕對的輪流,而是在排隊的所有線程中隨機選擇使用),JVM可以快速切換,使得像是多線程

原创 uva10002 Center of Masses

題意:計算多邊形的重心 解題:先找出凸包,再計算凸多邊形重心 WA:數據類型 代碼:   //uva10002 Center of Masses //AC By Warteac //Runtime:0.352s //2013-5-17 /

原创 vijos-p1237 || China University of Petrolenum 1363

//vijos-p1237 || China University of Petrolenum 1363 //AC by warteac //2013-7-19 //DP,分子/分母,排序,不斷根據計算結果再增大分子或者分母,並且最終的結

原创 Spring-retry 優雅地重試機制

Spring-retry 優雅地重試機制 如何有什麼問題出錯需要重試,不用繁瑣的寫for循環去手動重試,可以使用Spring-retry優雅地實現. 第一步:導入spring-retry build.gradle 中添加代碼: d

原创 AttributeError: module 'base64' has no attribute 'b64decode'

import base64 base_str = "xxxx" print(base64.b64decode(base_str)) 乳齒簡單的代碼運行竟然報錯: AttributeError: module 'base64' has no

原创 Leetcode 680. Valid Palindrome II

Leetcode 680. Valid Palindrome II Given a non-empty string s, you may delete at most one character. Judge whether you

原创 Prometheus+Grafana監控報警系統搭建

1.基本概念 Prometheus 官網(https://prometheus.io/) 是一套開源的監控和報警系統,也是一個時序數據庫。 架構圖 工作流程:通過exporters從數據源主動拉取數據(metrics),保

原创 Leetcode 876. Middle of the Linked List

Leetcode 876. Middle of the Linked List Given a non-empty, singly linked list with head node head, return a middle nod

原创 Leetcode 99. Recover Binary Search Tree

Leetcode 99. Recover Binary Search Tree Two elements of a binary search tree (BST) are swapped by mistake. Recover the

原创 非root用戶刪除libc.so.6 的可怕經歷

問題 背景:程序運行時缺少GLIBC_2.14, 需要將2.12升級到2.14,在安裝完glibc.2.14之後,進行軟連接刪除和重建時,刪除了libc.so.6. libc.so.6是大部分基本命令運行的庫,刪掉之後sudo命令就沒法

原创 awk實現多行合併

需求 文件每一行有兩列,需要將第一列相同的行合併。 例如: 111:aaa 22:bbb 22:ccc 合併之後變爲 111:aaa 22:bbbccc 實現 例如:文件名爲test.txt cat

原创 Java 複習總結

Java複習 public,protected,no modifier,private 修飾的屬性的訪問權限: 自己可以任意訪問; 同一個包中,只有private不能訪問; 不同的包中,只有子類可以訪問protected;

原创 Ubuntu 16 環境配置和軟件安裝

1.查看ubuntu系統位數 uname -a 我的是64位 2.安裝搜狗拼音 參照安裝搜狗拼音ubuntu16 安裝重啓完之後並沒有出現搜狗輸入法,解決方法: 在最上面的菜單欄找到小鍵盤或者小企鵝形狀的圖標(Fcitx co

原创 Leetcode 42. Trapping Rain Water

Leetcode 42. Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each b