原创 SpringBoot自定義靜態資源配置

可以配置文件裏配置: app.video.save-path=D:/tmp/ spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/res

原创 配置部分接口可跨域訪問的方式

記錄兩種接口可跨域訪問的配置方式: 1、集中配置 @Configuration public class CustomCorsConfiguration { @Bean public CorsFilter corsFi

原创 java http 手機瀏覽器下載word文檔失敗的問題

一開始設置的Content-type爲: response.addHeader("Content-type", "application/vnd.openxmlformats-officedocument.wordprocessingm

原创 c# dataGridView 序號自動遞增

 在datagridview上顯示行號 1,先在加入如下代碼 private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs

原创 hadoop 二次排序 group函數的作用的說明

hadoop mapreduce作業通過組合key實現二次排序的過程中,只要實現組合key的類就可以了。mapreduce框架本身會基於key對輸出進行排序。 而partion函數只爲了是實現數據規模較大時,對map的輸出實現分區。爲啓動

原创 springboot集成tk.mybatis,及Druid數據源

一、springboot集成Druid數據源 1、添加Druid依賴 2、添加配置 具體步驟如下: 1、添加Druid依賴 <dependency> <groupId>com.alibaba</g

原创 沒有mysqld_safe命令怎麼修改mysql的root密碼

使用yum按裝的mysql5.7,使用一段時間後,初始的root密碼登錄不進去了,就想使用一下命令進入安全模式修改root密碼 mysqld_safe --user=root --skip-grant-tables 結果發現找不到該命令

原创 Idea 打包jar文件,可避免出現Error: Could not find or load main class TestDemo.jar

在使用idea打包jar文件,執行java -jar xxx.jar後出現 Error: Could not find or load main class TestDemo.jar 找不到主類的錯誤。 依照以下方式打包可解決此問題:

原创 centos安裝mongoDB4.2

1.創建文件 在/etc/yum.repos.d 目錄下創建mongodb-org.repo的一個文件,文件內寫入: [mongodb-org-4.2] name=MongoDB Repository baseurl=https://r

原创 centos安裝MariaDB10.2

在/etc/yum.repos.d目錄下創建MariaDB.repo文件,寫入以下內容: [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.2/centos7-am

原创 C#調用C++DLL,及回調函數、string參數傳遞的總結

Int型傳入: Dll端: extern "C" __declspec(dllexport) int Add(int a, int b) {     return a+b; } C#端: [DllImport("aeClien

原创 C# 在dataGridView中行首或行尾手動添加記錄、修改一行記錄(1.行尾添加,非數據庫連接形式 2.修改某一行的數據 3.插入行首,不覆蓋行首)

1. 在行尾添加新的一行數據DataGridViewRow row = new DataGridViewRow(); row.CreateCells(dataGridView1); row.Cells[0].Value = 23; row

原创 動態規劃入門之硬幣找零問題

看了雷霄驊的故事,爲之深表惋惜,一位爲科研埋頭奉獻發光發熱的人,這件事也促使我開通博客,來記錄自己一點學習的過程。 最近在看動態規劃的內容,看了硬幣找零問題,是一個很好的對動態規劃算法入門的問題,問題描述如下:有n中硬幣,面值分別爲v1,

原创 springboot XML Parser Error on line 44: 元素類型爲 "context" 的內容不完整, 它必須匹配

SpringBoot 項目打包時出現以下錯誤提示: XML Parser Error on line 44: 元素類型爲 "context" 的內容不完整, 它必須匹配 "(property*,plugin*,commentGenerat

原创 啓動keepalived時日誌中出現“ip address associated with VRID 51 not present in MASTER advert”

之前配置好的keepalive,在後來測試過程中發現關閉keepalive重新啓動時日誌會報以下錯誤: Jul  1 14:47:13 frontend1 Keepalived_vrrp[112938]: bogus VRRP packe