Friday, June 13, 2014

BricKiller 1.0.6 is released



The Main Menu
Now, we have BricKiller 1.0.6 released. This new version brings new features that make you enjoy more on the game!

Go to App Store

In BricKiller,  User Interface of the game is enhanced. You'll have a new view of app icon, main menu and play boards.

You may find it is hard to bypass some of levels in World III, this version introduced 3 types of props that helps you to win the hard levels easily and more funny. 

The Prop Box
Now, we have three types of props: Eraser, Bomb and Exchanger. As you can see that in Props Box Dialog:

The prop ERASER means you can erase one brick by one eraser. When a brick is blocking your way, you can use it to erase the brick. However, you can not remove black bricks by using eraser.

The prop BOMB can eliminates bricks in one 3x3 area or at most 9 bricks at one time.  Bombs can not eliminate black bricks either. If the 3x3 area contains 2 black bricks and 5 colored bricks, only the 5 colored bricks can be removed.

The prop EXCHANGER is the most funny tool among the three. You can exchange the positions of two colored bricks by using an exchanger. No matter whether there other bricks block the two colored bricks to move or not. Or you can use exchanger to move one brick to another blank space without caring about other bricks blocking it. However, you cannot change the location of a black brick by using exchanger.


The power of Bomb
The Bomb is selected


How can you gain props? Every time you get 3 stars for a single level, you will get a prop. The type of the prop you will get is random.

Another new feature of BricKiller 1.0.6 is that the In-Store Purchase is added at settings screen after clicking the "Settings" Button in main menu. You can pay to remove Ads and buy more props for play. 

By the way, BricKiller has added five more levels in World I and 5 more levels in World III, go ahead to explorer them!

Monday, April 28, 2014

Use R to connect with HDFS and Hive

This document will provide some tips of R on how to connect Hive and HDFS with R. The RHive manual has a good document on how to do installation and initial setup for RHive before we start. In this document, I will provide more information on Hive and HDFS related stuff.

As we know the following command will connect HiveServerHost at port 10000 with HiverServer2:

> library(RHive)
> rhive.connect("HiveServerHost", 10000, hiveServer2)


If we give no arguments for rhive.connect, it will connect the Hive server with port number 10000 on local host:

> rhive.connect()

Then you can do query works on the Hive server by rhive.query(...), however, you need more power by using RHive, such as access HDFS and write a table onto it.

If you want to access a HDFS, you need to connect the name node of the HDFS first:

> rhive.hdfs.connect("hdfs://namenode:8020")

If above command doesn't work or not supported, add a dot(.) before the command, like:

> .rhive.hdfs.connect("hdfs://namenode:8020")


Next, we can try to create a 3-column table named "test" in Hive and save it in HDFS by using R: 

> L3 <- LETTERS[1:3]
> d <- data.frame(cbind(x=1, y=1:10), fac=sample(L3, 10, replace=TRUE))
> rhive.write.table(data=d, tableName="test")
[1] "test"


And show the content in table test:
> rhive.query("select * from test");
   x  y fac
1  1  1   B
2  1  2   A
3  1  3   A
4  1  4   B
5  1  5   B
6  1  6   A
7  1  7   C
8  1  8   A
9  1  9   B
10 1 10   A


You should check that there is a file located at /user/hive/warehouse/test/ in HDFS by the command:
> rhive.hdfs.ls("/user/hive/warehouse/test/")

Which means the content of the table has been saved to HDFS.

There are two good slides that you can refer on how to use RHive basic functions and functions related to HDFS:

RHive Basic Functions Tutorials
RHive HDFS Functions Tutorials

Thursday, April 24, 2014

BricKiller is Now Released!

Now my first iOS game BricKiller has been released! Go ahead to get it on iTunes Store:




Game Logo



Snapshot While Playing
It is a game to play with bricks within a board, you can move one brick from one place to another place at one time,  and get the bricks exploded away from the board by putting some of them in the same color in a horizon line, vertical line, or diagonal line. More bricks that you can kill from the play board, more space in the board can place bricks. Once the bricks fill up the board, game will be over.

It looks like gobang or  tictactoe at the first glance, but it is much interesting for various colorful bricks and funny roles to make you win the game. Every time you move the brick, you need to give the maximum chance that the bricks can make a line easily without blocking the move for other bricks.

BricKiller means killing the bricks as many as you can. The more bricks you kill, the more space you can reserve on the board, the less chance that the brick will block your way, and the more bricks in the same color you have to make in a line.


Main Menu
Every time if you move bricks without bricks killed, more bricks will show up, we call it a wave of bricks. The number of bricks that are shown up in one wave in each stage is different. That makes one part to make difficulty different from stage to stage.

BricKiller have two modes to play: the normal mode and the endless mode. In normal mode, each stage has an initial set of bricks(a colorful diagram) that is waiting you to solve. Normal mode also have 3 worlds of stages. Each world have different criteria to eliminate the bricks. World I requires 3 bricks with the same color in a line to eliminate bricks, and World II and World III require 4 bricks and 5 bricks respectively. Typically, the stages in World III is more difficult than World I and World II.

This game support Game Center, you can get rankings with your score in Endless Mode and compete with other guys all over the world.

This game provides 100+ levels, come and take challenge to unlock them!



Wednesday, March 26, 2014

BricKiller will be released!

My new game BricKiller will be released on April 20th, 2014 at Apple App Store. It contains 100+ levels and 2 modes for playing. Here are the snapshots of the game:

 
 

More information about the game will be available soon.

Monday, February 10, 2014

Get Oozie Job List Via Command Line

You may want to list oozie jobs which given criteria in command line. But it may not work good with the command oozie provided. For oozie version 2.0 or above, you may have option -jobtype combined with -filter for a list(refer to the link http://oozie.apache.org/docs/3.1.3-incubating/DG_CommandLineTool.html#Checking_the_Status_of_multiple_Coordinator_Jobs). However, for older versions, we need workarounds for this.

Luckily, we can get a list of oozie jobs by using curl via Ooize URLs in Oozie with older version. For example, the following command can give a list of workflow jobs:

$ curl http://localhost:11000/oozie/v1/jobs

(You can replace localhost above with any valid oozie node names)

Above command will give a JSON string within a line(this will be an extreme long line if there are dozens of jobs record) that record a list of workflow jobs. Due to pagination, this list could not be completed, you can specify the maximum number(suppose there shouldn't be more than 1000 workflows) of jobs listed:

$ curl 'http://localhost:11000/oozie/v1/jobs?len=1000'

(I just add single quote(') to prevent wild-casting of '?' in URL string)

Maybe we just only need Oozie workflow job IDs, use this command:

$ curl 'http://localhost:11000/oozie/v1/jobs?len=1000' | sed 's/id\[/\n/g; s/W\]/W\n/g' | grep "oozie-oozi-W$"

0006030-140210061306533-oozie-oozi-W
0006031-140210061306533-oozie-oozi-W
0006032-140210061306533-oozie-oozi-W
0006033-140210061306533-oozie-oozi-W
0006034-140210061306533-oozie-oozi-W
...


Then we can do something with the output by script conveniently, such as killing all workflows:

$ curl 'http://localhost:11000/oozie/v1/jobs?len=1000' | sed 's/id\[/\n/g; s/W\]/W\n/g' | grep "oozie-oozi-W$"  | while read job_id; do oozie job -kill $job_id; done

OK, you may want to get all RUNNING workflow job IDs, use filter=status%3DRUNNING:

$ curl 'http://localhost:11000/oozie/v1/jobs?len=1000&filter=status%3DRUNNING'
{"total":2, ...

So at the beginning of the output line, you will see how many workflow jobs are running. After that, the JSON string shows the detailed information of each job.

If you want to get other types of jobs, you can add jobtype= to URL, e.g, the following command will give the list of coordinator job IDs :

$ curl 'http://localhost:11000/oozie/v1/jobs?jobtype=coord&len=2000' | sed 's/id\[/\n/g; s/C]/C\n/g' | grep "oozie-oozi-C$"

(Just notice that the Coordinator job IDs end with 'C')