- 博客(133)
- 资源 (14)
- 收藏
- 关注
原创 从实践到实体:构建事物本质分析方法论和领域驱动设计的桥梁
本人(黄凯)从事软件研发多年,发现大家其实对领域驱动方法论,很多都掌握不好。有些同学在战术层面掌握的还行,看起来像模像样,但实际没有抓住事物和领域驱动的映射关系精髓,无法应对复杂的业务变化。我希望通过哲学的层面讲清楚实体和实践的关系,帮助大家建设准备的实体模型。 我们上学的时候学习面向对象的方法,老师经常举例子,比如有一只鸟,那么他应该有翅膀的属性,应该有飞的行为。那么当你工作的时候,不是具体的物体了,比如有个交易场景,咋建对象,交易是个对象吗?如果是的话,他应该有啥属性?应该有啥行为?接下来为你分析。马克
2024-07-08 17:46:17
784
原创 从哲学层面谈稳定性建设
从哲学层面讲稳定是物质的一种状态,即事物在持续量变的过程中,对外保持的关系基本不变,那么物质就是稳定的。而稳定性则呈现主观状态,即稳定性是使用物质的人对物质稳定的评价。这就告诉我们不仅要关注物质本身的稳定,还要关注物质不稳定后,尽可能降低使用物质的人的负面评价。通俗的来讲,就是如何让物质不出问题,出了问题如何降低影响面。本文从演绎的角度从顶向下分析了稳定性建设的方方面面。但这并不是否认通过经验归纳的重要性。
2024-06-09 21:16:34
1539
原创 技术支持服务体系建设
本文希望能通过上述分享,方便相关人员在自己的团队内建设一套完善的技术服务体系。我了解到很多研发团队没有把技术支持服务单独出来,随着业务的发展研发同学承担的技术服务的工作越来越多,希望你能通过形成独立的技术支持团队,降低研发同学的压力。
2024-05-28 14:31:06
2713
原创 发票整理问题算法
问题描述 4个部门向财务部小李上共交了40张共计1000k元发票,所有发票抬头一样,金额不一样。小李不小心打乱了这些发票,但是知道每个部门报销的金额分别为,300k,200k,400k,100k,现在你能否帮助小李将这些发票凑成4份,满足上面4个项目组的各自金额之和。设计算法实现。 思考 1看到这个问题首先想到的数学方程,先列个表格,0,表示不使用,1,表示使用, 方程 n表示发...
2018-03-16 10:37:05
1621
原创 幂等操作——防止客户端重复提交
如果我们要一个客户端请求扣费100元,用户数据库有1000元。 那么执行sql update accounts set current= current-100 where id=123456 如果我们这个sql语句执行成功了,但是http由于偶然性的断开,客户端会重试提交扣费请求,这样就会扣两次费用。 如果我们添加一个订单表detail,事务操作变成了 begin trans...
2018-02-11 14:59:35
1730
原创 Vetx.x : EventLoop线程不要锁(Synchronized/ReentrantLock)
Vetx.x : EventLoop线程不要锁(Synchronized/ReentrantLock)vert.x 里面有eventloop线程,而且eventloop线程是绝对不能阻塞的,但是实际使用中,有时候我们对阻塞理解不深刻,所以一些隐藏的阻塞没有那么好发现。eventloop 线程和work线程共用相同的锁下面的代码是一个简单的例子,用户请求localhost:8133/sync的时候会在
2017-09-18 17:50:08
1426
原创 棋盘覆盖
题目要求在棋盘覆盖问题中,要用下图—图(2)所示的4种不同形态的L型骨牌覆盖一个给定的特殊棋盘上除特殊方格以外的所有方格,且任何2个L型骨牌不得重叠覆盖运行结果 /* * Copyright (c) 2017, CipherGateway and/or its affiliates. All rights reserved. * */import javafx.application.Ap
2017-09-13 14:20:01
760
原创 dva的roadhogrc配置文件webstorm或idea解析
这是一款dva项目的.roaghogrc的idea 或者webstorm解析插件dva改用roadhog框架之后,配置文件改为了.roadhogrc, 但是该文件虽然是标准json格式,但是后缀却不是.json, idea或者webstom无法直接解析,这让人很容易错写格式。 为了满足webstorm或者idea平台下开发项目, 我们实现了.roadhogrc文件的webstorm或idea
2017-08-29 17:43:45
8481
原创 点击删除一列
javascript点击删除表格一列最近有同学问我如何点击删除购物车的一列。我想想我是用react的,只需要删除数据中的一列,然后视图就自动删除了。但是这儿就必须用原生js,那只好去网上找找了。然后写了个列子,供大家参考吧。 <html> <head> <style> table, td { border: 1px solid black; width: 300px; } </sty
2017-08-10 11:05:55
599
原创 关于实现在阿里的Antd的Modal上实现动态表的一种思路
关于实现在阿里的Antd的Modal上实现动态表的一种思路问题描述有一种业务场景,就是我们需要在一个Modal中实现动态添加表单项。并且在该Modal期间会触发状态树的更改,比如你在Modal上填写了一堆数据 然后点击提交按钮,数据被提交到后台,可是后台发现数据不满足需求,返回了错误信息。此时你希望Modal仍然能显示出来,并且包含已经填写过 的信息。但是当用户点击新建按钮时候,你又希望这个
2017-08-02 11:07:08
10585
1
原创 merge-sort-call-tree-graph
merge-sort-call-tree-graph实现归并排序的递归调用图最近为了给一个学归并排序的同学搞懂递归调用的过程,在纸上画了整个递归调用的流程,及其每次调用传递的参数以及执行后的相应结果. 感觉非常适合教学使用,随用js自动画了个图,方便大家学习.程序划分虽然这个程序是js写成的,但是由于教学对象是学C的,所以贴的代码仍然是C的. 我们把归并排序的过程分为5步,在下面的注释中可以看到
2017-07-27 20:02:18
473
原创 动态配置配置文件路径
动态配置配置文件路径应用场景做项目中经常问出现开发环境和生产环境配置文件路径不一样的情况。对于这样的问题,我们可没必要给每个环境准备一套代码。解决方法我们可以通过传递不同的vm 参数来实现动态路径。 参考代码如下。
2017-03-17 19:35:05
1128
原创 缓存
关于串行和并行的思考最近一个项目中有如下一个应用场景:我们实时记录用户的行为,并产生日志,每次产生一条日志的时候,我们就通过一系列规则来判断这个行为是否属于用户监控的行为。 监测日志行为的规则不止一条,而且具有优先级,如果该日志满足多条规则时候,以最高规则为准,处理用户的行为。我们以前实现的代码如下: Filter saveLog(Log log){ //在执行前,已经按优先级将filters排序
2017-03-10 23:05:17
319
原创 Java 8下的工厂模式
Java 8下的工厂模式你肯定厌倦了传统工厂模式的switch或者if else 模式, 如下public static Factory{ public Sample creator(String string){ switch(string){ "apple": return new Apple(); "car": return new Car();
2016-12-08 21:27:36
613
原创 Java8下重构log
重构log本文属于个人 读 Java8 in action 的感悟笔记lambda表达式具有懒加载的特性,我们看一个案例。最最原始的logger用法如下 if(logger.enabled()){ logger.debug("debug: " + getInfo(foo)); } 如果程序中用到这样的地方很多,那么程序写出来肯定会很难看,我们一般会封装成一个函数void log(String
2016-12-04 17:18:34
694
原创 基于React,dva脚手架的知乎日报
MyZhihuApp1,初始化npm install dva npm install dva-cli -g mkdir MyZhiHuAppDva dva -init npm start浏览器打开localhost:8989 你就可以看到欢迎界面了2,修改页面 打开/routes/IndexPage.less,改为:.normal { margin: 50px; text-align: ce
2016-10-25 10:57:52
15503
原创 React-Redux-Antd实现知乎日报项目(一)
最近刚学习React,决定实现一个稍微复杂完整的项目,实战一下React-Redux-Antd等库 开发环境配置 Ubuntu16.04 1,开发软件 sudo apt install npm sudo apt install git 2,采用atom作为编辑器 3,采用react-start-kit 作为脚手架 $ git clone https://github.com/
2016-10-10 21:49:02
4664
原创 LeetCode 138. 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. 这个题目想了好久,觉得应该用HashMap 之类
2016-08-10 15:43:52
398
原创 LeetCode82.Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example, Given 1->2->3->3->4->4->5, return 1->2->5. Given 1->
2016-08-08 14:48:20
342
原创 LeetCode80. Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array nums = [1,1,1,2,2,3], Your function should return length = 5, with the first fi
2016-08-08 14:06:47
304
原创 LeetCode 110. Balanced Binary Tree
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never dif
2016-08-05 17:34:53
316
原创 114. Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1
2016-08-05 16:55:11
308
原创 LeetCode 242. Valid Anagram
Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = "anagram", t = "nagaram", return true. s = "rat", t = "car", return false. Note: You may ass
2016-08-04 14:39:16
281
原创 LeetCode105. Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 这种类型的题目经常考选择题。对于这道题,采用的是分治的思想,通过preorder的第一个元素为根元素,将ino
2016-08-04 13:11:15
277
原创 LeetCode 116. Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node.
2016-08-04 09:44:27
248
原创 LeetCode 40. Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once in the combi
2016-07-28 14:39:56
280
原创 LeetCOde 64. Minimum Path Sum
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at
2016-07-28 13:39:32
265
原创 LeetCode 234. Palindrome Linked List
Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? 要在O(N)时间,O(1)空间完成,必须得反转链表,思路如下。 1,通过快慢指针找到中心位置。 2,以中心为线,将前面的链表反转 3,通过
2016-07-28 11:19:55
327
原创 LeetCode 257. Binary Tree Paths
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: ["1->2->5", "1->3"] 树的遍历,相当简单
2016-07-28 10:51:24
318
原创 LeetCode 203. Remove Linked List Elements
Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 --> 3 --> 4 --> 5 Credits: Special thanks
2016-07-27 11:33:46
244
原创 LeetCode344. Reverse String
Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 这个题目考察O(1)空间交换数组的。 public class Solution { public String reve
2016-07-26 17:23:56
239
原创 LeetCode 130 Surrounded Regions
Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. For example,
2016-07-26 15:50:22
327
原创 Leetcode 139, 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, given s = "leetcode", dict = ["leet"
2016-07-25 15:08:49
286
原创 LeetCode 143. 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 t
2016-07-25 10:58:12
300
原创 LeetCode 93. Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given "25525511135", return ["255.255.11.135", "255.255.111.35"]. (Order
2016-07-22 15:09:27
250
原创 LeetCode 226. Invert Binary Tree
Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 这道题和判断树的对称性是一样的 递归翻转左右子树。 /** * Definition for a binary tree node. *
2016-07-21 11:18:09
270
原创 LeetCode 129. Sum Root to Leaf Numbers
iven a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find the total
2016-07-21 11:13:39
293
原创 LeetCode 39. Combination Sum
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited numb
2016-07-20 16:36:14
301
原创 LeetCode 67. Add Binary
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 一位一位的加就行了,考虑溢出。 public class Solution { public String addBinary(String a, S
2016-07-20 14:25:45
237
单片机钢琴protel+keil仿真程序 下下来即可运行
2011-05-05
c#串口配置窗体(可用于继承窗体)serialport类
2012-02-25
STM32F0系列参考例程
2012-08-30
FrameLayout动态布局
2016-05-14
MySwipeMenuListViewV4
2016-05-15
MySwipeMenuListView3
2016-05-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅