Tutorial by Examples: f

Imagine the following XML: <root> <element foobar="hello_world" /> <element example="this is one!" /> </root> The following XPath expression: /root/element[@foobar = 'hello_world'] will return the <element foobar="hello_world&quo...
Let's say you don't want the fields houseNum and street in the address field of the final populated doc, use the populate() as follows, Person.findOne({_id: req.params.id}) .populate('address', '-houseNum -street') // note the `-` symbol .exec(function(err, person) { // do somet...
If you only want the fields houseNum and street in the address field in the final populated doc, use the populate() function as follows in the above two methods, Person.findOne({_id: req.params.id}) .populate('address', 'houseNum street') .exec(function(err, person) { // do somet...
Through this example, it will be explained to divide the node.js code into different modules/folders for better undertandibility. Following this technique makes it easier for other developers to understand the code as he can directly refer to concerned file instead of going through whole code. The m...
The following example is a very useful basis when you are trying to convert transaction data to un-pivoted data for BI/reporting reasons, where the dimensions which are to be un-pivoted can have a dynamic set of columns. For our example, we suppose that the raw data table contains employee assessme...
When sending a notification to an iOS device, you must set priority: "high" for it to wake up. Otherwise, the notification will not be received while the phone is asleep. Sets the priority of the message. Valid values are "normal" and "high." On iOS, these correspond...
var renderer = Platform.GetRenderer(visualElement); if (renderer == null) { renderer = Platform.CreateRenderer(visualElement); Platform.SetRenderer(visualElement, renderer); } DoSomeThingWithRender(render); // now you can do whatever you want with render
OpenCL is low level api so it must be implemented in "C space" first. For that, one needs to download header files from Khronos' site. My hardware is AMD and capable of version 1.2, downloading opencl.h cl_platform.h cl.h cl_ext.h cl_egl.h cl_dx9_media_sharing.h cl_d3d10.h c...
mongodump --db mydb --gzip --out "mydb.dump.$(date +%F_%R)" This command will dump a bson gzipped archive of your local mongod 'mydb' database to the 'mydb.dump.{timestamp}' directory
mongorestore --db mydb mydb.dump.2016-08-27_12:44/mydb --drop --gzip This command will first drop your current 'mydb' database and then restore your gzipped bson dump from the 'mydb mydb.dump.2016-08-27_12:44/mydb' archive dump file.
XML <GrandFather name="Bardock" gender="male" spouse="Gine"> <Dad name="Goku" gender="male" spouse="Chi Chi"> <Me name="Gohan" gender="male"/> <brother name="Goten" ...
XML <GrandFather name="Bardock" gender="male" spouse="Gine"> <Dad name="Goku" gender="male" spouse="Chi Chi"> <Me name="Gohan" gender="male"/> <brother name="Goten" ...
XML <GrandFather name="Bardock" gender="male" spouse="Gine"> <Dad name="Goku" gender="male" spouse="Chi Chi"> <Me name="Gohan" gender="male" /> <brother name="Goten" gender=&q...
XML <GrandFather name="Bardock" gender="male" spouse="Gine"> <Dad name="Goku" gender="male" spouse="Chi Chi"> <brother name="Goten" gender="male" /> <Me name="Gohan" gender=&q...
XML <Dashavatar> <Avatar name="Matsya"/> <Avatar name="Kurma"/> <Avatar name="Varaha"/> <Avatar name="Narasimha"/> <Avatar name="Vamana"/> <Avatar name="Balabhadra"/> ...
XML <Dashavatar> <Avatar name="Matsya"/> <Avatar name="Kurma"/> <Avatar name="Varaha"/> <Avatar name="Narasimha"/> <Avatar name="Vamana"/> <Avatar name="Balabhadra"/> ...
XML <House> <Rooms>10</Rooms> <People>4</People> <TVs>4</TVs> <Floors>2</Floors> </House> XPATH /House/child::node() OUTPUT <Rooms>10</Rooms> <People>4</People> <TVs>4</TVs&gt...
XML <House> <numRooms>4</numRooms> <Floor number="1"> <Room name="living"/> <Room name="kitchen"/> </Floor> <Floor number="2"> <Room name="master bedroom&qu...
1.Download font-awesome from here. 2.Copy the font-awesome directory into your project. 3.In the of your html, reference the location to your font-awesome.min.css. <link rel="stylesheet" href="path/to/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet&quot...
Suppose we want to have the following behaviour - We have a heading (say h3 element) and on clicking it, we want it to become an input box so that we can modify heading name. React makes this highly simple and intuitive using component states and if else statements. (Code explanation below) // I ha...

Page 300 of 457