Tutorial by Examples: f

Classes can implement more than one interface, as opposed to inheriting from more than one class (Multiple Inheritance) which isn't possible for Delphi classes. To achieve this, the name of all interfaces must be added comma-separated behind the base class. Of course, the implementing class must al...
Interfaces can inherit from each other, exactly like classes do, too. An implementing class thus has to implement functions of the interface and all base interfaces. This way, however, the compiler doesn't know that the implenting class also implements the base interface, it only knows of the interf...
Since the declaration of variables in interfaces isn't possible, the "fast" way of defining properites (property Value: TObject read FValue write FValue;) can't be used. Instead, the Getter and setter (each only if needed) have to be declared in the interface, too. IInterface = interface(...
When using the DllImport attribute you have to know the correct dll and method name at compile time. If you want to be more flexible and decide at runtime which dll and methods to load, you can use the Windows API methods LoadLibrary(), GetProcAddress() and FreeLibrary(). This can be helpful if the ...
First obtain the Microsoft.CodeAnalysis.CSharp.Workspaces nuget before continuing. var workspace = Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create(); var project = await workspace.OpenProjectAsync(projectFilePath); var compilation = await project.GetCompilationAsync(); foreach (var diag...
Name-based virtual hosting on Apache is described on the Apache website as such: With name-based virtual hosting, the server relies on the client to report the hostname as part of the HTTP headers. Using this technique, many different hosts can share the same IP address. Therefore, more than...
This command will save the open file with sudo rights :w !sudo tee % >/dev/null You can also map w!! to write out a file as root :cnoremap w!! w !sudo tee % >/dev/null
Add this to your $MYVIMRC: " Source vim configuration file whenever it is saved if has ('autocmd') " Remain compatible with earlier versions augroup Reload_Vimrc " Group name. Always use a unique name! autocmd! " Clear any preexisting autoc...
:autocmd BufWritePost * if &diff | diffupdate | endif
Create a file named '.jshintrc' in the root of your app, where package.json is. *Note on windows: create a file named "jshintrc.txt". Then rename it to ".jshintrc." (notice the dot at the end). This is a configuration file. It can for example tell jshint to ignore certain varia...
Create a file named: "Makefile" (with no extension) in the root of your app Open it in a text editor and add this: android: gulp lint gulp sass ionic run android --device ios: gulp lint gulp sass ionic build ios This will lint your app and ...
FRP, or Functional Reactive Programming, has some basic terms which you need to know. Every piece of data can be represented as Observable, which is an asynchronous data stream. The power of FRP is in representation synchronous and asynchronous events as streams, Observables, and providing the same...
When writing macros that expand into forms that might involve grouping, it is worthwhile spending some time considering what grouping construction to expand into. For definition style forms, for instance, a define-widget macro that will usually appear as a top-level form, and that several defuns, d...
You can use npm install -g to install a package "globally." This is typically done to install an executable that you can add to your path to run. For example: npm install -g gulp-cli If you update your path, you can call gulp directly. On many OSes, npm install -g will attempt to writ...
Node Version Manager (nvm) greatly simplifies the management of Node.js versions, their installation, and removes the need for sudo when dealing with packages (e.g. npm install ...). Fish Shell (fish) "is a smart and user-friendly command line shell for OS X, Linux, and the rest of the family&...
Square Root Use Math.sqrt() to find the square root of a number Math.sqrt(16) #=> 4 Cube Root To find the cube root of a number, use the Math.cbrt() function 6 Math.cbrt(27) #=> 3 Finding nth-roots To find the nth-root, use the Math.pow() function and pass in a fractional expo...
2005 The following iterates over the characters of the string s. It works similarly for looping over the elements of an array or a set, so long as the type of the loop-control variable (c, in this example) matches the element type of the value being iterated. program ForLoopOnString; {$APPTYPE ...
Every Windows Phone project contains App.cs class: public sealed partial class App : Application This class is your global application context. General Application class usage: App entry point, particularly for various activation contracts. Application lifecycle management. Application g...
// Get the reference to your ListView ListView listResults = (ListView) findViewById(R.id.listResults); // Set its adapter listResults.setAdapter(adapter); // Enable filtering in ListView listResults.setTextFilterEnabled(true); // Prepare your adapter for filtering adapter.setFilter...
In most scripting languages, if a function call fails, it may throw an exception and stop execution of the program. Bash commands do not have exceptions, but they do have exit codes. A non-zero exit code signals failure, however, a non-zero exit code will not stop execution of the program. This can...

Page 223 of 457