今天的风儿甚是喧嚣 JiaoPan 
  • 主页
  • 归档
  • 分类
  • 标签
  •     
leetcode(2) Reverse Integer

leetcode(2) Reverse Integer

difficult:easy #728Given a 32-bit signed integer, reverse digits of an integer.Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 Note:Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−$2^{31}$ , $2^{31}$ − 1]. For the purpose of this problem, assume that your function returns 0 when the reversed integer overflows. 解法int reverse(int x) { int result = 0; while (x != 0 )
 2018-07-06   leetcode    leetcode 
leetcode(1) Two-Sum

leetcode(1) Two-Sum

difficult:easy #1Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same element twice.Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. 解法1 暴力法时间复杂度 O(n^2) std::vector<int> sum::twoSum(std::vector<int>& nums, int target){ std::vector<int> result; for (int i = 0; i < nu
 2018-07-06   leetcode    leetcode 
Docker指南

Docker指南

Docker简介问题引入:当我们在本机开发好应用程序以后需要发布到服务器,但是服务器并非和我们本机系统有着一样的运行环境,如缺少数据库、缺少各种依赖包、依赖软件版本过低等等问题,需要花很长时间重新在服务器配置好运行环境,得不偿失.那么有没有方法能够将我们开发程序时本机上所有的运行环境打包,直接部署到服务器上程序就能运行的机制呢? Docker 让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,Docker是一个开源的应用容器引擎,基于Go语言,并遵从Apache2.0协议开源.容器是完全使用沙箱机制,相互之间不会有任何接口(类似iPhone的 app),更重要的是容器性能开销极低.[来源网络] 通过上述定义可以知道,Docker似乎类似于虚拟机,可以在Docker中打包安装任何应用并运行,比如tomcat、Java、mysql等.但它并不等同于虚拟机,为了区分Docker和虚拟机,我们先来了解虚拟机的运行机制,如下图所示: 基础设施(Infrastructure):个人电脑,数据中心的服务器,或者是云主机 操作系统(Host
 2018-06-13   docker    docker 
opencv3(1-2) linux配置opencv3开发环境

opencv3(1-2) linux配置opencv3开发环境

环境ubuntucmakecmake-guiopencv-3.3.1 下载地址:https://opencv.org/releases.htmlopencv_contrib-3.3.1 下载地址:https://github.com/opencv/opencv_contrib/releases 准备工作 更新系统sudo apt-get update sudo apt-get upgrade 安装cmake及必要依赖sudo apt-get install build-essential sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev 安装cmake-guisudo a
 2018-03-11   opencv3    opencv3 
1…567

検索

Hexo Fluid
 总访问量 次   总访客数 人