自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

我心中有猛虎 细嗅蔷薇

talk is cheap show me the code

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

原创 vue 解决密码框 input 中type=“password“时,chrome浏览器会回显之前保存的用户名和密码

现象input的type="password"时,会出现之前保存的用户名和密码回显出来解决办法给input加上如下属性 <el-input v-model=xxx type="password" autocomplete="new-password" readonly onfocus="this.removeAttribute('readonly');this.type='password'"placeholder="password" />...

2021-01-15 17:01:58 3242

原创 调试

如夏洛克·福尔摩斯所指出的,“当你排除了所有的不可能,无论剩下的是什么, 不管多么难以置信,一定就是真相。”(阿瑟·柯南·道尔,《四签名》)调试也像是一门实验性科学。一旦你猜到大概哪里出错了, 你可以修改程序,再试一次。 如果你的假设是正确的,那么你就可以预测到修改的结果,并且离正常运行的程序又近了一步。 如果你的假设是错误的,你就不得不再提一个新的假设。...

2020-04-19 18:42:36 220

原创 python import导入模块

regular imports 常规导入use from to import relative imports 相对导入optional imports 可选导入local imports 本地导入import considerations 导入注意事项regular imports:import sys, timeuse from to import:If you ju...

2020-04-19 18:41:23 532

原创 python使用Mock

文章目录背景问题一:使用mock调用lambda function问题二: 使用mock操作RDS(mysql)背景aws的lambda function使用python完成,python连接pymsql,涉及到的UT怎么写?问题一:使用mock调用lambda functionconn = boto3.resource('s3', region_name='us-east-1')con...

2020-04-19 18:35:59 508

原创 Redis总结

文章目录redis的基本介绍redis常见问题redis的并发竞争问题如何解决?redis持久化redis的基本介绍redis 是一个基于内存的高性能key-value数据库,整个数据库系统加载到内存中进行操作,定期通过异步操作把数据库数据flush到硬盘上进行保存,因为是纯内存操作,redis的性能非常出色,每秒处理10w次读写操作,是性能最快的key-value DB。除了性能之外,re...

2020-04-19 18:07:59 153

原创 Hadoop集群搭建模式和各模式问题

文章目录分布式集群的通用问题集群的搭建的集中通用模式1、单机模式2、伪分布式模式(搭建在了只有一个节点的集群中)3、分布式模式4、高可用模式5、联邦模式分布式集群的通用问题当前的HDFS和YARN都是一主多从的分布式架构,主从节点—管理者和工作者问题:如果主节点或是管理者宕机了。会出现什么问题?群龙无首,整个集群不可用。所以在一主多从的架构中都会有一个通用的问题:当集群中的主节点宕机之后...

2020-04-19 18:00:22 228

原创 azkaban基础概览

https://azkaban.readthedocs.io/en/latest文章目录一、为什么需要工作流调度器二、工作流调度实现方式三、常见工作流调度系统四、各种调度工具对比五、Azkaban 与 Oozie 对比六、Azkaban 介绍七、azkaban调度的任务有可能有那些类型一、为什么需要工作流调度器1、一个完整的数据分析系统通常都是由大量任务单元组成: shell 脚本程序,ja...

2020-04-19 17:56:02 258

原创 AWS S常见命令总结

管理存储桶创建桶:$ aws s3 mb s3://bucket-name删除桶:$ aws s3 rb s3://bucket-name删除非空桶:$ aws s3 rb s3://bucket-name –force列出存储桶$ aws s3 ls列出存储桶中所有的对象和文件夹$ aws s3 ls s3://bucket-name列出桶中 bucket-name/MyF...

2020-04-19 17:49:31 655

原创 Mysql使用Event定期清理数据

In order to delete data in a fixed time automatically, use mysql event;Login MysqlCheck event_schedulerSHOW VARIABLES LIKE ‘event_scheduler’;If event_scheduler is OFF临时:SET GLOBAL event_schedu...

2020-04-19 17:48:09 249

原创 The Key To Accelerating Your Coding Skills

When you learn to code, there is a moment when everything begins to change. At Firehose, we like to call this the inflection point of coding(编程拐点). After this phase, the way you operate as a developer...

2020-04-19 17:43:13 787

原创 Teach Yourself Programming in Ten Years

Why is everyone in such a rush?Walk into any bookstore, and you’ll see how to Teach Yourself Java in 24 Hours alongside endless variations offering to teach C, SQL, Ruby, Algorithms, and so on in a f...

2020-04-19 17:34:26 326

原创 ImportError: Python is not installed as a framework

ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more infor...

2020-04-19 17:30:37 442

原创 pycharm问题:module ‘pip’ has no attribute ‘main’

更新pip之后,Pycharm安装package出现报错:module ‘pip’ has no attribute ‘main’找到安装目录下 helpers/packaging_tool.py文件,找到如下代码:def do_install(pkgs): try: import pip except ImportError: error_no...

2020-04-19 17:27:00 187

原创 大数据基础一

文章目录大数据的前世今生大数据的发展史:从搜索到人工智能大数据应用领域:数据驱动一切移动计算比移动数据更划算大数据的前世今生一个文件系统hdfs,一个计算框架MapReduce,一个数据库系统大数据生态体系逐渐形成,其中包括:专门将关系数据库中的数据导入导出到 Hadoop 平台的 Sqoop;针对大规模日志进行分布式收集、聚合和传输的 Flume;MapReduce 工作流调度引擎 Ooz...

2020-04-19 14:19:23 243

原创 AWS Lambda function 版本化和格式化

函数版本化和别名化当你开始使用Lambda构建复杂系统时,你将想要以一个可控的基础来演进它们。我们已经添加了一个新的版本化特性来简化开发和测试这一重要方面。每次你上传一个特定函数代码的最新副本时,Lambda将会自动创建一个新的版本,并给它分配一个数字(1,2,3等等)。该函数的Amazon Resource Name(ARN,亚马逊资源名称)现在在末尾接受一个可选的版本限定符(一个:,然后是...

2020-04-19 14:12:36 338

原创 python type()和instance()区别

isinstance() function is used to judge one object is some type, this is familiar with function type()the differences between isinstance() and type() is that isinstance() consider the inheritation.cl...

2020-04-19 14:10:33 476

原创 leetcode contest-144

文章目录Defanging an IP AddressCorporate Flight BookingsDelete Nodes And Return ForestMaximum Nesting Depth of Two Valid Parentheses Stringsleetcode的周赛的题目越来越实用,也希望能不断提升本次的四道题目总结如下:Defanging an IP Addre...

2020-04-19 14:06:15 155

原创 LeetCode contest180

文章目录5356.矩阵中的幸运数5357. 设计一个支持增量操作的栈5179. 将二叉搜索树变平衡5359. 最大的团队表现值5356.矩阵中的幸运数完全拼手速的题目,数据量不大,即使O(n^3)也能解决5357. 设计一个支持增量操作的栈读题认真,也是没有难度的一道题目,基本上维护一个数组就可以,稍微留意下边界处理。5179. 将二叉搜索树变平衡利用中序遍历获得二叉搜索树的有序数组,...

2020-04-19 14:00:46 145

原创 python-zip,list赋值,全局变量

文章目录ziplist赋值shallow copy/Deep Copy最近使用python 看到这么几个知识点,收集下zipzip() 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表。如果各个迭代器的元素个数不一致,则返回列表长度与最短的对象相同,利用 * 号操作符,可以将元组解压为列表。https://docs.python.org/3...

2020-04-19 13:58:28 372

原创 Hive Metastore表结构设计分析

文章目录DatabaseTablePartitionsSDS围绕hive的metastore的表结构进行分析:DatabaseDBS表:column有DB_ID, DESC, DB_LOCATION_URI, NAME, OWNER_NAME, OWNER_TYPE 表示基本的DB信息,其中DB_ID是主键,关联的表有 FUNC_RU, FUNCS, DB_PRIVS, DATABASE_P...

2020-04-19 13:55:57 574

原创 Hive不读取下划线文件

文章目录现象原因现象在hive中建了一个parquet表,导入文件数据结构如下_success 0M_commited_ 10M_started_xxx 0Mpart-xxx.parquet 40M...查询表的数据量是正确的,但是多出来三个下划线开头的文件,考虑hive是read on schema的模式,为什么不读取这几个文件呢?原因发现网上有人讨论过这些现...

2020-04-16 11:37:34 651

原创 03.使用私有构造方法或者枚举类型实现单例Singleton属性【Effective Java】

Character 2 Creating and Destroying objects使用私有构造方法或者枚举类型执行单例singleton属性文章目录问题场景方法一:公共属性 public field方法二:静态工厂方法方法三:单一元素枚举类问题场景单例就是一个仅实例化一次的类(item95)。单例通常代表无状态对象,比如函数(item24)或者一个本质上唯一的系统组件。让一个类成为单例...

2020-04-06 12:14:03 189

原创 02.构造方法参数较多时考虑builder模式【Effective Java】

Character 2 Creating and Destroying objects构造方法参数较多时考虑builder模式问题场景静态工厂和构造器共有一个限制:在可选参数很多的情况下,这两个都不能够很好的scale。考虑一个代表在袋装食物上的营养标签的类,这些标签有一些必须要求的field,建议摄入量,每罐的量以及每份的卡路里,还有超过20个可选的field,总脂肪、饱和脂肪、反式脂肪...

2020-04-05 21:39:13 239

原创 01.使用静态工厂方法替代构造方法【Effective Java】

Character 2 Creating and Destroying objects使用静态工厂方法替代构造方法一个类允许客户端获取其实例的传统方式,是提供一个公共构造方法。 不过还有另一种技术应该成为每个程序员工具箱的一部分。 一个类可以提供一个简单的、只返回该类实例的公共静态工厂方法。 下面是一个 Boolean 简单的例子( 基本类型boolean的包装类)。 此方法将基本类型bool...

2020-04-05 19:54:03 268

原创 实习生面试总结

每年的三月份都是实习生面试的高潮,2017年也不例外 截止到目前,总结一下: 投递的岗位包括数据研发岗以及大数据工程师1.大部分的面试官都会在简历中找到自己感兴趣的点,比赛,项目都需要再好好总结下;2.比较有印象的几道算法题: 1.给两个字符串s,t  t中含有“*?”通配符  2.在一个网络格子中,非0 即1,怎么能快速的判断是三角形,正方形以及圆? 3.给定一

2017-03-27 22:12:01 844

原创 腾讯2017暑期实习生编程题器

3道编程题1. 给定一个字符串s,你可以从中删除一些字符,使得剩下的串是一个回文串。如何删除才能使得回文串最长呢? 输出需要删除的字符个数。求原字符串和其反串的最大公共子序列(不是子串,因为可以不连续)的长度(使用动态规划很容易求得),然后用原字符串的长度减去这个最大公共子串的长度就得到了最小编辑长度。#include <iostream>#include <stdio.h>#include

2017-03-20 17:39:38 496

原创 hadoop Hive sql 总结

Hive 是基于Hadoop 构建的一套数据仓库分析系统,它提供了丰富的SQL查询方式来分析存储在Hadoop 分布式文件系统中的数据,可以将结构化的数据文件映射为一张数据库表,并提供完整的SQL查询功能,可以将SQL语句转换为MapReduce任务进行运行,通过自己的SQL 去查询分析需要的内容,这套SQL 简称Hive SQL,使不熟悉mapreduce 的用户很方便的利用SQL 语言查询,汇总

2017-02-22 16:28:12 640

原创 Leetcode Find Peak Element 162

A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks, in that case

2017-01-14 20:33:12 566

原创 Leetcode Third Maximum Number 414

Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1: Input: [3, 2, 1]Outp

2017-01-13 16:35:35 439

原创 Leetcode Guess Number Higher or Lower 374

We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I’ll tell you whether the number is higher or lowe

2017-01-10 20:47:54 319

原创 leetcode Binary Tree Paths 257

Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree:1 / \ 2 3 \ 5 All root-to-leaf paths are:[“1->2->5”, “1->3”]题目链接要找出所有的路径,考虑使用dfs/** * Def

2017-01-10 20:31:52 317

原创 Leetcode Factorial Trailing Zeroes 172

Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.Credits: Special thanks to @ts for adding this problem and creating all test

2017-01-10 20:05:54 346

原创 Leetcode Binary Tree Level Order Traversal 102

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

2017-01-05 20:47:12 326

原创 快速的判断一个数是不是2,3,4的幂

1.判断是不是2的幂: 如果n是2的幂二进制中有一位是1,n-1的二进制表示中剩下的都是1 则判断用n&(n-1) 如果是0 就是2的幂2.判断是不是4的幂: 如果n是4的幂,首先是2的幂:n&(n-1)=0 然后看是否在1的位置是不是在偶数位 n&(0x55555555) 为1 || n&(0xaa

2017-01-03 17:32:53 821

原创 Leetcode Convert a Number to Hexadecimal 405

Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.Note:All letters in hexadecimal (a-f) must be in lowercase. The hexadecimal str

2017-01-03 16:42:44 337

原创 Leetcode Longest Valid Parentheses 32

Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.For “(()”, the longest valid parentheses substring is “()”, which has

2017-01-02 15:58:55 314

原创 Leetcode Longest Palindromic Substring 5

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: “babad”Output: “bab”Note: “aba” is also a valid answer. Example:Input:

2017-01-01 18:09:39 292

原创 Leetcode Reverse Linked List II 92

Reverse a linked list from position m to n. Do it in-place and in one-pass.For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note: Given m, n satisfy the following co

2017-01-01 15:28:43 384

原创 Leetcode Reorder List 143

Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes’ values.For example, Given {1,2,3,4}, reorder it to {1,4,2,3}

2017-01-01 14:32:31 320

原创 Leetcode Remove Duplicates from Sorted List II 82

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given 1->1->1->2

2017-01-01 11:30:44 454

空空如也

空空如也

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

TA关注的人

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