all errors and exceptions, both custom and default, are handled by the Handler class in app/Exceptions/Handler.php with the help of two methods.
report()
render()
public function render($request, Exception $e)
{
//check if exception is an instance of ModelNotFoundException.
if ($e in...
After you installed XAMPP and setup the MySQL database you can install WordPress.
Download the latest version of WordPress.
Unzip the file and insert the folder in the root directory of your webserver (if you used the suggested path during the setup of XAMPP it is "c:\xampp\htdocs").
...
Interpolating values is helpful if you need to pass a server-side variable to client-side JavaScript (or other languages that require it).
In the case of variables, numbers, strings, and the like, you can pass these types of variables directly into your JavaScript with bracket syntax plus an explan...
Below code represents an example of Opt-Out approach using Serializable and NonSerialized attributes.
/// <summary>
/// Represents a student.
/// </summary>
[Serializable]
public class Student
{
/// <summary>
/// Gets or sets student number.
/// </summary>...
This example will demonstrate how to get started with Firebase in your web apps with JavaScript.
We are going to add a text child in our Firebase Database and display it in realtime on our web app.
Lets get started.
Go to the Firebase Console - https://console.firebase.google.com and create a...
Publishers and subscribers don't need to know each other. They simply communicate with the help of message queues.
(function () {
var data;
setTimeout(function () {
data = 10;
$(document).trigger("myCustomEvent");
}, 2000);
...
ScriptAnalyzer ships with sets of built-in preset rules that can be used to analyze scripts. These include: PSGallery, DSC and CodeFormatting. They can be executed as follows:
PowerShell Gallery rules
To execute the PowerShell Gallery rules use the following command:
Invoke-ScriptAnalyzer -Path /...
To run the script analyzer against a single script file execute:
Invoke-ScriptAnalyzer -Path myscript.ps1
This will analyze your script against every built-in rule. If your script is sufficiently large that could result in a lot of warnings and/or errors.
To run the script analyzer against a w...
SCRIPT_DEBUG is a related constant that will force WordPress to use the "dev" versions of core CSS and JavaScript files rather than the minified versions that are normally loaded. This is useful when you are testing modifications to any built-in .js or .css files. Default is false.
//enab...
Now that you have a collection of all the shape references in the document. Loop through the collection with a foreach, and through each iteration create a Blip object. Set the Blip object embed value to the picture ID reference you captured earlier from the image part. Also create a Stretch object...
In the classical languages like Java, C# or C++ we start by creating a class and then we can create new objects from the class or we can extend the class.
In JavaScript first we create an object, then we can augment the object or create new objects from it. So i think, JavaScript demonstrates actua...
During coding, unexpected errors do arise frequently enough, which requires debugging and testing. But sometimes the errors are indeed expected and to bypass it, there is the Try..Catch..Throw..Finally..End Try block.
To manage an error correctly, the code is put into a Try..Catch block, whereby th...
Ajax calls, request and retrieve data for giving the user a sense of a better interactive user interface experience. This article will show you how to use jQuery and send data through Ajax calls.
For this example, we’re going to POST the following JavaScript object to our server.
var post = {
...
ArgumentCaptor will to receive the actual invocation arguments that has been passed to method.
ArgumentCaptor<Foo> captor = ArgumentCaptor.forClass(Foo.class);
verify(mockObj).doSomethind(captor.capture());
Foo invocationArg = captor.getValue();
//do any assertions on invocationArg
For ...
In this example 2000 bytes will be transfered using DMA, Transmit Half Complete and Transmit Complete interrupts achieving the best performance.
The first half of the transmit buffer is loaded with new data by the CPU in the Transmit Half Complete interrupt callback while the second half of the buf...