自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(42)
  • 资源 (2)
  • 收藏
  • 关注

原创 HBase API——封装成工具类Utils

前面介绍了HBase的常用API并给出了实例:HBase之Java API为了便于以后使用,把对HBase表的常见CRUD操作,封装在一个类HBaseUtil里面,实现为:import java.io.IOException;import java.util.HashMap;import org.apache.hadoop.hbase.HColumnDescriptor;import org.apache.hadoop.hbase.HTableDescriptor;import org.ap

2015-03-11 18:03:33 2708 1

原创 集群扩展:Hadoop环境搭建

hadoop安装步骤:系统需要安装的包 ssh,rpm,gcc,make yum -y install openssh-server openssh-clients检测ssh安装和rpm安装 a. ssh localhost b. yum install rpm 安装java a. 安装java-7 rpm -Uvh javab. 添加并配置新的jdk系统命令update-alt

2015-02-28 11:23:44 1035

原创 HDFS小文件合并问题的优化:copyMerge的改进

1.问题分析用fsck命令统计 查看HDFS上在某一天日志的大小,分块情况以及平均的块大小,即分析问题的存在性:从表中可以看出,每天日志量的分块情况:总共大概有268左右的块数,平均块大小为36MB左右,远远不足128MB,这潜在的说明了一个问题。日志产生了很多小文件,大多数都不足128M,严重影响集群的扩展性和性能:首先,在HDFS中,任何block,文件或者目录在内存中均以对象的形式存储,每个对象约占150byte,如果有1000 0000个小文件,每个文件占用一个block,则namenode大

2015-01-13 18:48:26 7070

翻译 译 Programming with typesafe enums and annotations in Java 5

Annotations——Java注解 你可能会遇到这种需求:通过与元数据(描述其他数据的数据)关联来注解你Java应用程序。一直以来,Java通过transient关键字提供了一种即时注解(ad hoc annotation)机制,这允许你标识一个成员变量在序列化过程中应该被忽略。但是,直到java5才正式地引入了一种标准方式去注解程序。Java5平台提供了下面四种注解机制:1. 声明注解类型:@interface;2. 元注解类型:可以识别应用于注解类型的程序元素和注解的生命周期(注解类型的

2014-12-05 10:28:50 1473

原创 VisuAlgo 学习笔记:Bitmask

原资源链接为:Bitmark其中各个模块代表的含义:- Set S: 初始值s- Set bit(j): s or 第j位- Check bit(j):s and 第j位- Toggle bit(j):s xor 第j位(相同的bit为0,不同则为1)- Clear bit(j位不为1): and 运算- Least

2014-12-04 17:26:32 4310 2

原创 LeetCode Solutions : Sort List

【算法思路】时间复杂度限制在O(n log n),我们可以第一时间想到常用的二路归并排序,快速排序和堆排序,其中快排和堆排只适用于线性表,即数组,故这道编程题毫无疑问用二路归并排序;【编程步骤】 * 1. 利用一个小技巧,可以设置慢行指针low和快行指针fast,把链表分成两部分来操作,即first和second链表 * 2. 递归排序first和second链表,即 first=sortList(head); second=sortList(second); * 3. 合并这两个链表,即:

2014-11-18 09:18:20 1580 1

原创 LeetCode Solutions : Reorder List

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder itto {1,4,2,3}.Considering the following steps: * 1. split such list

2014-11-17 10:01:06 1049

转载 微博广告推荐中有关Hadoop的那些事

一、背景       微博,一个DAU上亿、每日发博量几千万的社交性产品,拥有庞大的数据集。如何高效得从如此规模的数据集中挖掘出有价值的信息,以增强用户粘性,提高信息传播速度,就成了重中之重。因此,我们引入了hadoop 分布式计算平台,对用户数据和内容数据进行分析和挖掘,作为广告推荐的基础。 二、问题及解决方案       在hadoop平台上进行开发时,主要遇到

2015-04-28 09:18:10 616

转载 MapReduce原理与设计思想

一个有趣的例子你想数出一摞牌中有多少张黑桃。直观方式是一张一张检查并且数出有多少张是黑桃?MapReduce方法则是:给在座的所有玩家中分配这摞牌让每个玩家数自己手中的牌有几张是黑桃,然后把这个数目汇报给你你把所有玩家告诉你的数字加起来,得到最后的结论拆分MapReduce合并了两种经典函数:映射(Mapping)对集合里的每个目标应用同一个

2015-03-12 20:07:35 665 1

转载 JVM必备指南

简介Java虚拟机(JVM)是Java应用的运行环境,从一般意义上来讲,JVM是通过规范来定义的一个虚拟的计算机,被设计用来解释执行从Java源码编译而来的字节码。更通俗地说,JVM是指对这个规范的具体实现。这种实现基于严格的指令集和全面的内存模型。另外,JVM也通常被形容为对软件运行时环境的实现。通常JVM实现主要指的是HotSpot。JVM规范保证任何的实现都能够以同样的方式解

2015-03-12 16:30:54 508

原创 搭建Dev Box for Mac OS X:Java环境搭建和IntelliJ IDEA安装

Java安装安装新版的Java 1.7从下列网站下载 Mac OS X 版本的JDK,文件名是jdk-7u51-macosx-x64.dmg:http://www.oracle.com/technetwork/java/javase/downloads/index.html即:sibyl-lvdeMacBook-Pro:~ sibyl_lv$ whereis java/usr/bin/javasibyl-lvdeMacBook-Pro:~ sibyl_lv$ java -version

2015-03-10 16:32:52 2953

转载 Hbase配置项粗解

Hbase配置项粗解(1)重读hbase文档,把所有的配置项整理一遍。hbase.tmp.dir:本地文件系统的临时目录,默认是java.io.tmpdir/hbase−{user.name};hbase.rootdir:hbase持久化的目录,被所有regionserver共享,默认${hbase.tmp.dir}/hbase,一般设置为hdfs://namenode.example.org:90

2015-03-07 20:28:56 1661

原创 Maven入门:安装使用以及基本操作

这里详细地介绍下Maven入门及基本使用操作,演示如下:下载maven: http://maven.apache.org/新建项目Maven Project,Group Id为组织名称,Artifact Id为maven项目名称,version为版本阶段,当前0.0.1为测试阶段 点完成 Build Project: 编译项目: 打成jar包 当我们键入未知的类名,无法通过ctrl+shift+

2015-02-27 09:35:42 985

原创 LeetCode Solutions : Find Minimum in Rotated Sorted Array

【算法思路】利用折半查找的思路去查找这个最小元素【编程步骤】 * 1. 如果数组num只有一个元素,则所求的最小的元素就是它了; * 2. 若left到right位置的元素严格递增,则最小的元素为num[left],如左图否则,如右图,利用折半查找,若left到mid递增有序,则最小元素必出现在右边部分:mid+1到right;若mid到right递增有序,则最小元素出现在左边部分:left到mid;while(left<right){ if(num[left]<num

2015-01-07 15:35:18 873

原创 数据结构:可以用求最短路径的方法思想求最长路径么?给出详细解答。。

数据结构:可以用求最短路径的方法思想求最长路径么?为什么呢?这里求解最短路径的通用方法有Dijkstra算法和Floyd-Warshall算法,Dijkstra算法不允许边的权值为负,也不允许有回路,而Floyd-Warshall算法可以允许边的权值为负,但不允许负值边构成回路,即可以求解有回路的图它们都有局限,这两种算法的思想可以用来求最长路径么??为什么 不可以?以下给出详细解答:1) 不可以,核心在于最短路问题是有最优子结构的,就是『最短路的子路径还是最短路』,而最长路径不存在这

2015-01-03 17:43:42 3202 1

转载 HBase之Java API

【题目描述】Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5

2014-11-21 09:04:49 688

原创 LeetCode Solutions : Remove Duplicates from Sorted List II

【编程步骤】 * 1. 处理特殊情况:如果该链表为空或只有一个结点,说明此链表没有重复的元素,直接返回头指针head;即:if(head==null||head.next==null) return head; * 2. 设置伪头结点;即:ListNode pre=new ListNode(0); pre.next=head; head=pre; * 3. 令cur=pre.next,若不存在复本,cur依然为pre

2014-11-21 09:03:39 731

原创 LeetCode Solutions : Remove Duplicates from Sorted List

【题目描述】Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.【编程步骤】 * 1. 处理特殊情况:如果该链表为空或只有一个结点,说明此链表没有重复的元素,直接返回头指针head;即:if(head==null||

2014-11-19 19:10:08 595

原创 LeetCode Solutions : Remove Nth Node From End of List

【算法思路】这道题的关键在于找倒数第n个结点的前驱结点:可以设置慢行指针slow和快行指针fast,让快行指针fast先走n步,然后同步地移动慢行指针slow和快行指针fast,这样它们之间的距离永远相差n个结点,当fast指针移动最后一个结点的时候,slow指向倒数第n个结点;【编程步骤】 * 1. 处理特殊情况:如果被移除的结点为头结点,则移除,并返回第二个结点作为头结点; * 2. 如果为其他情况,则找到倒数第n个结点的前驱结点 pre; * 3. 移除倒数第n个结点,即 pre.next=s

2014-11-18 18:29:55 618

原创 LeetCode Solutions : 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. Y

2014-11-14 11:41:19 1076

原创 LeetCode Solutions : 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./** * Definition for singly-link

2014-11-13 19:17:17 857

原创 LeetCode Solutions : Path Sum I & II

Path SumGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary

2014-09-15 16:23:30 982

原创 LeetCode Solutions : Unique Paths I & II

Unique Paths A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is t

2014-09-11 17:30:19 872

原创 LeetCode Solutions : 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./** * Definition for singly-link

2014-09-03 18:54:30 768

原创 LeetCode Solutions : Combination Sum I & II

Combination Sum Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen fro

2014-09-02 17:09:15 859

原创 LeetCode Solutions : Remove Duplicates from Sorted List I & II

Remove Duplicates from Sorted List Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, r

2014-09-01 17:18:42 745

原创 LeetCode Solutions : Remove Duplicates from Sorted Array I & II

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

2014-08-27 18:25:01 662

原创 JQuery Study Notes— A small demo for Smooth Animated Menu

1. Before expanding:2.  coding: Smooth Animated Menu body { background-color: #F3F3F3; font-family: "Lucida Grande", arial, sans-serif;

2014-08-27 14:20:14 763

原创 LeetCode Solutions : Search in Rotated Sorted Array II

Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a function to determine if a given target is in the

2014-08-26 17:11:28 1091

原创 LeetCode Solutions : N-Queens II

Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.Java Solutions( Refer to blog  http://blog.csdn.net/mbh_199

2014-08-25 17:43:51 871

原创 LeetCode Solutions : 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.

2014-08-25 17:19:11 823

原创 JQuery Study Notes— A small demo for unfolding its content

1. Before unfolding:2. After unfolding:3. coding: Home .parent { width: 500px; color: white; } .label { width: 500

2014-08-25 14:40:47 569

原创 SharePoint2013 Study Notes— How to Create a Event Receiver and Add Feature Event Receivers

In the followingprocedure, you’ll expand this project by adding a simple event handler (anevent receiver) to a list instance to show how to handle events that occur inSharePoint items such as lists.

2014-08-21 15:34:52 1115

原创 LeetCode Solutions : Search in Rotated Sorted Array

Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array return

2014-08-18 15:06:00 734

原创 LeetCode Solutions : Search for a Range

Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not fo

2014-08-15 14:05:15 523

原创 LeetCode Solutions : Sqrt(x)

Implement int sqrt(int x).Compute and return the square root of x.Java Solutions:public class Solution { public int sqrt(int x) { if(x<0) return -1; long high=x/2+1; l

2014-08-14 16:48:19 630

原创 LeetCode Solutions : 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

2014-08-13 15:41:30 535

原创 LeetCode Solutions : 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-08-12 16:23:48 521

原创 CSS Study Notes— Selectors for Class/Div/Attribute

1.The [attribute] selector is used to select elements with the specified attribute.2.The [attribute=value] selector is used to select elements with the specified attribute and value.

2014-08-12 15:21:02 568

原创 LeetCode Solutions : Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right

2014-08-11 13:55:04 626

学籍信息管理系统(附源码、数据库文件、设计文档)

附源码、数据库文件、设计文档、需求分析、MVC模式解读,WEB动态网站开发;HTML语言;CSS样式;JAVASCRIPT脚本语言;XML脚本技术;MySql数据库;Servlet 、JSP技术;JAVA后台处理;Tomcat服务器;JavaBean等技术的相关应用

2014-01-14

空空如也

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

TA关注的人

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