Tutorial by Examples: com

The Flex compiler (mxmlc) is one of the most important parts of the Flex SDK. You can edit AS3 code in any text editor you like. Create a main class file that extends from DisplayObject. You can trigger builds at the command line as follows: mxmlc -source-path="." -default-size [width in...
Equality For basic equality testing, the equal operator == is used. For more comprehensive checks, use the identical operator ===. The identical operator works the same as the equal operator, requiring its operands have the same value, but also requires them to have the same data type. For exampl...
Addition + and subtraction - operations can be used to combine delegate instances. The delegate contains a list of the assigned delegates. using System; using System.Reflection; using System.Reflection.Emit; namespace DelegatesExample { class MainClass { private delegate void MyD...
Once a model object has been fetched, it becomes a fully realized instance of the class. As such, any additional methods can be accessed in forms and serializers (like Django Rest Framework). Using python properties is an elegant way to represent additional values that are not stored in the databa...
When running from the CLI, PHP exhibits some different behaviours than when run from a web server. These differences should be kept in mind, especially in the case where the same script might be run from both environments. No directory change When running a script from a web server, the current w...
It's possible to create a new ASP.NET Core project entirely from the command line using the dotnet command. dotnet new web dotnet restore dotnet run dotnet new web scaffolds a new "empty" web project. The web parameter tells the dotnet tool to use the ASP.NET Core Empty template. Use...
If you want to extend a class as-if you are a static function, for example for class Something add static looking function fromString, this can only work if the class has a companion object and that the extension function has been declared upon the companion object: class Something { compani...
Taken from jQuery.ajax API web site: $.ajax({ method: "POST", url: "some.php", data: { name: "John", location: "Boston" }, success: function(msg) { alert("Data Saved: " + msg); }, error: ...
In the simple example, we simply set the width of the rectangle to that of it's parent. Let's consider a more complicated example: ApplicationWindow { visible: true width: 400 height: 640 Rectangle{ id: rect anchors.centerIn: parent height: 100 ...
Common table expressions support extracting portions of larger queries. For example: WITH sales AS ( SELECT orders.ordered_at, orders.user_id, SUM(orders.amount) AS total FROM orders GROUP BY orders.ordered_at, orders.user_id ) SELECT sales.ordered_at, sales.total,...
Whenever a Python script is invoked from the command line, the user may supply additional command line arguments which will be passed on to the script. These arguments will be available to the programmer from the system variable sys.argv ("argv" is a traditional name used in most programmi...
// *** Case Insensitive comparison with exact title match *** NSPredicate *filterByNameCIS = [NSPredicate predicateWithFormat:@"self.title LIKE[cd] %@",@"Tom and Jerry"]; NSLog(@"Filter By Name(CIS) : %@",[array filteredArrayUsingPredicate:filterByNameCIS]);
// *** Case Insensitive comparison with matching subset *** NSPredicate *filterByName = [NSPredicate predicateWithFormat:@"self.title CONTAINS[cd] %@",@"Tom"]; NSLog(@"Filter By Containing Name : %@",[array filteredArrayUsingPredicate:filterByName]);
It is very convenient to use extension methods with interfaces as implementation can be stored outside of class and all it takes to add some functionality to class is to decorate class with interface. public interface IInterface { string Do() } public static class ExtensionMethods{ pu...
A comment is marked by an apostrophe ('), and ignored when the code executes. Comments help explain your code to future readers, including yourself. Since all lines starting with a comment are ignored, they can also be used to prevent code from executing (while you debug or refactor). Placing an ap...
Sub RemComments() Rem Comments start with "Rem" (VBA will change any alternate casing to "Rem") Rem is an abbreviation of Remark, and similar to DOS syntax Rem Is a legacy approach to adding comments, and apostrophes should be preferred Rem Comments CANNOT appear af...
Drush status drush status This will give you an overview of your Drupal site. Version, URI, database location, file paths, default theme etc. If you use this command and you do not see this information, it means you are in a wrong folder and Drush does not know which Drupal site you are referrin...
The following method computes the Nth Fibonacci number using recursion. public int fib(final int n) { if (n > 2) { return fib(n - 2) + fib(n - 1); } return 1; } The method implements a base case (n <= 2) and a recursive case (n>2). This illustrates the use of re...
All files are in folder files. First create list of DataFrames and then concat them: import pandas as pd import glob #a.csv #a,b #1,2 #5,8 #b.csv #a,b #9,6 #6,4 #c.csv #a,b #4,3 #7,0 files = glob.glob('files/*.csv') dfs = [pd.read_csv(fp) for fp in files] #duplicated ind...
It's often useful to combine multiple plot types in one graph (for example a Barplot next to a Scatterplot.) R makes this easy with the help of the functions par() and layout(). par() par uses the arguments mfrow or mfcol to create a matrix of nrows and ncols c(nrows, ncols) which will serve as a ...

Page 11 of 65