Tutorial by Examples: c

Essential for data references is the addition REF TO after TYPE. Dynamic Creation of Structures If the type of a structure should be decided on runtime, we can define our target structure as reference to the generic type data. DATA wa TYPE REF TO data. To give wa a type we use the statement CR...
AppBundle/Entity/Person.php <?php namespace AppBundle\Entity; /** * Person */ class Person { /** * @var int */ private $id; /** * @var string */ private $name; /** * @var int */ private $age; /** ...
AppBundle/Entity/Person.php <?php namespace AppBundle\Entity; use DoctrineORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; /** * @ORM\Entity * @ORM\Table(name="persons") * @ORM\Entity(repositoryClass="AppBundle\Entity\PersonRe...
One of the most common obstacles using classes is finding the proper approach to handle private states. There are 4 common solutions for handling private states: Using Symbols Symbols are new primitive type introduced on in ES2015, as defined at MDN A symbol is a unique and immutable data typ...
To Copy Data from a CSV file to a table COPY <tablename> FROM '<filename with path>'; To insert into table user from a file named user_data.csv placed inside /home/user/: COPY user FROM '/home/user/user_data.csv'; To Copy data from pipe separated file to table COPY user FROM '/h...
To Copy table to standard o/p COPY <tablename> TO STDOUT (DELIMITER '|'); To export table user to Standard ouput: COPY user TO STDOUT (DELIMITER '|'); To Copy table to file COPY user FROM '/home/user/user_data' WITH DELIMITER '|'; To Copy the output of SQL statement to file COPY (sql st...
You can use using in order to set an alias for a namespace or type. More detail can be found in here. Syntax: using <identifier> = <namespace-or-type-name>; Example: using NewType = Dictionary<string, Dictionary<string,int>>; NewType multiDictionary = new NewType(); /...
Directive code angular.module('myModule', []) .directive('myDirective', function() { return { template: '<div>{{greeting}} {{name}}!</div>', scope: { name: '=', greeting: '@' } }; }); The test describe('myDirective', function() ...
Dedicated Workers A dedicated web worker is only accessible by the script that called it. Main application: var worker = new Worker('worker.js'); worker.addEventListener('message', function(msg) { console.log('Result from the worker:', msg.data); }); worker.postMessage([2,3]); worker.j...
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...
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...

Page 372 of 826