Tutorial by Examples: del

You can delete trailing spaces with the following command. :%s/\s\+$//e This command is explained as follows: enter Command mode with : do this to the entire file with % (default would be for the current line) substitute action s / start of the search pattern \s whitespace character \+ e...
You can delete all blank lines in a file with the following command: :g/^$/d This command is explained as follows: enter Command mode with : g is a global command that should occur on the entire file / start of the search pattern the search pattern of blank line is ^g /end of the search pat...
Let's say that you have the following class: public class PersonInfo { public int ID { get; set; } [Display(Name = "First Name")] [Required(ErrorMessage = "Please enter your first name!")] public string FirstName{ get; set; } [Display(Name = "L...
It is possible to ask a program to execute a specific section of code only if an if statement is considered false. For this, we use the else key word. if(statement) { // Code to execute if the statement is true. } else { // Code to execute if the statement is false. } Both code se...
app\Exceptions\Handler.php public function render($request, Exception $exception) { if ($exception instanceof ModelNotFoundException) { abort(404); } return parent::render($request, $exception); } You can catch / handle any exception that is thrown in Laravel.
One example of machine learning algorithms is the Random Forest alogrithm (Breiman, L. (2001). Random Forests. Machine Learning 45(5), p. 5-32). This algorithm is implemented in R according to Breiman's original Fortran implementation in the randomForest package. Random Forest classifier objects ca...
To generate schema, view, controller, migration file for the repository, default CRUD templates and test files for a model (like a scaffolding in Rails) one can use phoenix.gen.html mix task like this: mix phoenix.gen.html Book books title note:text pages:integer author_id:references:authors Wh...
When dealing with large configuration sets of value, it might become quite unhandy to load them one buy one. Option model which comes with asp.net offers a convenient way to map a section to a dotnet poco: For instance, one might hydrate StorageOptions directly from a configuration section b addin...
var indexController = myApp.controller("indexController", function ($scope) { // controller logic goes here $scope.message = "Hello Hacking World" });
In T4 code-generation strategy used by Entity Framework 5 and higher, data annotation attributes are not included by default. To include data annotations on top of certain property every model regeneration, open template file included with EDMX (with .tt extension) then add a using statement under U...
To delete our instance, reuse the os_server command with all authentication information and simply replace ' state: present' by ' state: absent'. $vi stop_compute.yml - name: launch a compute instance hosts: localhost gather_facts: False tasks: - name: Create and launch the VM os_...
Create separate files for header and footer(as they are common for all the pages and it does not make sense to make them a part of a single page) Keep common elements(Like Search/Back/Next etc) in separate file(The idea is to remove any kind of duplication and keeping the segregation logical) Fo...
For Getting updated or to do something before app goes live to user you can use below method. AppDidFinishLaunching - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Write your code before app launch return YES; } While ...
1. What is MVVM? The Model View ViewModel (MVVM) pattern is a design pattern most commonly used for creating user interfaces. It is derived from the the popular "Model View Controller" (MVC) pattern. The major advantage of MVVM is that it separates: The internal representation of the a...
You cannot have more than one delimiter: if you specify something like -d ",;:", some implementations will use only the first character as a delimiter (in this case, the comma.) Other implementations (e.g. GNU cut) will give you an error message. $ cut -d ",;:" -f2 <<<&...
$ cut -d, -f1,3 <<<"a,,b,c,d,e" a,b is rather obvious, but with space-delimited strings it might be less obvious to some $ cut -d ' ' -f1,3 <<<"a b c d e" a b cut cannot be used to parse arguments as the shell and other programs do.
After defining the structure of your form with the WinForms designer you can display your forms in code with two different methods. Method - A Modeless form Form1 aForm1Instance = new Form1(); aForm1Instance.Show(); Method - A Modal Dialog Form2 aForm2Instance = new Form2(); aF...
A modeless form is employed (usually) when you need to shows something permanentely alongside your application main screen (think about a legend or an view on a stream of data coming asynchronously from a device or an MDI Child Window). But a modeless form poses an unique challenge when you want t...
Before starting with deletion I just want to put some lights on what is a Binary search tree(BST), Each node in a BST can have maximum of two nodes(left and right child).The left sub-tree of a node has a key less than or equal to its parent node's key. The right sub-tree of a node has a key greater ...

Page 18 of 23