自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(239)
  • 收藏
  • 关注

原创 Netty入门实战

Netty入门实战新建工程添加maven依赖https://mvnrepository.com<!-- https://mvnrepository.com/artifact/io.netty/netty-all --><dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version&g

2020-07-11 11:59:16 379

原创 sparkStreaming接收kafka消息,写入数据库

sparkStreaming接收kafka消息,写入数据库package com.ruijie.spark.streamimport org.apache.kafka.clients.consumer.ConsumerConfigimport org.apache.spark.streaming.{Seconds, StreamingContext}import org.apache.spark.{SparkConf, SparkContext}import org.apache.kafka.c

2020-06-06 16:57:44 882

原创 Docker内如何使用crontab

Docker内如何使用crontabrun.sh#!/bin/bashtimestamp=`date +%Y/%m/%d-%H:%M:%S`echo "System path is $PATH at $timestamp"entrypoint.sh#!/bin/bash# Start the run once job.echo "Docker container has been started"declare -p | grep -Ev 'BASHOPTS|BASH_V

2020-05-26 23:41:48 1550

原创 standalone模式下的资源、任务调度源码剖析

standalone模式下的资源、任务调度源码剖析整体流程图standalone模式简介standalone模式,是spark自带的资源调度框架,该框架下主要有三个节点:client 客户端,将应用程序提交,记录着要运行业务逻辑master 负责资源管理worker 负责任务的执行spark Application有个Driver驱动,即用户提交的程序,Driver进程可以运...

2020-04-04 14:06:58 1024

原创 Intellij IDEA2017.3.5安装

1.下载安装包及链接: https://pan.baidu.com/s/16az6tmQub-bOn2CFOXLa2g 提取码: 7689 复制这段内容后打开百度网盘手机App,操作更方便哦2.将下载的JetbrainsCrack-2.7-release-str.jar补丁放在idea的安装目录下的bin目录下3.修改该bin目录下的两个文件:idea.exe.vmoptio...

2019-12-29 18:52:44 872 1

原创 python时间与时区

pandas中的时区默认情况下,pandas中的时间序列是单纯的(naive)时区import pandas as pdimport numpy as nprng = pd.date_range('3/9/2012 9:30', periods=6, freq='D')ts = pd.Series(np.random.randn(len(rng)), index=rng)print(...

2019-11-04 00:32:31 3818

原创 Docker笔记

根据镜像运行一个容器docker run -it ubuntu:16.04 /bin/bash列出镜像docker images进入docker容器docker attachdocker exec -it goofy_almeida /bin/bash退出容器exitCtrl + D列出最近的容器docker ps -n 3过滤容器...

2019-10-10 16:53:20 257

原创 Python读取mongodb采坑记录

pymongo在读写dataframe时自动的相差8个小时dataframe数据集预览查看一下数据的类型可以看到,collect_time的数据类型是datetime64写入mongodbconnections.insert(json.loads(data_final.T.to_json()).values())查看数据库通过对比我们发现,当将 datet...

2019-09-26 20:22:49 1244 1

原创 python模块导入报错 ImportError: No module named 'xxx'

python模块以及导入出现ImportError: No module named 'xxx’问题python中,每个py文件被称之为模块,每个具有__init__.py文件的目录被称为包。只要模 块或者包所在的目录在sys.path中,就可以使用import 模块或import 包来使用若需要导入不同目录的文件,首先使用sys.path.append方法将所需目录加入到搜素目录中。然后进行...

2019-09-21 13:30:45 1375

原创 数据结构与算法

转圈打印矩阵 “之”字形打印矩阵 数组中是否出现长度大于一半的数:依次删除两个不同的数 1-m的随机数,产生1-n的随机数 无序数组,需要排序的最短长度 找到局部最小 返回子数组乘积最大的值 完全二叉树的节点数 两个长度相同的有序数组,求上中位数 两个排序数组中第k小的数 Manacher算法 kmp算法 BFPRT算法:无序数组中找到第k小的数 一个无序数组,知道没有出...

2019-09-13 20:38:20 154

转载 ubuntu搭建spark单机版

安装Java SE1、下载JAVA SE linux版本。下载地址为:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html注意选择Linux版本,根据机器类型选择32位或者64位。2、下载jdk-8u131-linux-x64.tar.gz后,解压到自己指定目录。...

2019-08-13 21:51:33 287

原创 Tensorflow笔记(一)

Tensorflow笔记tf_cnn_benchmarks运行命令 tf_cnn_benchmarks​--device=cpu --data_format=NHWC works for me.I would suggest that --device=cpu --data_format=NHWC...

2019-08-12 19:33:30 693

原创 LeetCode力扣之135. Candy

There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least one candy....

2018-03-27 10:17:07 450 1

原创 133. Clone Graph

Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use # as a separator for each node, and...

2018-03-26 22:21:22 225

原创 LeetCode力扣之132. Palindrome Partitioning II

Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = "aab",Return 1 since t...

2018-03-26 21:13:37 287

原创 LeetCode力扣之131. Palindrome Partitioning

Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return[ ["aa","b"], ["a","a",...

2018-03-26 20:17:13 244

原创 LeetCode力扣之130. Surrounded Regions

Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region.For example,X X X XX O O X...

2018-03-26 17:28:48 271

原创 LeetCode力扣之129. Sum Root to Leaf Numbers

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1-&gt;2-&gt;3 which represents the number 123.Find the total su...

2018-03-26 14:10:48 176

原创 LeetCode力扣之128. Longest Consecutive Sequence

Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is [1, 2, 3, 4]. Re...

2018-03-26 13:39:55 268

原创 LeetCode力扣之126. Word Ladder II

Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such that:Only one letter can be changed at a timeEach tr...

2018-03-26 10:51:26 465

原创 LeetCode力扣之125. Valid Palindrome

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a palindro...

2018-03-25 22:58:00 236

原创 LeetCode力扣之124. Binary Tree Maximum Path Sum

Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The path...

2018-03-25 22:43:56 158

原创 LeetCode力扣之123. Best Time to Buy and Sell Stock III

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at most two transactions.Note:You may not engage...

2018-03-25 22:03:28 222

原创 LeetCode力扣之121. Best Time to Buy and Sell Stock

Say 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 (ie, buy one and sell one share of the stock), des...

2018-03-25 20:50:24 193

原创 LeetCode力扣之120. Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [6,5,7],...

2018-03-25 20:19:40 151

原创 LeetCode力扣之119. Pascal's Triangle II

Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?package leetCode;import ja...

2018-03-25 17:10:55 229

原创 LeetCode力扣之117. Populating Next Right Pointers in Each Node II

Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution still work?Note:You may only use constant extra space....

2018-03-25 16:33:55 178

原创 LeetCode力扣之116. Populating Next Right Pointers in Each Node

Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right node. If there i...

2018-03-25 11:18:27 176

原创 LeetCode力扣之115. Distinct Subsequences

Given a string S and a string T, count the number of distinct subsequences of S which equals T.A subsequence of a string is a new string which is formed from the original string by deleting some (can ...

2018-03-25 09:36:17 225

原创 LeetCode力扣之113. Path Sum II

Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5 / \ ...

2018-03-24 21:35:18 192

原创 LeetCode力扣之112. Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum = 22...

2018-03-24 20:26:18 153

原创 111. Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.package leetCode;/** * Created by lxw, ...

2018-03-24 20:09:11 127

原创 LeetCode力扣之109. Convert Sorted List to Binary Search Tree

Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tree in which the de...

2018-03-21 18:03:25 142

原创 LeetCode力扣之108. Convert Sorted Array to Binary Search Tree

Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the t...

2018-03-21 16:54:44 215

原创 LeetCode力扣之107. Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,null,15,7], ...

2018-03-21 16:09:56 139

原创 LeetCode力扣之103. Binary Tree Zigzag Level Order Traversal

Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given binary tree [...

2018-03-21 10:54:54 147

原创 LeetCode力扣之102. Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \...

2018-03-15 10:44:27 120

原创 LeetCode力扣之99. Recover Binary Search Tree

Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is pretty straight forward. Could you devise a consta...

2018-03-14 16:35:48 215

原创 LeetCode力扣之97. Interleaving String

Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", return false.packag...

2018-03-13 21:56:20 217

原创 LeetCode力扣之95. Unique Binary Search Trees II

Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return all 5 unique BST's shown below. 1 ...

2018-03-13 20:18:13 172

空空如也

空空如也

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

TA关注的人

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