To disable the restriction to clone files with very long name (i.e. include path and filename) use the following command:
git config --global core.longPaths true
Extremely Serious
To disable the restriction to clone files with very long name (i.e. include path and filename) use the following command:
git config --global core.longPaths true
To provide which ssl backend to use with git use the following syntax:
git config --global http.sslBackend <SSL_BACKEND>
The SSL_BACKEND token can potentially be openssl or schannel.
schannel uses the windows certicate store.
Example
git config --global http.sslBackend schannel
A double quoted string prefixed with an at (@) sign symbol will be interpreted verbatim.
@"<STRING>"
The STRING token can have simple escaped sequences (e.g. \\ for backslash), hexadecimal escape sequence (i.e. \x<HEX_NUMBER>) and unicode escape sequences (i.e. \u<HEX_NUMBER>) that are interpreted literally. However, the "" will still be escaped an will produce a single double quote mark.
Verbatim string literal and string interpolation can be combined with the syntax as $@"<STRING>". Moreover, the {{ or }} will still be escaped.
var string1 = "C:\\Windows\\System32" var string2 = @"C:\Windows\System32" Console.WriteLine(string1) Console.WriteLine(string2)
The writelines will produce the same output.
A double quoted string prefixed with a dollar ($) sign symbol can includes interpolation expression.
$"<STRING>"
The STRING token can have interpolation expression and has the following syntax:
{<INTERPOLATION_EXPRESSION>[,<ALIGNMENT>][:<FORMAT_STRING>]}
Token | Description |
INTERPOLATION_EXPRESSION | The part that will produce a formatted output. |
ALIGNMENT | Imposed a minimum number of character. If positive it is right-aligned and if negative it is left-aligned. |
FORMAT_STRING | A format that is supported by the expression. Find more on here. |
If you needed to include { or } in your string output, escape it as {{ or }} respectively on which ever you need.
var name = "World" var greeting = $"Hello {name}"
//A Stream of Integers var ints = Stream.of(10, 20, 30 , 40); //Calculate the average using the Collectors.teeing method. long average = ints.collect( Collectors.teeing( //Sum all of the integers in the stream. Collectors.summingInt(Integer::valueOf), //Count the content of the stream. Collectors.counting(), //Calculate the average. ( sum, count) -> sum / count ) ); System.out.println(average);
//Create an instance of HttpClient using its builder. HttpClient httpClient = HttpClient.newBuilder() .version(HttpClient.Version.HTTP_2) .build(); //Create an instance of HttpRequest using its builder. HttpRequest req = HttpRequest.newBuilder(URI.create("https://www.google.com")) .GET() .build(); /* Use the httpClient.sendAsync() method and encapsulate the response in the CompletableFuture. */ CompletableFuture<HttpResponse> resFuture = httpClient.sendAsync(req, HttpResponse.BodyHandlers.ofString()); //Use the resFuture.thenAccept to wait for the async response. resFuture.thenAccept(res -> System.out.println(res.version())); //Wait for the resFuture to to complete. resFuture.join();
var VARIABLE = TYPED_VALUE;
Token | Description |
VARIABLE | An identifier the can hold a value. |
TYPED_VALUE | The value that has an identifiable type. |
switch(VARIABLE) { case MATCH_1 [, MATCH_2][, MATCH_N] -> EXPRESSION; | THROW-STATEMENT; | BLOCK default -> EXPRESSION; | THROW-STATEMENT; | BLOCK }
Token | Description |
VARIABLE | The variable to test. |
MATCH_1, MATCH_2, MATCH_N | The value or values that can match the VARIABLE. |
EXPRESSION | A expression to execute. |
THROW-STATEMENT | A expression that throws an exception. |
BLOCK | A block of statements to execute.
If a return value is required use the yield keyword instead of return. |
public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY; } Day day = Day.WEDNESDAY; int numLetters = switch (day) { case MONDAY, FRIDAY, SUNDAY -> 6; case TUESDAY -> 7; case THURSDAY, SATURDAY -> { System.out.println(8); yield 8; } case WEDNESDAY -> { System.out.println(9); yield 9; } default -> { throw new IllegalStateException("Invalid day: " + day); } }; System.out.println(numLetters);
Use the following java option to have a more verbose exception message especially for NullPointerException:
-XX:+ShowCodeDetailsInExceptionMessages
For example, if we have the following snippet:
var a = null; a.b = 1;
Running the above snippet will have the following exception:
Exception in thread "main" java.lang.NullPointerException: Cannot assign field "b" because "a" is null
Note: This is more useful if the classes were compiled with debugging info (i.e. javac -g )
© 2025 Ron and Ella Wiki Page
Theme by Anders Noren — Up ↑
Recent Comments