Tutorial by Examples: c

Firstly you have to add Xamarin.Android.Support.V7.AppCompat library for NuGet: https://www.nuget.org/packages/Xamarin.Android.Support.v7.AppCompat/ In the "values" folder under "Resources" add new xml file called "styles.xml": "styles.xml" file should co...
In order to start using Sequelize, you must first install the Sequelize package using the Node Package Manager (npm). Install sequelize module Add --save option to store module in package.json npm install sequelize Next, depending on which database system you wish to use with Sequelize, instal...
Sometimes it's useful to check if a field is present or absent on your JSON to avoid some JSONException on your code. To achieve that, use the JSONObject#has(String) or the method, like on the following example: Sample JSON { "name":"James" } Java code String jsonStr...
Bootstrap provides multiple classes for styling buttons and making them stand out. Bootstrap buttons can be created by adding the .btn class to an element. Bootstrap ClassRole (color).btn-defaultStandard button (white).btn-primaryProvides extra visual weight and identifies the primary action (blue...
I won't explain what Any and FirstOrDefault does because there are already two good example about them. See Any and First, FirstOrDefault, Last, LastOrDefault, Single, and SingleOrDefault for more information. A pattern I often see in code which should be avoided is if (myEnumerable.Any(t=>t.Fo...
public string GetCustomerNamesCsv() { List<CustomerData> customerDataRecords = GetCustomerData(); // Returns a large number of records, say, 10000+ StringBuilder customerNamesCsv = new StringBuilder(); foreach (CustomerData record in customerDataRecords) { custom...
In order to play a sound using the SoundEffect type, create a variable to hold the loaded sound. Typically this would be an instance variable in the Game class: private SoundEffect mySound; Then, in the LoadContent() method of the Game class: protected override void LoadContent() { // l...
Function composition allows for two functions to operate and be viewed as a single function. Expressed in mathematical terms, given a function f(x) and a function g(x), the function h(x) = f(g(x)). When a function is compiled, it is compiled to a type related to Function1. Scala provides two method...
<?php $to = '[email protected]'; $subject = 'Email Subject'; $message = 'This is the email message body'; $attachment = '/path/to/your/file.pdf'; $content = file_get_contents($attachment); /* Attachment content transferred in Base64 encoding MUST be split into chunk...
<?php $mail = new PHPMailer(); $mail->From = "[email protected]"; $mail->FromName = "Full Name"; $mail->addReplyTo("[email protected]", "Reply Address"); $mail->Subject = "Subject Text"; $mail->Body = "This is...
<?php $sendgrid = new SendGrid("YOUR_SENDGRID_API_KEY"); $email = new SendGrid\Email(); $email->addTo("[email protected]") ->setFrom("[email protected]") ->setSubject("Subject Text") ->setText("This is a ...
Scope testing & output of model <div ng-app="demoApp" ng-controller="mainController as ctrl"> {{$id}} <ul> <li ng-repeat="item in ctrl.items"> {{$id}}<br/> {{item.text}} </li> ...
Packages in PLSQL are a collection of procedures, functions, variables, exceptions, constants, and data structures. Generally the resources in a package are related to each other and accomplish similar tasks. Why Use Packages Modularity Better Performance/ Funtionality Parts of a Package S...
In JavaScript, the JSON object is used to parse a JSON string. This method is only available in modern browsers (IE8+, Firefox 3.5+, etc). When a valid JSON string is parsed, the result is a JavaScript object, array or other value. JSON.parse('"bar of foo"') // "bar of foo" (t...
A BlockingQueue is an interface, which is a queue that blocks when you try to dequeue from it and the queue is empty, or if you try to enqueue items to it and the queue is already full. A thread trying to dequeue from an empty queue is blocked until some other thread inserts an item into the queue. ...
Anonymous functions can be used for functional programming. The main problem to solve is that there is no native way for anchoring a recursion, but this can still be implemented in a single line: if_ = @(bool, tf) tf{2-bool}(); This function accepts a boolean value and a cell array of two functi...
Use the package percolate:synced-cron Define a job: SyncedCron.add({ name: 'Find new matches for a saved user filter and send alerts', schedule: function(parser) { // parser is a later.parse object return parser.text('every 10 minutes'); }, job: function() { user.alerts...
Since lots of beginners are confused about cloud hosting.I am writing this guide to walk through setting meteor on aws with ubuntu os. If you already have your instance running feel free to skip this step and go straight to installing meteor on aws. Login into AWS Console.Select EC2. Go to EC2 Dash...
Find files larger than 15MB: find -type f -size +15M Find files less than 12KB: find -type f -size -12k Find files exactly of 12KB size: find -type f -size 12k Or find -type f -size 12288c Or find -type f -size 24b Or find -type f -size 24 General format: find [options] -siz...
The Keep-Alive extension to HTTP/1.0 and the persistent connection feature of HTTP/1.1 provide long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. In some cases this has been shown to result in an almost 50% speedup in latency times for HTML documents ...

Page 403 of 826