- 博客(551)
- 资源 (7)
- 收藏
- 关注
原创 浏览器以只读方式打开PDF
1、 pdf.js禁掉下载和打印的功能<button id="print" style="display:none;" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print"> <span data-l10n-i...
2019-03-26 19:52:04 948
原创 线性回归
1、生成数据#!/usr/bin/env python3# -*- coding: utf-8 -*-import numpy as np import matplotlib.pyplot as plt #使用 matplotlib 可视化数据x_train = np.linspace(-1, 1, 101) #输入值为 -1 到 1 之间的 101 个均匀间隔的数字y_...
2019-03-26 17:01:17 233
原创 信用卡反欺诈
脱敏后的数据文件#!/usr/bin/env python3# -*- coding: utf-8 -*-import pandas as pdimport numpy as np import matplotlib.pyplot as pltfrom sklearn.utils import shuffleimport seaborn as snsimport matplot...
2019-03-26 15:49:21 1442
原创 K-Means算法实例
#!/usr/bin/env python3# -*- coding: utf-8 -*-import matplotlib.pyplot as pltimport sklearn.datasets as dsimport matplotlib.colors#造数据N=800centers=4# 生成2000个(默认)2维样本点集合,中心点5个data,y=ds.make_bl...
2019-03-26 14:28:54 12497 2
原创 kmeans算法初步
# -*- coding: utf-8 -*-"""Created on Tue Mar 26 09:11:21 2019@author: hadron"""from sklearn.datasets import make_blobsimport matplotlib.pyplot as pltif __name__ == '__main__': N = 400 ...
2019-03-26 09:40:37 245
原创 读取Excel数据进行决策树算法分析
#!/usr/bin/env python3# -*- coding: utf-8 -*-import reimport unicodedataimport copyfrom xlrd import open_workbookfrom xlrd import XL_CELL_TEXT, XL_CELL_NUMBER, XL_CELL_DATE, XL_CELL_BOOLEANimp...
2019-03-25 16:39:49 3964 2
原创 决策树算法简单应用
# -*- coding: utf-8 -*-from sklearn import tree# visualize codefrom sklearn.externals.six import StringIOimport pydotplus# 决策树算法# 初步的两个特性的判断,[重量,表皮光滑度](对于水果,可以是:1=光滑,0=粗糙)# 结论标签,1=苹果,0=橘子fe...
2019-03-25 16:10:09 566
原创 TensorFlow学习笔记:6、用Tensorflow计算a=(b+c)∗(c+2)
Tensorflow是基于graph的并行计算模型举个例子,用Tensorflow计算a=(b+c)∗(c+2)可以将算式拆分成一下:d = b + ce = c + 2a = d * e编程如下# -*- coding: utf-8 -*-"""Created on Wed Mar 20 16:39:49 2019@author: hadron"""# https:/...
2019-03-25 15:52:59 449
原创 TensorFlow学习笔记:5、矩阵的简单运算
# -*- coding: utf-8 -*-"""Created on Mon Mar 25 15:22:50 2019@author: hadron"""import tensorflow as tf# 例1:计算两个矩阵的和# 定义了两个常量op,m1和m2,均为1*2的矩阵 、m1=tf.constant([3,5]) m2=tf.constant([2,4]) ...
2019-03-25 15:33:40 390
原创 TensorFlow学习笔记:4、TensorFlow简单运算
文件 add.py#!/usr/bin/env python3# -*- coding: utf-8 -*-import tensorflow as tf# 基本常量操作# 构造函数返回的值就是常量节点(Constant op)的输出.a = tf.constant(2)b = tf.constant(3)# 启动TensorFlow会话ss = tf.Session()#...
2019-03-20 17:42:31 237
原创 Java读取Oracle的CLOB字段转换为String数据
1、方法1 流处理if (type.equalsIgnoreCase("CLOB")) { Clob clob=resultSet.getClob(columnIndex); String result=clob2String(clob); System.out.println("流处理读取CLOB:\n"+...
2019-03-15 10:23:51 6027 1
原创 spring-boot-starter-data-elasticsearch整合elasticsearch 6.x实现高亮highlighter解决办法
spring-boot-starter-data-elasticsearch整合elasticsearch 6.x实现高亮highlighter解决办法注意:此文是解决springboot 2.x通过spring-boot-starter-data-elasticsearch整合elasticsearch 6.x实现高亮highlighter解决办法。参考官方文档:https://docs....
2019-03-14 17:44:30 3557 5
原创 SpringBoot 2.x 统一异常处理
1、统一异常处理类package cn.hadron.controller;import org.springframework.web.bind.annotation.ControllerAdvice;import org.springframework.web.bind.annotation.ExceptionHandler;import org.springframework.web...
2019-03-05 14:13:34 7586
原创 Intellij idea打带Manifest文件的jar包(可执行jar包)
1、问题描述老版本Intellij idea可以很方便地打带Manifest文件的jar包,也就是可行性的Jar包。今天使用新版的Intellij idea打jar包时遇到了坑,jar包中竟然没有MANIFEST文件。2、新版的Intellij idea打带Manifest文件的jar包步骤2.1 F4 → Project Structure→Artifacts→+→jar→From m...
2019-03-04 16:26:51 8520
原创 web页面上单击按钮实现复制当前页面的url到剪贴板
超级简单,直接上代码<!DOCTYPE html><head> <meta charset="UTF-8"> <title>首页</title> <script> function copyUrl() { alert(this.location.href)
2019-03-01 09:16:00 4466 2
原创 SpringBoot 2.x项目jar包部署
1、修改pom.xml修改两处:(1)修改maven中的package方式为jar&amp;amp;lt;packaging&amp;amp;gt;jar&amp;amp;lt;/packaging&amp;amp;gt;(2)修改&amp;amp;lt;build&amp;amp;gt;&amp;amp;lt;/build&amp;amp;gt; &am
2019-02-14 15:33:32 2733
原创 Java Web(SpringBoot 2.x)上传文件夹,完整代码
1、pom.xml &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;spring-boot-starter-web&a
2019-02-14 15:02:28 2393
原创 BindTransportException: Failed to bind to [9300]
1、异常信息[2019-02-12T15:50:30,496][INFO ][o.e.n.Node ] [elastic1] starting ...[2019-02-12T15:50:30,775][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [elastic1] uncaught exception i...
2019-02-12 16:25:51 5946 4
原创 更改Tomcat日志目录
1、修改conf/logging.properties[root@elastic1 apache-tomcat-8.5.35]# vi conf/logging.properties############################################################# Handler specific properties.# Describes sp...
2019-01-18 14:06:34 2573
原创 Elasticsearch 7.x:3、文档管理
3.1 添加文档3.2 更新文档3.3 获取文档3.4 查询文档3.5 批量操作3.6 版本控制3.7 路由控制
2019-01-10 11:34:15 7395
原创 完整教程:spring-boot-starter-data-elasticsearch整合elasticsearch 6.x
1、前言网上很多言论:新版本的SpringBoot 2的spring-boot-starter-data-elasticsearch中支持的Elasticsearch版本是2.X,但Elasticsearch实际上已经发展到6.5.X版本了,为了更好的使用Elasticsearch的新特性,所以弃用了spring-boot-starter-data-elasticsearch依赖,而改为直...
2019-01-09 10:39:58 100258 41
原创 Elasticsearch 7.x:2、索引管理
2.1 新建索引(1)索引名小写PUT test{ &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;acknowledged&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot; : true, &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;quot;shards_acknowledged&amp;a
2019-01-07 17:40:58 13893 3
原创 Elasticsearch 7.x:1、图解Windows本地测试环境搭建
1.1 JDK配置(1)下载Windows版本的JDK8,并安装。(2)配置JAVA_HOME环境变量1.2 Windows版本下载1.3 启动目录结构:bin:启动文件config:配置文件log4j2.properties:日志配置文件jvm.options:java虚拟机的配置elasticsearch.yml:es的配置文件data:索引数据目录...
2019-01-07 10:08:30 4858 2
原创 Tika简单实例应用
1、Maven pom.xml创建Maven项目,添加以下依赖 &lt;!-- https://mvnrepository.com/artifact/org.apache.tika/tika-core --&gt; &lt;dependency&gt; &lt;groupId&gt;org.apache.tika&lt;/groupId&
2018-12-27 18:02:33 2036
原创 ES集群
官方网址:https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-cluster-health.html1、集群健康Let’s start with a basic health check, which we can use to see how our cluster is doing...
2018-12-27 14:51:57 558
原创 elasticsearch 6.x 基本概念解读
官方网址Elasticsearch最新基本请参考官方介绍:https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-concepts.html备注:以下是官方文档+谷歌翻译(翻译效果还可以)Basic Concepts/基本概念There are a few concepts that ...
2018-12-27 14:24:10 1139
原创 Elasticsearch 7.0变化
Elasticsearch 7.0变化1、官方文档https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-7.0.html2、High-level REST client 改变API methods accepting Header argument have been removed...
2018-12-26 17:15:34 8110 1
原创 基础教程:7、MySQL/MariaDB安装
7.1 安装[root@elastic1 ~]# yum install -y mariadb mariadb-server7.2 开机启动[root@elastic1 ~]# systemctl start mariadb[root@elastic1 ~]# systemctl enable mariadbCreated symlink from /etc/systemd/syste...
2018-12-24 16:07:34 817
原创 基础教程:5、图解Linux下JDK安装与环境变量配置
5.1 下载JDK8(1)百度搜索“jdk”第一条结果就是JDK下载地址(2)接受协议,单击下载(3)JDK的上传到Linux服务器
2018-12-15 23:00:01 1026 1
原创 基础教程:4、CentOS 7.x基本设置
4.1 修改hosts文件[root@localhost ~]# vi /etc/hosts[root@localhost ~]# cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.local...
2018-12-15 16:39:04 532
原创 CentOS 7系统修改mariadb的数据目录
1、起因安装MySQL/MariaDB数据库时,使用了默认的数据目录空间。今天创建数据表时失败,报错如下:ERROR 3 (HY000): Error writing file './esdb/news.frm' (Errcode: 28)原因是MySQL/MariaDB数据库的数据目录所在的分区空间已经用完。[root@test ~]# df -hFilesystem ...
2018-12-13 22:20:06 3433
原创 基础教程:3、Xshell 6 个人版安装与远程操作连接服务器
3.1 下载Xshell6(1)打开官网https://www.netsarang.com/download/free_license.html(2)单击“Xshell 6”图标下的“Download”按钮,进入下面页面。默认情况下已经选择“Home and school use”,然后输入个人姓名和Email,再单击“Submit”提交按钮。(3)提交后,需要到邮箱里查看邮件。(...
2018-12-12 23:32:14 1306 1
原创 基础教程:2、Linux服务器安装图解
2.1 Linux发行版选择2.2 下载CentOS镜像2.3 虚拟机安装镜像选择2.4 CentOS系统安装
2018-12-12 17:52:00 646
原创 基础教程:1、VMware Workstation虚拟机软件安装图解
1.1 重要提示安装软件之前,请先退出360、电脑管家等安全类软件,这类软件会阻止我们安装的软件进行注册表注册,很可能导致安装失败。1.2 VMware Workstation下载与安装1.2.1 下载打开VMware Workstation官网下载地址https://www.vmware.com/cn/products/workstation-pro/workstation-pro-ev...
2018-12-11 11:19:27 1317 1
原创 关闭Kibana进程
1、Elasticsearch异常停止,Kibana无法连接到Elasticsearch log [11:49:18.892] [warning][admin][elasticsearch] No living connections log [11:49:18.894] [warning][admin][elasticsearch] Unable to revive connect...
2018-11-29 14:15:23 4771
原创 SpringBoot 2.x 学习笔记(5):ECharts+AJAX实现异步数据加载
1、JavaBeanpackage com.cntaiping.tpa.eba.bean;import java.io.Serializable;public class UserBean implements Serializable{ private String username; private Double salary; public UserBean...
2018-11-14 14:06:43 1761
原创 SpringBoot 2.x 学习笔记(4):整合Echarts
1、下载Echartshttp://echarts.baidu.com/index.html2、添加echarts.js到项目中在resources目录下创建js目录,然后将刚才下载的echarts.js文件放到js目录下。不知道为什么我在IntelliJ IDEA工具下,创建对应的js目录失败,出现“static.js”或者“static.css”目录。只好删除之前失败的目录“st...
2018-11-14 09:50:56 2139
原创 Elasticsearch 6.x集群搭建
以下操作,每个节点相同1、关闭防火墙和SELINUXsystemctl stop firewalldsystemctl disable firewalldsetenforce 0sed -i "s#SELINUX=enforcing#SELINUX=disabled#g" /etc/selinux/config2、JDK安装rpm -qa|grep java|xargs rpm ...
2018-11-12 18:46:14 1834
原创 Java程序设计(Java9版):第8章 代码块与内部类
类的成员,除了属性与方法(包含构造器),还有代码块和内部类7.1 代码块jshell&gt; class CodeBlock{ ...&gt; { ...&gt; System.out.println("构造代码块"); ...&gt; } ...&gt; static { ...&gt;
2018-10-13 23:46:02 296
小巧的屏幕调节软件flux
2019-08-10
基于elasticsearch 6.x的新闻搜索项目代码
2019-07-17
Xftp6官方个人版
2018-11-11
Xshell 6 官方个人版
2018-11-11
hibernate5+spring4+springmvc+maven基本框架整合样例代码
2018-07-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人