自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

s37

s37

  • 博客(53)
  • 收藏
  • 关注

转载 linux - awk 和kill 批量杀死进程

ps -ef|grep check_os.sh | grep -v grep | awk ‘{print $2}’ | xargs kill -9$2表示第2列,即进程号PID;grep -v grep是列出除开grep命令本身的进程,grep iboss2确认进程关键字kill -9 强杀进程;xargs 使用上一个操作的结果作为下一个命令的参数使用awk:awk是一个强大的文本分析...

2019-02-26 22:52:00 2655

原创 Best Time to Buy and Sell Stock

Best Time to Buy and Sell StockSay you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one ...

2018-10-09 23:04:59 375

原创 linux防火墙

linux防火墙iptables使用iptables进行包过滤表链SELinuxlinux系统中查看己设置iptables规则通过iptables 过滤IP段欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一...

2018-09-25 10:21:01 430

原创 MySQL命令行学习

MySQL命令行学习1、登录mysql本地:mysql -u root -p, 回车后输入密码; 也可以p后不加空格,直接加密码。回车就登录了远程:mysql -hxx.xx.xx.xx -u -pxxx2、查看数据库:show databases;3、连接数据库:use db_name;4、查看数据表:show tables;5、查询:select * from ta...

2018-09-12 15:00:20 309

原创 gradle

./gradlew distTar./gradlew clean./gradlew debugRun./gradlew assembleDist

2018-08-30 16:58:09 158

原创 Robust Network Traffic Classification

摘要提出RTC(Robust statistical Traffic Classficiation)模型解决zero-day应用问题。提出用于RTC模型参数自动优化的方法。Introduction三种主流流量分类问题的解决方案 基于端口(port-based) - 依赖于检测标准端口, - 缺点:不使用标准端口和端口混淆 基于pay...

2018-08-30 16:26:05 852

原创 ubuntu redis服务

下载Redis配置Redissudo vim /etc/redis/redis.conf修改bind行,将127.0.0.1修改为*,配置远程可以访问- ubuntu启动Redis服务service redis-server startservice redis-server status以命令行方式进入Redis,分别为本地进入方式与远程进入方式:re...

2018-08-29 15:37:26 3828 1

转载 tmux 常用命令

tmux new -s 会话名 //新起一个会话tmux ls //查看现有的会话tmux a //进入最近的会话tmux a -t 会话名//进入指定会话tumx kill-session -t 会话名 //干掉指定会话control+b //唤起tmux(命令前缀)c //创建新窗口w //查看所有窗口" //横分面板% //竖分面板, //修改窗...

2018-08-29 15:01:33 3709

原创 Spark相对于MapReduce的优势对比

Spark相对于MapReduce的优势MapReduce存在的问题1. MapReduce框架局限性  1)仅支持Map和Reduce两种操作  2)处理效率低效。    a)Map中间结果写磁盘,Reduce写HDFS,多个MR之间通过HDFS交换数据; 任务调度和启动开销大;     b)无法充分利用内存     c)Map端和Reduce端均需要排序  3...

2018-08-16 11:20:35 5290

原创 hadoop集群spark配置,jupyter notebook,ubuntu

下载安装jupyter notebook,并配置,详见另一篇博客,jupyter notebook配置安装python包 findspark、pyspark。用findspark.init函数配置集群中spark-client2路径,python路径。import findsparkfindspark.init(spark_home="/usr/hdp/current/spark2...

2018-08-14 22:52:15 641

原创 hadoop单机部署,用来测试

转载自ee900222的博客2. Hadoop安装2.1 安装javaHadoop是使用JAVA写的,所以需要先安装JAVA环境。本次安装的是hadoop-2.7.0,需要JDK 7以上版本。 yum install java-1.7.0-openjdk yum install java-1.7.0-openjdk-devel安装后确认java –vers...

2018-08-11 13:35:49 419

原创 第一个wordcount程序

在hadoop集群中,系统自带了许多mapreduce的程序例子,在{%HOME%}/hadoop-mapreduce/hadoop-mapreduce-examples.jar里面有许多小例子,可以在hadoop集群中直接运行命令.当然运行前需要在HDFS上创建input目录和output目录,input目录需要一个输入文件,比如/s_tmp/input/tmp.txt接下来需要创建ou...

2018-08-10 15:44:34 2468 1

转载 大数据学习路线推荐

转自:https://www.cnblogs.com/zlslch/p/5448857.html1 Java基础:视频方面: 推荐《毕向东JAVA基础视频教程》。学习hadoop不需要过度的深入,java学习到javase,在Java虚拟机的内存管理、以及多线程、线程池、设计模式、并行化多多理解实践即可。书籍方面: 推荐李兴华的《java开发实战经典》...

2018-08-01 11:35:25 4739 1

原创 leetcode题记:Maximum Depth of Binary Tree

编程语言:JAVA题目描述:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A leaf is a ...

2018-07-31 22:00:10 133

原创 leetcode题记:Symmetric Tree

编程语言:JAVA题目描述:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 /...

2018-07-31 20:56:47 112

原创 leetcode题记:Same Tree

编程语言:JAVA题目描述:Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the s...

2018-07-30 22:03:54 128

原创 leetcode题记:Merge Sorted Array

编程语言:JAVA题目描述:Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are m and n respectively....

2018-07-30 20:27:56 136

原创 leetcode题记:Climbing Stairs

编程语言:JAVA 题目描述:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given...

2018-07-30 11:37:29 146

原创 leetcode题记:Sqrt(x)

编程语言:JAVA题目描述:Implement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative integer.Since the return type is an integer, the decimal digits are ...

2018-07-29 21:45:29 160

原创 leetcode题记:Add Binary

编程语言:JAVA题目描述:Given two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains only characters 1 or 0.Example 1:Input: a = "11", b = "1"...

2018-07-23 22:06:30 132

转载 HDFS机架感知概念及配置实现

转自:魔鬼地下室一、机架感知是什么?告诉 Hadoop 集群中哪台机器属于哪个机架二、那么怎么告诉呢?Hadoop 对机架的感知并非是自适应的,亦即,hadoop 集群分辨某台 slave 机器是属于哪个 rack 并非是智能感知的,而是需要 hadoop的管理者人为的告知 hadoop 哪台机器属于哪个 rack,这样在 hadoop的 namenode 启动初始...

2018-07-23 16:39:05 4343 1

转载 HDFS核心技术详解

转自:魔鬼地下室的博客HDFS核心技术详解我们都知道Hadoop 主要由HDFS和MapReduce 两个核心部分组成。其中最底部就是HDFS,它被用来存储Hadoop 集群中所有存储节点上的文件。hadoop的核心子项目——HDFS(分布式文件系统),下面将从HDFS的背景、基本概念 开始,步步深入了解HDFS的设计目标、HDFS的基本结构以及HDFS的相关操作等核心...

2018-07-23 16:32:49 1029

原创 leetcode题记:Plus One

编程语言:JAVA题目描述:Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the list...

2018-07-19 20:32:27 151

原创 leetcode题记:Length of Last Word

编程语言:JAVA题目描述:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.N...

2018-07-17 23:20:16 185

原创 leetcode题记:Maximum Subarray

编程语言:JAVA题目描述:Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Ou...

2018-07-15 22:21:46 137

原创 leetcode题记:Count and Say

编程语言:JAVA提交结果:Submission Detail18 / 18 test cases passed.Status: AcceptedRuntime: 41 msSubmitted: 0 minutes agoYou are here! Your runtime beats 4.27 % of java submissions题目描述:The cou...

2018-07-11 21:33:04 149

原创 leetcode题记:Search Insert Position

编程语言:java提交结果:62 / 62 test cases passed.Status: AcceptedRuntime: 3 msps:运行时间和占用空间打败了100%的提交者,hhh题目描述: Given a sorted array and a target value, return the index if the target is found....

2018-07-08 15:45:13 190

原创 leetcode题记:Implement strStr()

题目描述:Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll"Output: 2Exa...

2018-07-08 14:30:55 104

原创 区块结构(二)

1.区块:        区块是一种被包含在公开账簿(区块链)里的聚合了交易信息的容器数据结构。它由一个包含元数据的区块头和紧跟其后的构成区块主体的一长串交易组成。区块头是80字节,而平均每个交易至少是250字节,而且平均每个区块至少包含超过500个交易。区块结构2.区块头        区块头由三组区块元数据组成。首先是一组引用父区块哈希值的数据,这组元数据用于将该区块与区块链中前一区块相连接。...

2018-06-26 22:56:11 8848

转载 初识区块链

1.区块链概念:        区块链是由包含交易信息的区块从后向前有序链接起来的数据结构。        区块被从后向前有序地链接在这个链条里,每个区块都指向前一个区块。区块链经常被视为一个垂直的栈,第一个区块作为栈底的首区块,随后每个区块都被放置在其他区块之上。        对每个区块头进行SHA256加密哈希,可生成一个哈希值。通过这个哈希值,可以识别出区块链中的对应区块。同时,每一个区块...

2018-06-26 20:33:30 324

原创 代码整洁之道-阅读笔记

3.1.1.短小:函数的第一规则是要短小。第二条规则是还要更短小。     程序中每个函数都只有两行、三行或四行长。每个函数都一目了然。每个函数都只说一件事。而且,每个函数都依序把你带到下一个函数。这就是函数应该达到的短小程度3.1.2.if 语句、else 语句、while 语句其中的代码块应该只有一行。该行大抵应该是一个函数调用语句。3.2 只做一件事            函数应该做一件事。...

2018-06-22 21:28:59 186

原创 ubuntu文件夹打不开

解决办法:在命令行输入: killall nautilus

2018-06-22 20:01:30 9578 4

原创 logging调试程序python

使用logging类记录错误我们可以使用print()来调试程序,但如果到处是print(),想关闭又得一个个去修改。使用logging类,我们可以记录各种级别的错误,通过配置参数,可以控制显示哪些错误记录。错误级别:CRITICAL = 50FATAL = CRITICALERROR = 40WARNING = 30WARN = WARNINGINFO = 20DEBUG = 10NOTSET ...

2018-06-22 15:55:42 912

转载 git常用命令

转载自:http://www.ruanyifeng.com/blog/2015/12/git-cheat-sheet.html我每天使用 Git ,但是很多命令记不住。一般来说,日常使用只要记住下图6个命令,就可以了。但是熟练使用,恐怕要记住60~100个命令。下面是我整理的常用 Git 命令清单。几个专用名词的译名如下。Workspace:工作区Index / Stage:暂存区Reposito...

2018-06-22 15:02:26 103

原创 docker+ubuntu+ambari+HDP

更新源sudo apt-get install update安装HTTPS协议的源sudo apt-get install -y apt-transport-https安装docker镜像sudo apt-get install docker.io配置docker服务sudo usermod -aG docker sanqisud...

2018-04-17 17:41:58 2864

转载 高维稀疏特征的时候,lr 的效果会比 gbdt 好

高维稀疏特征的时候,lr 的效果会比 gbdt 好,为什么?这个问题我也是思考了好久,在平时的项目中也遇到了不少 case,确实高维稀疏特征的时候,使用 gbdt 很容易过拟合。但是还是不知道为啥,后来深入思考了一下模型的特点,发现了一些有趣的地方。假设有1w 个样本, y类别0和1,100维特征,其中10个样本都是类别1,而特征 f1的值为0,1,且刚好这10个样本的 f1特征值都为1,其余

2018-04-12 10:56:24 7310 1

转载 ubuntu关闭apt-get代理、设置http代理

ubuntu关闭http代理:转载自:http://colorpanda.iteye.com/blog/2063655今天想装个软件(wine),使用 sudo apt-get update 命令时,发现给出很多Ign 语句,总出现 Connecting to proxy.http://10.0.126.1:13128 的字样,发现这个代理是已经废弃掉的。接着想去取消使用该代理:1、 查看/etc...

2018-04-08 09:37:19 12243 2

转载 When Python imports but IPython does not

本文内容转载自博客This happens when the sys.paths of Python and IPython are different. To check the paths, enter the code below in each shell.In the Python shell:>>> import sys, pprint>>> pprint.pprint(sys.pat

2018-01-18 22:20:12 140

原创 spark平台搭建

Spark是用Scala程序设计语言编写而成,运行于Java虚拟机(JVM)环境之上。目前支持如下程序设计语言编写Spark应用:ScalaJavaPythonClojureR前提条件:为了让Spark能够在本机正常工作,你需要安装Java开发工具包(JDK)。windows与ubuntu自行下载对应的安装包安装,安装目录不要带空格。同样还需要在电脑上安装Spark软件. 在Spar

2017-12-20 21:09:12 474

原创 sklearn CountVectorizer\TfidfVectorizer\TfidfTransformer函数详解

from sklearn.feature_extraction.text import CountVectorizertexts=["dog cat fish","dog cat cat","fish bird", 'bird']cv = CountVectorizer()cv_fit=cv.fit_transform(texts)print(cv.get_feature_names())pr

2017-12-16 19:47:09 2708 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除