自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

SGAFPZ的博客

从零单排

  • 博客(34)
  • 资源 (3)
  • 收藏
  • 关注

原创 Reach a Number - LeetCode

Reach a Number - LeetCode题目:You are standing at position 0 on an infinite number line. There is a goal at position target.On each move, you can either go left or right. During the n-th move (start...

2019-07-29 15:41:36 331

原创 Word Break II - LeetCode

Word Break II - LeetCode题目:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is a valid dictionary w...

2019-01-18 17:05:30 435

原创 vue上传图片到服务器

vue上传图片到服务器我们做的商家管理系统需要在添加一道菜的时候把图片上传到服务器, 流程大概是这样子的:搭建一个文件服务器(可以与你的网站后台放在同一台物理机上)网站后台提供上传图片的API前端接收图片后把图片转成base64字符串,调用API上传图片后台接收到base64,把base64转成图片,存到文件服务器里面,根据存储的路径生成图片的url后台把图片的url返回给...

2018-06-30 12:18:09 7828 9

原创 vue-cli中使用vuex

vue-cli中使用vuex一、vuex的作用官网的解释:每一个 Vuex 应用的核心就是 store(仓库)。“store”基本上就是一个容器,它包含着你的应用中大部分的状态 (state)。我的理解:vuex就是用来存储数据的,的当你通过api向后台获得数据后,你可以把这些数据存在vuex的store里,之后使用的时候就可以直接在store中获取,当然你也可以把网页运行时产生的...

2018-06-30 08:35:31 671

原创 使用nginx部署vue-cli项目

使用nginx部署vue-cli项目本文介绍两种部署方法,一种是直接在物理机上部署,另一种是通过docker部署ubuntu16.04使用nginx部署vue-cli1. 安装nginx sudo apt-get install nginx 这样安装nginx后,配置文件的位置在/etc/nginx/nginx.conf2.打包vue-cli项目 npm run bu...

2018-06-30 05:47:15 3187

原创 homeassistant主动推送信息

homeassistant推送信息问题背景:前端刚启动时,会向云端发送获取硬件信息的请求,然后云端再调用homeassistant的rest api请求这些信息,再把信息发回前端。 但是这样有个问题,前端收到信息后,这些信息不会再发生变化,比如温度计的信息,可能前端获取到的温度是25度,但是过了1个小时,温度变成了27度,那么前端如果不重新启动就不能获取这个信息。 所以希望ho...

2018-06-28 21:49:18 5783

原创 让Vue响应Map或Set的变化

在Vuex中使用Map和Set问题背景我想在vuex的state中使用map,这样可以使很多操作变得方便const state = { all: new Map()}这样的操作是没有问题的,不会报错,state.all可以像正常的Map一样使用。 但是这里有一个问题,vue的响应式系统不支持Map和Set,也就是说,当Map与Set里面的元素变化时Vue追踪不到...

2018-06-21 06:17:58 14428 1

原创 Vuex组件传参时的类型问题

Vuex组件传参时的类型问题这是个很白痴的问题,但是确实花了我1个多小时才解决问题背景<transition name="slide-left" mode="out-in"> <categoryList v-if="flag" :search="search&

2018-06-17 20:59:02 1139

原创 利用ssh反向隧道实现远程控制homeassistant

利用ssh反向隧道实现远程控制homeassistanthomeassistant运行在内网,处于NAT之后,内网的ip是无法从外网直接访问的,所以如果想要实现远程控制,就需要进行内网穿透。本文使用ssh反向隧道进行内网穿透,从而实现远程控制。参考博客访问内网主机–ssh反向穿透+端口转发 使用SSH反向隧道进行内网穿透 SSH反向隧道进行内网穿透 利用ssh反向代理以及au...

2018-05-26 12:32:00 3962

原创 ubuntu18.04安装homeassistant

ubuntu18.04安装homeassistant完美安装homeassistant需要python3.51.安装python3.5sudo add-apt-repository ppa:deadsnakes/ppasudo apt-get updatesudo apt-get install python3.5即使你本来电脑上安装了其他版本python也没关系,运行上面...

2018-05-13 15:11:08 8028 4

原创 html5 vue bootstrap学习报告

html5 vue bootstrap学习报告由于之前学过html,所以html5很快就看完了,另外vue和bootstrap都看了一部分,了解了一些基本操作。学习成果是一个简单的登录框 上面两个输入框使用了html5中<input>标签的一个新属性placeholder. 效果就是数据框中默认出现的Username和Password,可以提示用户上面的框应该输入用户名...

2018-04-15 16:40:25 1450

原创 win10 TensorFlow GPU环境搭建

win10+cuda9.1+cudnn7.1.1+tf1.6+py3.6.5+vs2015这篇文章只是记录搭建的流程以及一些坑的解决方法,并不是详细的教程,也没有截图什么的我电脑上本身是装了vs2015的,省了一些功夫。1.安装cuda9.1去cuda官网上下载cuda9.1。 local安装包总是下载到一般就停了,暂停一下继续下载之后就变成了403.html 于是换了ne...

2018-04-03 11:27:18 629

原创 Network Delay Time - LeetCode

Network Delay Time - LeetCode 题目: There are N network nodes, labelled 1 to N. Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v is the ta

2018-01-20 20:50:35 344

原创 Climbing Stairs - LeetCode

Climbing Stairs - LeetCode 题目: 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 t

2018-01-20 20:28:03 255

原创 Russian Doll Envelopes - LeetCode

Russian Doll Envelopes - LeetCode 题目: You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and

2018-01-09 02:00:47 338

原创 算法第八章NP完全问题作业

8.14 prove that the following problem is NP-complete: given an undirected graph G = (V,E) and an integer k, return a clique of size k as well as an independent set of size k, provided both exist.题目中

2017-12-30 10:01:49 544

原创 Remove Invalid Parentheses - LeetCode

Remove Invalid Parentheses - LeetCode 题目: Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may con

2017-12-24 16:25:57 281

原创 Longest Increasing Path in a Matrix - LeetCode

Longest Increasing Path in a Matrix - LeetCode 题目: Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right,

2017-12-17 20:18:35 336 1

原创 Interleaving String - LeetCode

Interleaving String - LeetCode 题目: 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 = “aadbbcb

2017-12-07 14:21:43 281

原创 Dungeon Game - LeetCode

Dungeon Game - LeetCode 题目: 这又是一道动态规划的题目。 一开始的想法是用一个二维数组记录在(i,j)位置所能剩下的最大生命值,但是这是不对的。 后来想到了另一种方法,从右下角开始推,在(i,j)位置记录所需要的最小生命值。然后往起点推。 在走到最后一格后,只需要剩下一滴血就可以,虽然事实上可能剩下很多血,但是剩一滴血是满足条件的最小血量,这是个必

2017-11-27 20:19:19 311

原创 Search Insert Position - LeetCode

题目: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.时间比较紧,,选了一道特别简单的题目, 找到第一个大于等于target的数,

2017-11-26 23:40:20 229

原创 K Inverse Pairs Array - LeetCode

K Inverse Pairs Array - LeetCode 题目: Given two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs. We define an invers

2017-11-19 13:24:13 353

原创 Best Time to Buy and Sell Stock IV - LeetCode

Best Time to Buy and Sell Stock IV - LeetCode 题目: 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

2017-11-09 21:04:11 314

原创 Decode Ways II - LeetCode

Decode Ways II - LeetCode 题目: A message containing letters from A-Z is being encoded to numbers using the following mapping way: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Beyond that, now t

2017-11-02 14:27:03 272

原创 Reverse Nodes in k-Group - LeetCode

Reverse Nodes in k-Group - LeetCode 题目: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to

2017-10-26 13:59:42 250

原创 Regular Expression Matching - LeetCode

Regular Expression Matching - LeetCode 题目: Implement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero or more of the preceding ele

2017-10-20 00:54:06 301

原创 Frog Jump - LeetCode

Frog Jump - LeetCode 题目: A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into

2017-10-13 15:01:41 747

原创 Find Median from Data Stream - LeetCode

Find Median from Data Stream - LeetCode 题目: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two m

2017-10-08 22:33:42 316

原创 Candy - LeetCode

Candy - LeetCode 题目: 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: 1.Each

2017-09-26 15:07:47 299

原创 Max Points on a Line - LeetCode

Max Points on a Line - LeetCode 题目:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.这道题一看就能知道大概要怎么做,先选中vector第一个点A,然后遍历剩下的点Xi,求出剩下每个点Xi与A之间的坐标差,这个坐标

2017-09-21 15:56:06 435

原创 Jump Game II - LeetCode

Jump Game II - LeetCode大概翻译一下题目的意思,有一个非负整数数组,数组某个index上的数值代表在这个index上能跳的最大步数,要从这个数组的第一个位置跳到最后一个位置,求跳动的最少次数。 例:A = [2,3,1,1,4] 从A[0]开始跳,A[0]=2,所以在这个位置最多能跳2步。 如果跳两步那么就到了A[2],而A[2]=1所以在这个位置只能跳1步 显然这个样

2017-09-07 19:51:21 367

原创 破解ftp口令密码实验

关于FTP协议安全性的实验关于FTP协议安全性的实验一配置IIS服务器建立用户名和密码二使用Wireshark设置过滤规则为ftp三客户端使用ftp命令访问服务器端四抓包并分析用户名与口令五FTP协议的安全问题本文对此次试验作了一个总结,分析很粗浅,有错误之处请指出。一、配置IIS服务器建立用户名和密码这个步骤不是重点,而且网上都有教程,所以写的简略一点。 需要注意的是,我原来用的是wi

2016-04-19 10:46:22 7113 1

原创 贪吃蛇C语言代码

贪吃蛇C语言代码贪吃蛇C语言代码手动贪吃蛇智能贪吃蛇1.手动贪吃蛇/*蛇越长跑得越快*//*作者:SGAFPZ*/#include <stdio.h>#include <windows.h>#include <stdlib.h>#include <math.h>//#include <unistd.h>#include <conio.h>#include <string.h>#

2016-04-18 15:37:59 90421 53

原创 双向链表的归并排序

双向链表的归并排序双向链表的归并排序方法一在Merge函数中使用数组方法二改变指针指向归并排序分为两个部分: MergeSort 和 MergeMergeSort 是一个递归函数,在这个函数里面把待排序的数组或链表分段,直到每段的长度为1为止。Merge 在这个函数中把分开的两段结合起来,并且在结合的过程中排序对于一个数组用归并排序是比较方便的,而在对双向链表用归并排序时就会发现next/pre

2016-04-17 19:59:25 2391

基于PCA的人脸识别

基于PCA的人脸识别,用matlab实现,使用的是剑桥大学ORL人脸数据库

2018-03-13

matlab同态滤波巴特沃斯滤波完整实现

使用matlab实现的同态滤波,高通巴特沃斯滤波,低通巴特沃斯滤波

2018-01-09

matlab实现维纳滤波逆滤波

压缩包里面有6个.m文件, blurring.m用于给图像增加抖动效果 inverseFilter.m是不考虑噪声的逆滤波 inverseFilterWithNoise.m是考虑噪声的逆滤波 wienerFiltering.m是维纳滤波 另外两个是辅助函数

2018-01-09

空空如也

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

TA关注的人

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