Tutorial by Examples

CSRF is an attack which forces end user to execute unwanted actions on a web application in which he/she is currently authenticated. It can happen because cookies are sent with every request to a website - even when those requests come from a different site. We can use csurf module for creating cs...
If you choose to handle SSL/TLS in your Node.js application, consider that you are also responsible for maintaining SSL/TLS attack prevention at this point. In many server-client architectures, SSL/TLS terminates on a reverse proxy, both to reduce application complexity and reduce the scope of secur...
While redux itself is entirely synchronous, you can use a middleware such as redux-thunk to handle asynchronous actions. A "thunk" is another name for a callback. It is a function that is usually passed as an argument to be called at a later time. To use, apply the middleware to you...
Patterns can be specified as regular expressions: /regular expression/ {action} For example: echo "[email protected] not an email" | awk '/[^@]+@.+/ {print}' Produces: [email protected] Note that an action consisting only of the print statement can be omitted entirely. The abo...
Create a new httpHandler inside your ASP.NET project. Apply the following code (VB) to the handler file: Public Class AttachmentDownload Implements System.Web.IHttpHandler Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest ' pass an ID thr...
const loadUser = userId => dispatch => { dispatch({ type: 'USER_LOADING' }); $.ajax('/users/' + userId, { type: 'GET', dataType : 'json' }).done(response => { dispatch({ type: 'USER_LOADED', user: response }); }).fail((xhr, status, error) =>...
As defined in the AngularJS Documentation When a Controller is attached to the DOM via the ng-controller directive, Angular will instantiate a new Controller object, using the specified Controller's constructor function. A new child scope will be created and made available as an injectable par...
The Controller we have made can be instantiated and used using controller as Syntax. That's because we have put variable directly on the controller class and not on the $scope. Using controller as someName is to seperate the controller from $scope itself.So, there is no need of injecting $scope as ...
The way the $scope is injected in the controller's constructor functions is a way to demonstrate and use the basic option of angular dependency injection but is not production ready as it cannot be minified. Thats because the minification system changes the variable names and anguar's dependency i...
Use try-finally to avoid leaking resources (such as memory) in case an exception occurs during execution. The procedure below saves a string in a file and prevents the TStringList from leaking. procedure SaveStringToFile(const aFilename: TFilename; const aString: string); var SL: TStringList; ...
Detailed instructions on getting iPhone set up or installed. Turn on your iPhone. You will see the "Hello" screen in many languages. Slide to right to continue. Choose the language you want and tap your country or region. Choose a Wi-Fi network and make sure your iPhone 7 is connected...
Const baseString As String = "Foo Bar" Dim containsBar As Boolean 'Check if baseString contains "bar" (case insensitive) containsBar = InStr(1, baseString, "bar", vbTextCompare) > 0 'containsBar = True 'Check if baseString contains bar (case insensitive) co...
Const baseString As String = "Foo Bar" Dim containsBar As Boolean Dim posB As Long posB = InStr(1, baseString, "B", vbBinaryCompare) 'posB = 5
Const baseString As String = "Foo Bar" Dim containsBar As Boolean 'Find the position of the last "B" Dim posX As Long 'Note the different number and order of the paramters for InStrRev posX = InStrRev(baseString, "X", -1, vbBinaryCompare) 'posX = 0
An array is just a block of sequential memory locations for a specific type of variable. Arrays are allocated the same way as normal variables, but with square brackets appended to its name [] that contain the number of elements that fit into the array memory. The following example of an array uses...
Const baseString As String = "Foo Bar" Dim leftText As String leftText = Left$(baseString, 3) 'leftText = "Foo"
Const baseString As String = "Foo Bar" Dim rightText As String rightText = Right$(baseString, 3) 'rightText = "Bar"
Const baseString As String = "Foo Bar" 'Get the string starting at character 2 and ending at character 6 Dim midText As String midText = Mid$(baseString, 2, 5) 'midText = "oo Ba"
'Trim the leading and trailing spaces in a string Const paddedText As String = " Foo Bar " Dim trimmedText As String trimmedText = Trim$(paddedText) 'trimmedText = "Foo Bar"
Typical usage of ExtJS leverages the framework to build single-page rich-applications (RIA). The simplest way to get started is to make use of Sencha Cmd, a CLI build tool covering most of the general concerns in a deployment life-cycle, primarily: package and dependency management code compil...

Page 462 of 1336