Tutorial by Examples: ti

C++11 Type deduction using the auto keyword works almost the same as Template Type Deduction. Below are a few examples: auto x = 27; // (x is neither a pointer nor a reference), x's type is int const auto cx = x; // (cx is neither a pointer nor a reference), cs's type is const int ...
variables this local arguments
You can also use Laravel Artisan commands from your routes or controllers. To run a command using PHP code: Artisan::call('command-name'); For example, Artisan::call('db:seed');
A basic script showing the fundamentals of how to create/open, write to, and save an Excel spreadsheet. Using the AutoIt Excel library functions. ; Include definitions of the User Excel functions #include <Excel.au3> ; Include Message Box codes for the error messages #include <MsgBox...
Code coverage is a measure used to how often each source code statement and branch is executed. This measure is usually required when running a test suite to ensure that as much of the code as possible is tested by the test suite. It can also be used during profiling to determine code hot-spots and ...
Before using gcov, source code should be compiled with gcc using the two flags, -fprofile-arcs and -ftest-coverage. This tells the compiler to generate the information and extra object file code required by gcov. gcc -fprofile-arcs -ftest-coverage hello.c Linking should also use the -fprofile-a...
We can use the unit type as a function argument to define functions that we don't want executed until later. This is often useful in asynchronous background tasks, when the main thread may want trigger some predefined functionality of the background thread, like maybe moving it to a new file, or if...
You can use conditional operators in WordPress to enqueue scripts on specific pages of your Website. function load_script_for_single_post(){ if(is_single()){ wp_enqueue_script( 'some', get_template_directory_uri().'/js/some.js', array...
public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] ar = new int[n]; for(int i=0; i<n; i++) ar[i] = sc.nextInt(); quickSort(ar, 0, ar.length-1); } public static void quickSort(...
add_option function ins used to insert new row into options table. This will insert a new row in options table with option name some_option_name and value as some_option_value <?php add_option( 'some_option_name', 'some_option_value' ); ?>
delete_option function is used to delete an option from the options table. This will delete my_custom_option from the options table. <?php delete_option( 'my_custom_option' ); ?>
update_option function is used to update a value that already exists in the options table. If the option does not exist, then the option will be added with the option value. This will set the default comment status to 'closed': update_option( 'default_comment_status', 'closed' );
It's quite simple to install wordpress in MAMP. You have to follow a few simple steps: 1 - Download MAMP from here, it's free and you probably don't need the pro version. 2 - Install on your PC or Mac. 3 - Run the program -> you will see a little window open, from there you can set MAMP. At t...
The EntityType enum represents all the entities from Bukkit/Spigot. All its values can be found below. ValueDescriptionAREA_EFFECT_CLOUDN/AARMOR_STANDMechanical entity with an inventory for placing weapons / armor into.ARROWAn arrow projectile; may get stuck in the ground.BATN/ABLAZEN/ABOATA place...
To retrieve a list of nearby entities of an entity, one can use List<Entity> nearby = entity.getNearbyEntities(double x, double y, double z); Bukkit will then calculate a bounding box centered around entity, having as parameters: x: 1/2 the size of the box along x axis y: 1/2 the size ...
Python allows you to hack list comprehensions to evaluate conditional expressions. For instance, [value_false, value_true][<conditional-test>] Example: >> n = 16 >> print [10, 20][n <= 15] 10 Here n<=15 returns False (which equates to 0 in Python). So what Python i...
var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var app = express(); app.use(favicon(__dirname + '/public/img/favicon.ico')); app.use(express.static(path.join(__dirname, 'public'))); app.listen(3000, function() { console.log("...
The recommended approach would be to avoid doing so and rather use IOptions<TOptions> and IServiceCollection.Configure<TOptions>. That said, this is still pretty straightforward to make IConfigurationRootavailable application wide. In the Startup.cs constructor you should have the foll...
Install Java 8 from the Oracle website. (Optional) Install a Java build tool. Whether you choose to use Maven or Gradle, you normally don’t have to install anything, as JHipster will automatically install the Maven Wrapper or the Gradle Wrapper for you. If you don’t want to use those wrappers, ...
public class TestngAnnotation { // test case 1 @Test public void testCase1() { System.out.println("in test case 1"); } // test case 2 @Test public void testCase2() { System.out.println("in test case 2"); } @BeforeMethod pu...

Page 386 of 505