Tutorial by Examples: ear

In case of stackable modification, Scala arranges classes and traits in a linear order to determine method call hierarchy, which is known as linearization. The linearization rule is used only for those methods that involve method invocation via super(). Let's consider this by an example: class Shap...
Reading line by line awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' < input.fa one can read this awk script as: if the current line ($0) starts like a fasta header (^>). Then we prin...
download and linearize the 10 first FASTA sequences from UniProt: $ curl -s "ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_sprot.fasta.gz" |\ gunzip -c |\ awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N...
# models fit1 <- lm(mpg ~ wt, data = mtcars) fit2 <- lm(mpg ~ wt+hp, data = mtcars) fit3 <- lm(mpg ~ wt+hp+cyl, data = mtcars) # export to html texreg::htmlreg(list(fit1,fit2,fit3),file='models.html') # export to doc texreg::htmlreg(list(fit1,fit2,fit3),file='models.doc') Th...
NSMutableArray can be initialized as an empty array like this: NSMutableArray *array = [[NSMutableArray alloc] init]; // or NSMutableArray *array2 = @[].mutableCopy; // or NSMutableArray *array3 = [NSMutableArray array]; NSMutableArray can be initialized with another array like this: NSMuta...
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 ...
If you're just getting started with Chef, we recommend starting off with our Learn Chef tutorial at http://learn.chef.io/. If you have questions during or after that, check out or discussion forum/mailing list at https://discourse.chef.io/ or our public Slack team at https://community-slack.chef.io...
You can clear the console window using the console.clear() method. This removes all previously printed messages in the console and may print a message like "Console was cleared" in some environments.
You can set a setUp and tearDown function. A setUp function prepares your environment to tests. A tearDown function does a rollback. This is a good option when you can't modify your database and you need to create an object that simulate an object brought of database or need to init a configu...
The next function is useful even without iterating. Passing a generator expression to next is a quick way to search for the first occurrence of an element matching some predicate. Procedural code like def find_and_transform(sequence, predicate, func): for element in sequence: if predi...
jQuery datepicker has two options to allow displaying dropdowns for month and year selection. These options make navigation through large timeframes easier. <input type="text" id="datepicker"> <script> $("#datepicker").datepicker({ changeMont...
Let's say you need to check if an email address appears in a long list of email addresses. Use the MATCH function to return the row number on which the email address can be found. If there is no match, the function returns an #N/A error. =MATCH(F2,$D$2:$D$200,0) The value you're retrieving ...
Since arrays are reference types, it is possible to have multiple variables pointing to the same array object. Dim array1() As Integer = {1, 2, 3} Dim array2() As Integer = array1 array1(0) = 4 Console.WriteLine(String.Join(", ", array2)) ' Writes "4, 2, 3"
Intro An array is a container object that holds a number of values. In the following image you can see an array with size 10, the first element indexed 1 and the last element 10. Autohotkey offers a few ways of defining and creating arrays. Array := [] Array := Array() Creating and initia...
Introduction Binary Search is a Divide and Conquer search algorithm. It uses O(log n) time to find the location of an element in a search space where n is the size of the search space. Binary Search works by halving the search space at each iteration after comparing the target value to the middle ...
Save the session variable as a variable. $session = Yii::$app->session; $sess = $session['keys']; Then create or update the array value you want $sess['first'] = 'abc'; And finally save to the session variable $session['keys'] = $sess
To create a search form, enter the following code <%= form_tag("/search", method: "get") do %> <%= label_tag(:q, "Search for:") %> <%= text_field_tag(:q) %> <%= submit_tag("Search") %> <% end %> form_tag: This is t...
USE AdventureWorks2012; GO CREATE FULLTEXT INDEX ON Production.Document ( Title Language 1033, DocumentSummary Language 1033, Document TYPE COLUMN FileExtension Language 1033 ) KEY INDEX PK_Document_DocumentID ...
SELECT product_id FROM products WHERE CONTAINS(product_description, ”Snap Happy 100EZ” OR FORMSOF(THESAURUS,’Snap Happy’) OR ‘100EZ’) AND product_cost < 200 ; SELECT candidate_name,SSN FROM candidates WHERE CONTAINS(candidate_resume,”SQL Server”) AND candidate_division ...
Least squares is a standard approach to problems with more equations than unknowns, also known as overdetermined systems. Consider the four equations: x0 + 2 * x1 + x2 = 4 x0 + x1 + 2 * x2 = 3 2 * x0 + x1 + x2 = 5 x0 + x1 + x2 = 4 We can express this as a matrix multiplication A * x = b: A ...

Page 10 of 21