Tutorial by Examples: and

When Java annotations were first introduced there was no provision for annotating the target of an instance method or the hidden constructor parameter for an inner classes constructor. This was remedied in Java 8 with addition of receiver parameter declarations; see JLS 8.4.1. The receiver param...
If you would like to use vim in a manner similar to sed, you may use the -c flag to run an ex command from the command line. This command will run automatically before presenting the file to you. For example, to replace foo with bar: vim file.txt -c "s/foo/bar" This will open up the fi...
To create the serialVersionUID for a class in Kotlin you have a few options all involving adding a member to the companion object of the class. The most concise bytecode comes from a private const val which will become a private static variable on the containing class, in this case MySpecialCase: ...
Sometimes it is needful to backtrack after reading. # identify current position in file, in case the first line isn't a comment my $current_pos = tell; while (my $line = readline $fh) { if ($line =~ /$START_OF_COMMENT_LINE/) { push @names, get_name_from_comment($line); ...
sort command is used to sort a list of lines. Input from a file sort file.txt Input from a command You can sort any output command. In the example a list of file following a pattern. find * -name pattern | sort
Even if the result type of the query isn’t an entity type, if the result contains entity types they will still be tracked by default Example : In the following query, which returns an anonymous type, the instances of Book in the result set will be tracked using (var context = new BookC...
The JAR, WAR and EAR files types are fundamentally ZIP files with a "manifest" file and (for WAR and EAR files) a particular internal directory / file structure. The recommended way to create these files is to use a Java-specific build tool which "understands" the requirements f...
If the ORDER BY clause is specified in your update SQL statement, the rows are updated in the order that is specified. If LIMIT clause is specified in your SQL statement, that places a limit on the number of rows that can be updated. There is no limit, if LIMIT clause not specified. ORDER BY and L...
By default Controllers, ViewComponents and TagHelpers aren't registered and resolved via the dependency injection container. This results in the inability to do i.e. property injection when using a 3rd party Inversion of Control (IoC) container like AutoFac. In order to make ASP.NET Core MVC resolv...
For example, we have two environments: CI - Staging and want to add some customizations for each environment. Here I will try to customize server URL, app name. First, we create two targets for 2 environments by duplicating the main target: For each target, we will define a custom macro. Here I ...
This example has more tests available in unit testing. Employee.vb (Class Library) ''' <summary> ''' Employee Class ''' </summary> Public Class Employee ''' <summary> ''' First name of employee ''' </summary> Public Property FirstName As String = &q...
To set the environment to Development SET ASPNETCORE_ENVIRONMENT=Development Now running an Asp.Net Core application will be in the defined environment. Note There should be no space before and after the equality sign =. The command prompt should not be closed before running the application b...
Xamarin is becoming more and more popular - it is hard to decide when to use Xamarin.Forms and when Xamarin.Platform (so Xamarin.iOS and Xamarin.Android). First of all you should know for what kind of applications you can use Xamarin.Forms: Prototypes - to visualize how your application will l...
Writing a gzipped file To write a gzipped file, use the module IO::Compress::Gzip and create a filehandle by creating a new instance of IO::Compress::Gzip for the desired output file: use strict; use warnings; use open qw( :encoding(UTF-8) :std ); # Make UTF-8 default encoding use IO::Compres...
Sometimes, it's better to have only three options style="@android:style/TextAppearance.Small" style="@android:style/TextAppearance.Medium" style="@android:style/TextAppearance.Large" Use small and large to differentiate from normal screen size. <TextView ...
To handle a command, you must have a class that implements the CommandExecutor interface. The JavaPlugin class (your plugin's main class) already implements this. When implementing the CommandExecutor interface, the following method must be implemented: public boolean onCommand(CommandSender sende...
Samtools can be used to convert between sam and bam: -b indicates that the input file will be in BAM format -S indicates that the stdout should be in SAM format samtools view -sB thing.bam > thing.sam And to convert between sam and bam: samtools view thing.sam > thing.bam samtools ...
Add Firebase to Your Android Project Add Firebase to your app To add Firebase to your app you'll need a Firebase project and a Firebase configuration file for your app. Create a Firebase project in the Firebase console, if you don't already have one. If you already have an existing Google proje...
A Cmd cannot be reused after calling its Run, Output or CombinedOutput methods Running a command twice will not work: cmd := exec.Command("xte", "key XF86AudioPlay") _ := cmd.Run() // Play audio key press // .. do something else err := cmd.Run() // Pause audio key press,...
Here we will create collection for losses of Neural Network's computational graph. First create a computational graph like so: with tf.variable_scope("Layer"): W = tf.get_variable("weights", [m, k], initializer=tf.zeros_initializer([m, k], dtype=tf.float32)) ...

Page 104 of 153