Tutorial by Examples: al

While developing, inserting the following line to your code: assert False, value will cause django to raise an AssertionError with the value supplied as an error message when this line is executed. If this occurs in a view, or in any code called from a view, and DEBUG=True is set, a full and de...
A common usecase is to discard certain rest-calls, that are not needed any more after certain user-inputs. The most prominent example would be, when a user uses some search-function, makes a request, makes another request and for some reason the first request arrives after the second request and the...
Integer literals provide values that can be used where you need a byte, short, int, long or char instance. (This example focuses on the simple decimal forms. Other examples explain how to literals in octal, hexadecimal and binary, and the use of underscores to improve readability.) Ordinary integ...
jQuery plugins are typically installed via NPM or Yarn (if hosted there), or referencing an external script file containing the plugin, whether from a relative directory or a CDN. <script type="text/javascript" src="/path/to/plugin.jquery.js"></script>
What is Concurrency? Doing multiple things at the same time. Taking advantage of number of cores available in multicore CPUs. Running multiple programs in parallel. Objectives of Concurrency Running program in background without hogging CPU. Define Tasks, Define Rules and let...
Kotlin has two types of string literals: Escaped string Raw string Escaped string handles special characters by escaping them. Escaping is done with a backslash. The following escape sequences are supported: \t, \b, \n, \r, \', \", \\ and \$. To encode any other character, use the Unicod...
In Kotlin strings are compared with == operator which chect for their structural equality. val str1 = "Hello, World!" val str2 = "Hello," + " World!" println(str1 == str2) // Prints true Referential equality is checked with === operator. val str1 = ""&q...
While writing jQuery plugins is simple, we want to enclose our plugins in a local scope. This will avoid namespace conflicts as well as polluting the global namespace, on top of ensuring that jQuery is loaded before our plugin extends it. // Encapsulate our plugins in a local scope (function($) { ...
Boolean literals are the simplest of the literals in the Java programming language. The two possible boolean values are represented by the literals true and false. These are case-sensitive. For example: boolean flag = true; // using the 'true' literal flag = false; // using the 'fa...
func isValidEmail(email: String) -> Bool { let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}" let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx) return emailTest.evaluate(with: email) } or you could use String extensio...
Go to https://www.mozilla.org/firefox/new/. 1.Click on Download button. 2.An executable file will be downloaded. 3.Double click on the .exe file and click run. 4.Finish the setup. 5.Select the option of "Maintain shortcut on the desktop".
Go to https://ftp.mozilla.org/pub/firefox/releases/ Find the list of older versions in the above link. Select the operating system you want to install in. Select the Language you want to install in. An executable will be downloaded. Run the .exe file to install the firef...
To test an add-on you are developing, you will likely desire to install it in Firefox temporarily. You can do so by loading it as a Temporary Add-on. To do so: Go to about:debugging Click on "Load Temporary Add-on" In the file picker, navigate to the directory containing the add-on f...
This: class Villain(val minions: Map[String, Minion]) extends Dynamic { def applyDynamic(name: String)(jobs: Task*) = jobs.foreach(minions(name).do) def applyDynamicNamed(name: String)(jobs: (String, Task)*) = jobs.foreach { // If a parameter does not have a name, and is simply given, th...
Using a regular expression, parse a record name that might be hierarchical. The expression looks for the final colon in the name. It returns what follows the colon, or the entire name if none: regexp_substr( {name} , '[^:]*$' )
In a saved search formula, the possible values of mainline are designed to be useful in an HTML context. When mainline is true, the value of {mainline} is the 1-character string * (asterisk). When mainline is false, the value of {mainline} is the 6-character string   (non-breaking space, HT...
The following example combines several of the techniques covered here. It puts a hyperlink in a custom formatted column which, when clicked, opens the sales order record associated with a row. The hyperlink is designed to open the record in a new window or tab when clicked, and to display a tooltip ...
String literals provide the most convenient way to represent string values in Java source code. A String literal consists of: An opening double-quote (") character. Zero or more other characters that are neither a double-quote or a line-break character. (A backslash (\) character alters t...
Let's say we have a problem of size n. Now for each step of our algorithm(which we need write), our original problem becomes half of its previous size(n/2). So at each step, our problem becomes half. StepProblem1n/22n/43n/84n/16 When the problem space is reduced(i.e solved completely), it cannot ...

Page 211 of 269