Tutorial by Examples: c

As to pass list into a subroutine, you specify the subroutine's name and then supply the list to it: test_subroutine( 'item1', 'item2' ); test_subroutine 'item1', 'item2'; # same Internally Perl makes aliases to those arguments and put them into the array @_ which is available within the s...
If you like to organize your project by keeping source files in different subdirectories, you should know that during a build qmake will not preserve this directory structure and it will keep all the ".o" files in a single build directory. This can be a problem if you had conflicting file ...
In views\site\form-submission.php <?php Pjax::begin(['id'=>'id-pjax']); ?> <?= Html::beginForm(['site/form-submission'], 'post', ['data-pjax' => '', 'class' => 'form-inline']); ?> <?= Html::input('text', 'string', Yii::$app->request->post('string'), ['class' =&gt...
public function actionFormSubmission() { $security = new Security(); $string = Yii::$app->request->post('string'); $stringHash = ''; if (!is_null($string)) { $stringHash = $security->generatePasswordHash($string); } return $this->render('form-submi...

MVC

public interface ISingleton : IDisposable { } public class TransientDependency { } public class Singleton : ISingleton { public void Dispose() { } } public class CompositionRoot : IDisposable, IControllerFactory { private readonly ISingleton _singleton; // pass in any tru...
The following example creates a unique index on the JobCandidateID column of the HumanResources.JobCandidate table of the AdventureWorks2012 sample database. The example then creates a default full-text catalog, ft. Finally, the example creates a full-text index on the Resume column, using the ft ca...
USE AdventureWorks2012; GO CREATE FULLTEXT CATALOG production_catalog; GO CREATE FULLTEXT INDEX ON Production.ProductReview ( ReviewerName Language 1033, EmailAddress Language 1033, Comments Language 1033 ) KEY INDEX PK_ProductR...
USE AdventureWorks2012; GO CREATE FULLTEXT INDEX ON Production.Document ( Title Language 1033, DocumentSummary Language 1033, Document TYPE COLUMN FileExtension Language 1033 ) KEY INDEX PK_Document_DocumentID ...
SELECT product_id FROM products WHERE CONTAINS(product_description, ”Snap Happy 100EZ” OR FORMSOF(THESAURUS,’Snap Happy’) OR ‘100EZ’) AND product_cost < 200 ; SELECT candidate_name,SSN FROM candidates WHERE CONTAINS(candidate_resume,”SQL Server”) AND candidate_division ...
Steps to Reproduce (Turbo Forms, CRM 2015.1, --> CRM 2016.2) Form (with or without other required fields) has one field that is empty and required. Lose focus on the empty field ("title" in this example), this triggers the Field Notification Icon: Wire up onChange Handler for emp...
Your code can, and often should, throw an exception when something unusual has happened. public void WalkInto(Destination destination) { if (destination.Name == "Mordor") { throw new InvalidOperationException("One does not simply walk into Mordor."); } ...
pcall stands for "protected call". It is used to add error handling to functions. pcall works similar as try-catch in other languages. The advantage of pcall is that the whole execution of the script is not being interrupted if errors occur in functions called with pcall. If an error insid...
Given items as (value, weight) we need to place them in a knapsack (container) of a capacity k. Note! We can break items to maximize value! Example input: values[] = [1, 4, 5, 2, 10] weights[] = [3, 2, 1, 2, 4] k = 8 Expected output: maximumValueOfItemsInK = 20; Algorithm: 1) Sort values...
Use the makemigrations --name <your_migration_name> option to allow naming the migrations(s) instead of using a generated name. python manage.py makemigrations --name <your_migration_name> <app_name>
Enable utf8 pragma In order to enable utf8 pragma in one-liner, perl interpreter should be called with -Mutf8 option: perl -Mutf8 -E 'my $人 = "human"; say $人' Unicode handling with -C switch The -C command line flag lets you control Unicode features. It can be followed by a list of o...
The utf8 pragma indicates that the source code will be interpreted as UTF-8. Of course, this will only work if your text editor is also saving the source as UTF-8 encoded. Now, string literals can contain arbitrary Unicode characters; identifiers can also contain Unicode but only word-like characte...
8 The proposed Object.entries() method returns an array of key/value pairs for the given object. It does not return an iterator like Array.prototype.entries(), but the Array returned by Object.entries() can be iterated regardless. const obj = { one: 1, two: 2, three: 3 }; Object...
The Salesforce application consists of several products which can be integrated with each other: Sales Cloud Marketing Page, Salesforce Documentation Service Cloud Marketing Page, Salesforce Documentation, Trailhead Marketing Cloud Marketing Page Community Cloud Marketing Page, Salesforce Do...
LeakCanary is an Open Source Java library to detect memory leaks in your debug builds. Just add the dependencies in the build.gradle: dependencies { debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' ...
Normal mode Ctrl-wo Ex mode :only or short :on

Page 384 of 826