Tutorial by Examples

If you want to connect to an HBase server, first you need to make sure that the IP of the server is in your /etc/hosts file for example add the line 255.255.255.255 hbase Then you can use the Java API to connect to zookeeper, you only have to specify the client port and the zookeeper address ...
In HBase, data are stored in tables with columns. Columns are regrouped in column families, which can be for example "personal" or "professional", each of these containing specific informations. To create a table, you need to use the Admin Object, create it using : Admin admin ...
In HBase, you can use 4 types of operations Get : retrieves a row Put : inserts one or more row(s) Delete : delete a row Scan : retrieves several rows If you simply want to retrieve a row, given its row_key you can use the Get object: Get get = new Get(Bytes.toBytes("my_row_key")...
Basically, the Scan object retrieves all the rows from the table, but what if you want to retrieve only the rows where the value of a given column is equal to something ? Let me introduce you the Filters, they work like the WHERE in SQL. Before starting using the filters, if you know how your row_k...
There are two ways to define an anonymous function: the full syntax and a shorthand. Full Anonymous Function Syntax (fn [x y] (+ x y)) This expression evaluates to a function. Any syntax you can use with a function defined with defn (&, argument destructuring, etc.), you can also do with wi...
(defn print-some-items [[a b :as xs]] (println a) (println b) (println xs)) (print-some-items [2 3]) This example prints the output 2 3 [2 3] The argument is destructured and the items 2 and 3 are assigned to the symbols a and b. The original argument, the entire vector [2 ...
In the node JS command prompt, inside your loopback project, type the following command to create a new model. slc loopback:model If you have installed LoopBack CLI tool, you can create model with: lb model The command prompt will request informations about the model to create. In this examp...
Once you are done with a worker you should terminate it. This helps to free up resources for other applications on the user’s computer. Main Thread: // Terminate a worker from your application. worker.terminate(); Note: The terminate method is not available for service workers. It will be term...
Click Right Mouse on Database you want to migrate then -> Tasks -> Generate Scripts... Wizard will open click Next then chose objects you want to migrate and click Next again, then click Advanced scroll a bit down and in Types of data to script choose Schema and data (unless you want ...
console.dir(object) displays an interactive list of the properties of the specified JavaScript object. The output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects. var myObject = { "foo":{ "bar":"d...
VBA supports 2 calendars : Gregorian and Hijri The Calendar property is used to modify or display the current calendar. The 2 values for the Calendar are: ValueConstantDescription0vbCalGregGregorian calendar (default)1vbCalHijriHijri calendar Example Sub CalendarExample() 'Cache the curren...
Retrieve System DateTime VBA supports 3 built-in functions to retrieve the date and/or time from the system's clock. FunctionReturn TypeReturn ValueNowDateReturns the current date and timeDateDateReturns the date portion of the current date and timeTimeDateReturns the time portion of the current d...
These functions take a Variant that can be cast to a Date as a parameter and return an Integer representing a portion of a date or time. If the parameter can not be cast to a Date, it will result in a run-time error 13: Type mismatch. FunctionDescriptionReturned valueYear()Returns the year portion ...
DateDiff() DateDiff() returns a Long representing the number of time intervals between two specified dates. Syntax DateDiff ( interval, date1, date2 [, firstdayofweek] [, firstweekofyear] ) interval can be any of the intervals defined in the DatePart() function date1 and date2 are the two ...
CDate() CDate() converts something from any datatype to a Date datatype Sub CDateExamples() Dim sample As Date ' Converts a String representing a date and time to a Date sample = CDate("September 11, 2001 12:34") Debug.Print Format$(sample, "yyyy-mm-dd hh:nn:...
How To Install ANTLR in Eclipse (Last tested on Indigo and ANTLR IDE 2.1.2) Install Eclipse. Download ANTLR complete binaries jar that includes ANTLR v2. Extract to a temp directory. Copy the antlr-n.n folder to an appropriate permanent location, for example the same folder that Eclipse is in...
Generics became available with: .NET Framework 2.0 (and version 2.0 of the compact framework). Java in version 5. Common Lisp since it was standardised ...
Server Syntax var io = require('socket.io')(80); io.on('connection', function (mysocket) { //custom event called `private message` mysocket.on('private message', function (from, msg) { console.log('I received a private message by ', from, ' saying ', msg); }); //internal `di...
Suppose we want to read and stack a bunch of similarly-formatted files. The quick solution is: rbindlist(lapply(list.files(patt="csv$"), fread), id=TRUE) We might not be satisfied with this for a couple reasons: It might run into errors when reading with fread or when stacking with ...

Page 600 of 1336