Setting a top-level property compileOnSave signals to the IDE to generate all files for a given tsconfig.json upon saving.
{
"compileOnSave": true,
"compilerOptions": {
...
},
"exclude": [
...
]
}
This feature is available...
In Tcl, a control structure is basically just another command. This is one possible implementation of a do ... while / do ... until control structure.
proc do {body keyword expression} {
uplevel 1 $body
switch $keyword {
while {uplevel 1 [list while $expression $body]}
u...
2.1.3
1. Preview Different Devices
There is a preview panel at the right of the android studio. In thispanel there is a button with device name with which you are previewing the UI of your app like this .
Click on small dropdown indicator of this and a floating panel will appear with all the pr...
VB 14.0 introduces the ability to add comments after implicit line continuation.
Dim number =
From c As Char 'Comment
In "dj58kwd92n4" 'Comment
Where Char.IsNumber(c) 'Comment
Select c 'Comment
Set mark in cursor location:
C-space or C-@
Kill region (Cut):
C-w
Copy region to kill ring:
M-w or Esc-w
Yank (Paste) most recently killed:
C-y
Yank (Paste) next last killed:
M-y or Esc-y
Kill
killis the command used by Emacs for the deletion of ...
Document level
It is on by default, but you can have an extra layer of protection by placing Option Explicit On at the top of the code file. The option will apply to the whole document.
Project level
You can switch it on via the menu in Visual Studio:
Project > [Project] Properties > Com...
The System.String.Join method allows to concatenate all elements in a string array, using a specified separator between each element:
string[] words = {"One", "Two", "Three", "Four"};
string singleString = String.Join(",", words); // singleString =...
String Concatenation can be done by using the System.String.Concat method, or (much easier) using the + operator:
string first = "Hello ";
string second = "World";
string concat = first + second; // concat = "Hello World"
concat = String.Concat(first, second); // ...
Consider the following code as an illustration:
public String joinWords(List<String> words) {
String message = "";
for (String word : words) {
message = message + " " + word;
}
return message;
}
Unfortunate this code is inefficient if the w...
When a Google Map is displayed in lite mode clicking on a map will open the Google Maps application. To disable this functionality you must call setClickable(false) on the MapView, e.g.:
final MapView mapView = (MapView)view.findViewById(R.id.map);
mapView.setClickable(false);
com.android.dex.DexException: Multiple dex files define Lcom/example/lib/Class;
This error occurs because the app, when packaging, finds two .dex files that define the same set of methods.
Usually this happens because the app has accidentally acquired 2 separate dependencies on the same library....
A spring bean can be configured such that it will register only if it has a particular value or a specified property is met. To do so, implement Condition.matches to check the property/value:
public class PropertyCondition implements Condition {
@Override
public boolean matches(ConditionC...
Find meaningful names for computation units.
Use for comprehensions or map to combine computations together.
Let's say you have something like this:
if (userAuthorized.nonEmtpy) {
makeRequest().map {
case Success(respone) =>
someProcessing(..)
if (resendToUser) {
...
By default:
Use val, not var, wherever possible. This allows you to take seamless advantage of a number of functional utilities, including work distribution.
Use recursion and comprehensionss, not loops.
Use immutable collections. This is a corrolary to using val whenever possible.
Focus on da...
The Fibonacci numbers are defined inductively as
F0 = 0
F1 = 1
Fn+2 = Fn + Fn+1
The sum of the first n+1 Fibonacci numbers is given by
F0 + F1 + F2 + ... + Fn = Fn+2 - 1.
This summation arises, among other places, in the analysis of Fibonacci heaps, where it's used to provide a lower b...
Pressing C-h a will run the emacs function apropos-command which makes emacs prompt for words (or a regexp) to search for. It will then show a buffer containing a list of names and descriptions related to that topic, including key bindings for each of the functions available via keystrokes.
Pressin...
C-h k runs the function describe-key, which looks up the function mapped to the key strokes provided, and presents a description of the function which will be run when these keys are pressed.
C-h c runs the function describe-key-briefly, which only displays the function name mapped to given key seq...
C-h f runs the function describe-function, which displays information on the usage and purpose of a given function. This is especially useful for functions that do not have a mapped key binding that can be used for documentation lookup via C-h k.
Another powerful & mature concurrency tool in Haskell is Software Transactional Memory, which allows for multiple threads to write to a single variable of type TVar a in an atomic manner.
TVar a is the main type associated with the STM monad and stands for transactional variable. They're used m...
Zip two arrays into an array of pairs:
Prelude Data.Vector> Data.Vector.zip y y
fromList [(0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11)] :: Data.Vector.Vector