原创 遞歸應用-全排列

leetcode題 class Solution { public List<List<Integer>> permute(int[] nums) { List<List<Integer>> result

原创 Hive中找出分組第一的記錄

使用group by進行分組查詢只能獲取分組列以及聚合函數列,如果想要獲取表中非分組列則獲取不到,此時可以使用row_number()對分組進行排序,同時也可以獲取非分組列。 表結構 學生課程分數表,三列 create table

原创 三數之和爲0的解題過程

leetcode上有個三數之和的題目: 給定一個包含 n 個整數的數組 nums,判斷 nums 中是否存在三個元素 a,b,c ,使得 a + b + c = 0 ?找出所有滿足條件且不重複的三元組。 注意:答案中不可以包含重

原创 基於Drools的人羣推薦實現方案

業務上運營提前建好規則,根據廣告主等級、業務類型等屬性給廣告主推薦不同的人羣,通過規則引擎來實現,可避免代碼中出現過多的if else判斷 加載規則 1、從ClassPath下加載DRL文件頭,比如引入的類型、定義的全局變量 pr

原创 Git總結

commit HEAD: 當前commit HEAD~1: 簡寫HEAD~, HEAD的前一個版本 HEAD~n: HEAD的前n個版本 HEAD^1: 簡寫HEAD^, 只merge時主分支 HEAD^2: 代指merge分支

原创 如何發送帶cookie HTTP請求

Postman App&Postman Interceptor 安裝Postman 安裝chrome extension Postman Interceptor chrome上點擊Postman Interceptor

原创 Bloom Filter介紹

原文 概覽 這篇文章我們談談Guava中的Bloom Filter, Bloom Filter是一種省內存的基於概率的數據結構,可判斷一個元素是否在集合中。 Bloom Filter沒有False Negative,即判斷某元素時

原创 homework-0219

問題1.安裝Anaconda。 print("Hello Anacond!") Hello Anacond! 問題2.使用Jupyter Python3編寫Hello world程序。 print("hello world")

原创 pandas-study

quickstart pandas is for statistic and analysis Object Creation import numpy as np import pandas as pd s=pd.Series([

原创 matplotlib-study

Usage Guide Pyplot tutorial python import matplotlib.pyplot as plt import numpy as np fig = plt.figure() fig.supti

原创 homework-0306-最小二乘法

#問題1.實現一元線性迴歸 #使用如下提供的數據求解 x=[300,400,400,550,720,850,900,950] y=[300,350,490,500,600,610,700,660] import numpy as

原创 numpy-study

quickstart Array Example import numpy as np a=np.arange(15).reshape(3,5) a array([[ 0, 1, 2, 3, 4], [ 5,

原创 jupyter-study

print("hello world") hello world %connect_info { "shell_port": 62708, "iopub_port": 62709, "stdin_port": 627

原创 緩存架構

架構師之路 緩存的目的是高性能、高併發 進程內緩存 架構師之路 一個帶鎖的Map或內存DB,列入leveldb 進程內通信,效率高,但緩存大小受限 每個服務實例中都緩存一份數據,緩存數據可能不一致 進程內緩存違背了分層架構無狀態原

原创 數據庫架構

架構師之路 讀寫分離 一主多從,主從同步,讀寫分離,互聯網大部分業務讀多寫少,一般讀會先成爲性能瓶頸。讀寫分離解決讀寫高併發問題,有以下特點: 簡單易操作 線性提升讀性能 消除讀寫鎖提升寫性能 冗餘從庫實現讀高可用,寫依舊單點 石