Tutorial by Examples

When you are in a controllerAction And have a POST request coming in, but want to redirect it, to a different route, while still maintaining the POST method and the request object, you can use the following: return $this->redirectToRoute('route', array( 'request' => $request, ), 307); ...
Subdomain-based routing can be handled in Symfony using host parameter. For example, _locale parameter can be used as subdomain value. Assuming locale: en domain: somedomain.com parameters are defined in parameters.yml config file, route would be: /** * @Route( * "/", * ...
Firebase Crash Reporting automatically generates reports for fatal errors (or uncaught exceptions). You can create your custom report using: FirebaseCrash.report(new Exception("My first Android non-fatal error")); You can check in the log when FirebaseCrash initialized the module: ...
To start the registration for push notifications you need to execute the below code. // registers for push var settings = UIUserNotificationSettings.GetSettingsForTypes( UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, new NSSet()); ...
Implementation on Android is a bit more work and requires a specific Service to be implemented. First lets check if our device is capable of receiving push notifications, and if so, register it with Google. This can be done with this code in our MainActivity.cs file. protected override void OnCrea...
On Windows Phone something like the code underneath needs to be implemented to start working with push notifications. This can be found in the App.xaml.cs file. protected async override void OnLaunched(LaunchActivatedEventArgs e) { var channel = await PushNotificationChannelManager.CreatePush...
CommandUsageaboutShort information about ComposerarchiveCreate an archive of this composer packagebrowseOpens the package's repository URL or homepage in your browser.clear-cacheClears composer's internal package cache.clearcacheClears composer's internal package cache.configSet config optionscreate...
By default, PHP will tell the world what version of PHP you are using, e.g. X-Powered-By: PHP/5.3.8 To fix this you can either change php.ini: expose_php = off Or change the header: header("X-Powered-By: Magic"); Or if you'd prefer a htaccess method: Header unset X-Powered-By ...
Step 1: Locate your download of Node.js, typically it is installed under C:/program files/nodejs Step 2: Open Visual Studios and navigate to "Tools>Options" Step 3: In the options window navigate to "Projects and Solutions>External Web Tools" Step 4: Add new entry with y...
If Sitecore is setup in a CM-CD enviornment there could be a need to fire events on CD server when CM events are fired. The example could be firing publish:end:remote on CD when content editors done publish on CM. In order to make sure that events are firing the following steps are required to be ...
This example shows how to perform basic mathematical operations using BigDecimals. 1.Addition BigDecimal a = new BigDecimal("5"); BigDecimal b = new BigDecimal("7"); //Equivalent to result = a + b BigDecimal result = a.add(b); System.out.println(result); Result : 12 ...
NULL is a special case when it comes to comparisons. Assume the following data. id someVal ---- 0 NULL 1 1 2 2 With a query: SELECT id FROM table WHERE someVal = 1 would return id 1 SELECT id FROM table WHERE someVal <> 1 would return id 2 SELECT id FROM tabl...
SUBSTRING (or equivalent: SUBSTR) returns the substring starting from the specified position and, optionally, with the specified length Syntax: SUBSTRING(str, start_position) SELECT SUBSTRING('foobarbaz', 4); -- 'barbaz' SELECT SUBSTRING('foobarbaz' FROM 4); -- 'barbaz' -- using negative index...
Python follows PEMDAS rule. PEMDAS stands for Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction. Example: >>> a, b, c, d = 2, 3, 5, 7 >>> a ** (b + c) # parentheses 256 >>> a * b ** c # exponent: same as `a * (b ** c)` 7776 >>...
When performance is a concern, invoking a method via reflection (i.e. via the MethodInfo.Invoke method) is not ideal. However, it is relatively straightforward to obtain a more performant strongly-typed delegate using the Delegate.CreateDelegate function. The performance penalty for using reflecti...
In order to be able to use a class as the key in a map, all that is required of the key is that it be copiable and assignable. The ordering within the map is defined by the third argument to the template (and the argument to the constructor, if used). This defaults to std::less<KeyType>, w...
What we have is a list of credit cards and we'd like to calculate the premiums for all those cards that the credit card company has to pay out. The premiums themselves depend on the total number of credit cards, so that the company adjust them accordingly. We already have a function that calculate...
IMP is a C type referring to the implementation of a method, also known as an implementation pointer. It is a pointer to the start of a method implementation. Syntax: id (*IMP)(id, SEL, …) IMP is defined by: typedef id (*IMP)(id self,SEL _cmd,…); To access this IMP, the message “methodForSe...
When creating a timer, you can set the userInfo parameter to include information that you want to pass to the function you call with the timer. By taking a timer as a parameter in said function, you can access the userInfo property. NSDictionary *dictionary = @{ @&quo...
The HTTP message body can be compressed (since HTTP/1.1). Either by the server compresses the request and adds a Content-Encoding header, or by a proxy does and adds a Transfer-Encoding header. A client may send an Accept-Encoding request header to indicate which encodings it accepts. The most com...

Page 692 of 1336