Tutorial by Examples: c

Method references make excellent self-documenting code, and using method references with Streams makes complicated processes simple to read and understand. Consider the following code: public interface Ordered { default int getOrder(){ return 0; } } public interface Valued&lt...
An object cannot occupy less than 1 byte, as then the members of an array of this type would have the same address. Thus sizeof(T)>=1 always holds. It's also true that a derived class cannot be smaller than any of its base classes. However, when the base class is empty, its size is not necessaril...
Gradient Boosting for classification. The Gradient Boosting Classifier is an additive ensemble of a base model whose error is corrected in successive iterations (or stages) by the addition of Regression Trees which correct the residuals (the error of the previous stage). Import: from sklearn.ensem...
Starting an Ionic App $ ionic start myapp [template] Starter templates can either come from a named template, a Github repo, a Codepen, or a local directory. A starter template is what becomes the www directory within the Cordova project. Named template starters tabs (Default) sidemen...
Given a file file.txt with the following content: line 1 line 2 line 3 You can add a new line using below command sed '/line 2/{x;p;x;}' file.txt The above command will output line 1 line 2 line 3 Explanation: x command is eXchange. sed has a buffer that you can use to store some ...
$ cat ip.txt address range substitution pattern sample Range specified is inclusive of those line numbers $ sed -n '2,4p' ip.txt range substitution pattern $ can be used to specify last line. Space can be used between address and command for clarity $ sed -n '3,$ s/[aeiou]/...
$ cat ip.txt address range substitution pattern sample Add Sub Mul Div Lines matching a pattern $ sed '/add/d' ip.txt range substitution pattern sample Add Sub Mul Div $ sed -n '/t/p' ip.txt substitution pattern $ sed -n '/[A-Z]/ s| |/|gp' ip.txt Add/Sub/Mul/Div ...
$ cat ip.txt address range substitution pattern sample Add Sub Mul Div Line number to line matching pattern $ sed -n '2,/pat/p' ip.txt range substitution pattern Line matching pattern to line number $ sed '/pat/,$d' ip.txt address range substitution GNU sed ...
Suppose we have a file cat -n lorem_ipsum.txt 1 Lorem Ipsum is simply dummy text of the printing and typesetting industry. 2 Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen...
Follow this steps for adding splash screen into WPF application in Visual Studio: Create or get any image and add it to your project (e.g. inside Images folder): Open properties window for this image (View → Properties Window) and change Build Action setting to SplashScreen value: R...
If your application is lightweight and simple, it will launch very fast, and with similar speed will appear and disappear splash screen. As soon as splash screen disappearing after Application.Startup method completed, you can simulate application launch delay by following this steps: Open App.x...
AWK often used for manipulating entire files containing a list of strings. Let's say file awk_test_file.txt contains: First String Second String Third String To convert all the strings to lower case execute: awk '{ print tolower($0) }' awk_test_file.txt This will result: first string se...
General overview The background-size property enables one to control the scaling of the background-image. It takes up to two values, which determine the scale/size of the resulting image in vertical and and horizontal direction. If the property is missing, its deemed auto in both width and height....
Using The Terminal The examples in this document assume that you are using a POSIX-compliant (such as bash, sh, zsh, ksh) shell. Large portions of GNU/Linux functionality are achieved using the terminal. Most distributions of Linux include terminal emulators that allow users to interact with a...
# This comment occupies a whole line - some item # This comment succeeds content of a line - http://example.com/#nocomment - "This # does not introduce a comment." - | This is a block scalar. A # inside it does not introduce a comment. # unless it is less indented than th...
ShortcutDescriptionCtrl + rsearch the history backwardsCtrl + pprevious command in historyCtrl + nnext command in historyCtrl + gquit history searching modeAlt + .use the last word of the previous commandrepeat to get the last word of the previous + 1 commandAlt + n Alt + .use the nth word of the pr...
ShortcutDescriptionCtrl + amove to the beginning of the lineCtrl + emove to the end of the lineCtrl + kKill the text from the current cursor position to the end of the line.Ctrl + uKill the text from the current cursor position to the beginning of the lineCtrl + wKill the word behind the current cur...
ShortcutDescriptionCtrl + cStop the current jobCtrl + zSuspend the current job (send a SIGTSTP signal)
Converter between boolean and visibility. Get bool value on input and returns Visibility value. NOTE: This converter have already exists in System.Windows.Controls namespace. public sealed class BooleanToVisibilityConverter : IValueConverter { /// <summary> /// Convert bool or Nu...
Show how to create simple converter with parameter via property and then pass it in declaration. Convert bool value to Visibility. Allow invert result value by setting Inverted property to True. public class BooleanToVisibilityConverter : IValueConverter { public bool Inverted { get; set; } ...

Page 329 of 826