- 博客(38)
- 收藏
- 关注
原创 什么是CQRS?
定义CQRS(Command Query Responsibility Segregation)即命令查询职责分离。它是一种架构模式,主要思想是将应用程序中的数据操作分为两种不同的类型:命令(Command)和查询(Query)。命令是对数据进行修改的操作,比如插入、更新、删除数据;查询是对数据进行读取的操作,例如获取用户信息、查询订单列表等。工作原理在传统的应用程序架构中,数据的读取和写入通常是通过同一个数据访问层(DAL)或者数据模型来完成的。而在CQRS架构中,有专门的命令模型(Com
2025-01-05 16:36:20
301
原创 leetcode-21-Merge Two Sorted Lists
一、问题Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.二、代码/** * Definition for singly-linked lis
2018-01-30 23:05:39
270
原创 leetcode-3-Longest Substring Without Repeating Characters
一、问题Given a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is “abc”, which the length is 3.Given “bbbbb”, the answer is “b”
2018-01-30 23:03:28
281
原创 hard-480. Sliding Window Median
问题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 middle value.Examples: [2,3,4] , the medi
2018-01-30 23:03:01
243
原创 LeetCode - easy-762. Prime Number of Set Bits in Binary Representation
竞赛问题Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary representation.(Recall that the number of set bits an in
2018-01-30 23:01:44
330
原创 LeetCode - easy-747. Min Cost Climbing Stairs
问题On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top
2018-01-30 23:01:16
200
原创 LeetCode - easy-744. Find Smallest Letter Greater Than Target
问题Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list that is larger than the given target.Letters
2018-01-30 23:00:09
271
原创 LeetCode - easy-720. Longest Word in Dictionary
720. Longest Word in DictionaryGiven a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other words in words. If
2018-01-30 22:59:42
202
原创 LeetCode - easy-697. Degree of an Array
问题Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements.Your task is to find the smallest possible length o
2018-01-30 22:59:02
196
原创 LeetCode - easy-695. Max Area of Island
问题Given a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are su
2018-01-30 22:57:56
248
原创 LeetCode - easy-682. Baseball Game
问题You’re now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer (one round's score): Directly represents the number of points you get in thi
2017-11-13 17:19:59
257
原创 LeetCode - easy-628. Maximum Product of Three Numbers
问题Given an integer array, find three numbers whose product is maximum and output the maximum product.Example 1:Input: [1,2,3]Output: 6Example 2:Input: [1,2,3,4]Output: 24Note: * The length of the gi
2017-11-13 17:19:30
223
原创 LeetCode - easy-344. Reverse String
问题Write a function that takes a string as input and returns the string reversed.Example:Given s = “hello”, return “olleh”.代码class Solution {public: string reverseString(string s) { //方法一:
2017-11-13 17:19:00
194
原创 LeetCode - easy-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?思考此题初看简单,实则容易走歪。使用 哈希表 unordered_set 来实现的话,就是将指针存进去,每次存之前看set里有没有这个指针,有则说明有cycle。时间复杂度和空间
2017-11-13 17:18:31
225
原创 LeetCode - 653. Two Sum IV - Input is a BST
问题 easyGiven a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.Example 1:Input: 5 / \ 3 6 / \
2017-11-07 22:16:31
222
原创 LeetCode - 530. Minimum Absolute Difference in BST
问题 easyGiven a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.Example:Input: 1 \ 3 / 2Output:1Explanation:The mini
2017-11-07 22:15:47
240
原创 LeetCode - 409. Longest Palindrome
问题Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example “Aa” is not consid
2017-11-07 22:15:14
191
原创 LeetCode - 98. Validate Binary Search Tree
问题 :MediumGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node’s key.
2017-11-02 23:37:41
234
原创 LeetCode - 48. Rotate Image
问题:You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).
2017-11-02 23:36:33
223
原创 LeetCode 24. Swap Nodes in Pairs
问题Given a linked list, swap every two adjacent nodes and return its head.For example, Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You may
2017-10-26 10:29:42
350
原创 LeetCode - 19. Remove Nth Node From End of List
问题Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the linked list
2017-10-22 21:34:47
225
原创 LeetCode - 2. Add Two Numbers
问题You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return
2017-10-22 21:33:11
214
转载 C++中类对象的内存布局和占用空间
一个Class对象需要占用的内存空间:*非静态成员变量总合。*加上编译器为了CPU计算,作出的数据对齐处理。*加上为了支持虚函数,产生的额外负担。
2017-05-21 23:01:12
461
原创 阅读笔记:pg085 AXI4-Stream infrastructure
pg085-axi4stream-infrastructure.pdf 这篇文档,所介绍不仅仅是 AXI4-Stream Switch 一个IP核,而是分别对下图所示的几个IP核进行了说明,阅读时需要区分。另外,在这些IP核中,数据传输的基本单位是传输(transfer),类似于数据包的概念,2个以上的 transfer 构成一个 transaction。
2017-05-14 19:57:55
14213
4
原创 IEEE 802.1Q 第八章2/3/4节 笔记
IEEE 802.1Q 8.2/8.3/8.4节,主要讲述网桥基本结构,基本功能,以及生成树算法。
2017-04-11 16:21:25
2534
4
转载 IEEE 802.1Q VLAN技术原理
在数据通信和宽带接入设备里,只要涉及到二层技术的,就会遇到VLAN。而且,通常情况下,VLAN在这些设备中是基本功能。所以不管是刚迈进这个行业的新生,还是已经在这个行业打拼了很多年的前辈,都要熟悉这个技术。
2017-03-27 16:31:31
1899
2
原创 Basic Switch Operation 阅读笔记
《Basic Switch Operation》是关于以太网交换机基本工作原理的一篇非常好的科普文章,本文是阅读过程中的一些笔记。最近参与车联网中时间敏感网络(Time sensitive networks)的项目,要做一个支持虚拟局域网的Audio/Video Bridge,要读很多这方面的协议、论文,比如802.1Q 、Qav、Qbv、Qci等,所以打算顺便写这系列的阅读笔记。
2017-03-19 22:17:22
597
原创 Matlab读写Excel文件
昨天实验室给的任务是计算经过AAC-LC编码后的音频客观质量分peaq。当计算立体声的peaq时,输出的是3万多行、2列的excel文档,其中依次是每一帧的计算结果。数据比较杂乱,无法直接在excel中用函数整理,所以决定使用Matlab。
2016-12-02 09:46:45
1243
原创 利用FFmpeg制作视频序列
前言本文介绍了利用FFmpeg进行视频测试序列制作的方法。所谓测试序列就是将若干个不同场景的视频片段,按照不同的分辨率、码率、编码方法等进行处理,然后拼接成一条长视频,供测试者打分。一般包括以下几个步骤:视频截取、采样/编码/转码、黑帧/灰帧制作、视频拼接、视音频融合等。前言一视频截取二采样和编码三黑帧灰帧的制作四视频拼接1 先音视频片段融合再拼接2 先视音频片段分别拼接得到长视频和长
2016-07-21 17:09:57
1578
原创 Bundler及PMVS的配置与使用(简易版)
系统原理:利用Bundler获取相机位姿参数和稀疏点云,利用PMVS系统,以bundler的输出作为输入,获得稠密的点云模型。文章主要介绍了简易版的Bundler及PMVS的配置与使用方法。
2016-05-03 21:45:52
4573
7
原创 Bundler 及 PMVS 常见问题&解决方法
Bundler是Noah Snavely开发的一套基于SfM原理、能够利用无序图片重建三维模型的系统。CMVS+PMVS是Yasutaka Furukawa博士写的一套强大系统,能够以Bundler的输出作为输入,二者搭配使用,能够重建出稠密的点云模型。下面是我总结的这整套系统在实际编译、运行中的常见问题,并给出相应解决方法,希望对大家有所帮助。
2016-05-03 08:59:37
6272
13
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人