自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

uj_mosquito的专栏

菜鸟一枚

  • 博客(115)
  • 资源 (6)
  • 收藏
  • 关注

原创 shell编程小tip(陆续更新)

1、运算e.g. ((data=$data/10))和data=`expr $data /10`的区别有的时候取出来的数data=08而不是8,,这时候用第一种就会出语法错误-bash: ((: data=08: value too great for base (error token is "08")这是就只能用第二种data=`expr $data / 10`

2015-03-10 12:24:49 544

原创 Sum Root to Leaf Numbers

Given 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 tota

2015-02-04 17:44:12 585

原创 4Sum

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Element

2015-02-04 17:14:13 601

原创 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 would have exact

2015-02-04 16:11:00 606

原创 3Sum

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:Elements in a triplet (a,b,c

2015-02-04 12:59:21 608

原创 Construct Binary Tree from Inorder and Postorder Traversal

Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.#include#includetypedef struct TreeNode { int v

2015-01-30 17:57:45 561

原创 Path Sum II

Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5 / \

2015-01-30 15:32:53 598

原创 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 6The flattened tree should look like: 1

2015-01-30 14:44:42 446

原创 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 as the lowest possible

2015-01-30 13:57:00 448

原创 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 diffe

2015-01-30 11:25:48 620

原创 Integer to Roman

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.string intToRoman(int num) { int numarr[] = {1, 4, 5, 9, 10, 40, 50, 90, 100, 400,

2015-01-29 15:39:25 535

原创 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, and there exists one unique longest palindromic substring.#include#includ

2015-01-27 13:57:31 495

原创 Gas Station

There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to

2015-01-23 18:12:10 506

原创 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.#include#includetypedef struct TreeNode { int val

2015-01-23 15:49:44 415

原创 Partition List

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each of

2015-01-21 17:55:54 554

原创 Permutations

Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].C++:class S

2015-01-20 11:48:28 490

原创 Pow(x, n)

Pow(x, n) Total Accepted: 35792 Total Submissions: 135252My SubmissionsQuestion Solution Implement pow(x, n).#includedouble ipow(double x, int n) { if(n == 0) r

2015-01-20 10:19:39 536

原创 N-Queens II

Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.class Solution {public:void print(int queue[], int n, vector> &

2015-01-19 18:50:58 460

原创 N-Queens

The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens puzzle.

2015-01-19 18:23:44 402

原创 Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.#include#include#includechar *mul

2015-01-14 20:03:16 399

原创 堆排序

#includevoid AdjustHeap(int A[], int i, int n) { int j, tmp, tmpid; for( ; i * 2 + 1 < n; i++) { if(i * 2 + 2 >= n) { tmp = A[i * 2 + 1]; tmpid = i * 2 + 1;

2015-01-14 17:14:11 475

原创 Sort List

Sort a linked list in O(n log n) time using constant space complexity.#include#includetypedef struct ListNode{ int val; struct ListNode *next;}ListNode;ListNode *mergesort(ListNode *

2015-01-13 17:13:13 437

原创 sort

#include//bubble sortvoid BubbleSort(int A[], int n) { int i, j, tmp, flag = 1; j = n - 1; while (flag) { flag = 0; for (i = 0; i < j; i++) { if (A[i] > A[i

2015-01-07 20:52:15 578

原创 Best Time to Buy and Sell Stock III

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at most two transactions.Note:You may

2015-01-04 16:04:10 606

原创 Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on

2015-01-04 15:06:35 377

原创 Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),

2015-01-04 13:54:57 444

原创 Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin

2014-12-31 18:01:04 434

原创 Add Two Numbers

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link

2014-12-31 10:18:59 495

原创 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

2014-12-30 09:54:56 546

原创 Excel Sheet Column Title

Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB 注:包含了171E

2014-12-29 16:07:49 565

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

2014-12-29 15:02:58 365

原创 Single Number II

Given an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without usi

2014-12-29 11:35:08 332

原创 Evaluate Reverse Polish Notation

Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1",

2014-12-26 11:15:58 448

原创 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".click to show clarification.Clarification:What constitutes

2014-12-26 10:28:14 701

原创 apt-get Unable to fetch some archives的解决方法

报错:E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/libc6-dev_2.19-10ubuntu2.2_amd64.deb  Could not resolve 'archive.ubuntu.com'E: Failed to fetch http://archive.ubuntu.co

2014-12-25 17:01:14 18202 3

原创 CephFS环境搭建(二)

《CephFS环境搭建(一)》介绍了如何简单搭建一个单Mon,MDS的Cephfs并导出使用,这里深入一步建立三个池,SSD和SATA分开存放在不同的池,建立多Mon,多MDS,结合纠删码,cache分层,建立一个比较健全的cephfs。

2014-12-25 13:58:19 3954 1

原创 Maximum Product Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguous subarray [2,3] has the larges

2014-12-25 13:19:29 457

原创 常用的shell命令(陆续更新)

1、获取管道前面的返回值 echo ${PIPESTATUS[0]}e.g.root@node2:~# date1 | echo 22No command 'date1' found, did you mean: Command 'date' from package 'coreutils' (main)date1: command not foundroot@node2

2014-12-24 14:28:09 977

原创 Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [

2014-12-22 19:04:54 389

原创 Single Number

Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ext

2014-12-19 17:13:34 505

apache-tomcat-6.0.18.exe

Apache Tomcat is an implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process

2012-01-09

Migrating Enterprise Storage Applications to the Cloud

Cloud computing has emerged as a model for hosting computing infrastructure and outsourcing management of that infrastructure. It offers the promise of simplified provisioning and management, lower costs, and access to resources that scale up and down with demand. Cloud computing has seen growing use for Web site hosting, large batch processing jobs, and similar tasks. Despite potential advantages, however, cloud computing is not much used for enterprise applications such as backup, shared file systems, and other internal systems. Many challenges need to be overcome to make cloud suitable for these applications, among them cost, performance, security, and interface mismatch.

2012-01-09

Configure选项简介

'configure'脚本有大量的命令行选项.对不同的软件包来说,这些选项可能会有变化,但是许多基本的选项是不会改变的.带上'--help'选项执行'configure'脚本可以看到可用的所有选项.尽管许多选项是很少用到的,但是当你为了特殊的需求而configure一个包时,知道他们的存在是很有益处的.下面对每一个选项进行简略的介绍:

2011-12-28

Jquery 15 天教程

为什么我改变我我对 jQuery 的看法,以及为什么你要考虑去使用它? 很简单, 只要你看一眼过使用 jQuery 的页面你就会发现它是如此的简单易用.只用很少 的几行,就能表现出很优雅的效果. 有一天当我突然看到一些用 jQuery 写的代 码时我一下子豁然开朗了. 早茶的过程中,我例行公务的去翻阅我的订阅,去看 每日必看的设计博客的时候我看到了一个用 jQuery 写的 javascript 的例子.事 实证明,这些代 码还是有些和浏览器关联的 bug,不过这些概念还是我以前从来 没有见过的.

2011-12-14

分布式网络存储Distributed File Systems--Concepts and Examples.PDF

The purpose of a distributed file system (DFS) is to allow users of physically distributed computers to share data and storage resources by using a common file system. A typical configuration for a DFS is a collection of workstations and mainframes connected by a local area network (LAN). A DFS is implemented as part of the operating system of each of the connected computers. This paper establishes a viewpoint that emphasizes the dispersed structure and decentralization of both data and control in the design of such systems. It defines the concepts of transparency, fault tolerance, and scalability and discusses them in the context of DFSs. The paper claims that the principle of distributed operation is fundamental for a fault tolerant and scalable DFS design. It also presents alternatives for the semantics of sharing and methods for providing access to remote files. A survey of contemporary UNIX@-based systems, namely, UNIX United, Locus, Sprite, Sun’s Network File System, and ITC’s Andrew, illustrates the concepts and demonstrates various implementations and design alternatives. Based on the assessment of these systems, the paper makes the point that a departure from the approach of extending centralized file systems over a communication network is necessary to accomplish sound distributed file system design. Categories and Subject Descriptors: C

2010-04-12

嵌入式系统linux下触摸屏实验报告

嵌入式实验报告,内容是在linux下完成触摸式手机的功能触摸屏工作原理、ADS7843模/数转换芯片

2009-08-29

空空如也

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

TA关注的人

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