Tutorial by Examples: f

To know the path of the directory your file is in you can use: Esc to enter command mode :pwd This will print the path to the directory at the bottom of the editor, like this I'm a ninja ~ ~ ~ ~ ~ /home/ubuntu/myfolder 1,5 All Now...
Interface declaration for downloading a file public interface ApiInterface { @GET("movie/now_playing") Call<MovieResponse> getNowPlayingMovies(@Query("api_key") String apiKey, @Query("page") int page); // option 1: a resource relative to your bas...
# will retrieve my home path ENV['HOME'] # => "/Users/username" # will try retrieve the 'FOO' environment variable. If failed, will get 'bar' ENV.fetch('FOO', 'bar')
In Normal, type the following to delete a range of lines into a named register :10,20d a This will delete lines 10,20 in register "a. We can verify this by typing :reg This will show the text that was delete in register "a. To paste the contents in "a, just type "ap ...
When you need to pass some data from the parent task to its children tasks, so it logically flows with the execution, use AsyncLocal class: void Main() { AsyncLocal<string> user = new AsyncLocal<string>(); user.Value = "initial user"; // this does not aff...
Many of the console's print methods can also handle C-like string formatting, using % tokens: console.log('%s has %d points', 'Sam', 100); Displays Sam has 100 points. The full list of format specifiers in Javascript is: SpecifierOutput%sFormats the value as a string%i or %dFormats the value a...
If a recursive call goes "too deep", this results in a StackOverflowError. Java allocates a new frame for every method call on its thread's stack. However, the space of each thread's stack is limited. Too many frames on the stack leads to the Stack Overflow (SO). Example public static vo...
Default date format: "mm/dd/yy" The following example shows how you can set the date format in initialization with the dateFormat option. <input type="text" id="datepicker"> <script> $("#datepicker").datepicker({ dateFormat: "...
In functions, you can define a number of mandatory arguments: def fun1(arg1, arg2, arg3): return (arg1,arg2,arg3) which will make the function callable only when the three arguments are given: fun1(1, 2, 3) and you can define the arguments as optional, by using default values: def fun...
When you want to create a function that can accept any number of arguments, and not enforce the position or the name of the argument at "compile" time, it's possible and here's how: def fun1(*args, **kwargs): print(args, kwargs) The *args and **kwargs parameters are special parame...
Since Laravel version 5.2.31 the web middleware is applied by default within the RouteServiceProvider (https://github.com/laravel/laravel/commit/5c30c98db96459b4cc878d085490e4677b0b67ed) In app/Providers/RouteServiceProvider.php you will find the following functions which apply the middleware on ev...
A common issue that users of Eclipse encounter is related to the default system JVM. A typical situation is a 64 bit Windows which has both 32 and 64 bit versions of Java installed, and a 32 bit Eclipse. If the 64 bit version of Java is the system default, when Eclipse is launched an error dialog i...
The target attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form. The target attribute defines a name of, or keyword for, a browsing context (e.g. tab, window, or inline frame). From Tag with a target attribute: <form ta...
The following example shows how you can use the pushd command and the popd command in a batch program to change the current directory from the one in which the batch program was run and then change it back: @echo off rem This batch file deletes all .txt files in a specified directory pushd %1 ...
private final OkHttpClient client = new OkHttpClient(); public void run() throws Exception { RequestBody formBody = new FormBody.Builder() .add("search", "Jurassic Park") .build(); Request request = new Request.Builder() .url("https:...
with Ada.Text_IO; procedure Main is X : Float := 2.71; begin Ada.Text_IO.Put_Line (Float'Image (X)); end Main; Result 2.71000E+00
x IN ( SELECT ... ) turn into a JOIN When possible, avoid OR. Do not 'hide' an indexed column in a function, such as WHERE DATE(x) = ...; reformulate as WHERE x = ... You can generally avoid WHERE LCASE(name1) = LCASE(name2) by having a suitable collation. Do no use OFFSET for "paginatio...
You can find the Chef documentation at https://docs.chef.io/.
You can change the url of an existing remote by the command git remote set-url remote-name url
For a Django project with requirements and deployment tools under source control. This example builds upon concepts from the Two Scoops of Django. They have published a template: repository/ docs/ .gitignore project/ apps/ blog/ migrations/ ...

Page 192 of 457