Tutorial by Examples

There are six specific core error constructors in JavaScript: EvalError - creates an instance representing an error that occurs regarding the global function eval(). InternalError - creates an instance representing an error that occurs when an internal error in the JavaScript engine is thr...
JqGrid is implemented as jQuery plugin, our plugin uses jQuery UI CSS or Bootstrap CSS for styling. Thus one would have to include the corresponding JavaScript and CSS files. The second basic thing, which one should know, is the fact that free jqGrid uses HTML internally. One would have to create a...
Bucket Sort is a sorting algorithm in which elements of input array are distributed in buckets. After distributing all the elements, buckets are sorted individually by another sorting algorithm. Sometimes it is also sorted by recursive method. Pseudo code for Bucket Sort Let n be the length of t...
C Merge Sort int merge(int arr[],int l,int m,int h) { int arr1[10],arr2[10]; // Two temporary arrays to hold the two arrays to be merged int n1,n2,i,j,k; n1=m-l+1; n2=h-m; for(i=0; i<n1; i++) arr1[i]=arr[l+i]; for(j=0; j<n2; j++) arr2[j]=arr[m+j+1]; arr...
Quicksort is a sorting algorithm that picks an element ("the pivot") and reorders the array forming two partitions such that all elements less than the pivot come before it and all elements greater come after. The algorithm is then applied recursively to the partitions until the list is so...
One of the more useful things about const correctness is that it serves as a way of documenting code, providing certain guarantees to the programmer and other users. These guarantees are enforced by the compiler due to constness, with a lack of constness in turn indicating that code doesn't provide...
use std::ops::Drop; struct Foo(usize); impl Drop for Foo { fn drop(&mut self) { println!("I had a {}", self.0); } }
use std::ops::Drop; #[derive(Debug)] struct Bar(i32); impl Bar { fn get<'a>(&'a mut self) -> Foo<'a> { let temp = self.0; // Since we will also capture `self` we.. // ..will have to copy the value out first Foo(self, temp) ...
In some scenarios, we might want to narrow down the results being shown by PlaceAutocomplete to a specific country or maybe to show only Regions. This can be achieved by setting an AutocompleteFilter on the intent. For example, if I want to look only for places of type REGION and only belonging to I...
<?php $parameters = array('path' => '/test.txt'); $headers = array('Authorization: Bearer <ACCESS_TOKEN>', 'Content-Type: application/json'); $curlOptions = array( CURLOPT_HTTPHEADER => $headers, CURLOPT_POST => true, CURLOPT_PO...
The puppet agent is a service that runs on the servers. Once the service is started, The agent will be triggered on background every 30 min (by default). The agent have 2 main usages: Send server`s facts to the puppet master Receive catalog from the puppet master ans apply it
By default the agent is triggered every 30 minutes. This interval value can be changed from the puppet.conf file. Linux- /etc/puppet/puppet.conf Windows - %PROGRAMDATA%\PuppetLabs\puppet\etc\puppet.conf Set the runinterval to the wanted interval. runinterval=xxx The agent can be trigge...
Sometimes it is helpful to get more output on puppet agent run. It is very useful for debugging. Run puppet agent with verbose and debug parameters: debug - Enable full debugging. verbose - Turn on verbose reporting. puppet agent -t --verbose --debug
Puppet agnet logs messages. You can view this logs here: Linux - /var/log/puppet/puppet.log Windows - view the Event Viewer (Control Panel → System and Security → Administrative Tools → Event Viewer)
No Java variable represents an object. String foo; // NOT AN OBJECT Neither does any Java array contain objects. String bar[] = new String[100]; // No member is an object. If you mistakenly think of variables as objects, the actual behavior of the Java language will surprise you. For...
Another way to .Install installers is by using Castle's FromAssembly class. It gives an array of functions to locate installers in the loaded assemblies. For example: //Will locate IInstallers in the current assembly that is calling the method container.Install(FromAssembly.This()); For more d...
Castle enables to register components also via XML Registration. //To install from the app/web.config container.Install(Configuration.FromAppConfig()); //To install from an xml file Configuration.FromXmlFile("relative_path_to_file.xml"); Read Castle's documentation for "What ...
It is possible to run windeployqt and macdeployqt from CMake, but first the path to the executables must be found: # Retrieve the absolute path to qmake and then use that path to find # the binaries get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION) get_filename_component(_qt_bi...
Background: The Household entity includes a set of options, each of which is an entity that is managed in an admin backend. Each option has a boolean enabled flag. If a previously enabled option is set to disabled it will need to be persisted in later Household edits, but cannot be edited away. T...
->add('housing', EntityType::class, array( 'class' => 'AppBundle:Housing', 'choice_label' => 'housing', 'placeholder' => '', 'attr' => (in_array('Housing', $options['disabledOptions']) ? ['disabled' => 'disabl...

Page 967 of 1336