自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

一搏

一切都是最好的安排

  • 博客(49)
  • 问答 (1)
  • 收藏
  • 关注

翻译 一叶障目 —— docker

本篇文章来自docker官方文档的翻译主要内容包括docker的作用,架构,底层技术概览Docker overview大约阅读时间:10Docker是一个用于开发,交付和运行应用程序的开放平台。 Docker使您能够将应用程序与基础架构(环境配置)分开,从而可以快速交付软件。 借助Docker,您可以和管理应用程序相同的方式来管理基础架构(环境配置)。 通过利用Docker的方法来快速交付...

2020-03-29 18:55:26 178

原创 Socket编程基本概念----imooc(3)

第4章 通过Socket 实现UDP编程@(JAVA)[socket, java]Socket编程基本概念—-imooc(1) Socket编程基本概念—-imooc(2) Socket编程基本概念—-imooc(3)4-1 DatagramPacket & DatagramSocket 简介UDP协议(用户数据报协议)是无连接,不可靠的,无序的以数据报作为载体,传输时,首先将要传输的数据定

2016-09-21 00:22:02 529

原创 Socket编程基本概念----imooc(2)

Socket编程2@(JAVA)[socket, java](http://www.imooc.com/learn/161)Socket编程1,这是第一篇Socket编程2使用多线程实现客户端的通信使用多线程实现客户端的通信上一篇最后实现了一个服务端和客户端之间的简单交流,这次要给服务端中加入多线程,可以接受很多个客户的消息,并记录其IP,和人数服务端(中间的代码提取到了多线程类中(第三段代

2016-09-21 00:19:22 534

原创 Socket编程基本概念----imooc(1)

Socket编程@(JAVA)http://www.imooc.com/learn/161Socket编程课程简介网络基础知识InetAddressjava中的URL应用socket简介编程实现基于TCP的Socket通信实现用户登录课程简介网络基础知识InetAddress类URLTCP编程UDP编程网络基础知识俩台计算机通过网络进行通信的3个必备条件IP地址 (电脑的名

2016-09-19 00:40:42 1293

原创 虚拟机下centos 6/7 配置 jdk1.8 + tomcat9

弄这几行命令弄了2天,只要是我的centos连不到网络,有线无线桥接什么的搞晕了,记录一下这几行命令,如果正好看到有啥问题可以留言 2016.9.18 23:54虚拟机是VMware / ORCLE VM VIRTUALBOX 没多大差别流程下载虚拟机,以及centos镜像如果是64位系统但没有64位选项,bios中开启虚拟化功能即可 下载JDK1.8 检查一下 继续下载,这个

2016-09-18 23:55:46 1260

原创 RandomAccessFile 基础

RandomAccessFile@(JAVA) http://blog.csdn.net/akon_vm/article/details/7429245基本概念RandomAccessFile是用来访问那些保存数据记录的文件的,你就可以用seek( )方法来访问记录,并进行读写了。这些记录的大小不必相同;但是其大小和位置必须是可知的。但是该类仅限于操作文件。是一个直接继承Object的,独

2016-09-16 09:12:47 277

原创 Java线程:Synchronized

Synchronized的作用主要有三个从语法上讲Synchronized总共有三种用法 以下转自:http://www.cnblogs.com/paddix/p/5367116.htmlSynchronized的作用主要有三个:确保线程互斥的访问同步代码保证共享变量的修改能够即使可见有效解决重排序问题从语法上讲,Synchronized总共有三种用法:修饰普通方法修饰静态方法修

2016-09-13 22:40:27 265

原创 Java 线程(Thread)基础知识概括

线程基本概念通过实现Runnable接口来创建线程通过继承Thread来创建线程俩种实现方法比较 参考 http://www.runoob.com/java/java-multithreading.html http://www.infoq.com/cn/articles/cf-java-thread https://www.ibm.com/developerworks/

2016-09-09 14:34:25 479

原创 codeforce 78E

思路:先用BFS找出炸弹到各个地方的时间再用BFS依次找出每个人(从它所在坐标 )在规定时间内能走到的所有坐标,以及到相应位置的时间 然后比较每个坐标,比较人所到的时间和炸弹到的时间,前者要比后者小才能通过,看这些合格的点中有没有救生胶囊,有的话就OK(这里的处理我代码上还有错,等有时间再改。。)正规的做法是先用BFS建图,然后用最大流计算#include <stdio.h>#include

2016-08-29 20:28:52 391

原创 codeforce 69D

#include<iostream>#include<vector>#include<math.h>#include<algorithm>//输入保证初始点到原点距离小于d,判断的是移动点到原点的距离(不是初始点)//将所有向量先排序(从大到小),然后依次取出,若所有选择都失败,则跳出,如果当时是A赢,那么A赢,如果是B赢,那么进入A的下一个选择,A有N次机会using namespace s

2016-08-29 12:14:15 463

原创 状态压缩DP

懂了就删#include <cstdio>#include <cstring>const int N = 13;const int M = 1<<N;const int mod = 100000000;int st[M],map[M]; ///分别存每一行的状态和给出地的状态int dp[N][M]; //表示在第i行状态为j时候可以放牛的种数bool judge1(int x)

2016-08-25 15:58:58 260

原创 10018 - 隔离圈

今天做了一道几何题,用到了凸包,求最小外接圆,判断点是否在多边形内。找了半天,记录一下 以下代码都是转载的,侵权即删凸包求多边形的最小外接圆判断点是否在多边形内凸包求多边形的最小外接圆判断点是否在多边形内凸包 //二维点(或向量)结构体定义//typedef vector<Point> vector<Point>;//判断两个点(或向量)是否相等bool operator==(con

2016-08-22 22:43:36 678

原创 DFS JAVA 模板

很好用import java.awt.*;import java.util.ArrayList;/** * Created by zhangzexiang on 2016/8/9. */public class SmartRorbot_1048 {static int maxn=100; static boolean vst[][] = new boolean[maxn][maxn

2016-08-09 21:42:08 2399

原创 350. Intersection of Two Arrays II

Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note: Each element in the result should appear as many times as it

2016-07-03 21:26:35 284

原创 349. Intersection of Two Arrays

Given two arrays, write a function to compute their intersection.Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note: Each element in the result must be unique. The result can be in

2016-07-03 19:46:21 312

原创 汤阳光OA系统笔记-----Hibernate建关联表模板

?属性,本类与?的 ?public class Privilege { private Long id; private String name; // 权限名称 private String url; private Set<Role> roles = new HashSet<Role>(); private Privilege parent; // 上级权限

2016-06-09 19:59:23 539

原创 汤阳光OA系统笔记----简化后的基本步骤

观察有几个功能 增删改查设计实体有几个请求 增删改查=====6个Action相关准备 Action ,jsp , 做service相关的 接口,实现类,配置填空 Action方法,Service方法,JSP页面

2016-06-09 17:46:57 976

原创 记录汤阳光OA视频每集的要点

实在找不到可以用来记录这些东西的好用的编译器了。。27添加部门列表的显式功能28功能 在指定部门下新建页面的部门不用自己选自动出来功能 返回上一级功能 增删改之后还能回到原来的页面29功能 懒加载异常的解决方法29-32递归显示部门列表33简化公共页面34简化action层35去除Dao层36-37创建userAction userService userj

2016-06-09 13:58:43 2063

原创 汤阳光OA系统记录-----Hibernate实体映射

格式:?属性,本类与?的? ?1 属性名 ?2 关联对类型 ?3 关系多对一: <many-to-one name="" class="" column=""></many-to-one>一对多(Set): <set name=""> <key column=""></key> <one-to-many class=""/>

2016-06-08 15:14:53 480

原创 汤阳光OA系统笔记----如何确定实体类

确定实体类要写什么属性,有什么关联

2016-06-08 09:34:51 648

原创 汤阳光OA系统记录-----基本步骤

-设计实体表-设计实体 JavaBean hbmxml 建表- 分析有几个功能对应几个请求- 功能所对应的表单以及对应的模板- 新建对应页面- 配置structs- 测试之前的Action可以运行没实际作用实现功能-实现Action的实际功能对应Service ServiceImpl中的补全DepartmentActionDepartmentServiceDepartme

2016-06-08 09:11:09 1354

原创 206. Reverse Linked List

Reverse a singly linked list. Hint: A linked list can be reversed either iteratively or recursively. Could you implement both?思路1自己想的,结果是超时,为什么会超时 >_<class Solution {public: ListNode* reverse

2016-05-09 23:09:19 267

原创 61. Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative.For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL.思路先求出尾节点以及链表大小,然后重新连接,感觉链表的链接还是很直观的。clas

2016-05-09 22:46:50 239

原创 189. Rotate Array

Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note: Try to come up as many solutions as you can, ther

2016-05-09 15:16:25 258

原创 229. Majority Element II

Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.Hint: How many majority elements could it possibly ha

2016-05-09 14:26:03 246

原创 169. Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element always

2016-05-08 21:00:06 245

原创 快速排序算法

http://blog.csdn.net/morewindows/article/details/6684558整体思路 先把一个数组的第一个数作为基准 从数组尾向前找比基准小的数,找到后换位, 然后从数组头向后找比基准大的数,找到然后换位 最后的情况就是中间是基准,左边都是比它小的数,右边都是比它大的数然后再进行 分治法用作者的一句话就是 挖坑填数+分治法//快速排序void quic

2016-05-08 15:17:04 248

原创 217. Contains Duplicate

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is

2016-05-05 10:53:39 214

原创 171. Excel Sheet Column Number

Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example A -> 1 B -> 2 C -> 3 ... Z -> 26

2016-05-04 22:31:24 180

原创 242. Valid Anagram

Given two strings s and t, write a function to determine if t is an anagram of s. 看一个数是不是另一个数的anagram anagram :组成元素相同,但顺序不同For example, s = “anagram”, t = “nagaram”, return true. s = “rat”, t = “c

2016-05-04 22:10:20 226

原创 List

相较于 vector 的连续线性空间,List 就显得复杂很多,它的好处是每次插入或删除一个元素,就配置或释放一个元素空间。因此 list 对于空间的运用有绝对的精准。对于任何位置的元素插入或移除,永远是常数时间 list 的节点(node) list 本身和 list 的节点是不同的结构,需要分开设计以下是 STL list 的节点(node)结构//是一个双向链表template<cla

2016-05-04 21:28:40 425

原创 空间配置器allocator

先解决一个坑 allocator在源码剖析的第二章,便是讲的allocator,(第一次看的时候一脸蒙B)因为所有的STL的操作对象都存放在容器内,而容器一定要配置空间以置放资料,都要用到allocatorSGI标准的空间适配器 std::allocator下面的代码,只是把C++的:::operator new 和 ::operator delete 做一层薄薄的包装,SGI 从未使用过它,也

2016-05-04 11:45:35 271

原创 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思路1 为了最后能return修改后的链表,所以我们创建了一个总头dummy,来指向

2016-05-03 22:01:53 202

原创 237. Delete Node in a Linked List

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value 3, t

2016-05-03 21:27:37 217

原创 26. 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 another array, you must do this in place with cons

2016-05-03 10:53:02 196

原创 27. 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 pla

2016-05-02 22:59:51 180

原创 283. Move Zeroes

Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling your funct

2016-05-02 21:20:13 315

原创 226. Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia: This problem was inspired by this original tweet by Max Howell:Google: 90

2016-05-02 15:06:12 286

原创 vector

看完STL源码剖析也有2个月了吧,虽然看的时候明白了,但很快就忘了,Vector更是看过好几次了,但都没有记录下来。还是从开头开始吧,毕竟现在只是打地基,打地基,打地基~.~vector是个动态空间(array是静态空间)所以实现vector关键在于其对大小的控制以及重新配置时的数据移动效率对于扩充空间(不论大多),是“配置新空间/ 数据移动 / 释还旧空间”的大工程,时间成本很高,所以空间配

2016-05-02 13:46:59 506

原创 204. Count Primes

Description:Count the number of prime numbers less than a non-negative number, n.计算比N小的所有质数的个数这道题花了好多时间,数学真实博大精深 ·.·懵懂无知的我最开始是知道暴力求解是行不通的,然后发现第一种解法:把要除的所有比N小的数,变成了sqrt(n),直接少了一半,然后感慨了一番,结果。。。。这尽然是最最基

2016-05-01 23:25:15 353

空空如也

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

TA关注的人

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