Tutorial by Examples: er

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...
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...
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...
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
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...
to_upper(): #include <iostream> #include <string> #include <boost/algorithm/string.hpp> using namespace std; int main() { // String to convert characters to uppercase string str = "ThIS iS SUpPoSEd tO Be UpPeR CAsE."; // Convert characters i...
The typical Visitor example in Java would be: interface ShapeVisitor { void visit(Circle c); void visit(Rectangle r); } interface Shape { void accept(ShapeVisitor sv); } class Circle implements Shape { private Point center; private double radius; public Circl...
Objective-C NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Hello. That is a test attributed string."]; [str addAttribute:NSBackgroundColorAttributeName value:[UIColor yellowColor] range:NSMakeRange(3,5)]; [str addAttribute:NSForegroundColorAttrib...
Note I assume you know Webcomponent Specifications Polymer from Google What if, we could just have one custom element, say <tool-bar></tool-bar> and it magically did everything that messy Modal markup could? Tempting eh! How do you specify which Modal belongs to which project...
IF you are using simple categories, with each physics body belonging to only one category, then this alternative form of didBeginContact may be more readable: func didBeginContact(contact: SKPhysicsContact) { let contactMask = contact.bodyA.categoryBitMask | contact.bodyB.categoryBitMask ...
Fetching or loading data can be primarily classified into two types: eager and lazy. In order to use Hibernate make sure you add the latest version of it to the dependencies section of your pom.xml file: <dependency> <groupId>org.hibernate</groupId> <artifactId>hi...
Find div with id="article" and strip out all the inner script tags. #!/usr/bin/env stack -- stack --resolver lts-7.1 --install-ghc runghc --package text --package lens --package taggy-lens --package string-class --package classy-prelude {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE O...
Here is an example of an Azure Powershell automation runbook that deletes any blobs in an Azure storage container that are older than a number of days. This may be useful for removing old SQL backups to save cost and space. It takes a number of parameters which are self explanatory. Note: I have ...
Most examples of a function returning a value involve providing a pointer as one of the arguments to allow the function to modify the value pointed to, similar to the following. The actual return value of the function is usually some type such as an int to indicate the status of the result, whether ...
Debugging by raising exceptions is far easier than squinting through print log statements, and for most bugs, its generally much faster than opening up an irb debugger like pry or byebug. Those tools should not be your first step. Debugging Ruby/Rails Quickly: 1. Fast Method: Raise an Exceptio...
UIDevice *deviceInfo = [UIDevice currentDevice]; NSLog(@"Device Name %@", deviceInfo.name); //Ex: myIphone6s NSLog(@"System Name %@", deviceInfo.systemName); //Device Name iPhone OS NSLog(@"System Version %@", deviceInfo.systemVersion); //System Version 9.3...
//Get permission for Battery Monitoring [[UIDevice currentDevice] setBatteryMonitoringEnabled:YES]; UIDevice *myDevice = [UIDevice currentDevice]; [myDevice setBatteryMonitoringEnabled:YES]; double batLeft = (float)[myDevice batteryLevel] * 100; NSLog(@"%.f",batLeft); int d = myD...
String to immutable ubyte[] string s = "unogatto"; immutable(ubyte[]) ustr = cast(immutable(ubyte)[])s; assert(typeof(ustr).stringof == "immutable(ubyte[])"); assert(ustr.length == 8); assert(ustr[0] == 0x75); //u assert(ustr[1] == 0x6e); //n assert(ustr[2] == 0x6f); //o...
01 a PIC 9. 01 b PIC 99. 01 c PIC 999. 01 s PIC X(4). 01 record-group. 05 field-a PIC 9. 05 field-b PIC 99. 05 field-c PIC 999. 01 display-record. 05 field-a PIC Z. 05 field-b PIC ZZ. 05 field-c PIC $Z9. *> numeric fields are moved left to right *> a set to...

Page 306 of 417