自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

学习的路上,永不停止

生命不止,学习不止

  • 博客(155)
  • 资源 (10)
  • 收藏
  • 关注

原创 python-变量定义域及相关函数

1) 变量按作用域分类:全局变量(global),局部变量(local)2)LEGB原则:     L(local):局部作用域     E(Enclosing function local)外部嵌套函数作用域     G(Global module)函数定义所在模块作用域     B (Build)python 内置作用域3)局部变量->全局变量def fun...

2018-07-18 10:40:23 3182

原创 java-利用正则表达式替换双引号中的逗号

String s="2018-07-11,Banner,俄罗斯方块2018新版(iOS),iOS-俄罗斯方-banner,\"1,151,686\",\"1,319\",58.15,0.05,0.03%"; Pattern p = Pattern.compile("(\".*?),(.*?\")"); Matcher m = p.matcher(s); Strin...

2018-07-12 13:13:17 6308

原创 python-总结numpy

使用np.random.randn(5)创建的为一个秩为1的数据结构,往往我们由于这个问题导致python代码产生bug,如图所示:a=np.random.randn(5)[-1.48338769 -0.9962106 0.40807657 -0.60869681 1.80409923]当我们使用a.shape时可以查看它的数据结构print(a.shape)(5,)使用np.do...

2018-07-04 10:54:59 129

原创 python-广播

(m,n)+(1,n),会使(1,n)复制成(m,n)再进行相加例如:import numpy as npA=np.array([[56.0,0.0,4.4,68.0],[1.2,104.0,52.0,8.0],[1.8,135.0,99.0,0.9]])print(A)cal=A.sum(axis=0)print(cal)percentag=100*A/calprint(percen...

2018-07-04 10:39:03 142

原创 python-numpy

import numpy as np平方 :np.exp(v)log:np.log()绝对值:np.abs(v_np.maximum(v,o)...

2018-07-04 10:24:10 178

原创 在.net core下利用机器学习,对课程进行分类

安装ML Install-Package Microsoft.ML -Version 0.2.0创建LearningPipeline对象var pipeline = new LearningPipeline();加载学习的文件 string dataPath = "data.txt"; pipeline.Add(new TextLoader(dataPath).CreateFrom<Iri...

2018-07-03 15:25:28 790

原创 python-数据类型和变量

数据类型:整数、浮点数、字符串、多行字符串、布尔值、空值整数:1,2 0xFa浮点数:1.223,1.2e-10字符串:使用单引号或者双引号   "hello world",'hello world'布尔值:True False ;运算方式:and、 or、not空值:None...

2018-06-15 14:14:32 94

翻译 js-原生execCommand

一个HTML文档被切换到时designMode,它的document对象公开了一个execCommand方法来运行操作当前可编辑区域的命令,例如表单输入或contentEditable元素。大多数命令会影响文档的选择(粗体,斜体等),而其他命令会插入新元素(添加链接)或影响整行(缩进)。使用contentEditable时execCommand()会影响当前活动的可编辑元素。命令参数:backCo...

2018-06-14 14:05:32 503

原创 js-将在线图片转成Base64的图片

convertImgToBase64:function(url, outputFormat,callback){ var canvas = document.createElement('CANVAS'), ctx = canvas.getContext('2d'), img = new Image(); img.crossOrigin = 'Anonymous'; ...

2018-06-14 14:01:18 2468

原创 js-实现富文本编辑器的插入链接功能

通过js和xcConfirm插件,实现富文本编辑器的插入链接功能,代码如下:function insertLink() { //获取选区对象 var selObj = window.getSelection(); var selRange = selObj.getRangeAt(0); //获取所选内容的父级节点 var selParent = selRange.co...

2018-06-14 14:00:00 2210

原创 js-利用ranage 实现系统元素的选择

let target = e.target; // 删除之前所有的选区 window.getSelection().removeAllRanges(); let selection = window.getSelection(); let range = document.createRange(); range.selectNode(...

2018-06-14 13:57:37 337

原创 动态规划-最大连续子数

给定一组数组求最大连续子数组,注:元素可以不相邻连续,例如:11,2,3,5,4 则结果为3(2,3,4)public static int MaxLengthOfArray1(int[] nums) { int global = 0; for(int i = 0; i < nums.Length; i++) ...

2018-06-11 15:15:58 185

翻译 动态规划-最大连续子序列积

给定一个数组,求取最大连续最大子序列积 public static int MaxProduct(int[] nums) { int maxLocal = nums[0]; int minLocal = nums[0]; int global = nums[0]; for (int i...

2018-06-11 14:46:08 323

翻译 动态规划-最大连续字数

给定一个数组,求最大连续的子数组解法1: 动态规划 public static int MaxSubArray(int[] nums) { int maxLocal = nums[0]; int global = nums[0]; for(int i = 1; i < nums.Length; i++)...

2018-06-11 14:28:44 206

原创 动态规划-三角形

题目:给定一个指定的三角形的数字矩阵,如图所示:              2            3     4          6   5    7求从顶端到底部的最小距离。 public static int MinimunTotal(List<List<int>> triangle) { for(int i = tria...

2018-06-11 13:57:33 208

原创 贪心法-最大容积

有一个数组,每个数组的值假设为木板的高度,求这个最大能够装载的容积public static int MaxArea(int[] height) { int start = 0; int end = height.Length - 1; int result = int.MinValue; ...

2018-06-08 16:59:53 163

翻译 贪心法-最大不重复子串

public static int lengthOfLongstSubString(String s) { const int ASCII_MAX = 255; int[] last = new int[ASCII_MAX]; for (var i = 0; i < ASCII_MAX; i++) l...

2018-06-08 16:48:14 234

翻译 贪心法-Best Time to Buy and Sell Stock

public static int MaxProfit(int[] prices) { if (prices.Length < 2) return 0; int profit = 0; int cur_min = prices[0]; for(int i = 1; i < ...

2018-06-08 15:25:54 158

翻译 贪心法-Jump Game II

给定一个数组,每个数组元素为跳转的最大值,求走完这个数组的最小步骤public static int Jump(int[] nums) { int step = 0; int left = 0; int right = 0; if (nums.Length == 1) return 0;...

2018-06-07 16:11:01 134

转载 贪心法-Jump Game

给定一个数组,每个数组元素的值为最大的跳跃值,求是否能从数组0元素到数组最大的元素public static bool canJump2(int[] nums) { int[] f = new int[nums.Length]; for(int i = 1; i < nums.Length; i++) {...

2018-06-07 15:55:17 158

翻译 分治法-pow(x,n)

public static double myPow(double x,int n) { if (n < 0) return 1.0 / power(x, -n); else return power(x, n); } static double power (double x,int ...

2018-06-07 15:08:45 260

原创 UWP-Code 入门篇

1、常用Layout : RelativePanel、Grid、StackPanel2、常用控件:TextBox、ToggleSwitch、DatePicker、ComboBox3、* 默认代表剩余宽度或高度,若出现同一级布局出现*,则表示比例4、ThemeDictionaries、StaticDictionary、RelativeDictionary、CustomerDictionary...

2018-05-28 17:23:26 172

原创 UWP-图片缓存本地之图片与byte数组之间的转换

1、提取image control的source2、从image control中提取图片byte  var himage = (BitmapImage)this.Img.Source; RandomAccessStreamReference random = RandomAccessStreamReference.CreateFromUri(himage.Uri...

2018-05-28 16:50:24 784

原创 python-3 三大结构

if 条件表达式:            语句1            语句2            .......note:条件表达式后的冒号不能少           根据缩进进行判断代码块num=8if num>8: print("大于8")print("小于8")num=8if num>8: print("大于8")else: print("小于8")...

2018-05-23 16:16:19 994

原创 python-2 运算符

逻辑运算符and 与or 或not 非python 中没有异或运算规则:and--乘法  or--加法                  True--1  False--0成员运算符号用来检测某个变量是否是另一个变量的成员in 、not in优先级表格** 指数- + -按位反转*  /  %  // 乘、除、取模和取整除+ - 加法减法>> << 右移 左移运算符&amp...

2018-05-23 15:08:18 320

原创 python-1、环境安装及基础知识

环境:Anaconda3 + pychanm单行注释:# 多行注释:'''   '''程序=数据结构+算法变量:推荐使用数字、大小写、下划线...· 数字不可以开头。· 一般下划线开头的内容具有特殊含义,故不推荐下划线· 区分大小写· 类命名:大驼峰命名规则· 普通变量或者函数:小驼峰保留关键字:class、def、break、for查看关键字:import keywordprint(keywo...

2018-05-23 11:21:17 104

原创 .net 连接mysql数据库 -database 优先

https://download.csdn.net/download/smj20170417/10429162https://download.csdn.net/download/smj20170417/10429150安装上面2个文件,即可

2018-05-22 11:11:10 179

翻译 链表-插入排序

public class ListNode { public ListNode(int data) { this.data = data; } public int data { set; get; } public ListNo...

2018-05-21 13:46:42 77

原创 Hadoop-window下借助vm搭建hadoop环境

下载jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.htmlhadoop:http://hadoop.apache.org/将文件传输到Linux :yum install lrzsz上传文件:rz -y  下载文件:sz filename若文件后缀为rpm,则使用:rpm -i...

2018-05-16 17:24:11 219

翻译 在二叉搜索树查找第k大的结点

给定一颗二叉搜索树,查找第k大的结点public static int KthSmallest(TreeNode root, int k) { Stack<TreeNode> s = new Stack<TreeNode>(); TreeNode p = root; while (s.C...

2018-05-10 17:00:00 1512

翻译 将排序的数组转换成二叉搜索树

给定一组递增的数,将其转换成BSTpublic static TreeNode SortedArrayToBST(int[] nums) { return SortedArrayToBST(nums, 0, nums.Length); } private static TreeNode SortedArrayToBST(in...

2018-05-10 16:44:25 341

翻译 FlattenTree

有一颗二叉树,将左子树的所有节点,转移到右子树上,如:      1             1     /  \            \   2    3            2                      \                        3代码: /// <summary> /// 将root 中右子树->左子...

2018-04-18 16:55:34 735

翻译 判定平衡二叉树

有一棵树,判断是否为平衡二叉树。平衡二叉树即为:左右子树的高度差不超过1代码: /// <summary> /// 若root为平衡二叉树,则返回二叉树的高度,否则返回-1 /// </summary> /// <param name="root"></param> /// <...

2018-04-18 16:17:30 136

翻译 对称二叉树

如果以根为中心,整棵树关于根对称的,则返回true,否则为false递归版: public static bool IsSymmetric(TreeNode root) { if (root == null) return true; return IsSymmetric(root.Left,root.Right); ...

2018-04-16 16:33:06 138

翻译 相同树

如果2个二叉树的数据结构和对应节点的值都相同,则2棵树是相同树。递归版: public static bool IsSameTree(TreeNode p,TreeNode q) { if (p == null && q == null) return true; if (p == null || q == null)...

2018-04-16 16:19:09 154

翻译 二叉树Zigzag层次遍历

给定一个二叉树 返回Zigzag层次遍历的的值(例如:从左到右,然后从右到左,以此类推)如图: 3 / \ 9 1 / \ 1 3返回结果为:[ [3], [1,9], [1,3]]代码如下:public static List<List<int>> ZigzagLevelTreeTraversal(TreeNode root...

2018-04-13 16:48:31 1565

原创 使用StackExchange.Redis操作Redis--配置

1、最简单的配置var conn = ConnectionMultiplexer.Connect("localhost");在不指定端口号的情况下,默认6379端口;附加选项只是简单的附件(逗号分隔)。端口常用冒号(:)表示。例如var conn = ConnectionMultiplexer.Connect("redis0:6380,redis1:6380,allowAdmin=true");通...

2018-04-13 14:35:41 13900 2

原创 使用StackExchange.Redis操作Redis--基础

1、命名空间中的StackExchange.Redis的ConnectionMultiplexer类:线程安全,共享,重用,2、创建示例:ConnectionMultiplexer redis=ConnectionMultiplexer.connect("127.0.0.1")由于ConnectionMultiplexer实现了IDisposable接口,故可以在不使用的时候进行释放。对于主/从设...

2018-04-13 11:34:29 2150

原创 Windows 10 搭建Redis 集群环境

1、下载最新的redis安装包:redis下载地址2.解压redis压缩包后,将redis.conf 文件进行修改,修改关键代码如下:port 7005cluster-enabled yescluster-config-file nodes.confcluster-node-timeout 5000appendonly yes文件中的 cluster-enabled 选项用于开实例的集群模...

2018-04-13 10:59:36 905

翻译 反转二叉树

     二叉树如图所示:     2   /   \  1     3 / \   / \1   2 6   5反转后结果如下:    2   /   \  3    1 / \   / \5  6 2   1程序如下: public static TreeNode InvertTree(TreeNode root) { Queue<TreeNode...

2018-04-11 16:53:38 1178

jquery自定义弹框

非常好看的弹框,支持多种方式的使用,可以进行自定义

2018-06-13

mysql-connect-net-8.0

mysql连接net mysql连接net mysql连接net mysql连接net

2018-05-22

mysql-for-visualstudio-1.2

mysql-for-visualstudio 资源安装包mysql-for-visualstudio 资源安装包mysql-for-visualstudio 资源安装包

2018-05-22

poi操作表格

使用poi 操作表格,Android可以操作简单的表格,进行合并单元格等操作

2017-11-21

.net framkwork 4.0框架

.net 4.0 framework 安装驱动包,.net开发必须的包,欢迎下载

2017-11-20

css3-ul-ol列表

css3-ul-li 设计列表,好看的列表样式,欢迎下载哦。亲测

2017-11-20

aspose.cell excel操作文件

aspose.cell 十分好用的excel操作文件,针对于excel的导入导出,

2017-11-20

bootstrap 新版

bootstrap 插件,美化界面,快速开发,快速构建网站。

2017-11-20

bootstrap表单构造器

表单构建,基于bootstrap form上传,亲测可用,非常好用

2017-11-20

新版bootstrap-上传

bootstrap文件上传,特别好用的插件,可以尝试下哦,亲测可用

2017-11-20

空空如也

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

TA关注的人

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