自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

博客已退休

停止更新

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

原创 Redux:例子分析 Async

概况例子源代码:https://github.com/reactjs/redux/tree/master/examples/async 运行之后的效果: 可以看到,基本上可以分为上下两个部分。上面部分是一个下拉框,从中可以选择想要显示项目,下面部分在没有完全得到数据之前,显示“Loading…”,得到数据之后,显示对应的内容,以及获取内容的时间,和一个用于刷新的按钮。 如果想要显示最...

2018-02-09 08:46:23 511

原创 C# WPF 控件截屏

C# WPF 控件截屏,将当前控件的内容转化为图片。public partial class MyWindow : Window{ private void ToImage() { RenderTargetBitmap targetBitmap = new RenderTargetBitmap((int)Width, (int)Height, 96d, 96d

2018-02-02 22:09:55 1840

原创 Redux 例子分析: 从 UI 角度解析 todos

在 Redux 例子分析: todos 中,我从代码的角度来说明 todos 这个例子是怎样实现的。如果很了解redux,一目了然,但是如果不太熟悉,那么就觉得有些难度了。如果能从UI的角度来逐步分析,应该会更加直接。 运行 todos,做出如下效果: 实现Todo 列表单条记录 Todo先来分析一下 list 中的这两项,即 hello 和 goodbye。想要在浏览器里

2018-02-02 21:32:02 531

原创 Redux 例子分析: todos

代码来源:https://github.com/reactjs/redux/tree/master/examples/todos source 目录夹结构(不包含测试,即spec.js结尾文件):- actions - index.js- components - App.js - Footer.js - Link.js - Todo.js

2018-01-16 21:15:52 766

原创 Redux 例子分析: counter-vanilla

本文内容来自 Facebook 官方Git Repo: counter-vanilla 例子代码运行界面: 显示结果的文字,加上四个按钮。 对应的HTML代码:div> p> Clicked: span id="value">0span> times button id="increment">+button> button id="decrement

2018-01-15 21:00:56 213

原创 Redux 例子分析: counter

本文内容来自 Facebook 官方Git Repo: counter 它所讲述的内容,是把 counter-vanilla中的例子和React结合在一起。 效果: 项目的目录结构:- components - Counter.js - Counter.spec.js- reducers - index.js - index.spec.js- in

2018-01-15 15:59:43 445

原创 NodeJS 知识点&框架整理&信息 收集

以下链接是关于NodeJS从前端到后端相关的链接,以备我个人查询所需: 2017 Node.js 开发框架比较 ReactJS React Rounter 文档 Redux文档 菜鸟教程

2018-01-12 15:21:17 267

原创 WPF 带 ICON 的 button 状态切换 (Enable/Disable)

问题的引出在WPF中,如果一个button只有文字,没有图标,当disable的时候,文字就会变成灰色。如果这个button的内容中有图片,disable的时候,不会发生任何变化。那么,问题来了,如何使得图片在显示的时候也可以变成灰色,或者使得它变得不一样呢?解决方案两种方案,一种是图片变成灰色,另一种是变成半透明。对于方案一,当图片是彩色的时候,效果很好,但是如果图片本身是灰色的

2018-01-08 21:47:25 7151

原创 C++ 知识点链接转载(持续更新)

C++ 知识点链接转载(持续更新) C++ 初始化类的常量数据成员、静态数据成员、常量静态数据成员 C++中explicit的用法

2017-12-22 13:50:35 183

原创 .Net 知识点链接转载(持续更新)

.Net 知识点链接转载(持续更新)C# 序列化与反序列化意义详解ObservableCollection 的序列化 C# 单元测试框架 xUnitWPF调用图片路径,或资源图片C# Lambda表达式

2017-12-21 09:31:16 278

转载 C# 获取当前的 dll 所在的路径

C# 获取当前的 dll 所在的路径1. 通过 `CodeBase` 得到一个 URI 格式的路径;2. 用 `UriBuild.UnescapeDataString` 去掉前缀 File://;3. 用 `GetDirectoryName` 把它变成正常的 windows 格式。

2017-12-21 09:15:03 9813

原创 LEETCODE: 729. My Calendar I & 731. My Calendar II

729. My Calendar IImplement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking.Your class will have the method, book(int start, int en

2017-11-30 12:34:52 926

原创 LEETCODE: 724. Find Pivot Index

遍历所有位置,然后分别计算左边所有元素的和,以及右边所有元素的和,如果它们相等,那么符合条件,返回。

2017-11-23 13:00:45 284

原创 LEETCODE: 719 Find K-th Smallest Pair Distance

Given an integer array, return the k-th smallest distance among all the pairs. The distance of a pair (A, B) is defined as the absolute difference between A and B.Example 1:Input:nums = [1,3,1]k = 1

2017-11-23 09:10:42 799

原创 React 例子 - 右键菜单 context menu

代码并非原创,忘了从哪里找到的,如有人知道,可博客留言。 效果点击链接: https://codepen.io/Anyicheng2015/pen/jaayMw首先,你要对React有点了解。其次,你要明白HTML的事件处理机制。我先贴代码的框架,然后逐步完善。class ContextMenu extends React.Component { constructor(props) {

2017-11-20 12:20:37 14476 4

原创 React Doc 简单摘要 (三)

事件处理注意命名规范:驼峰命名:原来的 onclick 变成 onClick处理函数: handle*注意 this 指针的绑定。

2017-09-21 15:22:35 242

原创 React Doc 简单摘要 (二)

React State 文档简化版

2017-09-21 14:51:05 310

原创 React Doc 简单摘要 (一)

Hello world程序员第一个程序必定是 Hello World! Html:div id="root"> div>Javascript:ReactDOM.render( h1>Hello, world!h1> document.getElementById('root'));在线代码编辑器(在线IDE): https://codepen

2017-09-13 12:51:56 392

原创 Javascript 笔记一:Fetch

Fetch API参考:最简单的使用方法带参数的使用方法返回状态判断HTTP参考链接

2017-08-15 16:22:25 338

原创 C# WPF DataGrid 分组(Group)

C# WPF DataGrid 分组(Group)效果如图,每个列的名字可以自定义。我随便用了”File”和”Attachment Name”。 在Window的Resources里面设置Style, GroupHeaderStyle: <Style

2017-02-15 15:23:35 8711

原创 Visual Stuido (1): 跨项目调用 同一个solution下面不同project之间的方法调用

Visual Stuido (1): 跨项目调用 同一个solution下面不同project之间的方法调用:AnotherProject的配置Configuration Type是Dynamic Library(.dll) 或者 Static Library(.lib)

2017-02-07 07:16:56 5593 4

原创 面向对象编程

引言面向对象编程基于三个基本概念:数据抽象、继承和动态绑定。 在C++中,我们用类进行数据抽象。比如,一辆车可以抽象成class car,然后我们可以为之提供一些与现实相关的操作,如开车run(),停车stop()等等。 用类派生从一个类继承另一个类:派生类包含基类的所有成员。 动态绑定,编译器在运行时决定是用基类定义的函数版本还是派生类定义的版本。 继承和动态绑定从两个方面简化了我们的程序

2015-06-09 16:12:48 411

原创 LEETCODE: 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 ↘

2015-03-02 15:59:05 246

原创 LEETCODE: Find Minimum in Rotated Sorted Array II

Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Suppose a sorted array is rotated at some pivot u

2015-01-22 17:16:32 280

原创 LEETCODE: Find Minimum in Rotated Sorted Array

Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).Find the minimum element.You may assume no duplicate exists in

2015-01-22 16:49:56 288

原创 LEETCODE: Maximum Product Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the largest

2015-01-16 14:43:35 340

原创 LEETCODE: Reverse Words in a String

Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click to show clarification.Clarification:What constitutes

2015-01-13 14:20:09 342

原创 LEETCODE: Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1",

2015-01-13 14:05:54 312

原创 LEETCODE: Max Points on a Line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.居然是图像处理那个求直线算法的原理的简化版!/** * Definition for a point. * struct Point { * int x; *

2015-01-11 22:33:11 315

原创 LEETCODE: Sort List

Sort a linked list in O(n log n) time using constant space complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(in

2015-01-11 22:22:02 257

原创 LEETCODE: Insertion Sort List

Sort a linked list using insertion sort.插入排序而已!/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {}

2015-01-11 22:00:48 370

原创 LEETCODE: Binary Tree Postorder Traversal

Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].Note: Recursive solut

2015-01-10 14:08:59 301

原创 LEETCODE: Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].Note: Recursive soluti

2015-01-10 11:47:03 272

原创 LEETCODE: Reorder List

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 

2015-01-10 11:06:13 289

原创 LEETCODE: Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?/** * Definition for singly-linked li

2015-01-10 10:29:56 366

原创 LEETCODE: 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?/** * Definition for singly-linked list. * struct ListNode { * int val;

2015-01-10 10:08:58 292

原创 LEETCODE: Word Break II

Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "

2015-01-10 10:02:13 326

原创 LEETCODE: Word Break

Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet"

2015-01-09 22:33:26 322

原创 LEETCODE: Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list./** * Definition for sing

2015-01-09 21:36:00 294

原创 LEETCODE: Single Number II

Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without usi

2015-01-06 23:02:17 310

空空如也

空空如也

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

TA关注的人

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