- 博客(82)
- 资源 (3)
- 收藏
- 关注
原创 GDAL安装
1. sudo apt-get install python3-gdal2. gdal-config --version3.pip install GDAL==3.4.1
2024-01-15 21:54:02 547
原创 Centos import torchvision 出现 No module named ‘_lzma‘
stackoverflow.com backports/lzma/_lzmamodule.c:115:18: fatal error: lzma.h: No such file or directory 解决方案1. pip install backports.lzma无法安装, 报无法编译的错 centos: yum install -y xz-develdocker:apt-get install -y liblzma-devOSX:brew install xz
2021-04-15 15:55:31 2174 1
原创 微信小程序开发全线记录
导师让我写个微信小程序,花了4天终于完结了,开心。小记录一下我都经历了什么。本文包含 微信开发平台,flask交互,腾讯云部署本地接口以及设置域名绑定1. 微信小程序开发这一部分主要参考微信小程序文档,会基础的html,css,js就行。避雷点有:view替代div,利用flex布局。flex-direction: column 表示列排布,row表示横排布。selectable='true' 表示长按可复制2. flask交互小程序:wx.request(本地IP地址)f.
2020-08-13 22:53:53 312
原创 [leetcode BY python]1两数之和
给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。示例:给定 nums = [2, 7, 11, 15], target = 9因为 nums[0] + nums[1] = 2 + 7 = 9 所以返回 [0, 1]解题方法:cla...
2020-02-27 23:01:13 206
原创 利用清华镜像站解决pip超时问题
pypi 镜像使用帮助pypi 镜像每 5 分钟同步一次。临时使用pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package以下载pytorch 为例:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pytorch注意,sim...
2020-02-07 21:58:46 1939 1
原创 面试---刷牛客算法题
二维数组中的查找题目描述在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。Consider the following matrix:[[1, 4, 7, 11, 15],[2, 5, 8, 12, 19],[3, 6, 9, 16, 22],[...
2019-08-19 22:47:30 261
原创 面试--牛客刷题(3)
1.矩形覆盖题目描述我们可以用 21 的小矩形横着或者竖着去覆盖更大的矩形。请问用 n 个 21 的小矩形无重叠地覆盖一个 2*n 的大矩形,总共有多少种方法?解题思路本题同斐波那契函数以及青蛙跳台阶的思路,可以参考面试--牛客刷题(2)中的内容python实现如下:# -*- coding:utf-8 -*-class Solution: def rectCover(sel...
2019-08-19 22:46:53 214
原创 读论文-----Adversarially Learned One-Class Classifier for Novelty Detection
论文下载地址:http://openaccess.thecvf.com/content_cvpr_2018/papers/Sabokrou_Adversarially_Learned_One-Class_CVPR_2018_paper.pdf代码地址: https://github.com/khalooei/ALOCC-CVPR2018Adversarially Learned One-Cla...
2019-04-15 13:40:59 2982 4
转载 如何在面试中介绍自己的项目经验
在面试时,经过寒暄后,一般面试官会让介绍项目经验 。常见的问法是,说下你最近的(或最拿得出手的)一个项目。 根据我们的面试经验,发现有不少候选人对此没准备,说起来磕磕巴巴,甚至有人说出项目经验从时间段或技术等方面和简历上的不匹配,这样就会造成如下的后果。第一印象就不好了,至少会感觉该候选人表述能力不强。一般来说,面试官会根据候选人介绍的项目背景来提问题,假设面试时会问10个问题,那...
2019-01-10 10:56:52 285
原创 面试--牛客刷题
1.斐波那契数列题目描述求斐波那契数列的第 n 项,n <= 39。解题思路如果使用递归求解,会重复计算一些子问题。例如,计算 f(10) 需要计算 f(9) 和 f(8),计算 f(9) 需要计算 f(8) 和 f(7),可以看到 f(8) 被重复计算了。考虑到第 i 项只与第 i-1 和第 i-2 项有关,因此只需要存储前两项的值就能求解第 i 项,从而将空间复杂度由 O(N) ...
2019-01-08 14:59:14 344
原创 面试---牛客刷题(2)
1.重建二叉树题目描述输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。解题思路前序遍历的第一个值为根节点的值,使用这个值将中序遍历结果分成两部分,左部分为树的左子树中序遍历结果,右部分为树的右子树中序遍历...
2019-01-08 11:08:18 282
原创 [leetcode BY python]191. Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representation 000000000000...
2018-04-11 00:56:57 352
原创 [Leetcode BY python ]190. Reverse Bits
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 0011100101111...
2018-04-11 00:47:59 221
转载 如何打开ipynb文件
Linux看这里:http://blog.csdn.net/qq_15773669/article/details/69062374如何打开ipynb文件通过安装anacondaanaconda包含大量的科学计算包,其中就包含ipython 和jupyter,安装之后即可用其打开ipython文件.安装方式为: 官网下载相应python版本的安装文件,我这里下载的是python2.7的版本.然后输...
2018-03-11 02:26:50 1024
翻译 《Fluent Python》第三章Dictionaries and Sets
即使用户的程序代码没有明确的使用字典,但在任何运行的Python程序可能有多个字典同时工作。 — A. M. Kuchling (18章,《“Python’s Dictionary I...
2018-03-08 23:04:23 346
原创 [CCF BY C++]2017-12 游戏
问题描述试题编号:201712-2试题名称:游戏时间限制:1.0s内存限制:256.0MB问题描述:问题描述 有n个小朋友围成一圈玩游戏,小朋友从1至n编号,2号小朋友坐在1号小朋友的顺时针方向,3号小朋友坐在2号小朋友的顺时针方向,……,1号小朋友坐在n号小朋友的顺时针方向。 游戏开始,从1号小朋友开始顺时针报数,接下来每个小朋友的报数是上一个小朋友报的数加1。若一个小朋友报的数为k的倍数或...
2018-03-08 01:00:40 386
原创 [CCF BY C++]2017.12 最小差值
问题描述试题编号:201712-1试题名称:最小差值时间限制:1.0s内存限制:256.0MB问题描述:问题描述 给定n个数,请找出其中相差(差的绝对值)最小的两个数,输出它们的差值的绝对值。输入格式 输入第一行包含一个整数n。 第二行包含n个正整数,相邻整数之间使用一个空格分隔。输出格式 输出一个整数,表示答案。样例输入51 5 4 8 20样例输出1样例说明 相差最小的两个数是5和4...
2018-03-07 23:12:35 325
转载 斯坦福第五章:拉普拉斯平滑处理
链接:http://blog.csdn.net/daijiguo/article/details/52222683拉普拉斯平滑拉普拉斯平滑(Laplace Smoothing)又被称为加 1 平滑,是比较常用的平滑方法。平滑方法的存在时为了解决零概率问题。总结:分子加一,分母加K,K代表类别数目。...
2018-02-20 14:54:41 646
转载 python jieba分词模块的基本用法
链接在这儿:https://www.cnblogs.com/jiayongji/p/7119065.htmljieba(结巴)是一个强大的分词库,完美支持中文分词,本文对其基本用法做一个简要总结。安装jiebapip install jieba简单用法结巴分词分为三种模式:精确模式(默认)、全模式和搜索引擎模式,下面对这三种模式分别举例介绍:精确模式import jiebas = u'我想和女朋...
2018-02-16 17:28:59 670
转载 Mac删除文件&文件夹
有时候在Finder中查找文件、文件夹不是很方便,在Mac下使用终端(console)删除文件文件夹非常的方便。下面介绍一下删除文件和文件夹的命令:1. 删除文件命令 [html] view plain copyrm 文件名 2. 删除文件夹命令 [html] view plain copysudo rm -r -f 文件夹名 过程中可能会提示你输入password,只要依照提示输入Apple...
2018-02-16 17:24:35 470
原创 [LeetCode By Python]189. Rotate Array
题目:Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note:Try to come up as many solutions as you can, th...
2018-02-08 15:24:27 646
原创 [LeetCode By MYSQL] Combine Two Tables
题目:Table: Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName | varchar |+-------------+---------+Pe...
2018-02-08 14:41:05 279
原创 [LeetCode By Python]172. Factorial Trailing Zeroes
题目:Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.解释:求阶乘后0的个数,如果使用暴力可能会超出范围,而且速度会很慢。分析题目特点0的个数,即n!有多少个10,10又可以分解为2*5,2很充足,就...
2018-02-08 14:29:55 776
原创 [LeetCode By Python]171. Excel Sheet Column Number
题目:Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3
2018-02-07 14:56:14 255
原创 [LeetCode BY Python]169. Majority Element
题目:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority e
2018-02-07 14:07:03 258
原创 [LeetCode By Python]168. Excel Sheet Column Title
题目:Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB
2018-02-07 13:26:20 255
原创 [LeetCode By Python]167. Two Sum II - Input array is sorted
题目:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two
2018-02-06 23:11:24 399
原创 [LeetCode BY Python]160. Intersection of Two Linked Lists
题目:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a1 → a2 ↘
2018-02-06 22:31:32 267
原创 [LeetCode BY Python]155. Min Stack
题目:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top(
2018-02-06 18:41:31 310
原创 [LeetCode By Python]141. Linked List Cycle
题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解释:判断链表是否有环,如果可以用额外空间,可以使用字典记录键的次数,大于1则存在环。现有情况下可以用快慢指针方法,慢指针走一步,
2018-02-06 17:02:52 364
原创 [LeetCode By Python]136. Single Number
题目:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it with
2018-02-06 16:21:47 241
原创 [LeetCode By Python]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
2018-02-06 01:56:57 238
原创 [LeetCode By Python]122. Best Time to Buy and Sell Stock II
题目: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 as many transactions as you like (ie,
2018-02-06 01:27:13 238
原创 [LeetCode By Python]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 o
2018-02-06 01:15:08 244
原创 [LeetCode By Python]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?代码:
2018-02-06 00:53:31 357
原创 [LeetCode By Python]118. Pascal's Triangle
题目:Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]da代码+调试:clas
2018-02-06 00:46:15 340
原创 [LeetCode By Python]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
2018-02-04 15:10:17 181
原创 [leetCode By Python]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.代码+调试:class T
2018-02-04 14:51:34 330
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人