自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Rock's IT Blog

This is a blog of information and communication technology.

  • 博客(48)
  • 收藏
  • 关注

转载 All SQL-on-Hadoop Solutions are missing the point of Hadoop

All SQL-on-Hadoop Solutions are missing the point of HadoopPosted on October 28, 2013 at 2:52 pm.Written by Daniel AbadiFor several years, Hadapt and Hive were the only SQL-on-Hadoop sol

2015-01-04 00:34:06 746

转载 Classifying the SQL-on-Hadoop Solutions

Classifying the SQL-on-Hadoop SolutionsPosted on October 2, 2013 at 10:00 am.Written by Daniel AbadiAlmost a year and a half ago on this blog, I went on something that is probably best des

2015-01-04 00:32:05 1229

转载 Classifying Today’s “Big Data Innovators”

Classifying Today’s “Big Data Innovators”Posted on December 21, 2012 at 9:57 am.Written by Daniel AbadiLast week, InformationWeek published a piece, authored by Doug Henschen, that liste

2015-01-04 00:29:46 646

转载 Why Database-to-Hadoop Connectors are Fundamentally Flawed and Entirely Unnecessary

Why Database-to-Hadoop Connectors are Fundamentally Flawed and Entirely UnnecessaryPosted on July 24, 2012 at 10:53 pm.Written by Daniel AbadiThe PastBefore Hadoop, the Big Data market

2015-01-04 00:23:41 687

原创 C++ Singleton + MultiThread

#include #include using namespace std;template class Singleton {public: static T *instance() { if (object == NULL) { mtx.lock(); if (object == NULL) object = new T; mtx.unlock(); }

2014-10-17 23:41:14 908

原创 C++ Singleton

Singleton in C++:#include using namespace std;class Restaurant {public: static Restaurant *getInstance() { if (instance == NULL) instance = new Restaurant(100); return instance; } int get

2014-09-28 01:42:42 1151 2

转载 Static member functions in C++

In the previous lesson on static member variables, you learned that classes can have member variables that are shared across all objects of that class type. However, what if our static member variab

2014-09-28 01:35:31 688

转载 Static member variables in C++

Static keyword in CIn the lesson on file scope and the static keyword, you learned that static variables keep their values and are not destroyed even after they go out of scope. For example:

2014-09-28 01:20:30 1160

原创 Enumerate Combination C(k, n) in a bitset

Suppose n#include #include #include using namespace std;bitset getComb(const vector &comb) { bitset bitcombs; for (int i=0; i<comb.size(); ++i) bitcombs.set(comb[i], true); return bitcombs

2014-08-01 07:21:45 948

原创 Iterative (non-recursive) Quick Sort

An iterative way of writing quick sort:#include #include #include using namespace std;void quickSort(int A[], int n) { stack> stk; stk.push(make_pair(0, n-1)); while (!stk.empty()) { pair

2014-05-30 15:46:15 1200

原创 Iterative (non-recursive) Merge Sort

An iterative way of writing merge sort:#include using namespace std;void merge(int A[], int l, int r, int e, int B[]) { int i = l, j = r, k = l; while (i<r && j<e) { if (A[i] > A[j]) B[k++] =

2014-05-29 21:52:15 1545

原创 Counting Inversion Pairs in an Array

Given an array, for example, 246135, an inversion pair is the pair whose first value is larger than its second value according to the sequence from left to right, (2,1) (4,1) (4,3) (6,1) (6,3) (6,5).

2014-05-11 23:44:22 1238

原创 Solving Greatest Common Divisor

Two ways of solving greatest common divisor: recursion and iteration.#include using namespace std;int maxCommonDivisor1(int a, int b) { int n = max(a, b), d = min(a, b), m = n % d; return (m==0

2014-05-11 20:19:56 750

转载 Big Data Analytics Beyond Hadoop

1. IntroductionGoogle’s seminal paper on Map-Reduce [1] was the trigger that led to lot of developments in the big data space. Though the Map-Reduce paradigm was known in functional programming li

2014-04-15 22:32:08 1938

转载 Plain Explanation of "memory_order"

memory_order_acquire: guarantees that subsequent loads are not moved before the current load or any preceding loads.memory_order_release: preceding stores are not moved past the current store or any s

2014-03-28 23:39:57 881

转载 C++11 Synchronization Benchmark

In the previous parts of this series, we saw some C++11 Synchronization techniques: locks, lock guards and atomic references.In this small post, I will present the results of a little benchmark I

2014-03-27 09:15:44 829

转载 C++11 Concurrency Tutorial – Part 4: Atomic Types

In the previous article, we saw advanced techniques about mutexes. In this post, we will continue to work on mutexes with more advanced techniques. We will also study another concurrency technique of

2014-03-27 08:33:07 1038

转载 C++11 Concurrency Tutorial – Part 3: Advanced locking and condition variables

In the previous article, we saw how to use mutexes to fix concurrency problems. In this post, we will continue to work on mutexes with more advanced techniques. We will also study another concurrency

2014-03-26 15:20:27 1088

转载 C++11 Concurrency Tutorial – Part 2 : Protect shared data

In the previous article, we saw how to start threads to execute some code in parallel. All the code executed in the threads were independant. In the general case, you often use shared objects between

2014-03-26 13:19:56 742

转载 C++11 range-based for loops

In the first article introducing C++11 I mentioned that C++11 will bring some nice usability improvements to the language. What I mean is that it removes unnecessary typing and other barriers to get

2014-03-26 12:08:31 1538

转载 C++11 Concurrency – Part 1 : Start Threads

C++11 introduced a new thread library. This library includes utilities for starting and managing threads. It also contains utilities for synchronization like mutexes and other locks, atomic variables

2014-03-26 09:08:23 670

转载 #undef的用处

如果你想定义这个宏那就#define X如果你不想让你已经#define X的宏在其他其他地方由于引入了这个包含宏的.h文件而引起一些编译问题,那你就#undef X掉,就这么简单。举个简单的例子。有1.c,11.h,12.h三个文件其中在11.h中定义了#define X externx int a;而在12.h中你又定义了#define X intx b;而在1

2014-03-25 23:04:55 756

原创 Longest Common Substring

Longest Common Substring (notsubsequence, for thesubsequence solution, please find answers in the book >) is to find (one of) the longest common substring in two strings. It is short for LCS in

2014-03-21 15:06:53 2325

转载 C++四种强制类型转换运算符

C++有四种强制类型转换符,分别是dynamic_cast,const_cast,static_cast,reinterpret_cast。其中dynamic_cast与运行时类型转换密切相关,在这里我们先介绍dynamic_cast,其他三种在后面介绍。1、dynamic_cast运算符    该转换符用于将一个指向派生类的基类指针或引用转换为派生

2014-03-20 00:19:11 9908 2

原创 Longest Palindromic Subsequence

Longest Palindromic Subsequence (not substring, for the substring solution, please find answers in myGitHub) is to find (one of) the longest palindromic subsequence in a string. It is short for LP

2014-03-19 17:06:51 1398

转载 Manacher's algorithm for finding longest palindromic substring

Given a string S, find the longest palindromic substring in S.An O(N) Solution (Manacher’s Algorithm):First, we transform the input string, S, to another string T by inserting a special charac

2014-03-18 20:54:31 1004

原创 Several notes on Redis

These notes on Redis are based on its beta version. One could seeits source code on my GitHub, where I havetidied the original codes in order to make the codes more easily readable withonly around 3

2014-03-15 12:46:02 911

原创 Big-endian and little-endian

Big-endian is used in the network transmission, while Little-endian is popular in x-86 systems. Two pictures follow.Possible advantages for using differnt policies:Big-endian: good for transmi

2014-03-02 23:39:08 924

转载 非阻塞IO和阻塞IO

非阻塞IO 和阻塞IO:       在网络编程中对于一个网络句柄会遇到阻塞IO 和非阻塞IO 的概念, 这里对于这两种socket 先做一下说明:       基本概念:              阻塞IO::                     socket 的阻塞模式意味着必须要做完IO 操作(包括错误)才会

2014-03-02 20:17:59 527

转载 基于Linux下的TCP编程

基于Linux的TCP网络编程一.Linux下TCP编程框架TCP网络编程的流程包含服务器和客户端两种模式。服务器模式创建一个服务程序,等待客户端用户的连接,接收到用户的连接请求后,根据用户的请求进行处理;客户端模式则根据目的服务器的地址和端口进行连接,向服务器发送请求并对服务器的响应进行数据处理。1.服务器端程序包括Ø  建立套接字(

2014-03-02 16:48:39 750

原创 A simple implementation of string split in C++

Since string's split function is not naturally provided in C++, we must implement it by ourselves. Here is a simple implementation of split based on strtok.vector split(const string &str, const

2014-02-24 13:35:38 977

原创 Setting shared (dynamic) library in Eclipse C++ in Linux

1. Build shared library project from Eclipse.2. Create header (hello.h) and source (hello.cc) file. Build them to create the shared library.codes of hello.h#ifndef HELLO_H_#de

2014-02-15 13:12:16 1599

原创 Setting static library in Eclipse C++ in Linux

1. Build static library project from Eclipse.2. Create header (hello.h) and source (hello.cc) file.codes of hello.h#ifndef HELLO_H_#define HELLO_H_void output();#endif /* HEL

2014-02-15 12:00:04 1854

原创 Code analysis of Hadoop v0.1.0 (2) conf package

conf package is about the configuration set about the whole system. Below is the annotation in configuration.java./** Provides access to configuration parameters.  Configurations are specified

2013-09-15 22:57:55 636

原创 Code analysis of Hadoop v0.1.0 (1) Setting up the environment

This document is to analyze the code in the Hadoop v0.1.0, which is the first version of Hadoop with more than 20000 code lines. The IDE environment is Eclipse on the  Ubuntu10.04 platform.

2013-09-15 12:25:09 630

原创 Difference between time_t and clock_t

The example:#include using namespace std;int main(){ time_t time_start, time_end; time(&time_start); sleep(5); time(&time_end); cout<<difftime(time_end, time_start)<<endl; // 5 clo

2012-03-21 10:11:17 466

原创 Understanding of extern "C"

In this example, there are two files, namely f1.c and test.cc.f1.cvoid f1(){ return;}test.ccextern "C" { extern void f1();}int main(){ f1(); return 0;}Compiler will compil

2012-01-01 18:08:39 330

原创 Two ways using global objects in C++

1.Through includeGlobe.h#ifndef GLOBE_H_#define GLOBE_H_int g = 0;#endif /* GLOBE_H_ */A.h#ifndef A_H_#define A_H_#include "Globe.h" // through includeclass A {public: A() { g =

2011-12-20 21:55:29 408

原创 M-Tree for Similarity Search

My current area of research is similarity search. Just like the normal search process, we need several data structures to make the similarity search effectively and efficiently, which should support t

2011-12-18 21:41:32 1116

原创 Convert skills in C++, including int, double, float, bool with string

#include // must#include using namespace std;int main(){ stringstream ss; /************ int->string ************/ int i = 12; string str; ss << i; ss >> str; cout << str << endl; /*****

2011-12-14 22:20:17 521

空空如也

空空如也

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

TA关注的人

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