自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 小米算法笔试

第一题:求矩阵相乘s1=input()m = int(s1.split()[0])k = int(s1.split()[1])n = int(s1.split()[2])A =[]B =[]for i in range(m): A.append([int(i) for i in input().split()])for i in range(k): B.append([int(i) for i in input().split()])def matrix_multipl

2020-09-08 19:54:11 901

原创 shell下后台挂起

nohup sh xxx.sh 2020-02-14 2020-03-15 >log0 2>&1 &

2020-07-15 15:45:47 1094

原创 hive随机查询若干条结果

select * from table01 order by rand() limit 10000;

2020-07-10 10:57:57 567

原创 shell下查看当前文件夹下各文件内存

sh -sh *

2020-07-09 14:37:31 405

原创 shell下移动文件

mv 文件名 目标路径复制文件cp 文件名 文件路径更改文件名mv 文件名 新的文件名

2020-07-08 15:12:30 2122

原创 将hive查询内容存储到文件中

首先先写一个shell脚本:hql=""hive -e "$hql" >> 文件名如果要输出表头:再加入configconfig="set hive.cli.print.header=true;"hql="$config"hive -e "$hql" >> 文件名

2020-07-08 14:47:17 549

原创 hadoop文件操作

将文件从服务器上传到hdfs上:hadoop fs -put 文件名 hdfs路径将文件从hdfs上拉到本地:hadoop fs -get hdfs路径 本地路径查看hdfs文件目录hadoop fs -ls 文件夹名

2020-07-08 14:41:47 498

原创 vi定位到第一行,最后一行和任意行

第一行:两次按g第二行:shift+g任意一行:vi 文件名 +行号

2020-07-08 14:38:06 1245

原创 shell下文件太大不能用vi查看

less 文件名

2020-07-08 14:36:56 789

原创 shell下将查看大文件有多少行

awk '{print NR}' test1.csv|tail -n1

2020-07-08 14:36:18 503

原创 shell下将文件中的分隔符从‘\t‘转换成‘,‘

awk 'BEGIN{FS="\t";OFS=","}{$1=$1;print $0}' train.csv> data.train

2020-07-08 14:33:52 1494

原创 利用双目视觉进行三维重建

三维重建的方法介绍

2020-07-06 15:46:47 374

原创 pycharm安装opencv,python,anaconda

参考这篇博文

2020-07-06 14:04:46 140

原创 hive sql内置函数大全

中文版

2020-06-21 16:51:31 447

原创 hive sql之lateral view explode用法

这篇文章讲的特别好

2020-06-18 18:41:45 844

原创 sql 遇到多个重复列名报错:Ambiguous column reference

不要有重复的列表

2020-06-18 18:30:24 6368

原创 subline修改字体大小和空格问题

使用python的时候有时会碰到和identation相关的问题,很多时候是由于混用了空格和制表符。在sublime中显示空格和制表符后,便可以轻松修改。点击:preferences > settings:在右面输入:{ "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", "font_size": 10, "ignored_packages":[ "Vintage"],

2020-06-18 18:29:24 250

原创 linux使用手册

这两篇博客写的比较好:http://cn.linux.vbird.org/linux_basic/linux_basic.phphttps://www.linuxprobe.com/chapter-04.htmlxshell下拉取文件:sz上传:rz

2020-06-18 18:25:01 136

原创 \r:command not found

今天在xshell下运行.sh的脚本,里面写的是hive语句,但是报\r:command not find 的错误,查了一下说是linux下不能认出win的换行符,所以在vi界面下输入::set fileformat=unix即可将doc模式切换到unix模式,在win下编辑器里写的时候,也要注意先将模式切换到unix。切记不要在win和linux下来回的粘贴复制,这不是一个好的程序员的素养。...

2020-06-18 18:15:46 219

原创 拼多多算法笔试2020

https://www.nowcoder.com/test/question/4efe0a1953114c4ea5cdec4cddbbfa88?pid=23354036&tid=33813424import mathif __name__ == "__main__": t = int(input()) for i in range(t): n = int(input()) print(int(math.log(n,2))+1) # 二分法,每次.

2020-06-03 12:56:36 887

转载 k-means算法实现python

import numpy as npimport matplotlib.pyplot as plt# 两点距离def distance(e1, e2): return np.sqrt((e1[0]-e2[0])**2+(e1[1]-e2[1])**2)# 集合中心def means(arr): return np.array([np.mean([e[0] for e in arr]), np.mean([e[1] for e in arr])])# arr中距离a最远的元素

2020-05-22 22:55:21 254

原创 利用request库请求api

import requestsdef re(): url = 'http://shuyantech.com/api/entitylinking/cutsegment?q=' word = '打球的李娜和唱歌的李娜不是同一个人' url = url + word r = requests.get(url) print(r.text)if __name__ == "__main__": count = 0 while(True):

2020-05-13 13:25:50 187

原创 vae

https://blog.csdn.net/weixin_40955254/article/details/82315224

2020-01-12 16:59:42 151

原创 《python编程:从入门到实践》课后习题答案

https://www.xz577.com/j/129.html

2020-01-10 21:18:31 7499

原创 python和c++的区别

https://www.jianshu.com/p/c70474e1db0a

2020-01-10 20:26:46 114

原创 python opencv用法中文教程

https://www.cnblogs.com/Undo-self-blog/p/8423851.html

2020-01-09 13:37:03 125

原创 python反转字符串的六种方法

https://www.cnblogs.com/taceywong/p/8045127.html

2020-01-08 22:12:55 128

原创 clion IDEA 2019 Activation Code

https://blog.csdn.net/qq_36875339/article/details/89601318

2020-01-01 14:35:42 5020

原创 scp远程传输文件时port 22: Operation timed out lost connection

查看端口号仍然是22,这是因为没有权限拷贝到远程服务器的其它文件,只能拷到根目录下

2019-12-20 10:47:44 3637

原创 深度学习环境配置

1.查看电脑上是否有gpu2.下载按照gpu对应的显卡,这样电脑上就会显示有gpu了,可以使用gpu了3.下载安装cuda,因为有了gpu可以跑别人的项目,但是有了cuda就能对gpu自己编程。4.下载安装cudnn,它是一个处理神经网络的库,keras用tensorflow,tensorflow去调用cudnn,cudnn去调用cuda,cuda去调用gpu...

2019-12-19 21:56:37 148

原创 深入理解计算机系统

leal和mov的用法:https://blog.csdn.net/farmwang/article/details/75103220

2019-12-11 20:21:32 103

原创 leetcode 1202 python

题目要求:https://leetcode-cn.com/problems/smallest-string-with-swaps/class Solution: def smallestStringWithSwaps(self, s: str, pairs: List[List[int]]) -> str: p = {i:i for i in range(len(...

2019-12-11 20:10:25 109

原创 leetcode 200 python

题目要求:https://leetcode-cn.com/problems/number-of-islands/class Solution: def numIslands(self, grid: List[List[str]]) -> int: if not grid: return 0 row = len(grid) col =...

2019-12-11 19:03:57 167

原创 leetcode 130 python

题目要求:https://leetcode-cn.com/problems/surrounded-regions/class Solution: def solve(self, board: List[List[str]]) -> None: """ Do not return anything, modify board in-place ins...

2019-12-11 18:51:53 158

原创 awk用法

http://www.ruanyifeng.com/blog/2018/11/awk.html

2019-12-11 16:12:51 61

原创 c++数组

一维数组:https://www.runoob.com/cplusplus/cpp-arrays.html多维数组:https://www.runoob.com/cplusplus/cpp-multi-dimensional-arrays.html

2019-12-11 15:04:53 59

原创 leetcode 128 python

class Solution: def longestConsecutive(self, nums: List[int]) -> int: if not nums: return 0 nums.sort() longest_streak = 1 current_streak = 1 ...

2019-12-11 15:00:45 189

原创 并查集

https://blog.csdn.net/liujian20150808/article/details/50848646

2019-12-11 14:48:30 48

原创 xcode配置最新版opencv

关于下面这个部分的修改,无论试了网上所有的方法都报错,这是因为在include后面还有个opencv4文件夹,应该改为下面的路径:

2019-12-09 23:09:34 71

原创 leetcode 1025 python

题目要求:https://leetcode-cn.com/problems/divisor-game/思路:如果N是奇数,因为奇数的所有因数都是奇数,因此 N 进行一次 N-x 的操作结果一定是偶数,所以如果 a 拿到了一个奇数,那么轮到 b 的时候,b拿到的肯定是偶数,这个时候 b 只要进行 -1, 还给 a 一个奇数,那么这样子b就会一直拿到偶数,到最后b一定会拿到最小偶数2,a就输了。...

2019-12-09 19:38:33 93

空空如也

空空如也

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

TA关注的人

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