- 博客(35)
- 收藏
- 关注
原创 Linux下socket通信示例
服务端socket流程:socket() –> bind() –> listen() –> accept() –> 读取、发送信息(recv,send等)客户端socket流程:socket() –> connect() –> 发送、读取信息(send,recv等) 服务端:#include &am
2018-07-20 11:23:13
1066
原创 Docker网络实践运用
Docker 容器网络概述要构建具有安全的一致行为的 Web 应用程序,可以使用 Docker 网络特性。根据定义,网络为容器实现了完全隔离。因此,控制应用程序所在的网络很重要。Docker 容器网络为用户提供了这种控制能力。我们在某个微服务架构的项目中,出于安全隔离微服务进程和外界网络的目的,采用了这种Docker容器网络的解决方案。采用Docker容器网络的好处是,处于同一容器网络的容...
2018-07-06 12:54:06
277
原创 Docker部署golang微服务项目
因为实训需要,我要在服务器上用docker部署我们小组的微服务项目。我们的微服务有Gateway,User,Scene,Device四个部分,分别占用不同的端口,其中Gateway向小程序前端提供https服务,其他三个提供http服务(服务之间的通信)。 四个服务都直接访问docker宿主机的一个容器中mysql,该mysql设置了端口映射。Docker容器之间的通信有三种方法,我采用us...
2018-05-15 15:11:20
1490
原创 系统分析与设计第四次作业
系分第四次作业阅读 Asg_RH 文档,按用例构建领域模型。数据库建模(E-R 模型)使用Mysql Workbench构建生成的sql语句如下:-- MySQL Script generated by MySQL Workbench-- Sun Apr 29 12:43:14 2018-- Model: New Model Version: 1....
2018-04-29 12:57:27
252
原创 系统分析与设计第三次作业
系统分析与设计第三次作业用例建模a. 阅读 Asg_RH 文档,绘制用例图。 按 Task1 要求,请使用工具 UMLet,截图格式务必是 png 并控制尺寸b. 选择你熟悉的定旅馆在线服务系统(或移动 APP),如绘制用例图。并满足以下要求:对比 Asg_RH 用例图,请用色彩标注出创新用例或子用例尽可能识别外部系统,并用色彩标注新的外部系统和服务c. 对比两个时代、...
2018-04-22 15:26:42
248
原创 [LeetCode]Flatten Binary Tree to Linked List题解(二叉树)
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 sh...
2018-04-08 11:38:43
166
原创 [LeetCode] Next Permutation(一种巧妙的解题方法)
Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it ...
2018-04-04 21:40:42
327
原创 [LeetCode]Combination Sum题解(DFS)
Combination Sum Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated n...
2018-03-23 11:35:47
302
原创 系统分析与设计 homework2
1. 简述瀑布模型、增量模型、螺旋模型(含原型方法)的优缺点。瀑布模型优点: 降低了软件开发的复杂度,提高软件开发过程中的透明性,提高软件开发的可管理性。 为项目提供了按阶段划分的检查点。 当前一阶段完成后,只需关注后续阶段。缺点: 瀑布模型中的软件活动是文档驱动的,当阶段之间规定过多的 文档时,会极大地增加系统的工作量 回溯修改很困难甚至不可能,但是软件生产的过程需要时...
2018-03-22 22:49:31
225
原创 系统分析与设计 homework-1
1、软件工程的定义软件工程是将系统化、规范化、可度量的方法应用于软件的开发、运营和维护上,也就是将工程方法应用于软件上,并对这些方法的研究。2、软件危机(software crisis)软件危机(software crisis)是由于计算机能力的快速增长和无法解决的问题的复杂性。随着软件复杂性的增加,很多软件问题由于现有方法的不足够而产生。软件危机的原因与硬件的整体复杂度和软件...
2018-03-14 17:03:59
340
原创 stringstream快速实现String和int之间的转换
需要包含头文件”sstream”#include <iostream>#include <string>#include <sstream>using namespace std;int string2int(string str){ int num; stringstream sstream; sstream <&...
2018-03-13 17:26:29
1842
原创 [LeetCode]Delete and Earn题解(动态规划)
Delete and Earn Given an array nums of integers, you can perform operations on the array. In each operation, you pick any nums[i] and delete it to earn nums[i] points. After, you must delete eve
2017-12-28 20:36:47
269
原创 [LeetCode]Longest Palindromic Substring题解(动态规划)
Longest Palindromic Substring: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: “babad” Output: “bab”...
2017-12-27 15:50:38
326
原创 [LeetCode]Letter Combinations of a Phone Number题解
Letter Combinations of a Phone Number: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone...
2017-12-26 18:34:05
294
原创 [LeetCode]Length of Last Word
Length of Last Word: Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string. If the last word does not exist, return
2017-12-16 23:59:37
153
原创 [LeetCode]Find Pivot
Find Pivot: Given an array of integers nums, write a method that returns the “pivot” index of this array. We define the pivot index as the index where the sum of the numbers to the left of the i
2017-12-09 10:48:31
253
1
原创 [LeetCode]Find Bottom Left Tree Value
Find Pivot: Given an array of integers nums, write a method that returns the “pivot” index of this array. We define the pivot index as the index where the sum of the numbers to the left of the i
2017-12-02 14:42:18
191
原创 [LeetCode]Maximum Length of Repeated Subarray
Maximum Length of Repeated Subarray: Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays. Example 1: Input: A: [1,2,3,2,1] B: [3,2,1,4
2017-11-23 20:19:27
208
原创 [LeetCode]Maximum Subarray题解
[*Maximum Subarray*](https://leetcode.com/problems/maximum-subarray/description/):>Find the contiguous subarray within an array (containing at least one number) which has the largest sum.>For example, given
2017-11-22 16:43:44
205
原创 [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”.
2017-11-07 23:59:35
141
原创 [LeetCode]Implement strStr()
Implement strStr(): Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 执行两次遍历即可。算法复杂度在最坏的情况下不会超过O(mn)。class Solution {
2017-10-31 21:45:19
159
原创 Recyclerview adapter
import android.support.v7.widget.RecyclerView;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.TextView;import java.util.ArrayList;/**
2017-10-25 10:52:06
181
原创 [LeetCode]Symmetric Tree
Symmetric Tree: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2
2017-10-24 12:48:18
237
转载 Socket的基本操作
socket的基本操作:(1)socket()函数: (2)bind()函数: (3)listen(),connect()函数; (4)accept()函数; (5)socket中的发送与接收函数: (6)close()函数: (7)服务器上调用socket函数: (8)客户端调用socket函数: (9)IP地址转换函数:inet_pton, inet_ntop, inet_add
2017-10-24 00:17:28
460
原创 [LeetCode]3Sum Closest题解
3sum Closest: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input wou
2017-10-16 17:08:24
233
原创 [LeetCode]Swap Nodes in Pairs题解
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 shoul
2017-10-09 23:43:57
189
原创 [LeetCode] Remove Element题解
Remove Element: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you must do this in place with c
2017-10-03 20:07:37
176
原创 [LeetCode]Remove Duplicates from Sorted Array题解
Remove Duplicates from Sorted Array: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for anoth
2017-09-24 23:13:01
176
原创 [LeetCode]Generate Parentheses题解
Generate Parentheses: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ “((()))”, “(()())”
2017-09-17 21:03:06
193
转载 Java中InputStream 、 InputStreamReader 、 BufferedReader的区别
1.InputStream、OutputStream处理字节流的抽象类InputStream 是字节输入流的所有类的超类,一般我们使用它的子类,如FileInputStream等.OutputStream是字节输出流的所有类的超类,一般我们使用它的子类,如FileOutputStream等.2.InputStreamReader OutputStreamWriter处理字符流的抽象类InputSt
2017-09-17 12:19:24
256
原创 [LeetCode]Longest Substring Without Repeating Characters题解
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
2017-09-11 21:40:28
187
原创 [LeetCode] Binary Tree Postorder题解
Binary Tree Postorder Given a binary tree, return the postorder traversal of its nodes’ values. For example: Given binary tree {1,#,2,3},return [3,2,1]. Note: Recursive solution is trivi
2017-09-10 15:21:07
244
原创 [LeetCode] Add Two Numbers题解
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 nu
2017-09-10 13:41:17
165
原创 [LeetCode] Three Sum题解
Three Sum: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must n
2017-09-07 13:49:47
456
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人