Tutorial by Examples: c

A letter with a diacritic may be represented with the letter, and a combining modifier letter. You normally think of é as one character, but it's really 2 code points: U+0065 — LATIN SMALL LETTER E U+0301 — COMBINING ACUTE ACCENT Similarly ç = c + ¸, and å = a + ˚ combined forms To compl...
public ActionResult Index() { //Redirects to another action method by using its URL. return new RedirectResult("http://www.google.com"); } Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action resu...
public ActionResult PopulateFoods() { // Redirects to another action method. In this case the index method return RedirectToAction("Index"); } Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action ...
public ActionResult Hello() { // Returns a user-defined content type, in this case a string. return Content("hello world!"); } Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action results. The Ac...
Xamarins built in gesture recognizers provide only very basic touch handling. E.g. there is no way to get the position of a touching finger. MR.Gestures is a component which adds 14 different touch handling events. The position of the touching fingers is part of the EventArgs passed to all MR.Gestu...
Imagine the following XML: <root> <element foobar="hello_world" /> <element example="this is one!" /> </root> /root/element[@foobar] and will return the <element foobar="hello_world" /> element.
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...
Assuming that you are running redis server on localhost you can type command redis-cli After this command appear redis command line prompt 127.0.0.1:6379>
There are four types of sockets available in POSIX API: TCP, UDP, UNIX, and (optionally) RAW. Unix domain sockets may act like stream sockets or like datagram sockets. Some of endpoint types: struct sockaddr - universal endpoint type. Typically, other concrete endpoint types are converted to thi...
If the built in attributes are not sufficient to validate your model data, then you can place your validation logic in a class derived from ValidationAttribute. In this example only odd numbers are valid values for a model member. Custom Validation Attribute public class OddNumberAttribute : Valid...
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...
How do you handle errors, rather then log them to the console? Bad way: Router.route('/') .get((req, res) => { Request.find((err, r) => { if(err){ console.log(err) } else { res.json(r) } }) }) .post((req, res) => { const reque...
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" ...

Page 552 of 826