Tutorial by Examples: o

The default position of an element is static. To quote MDN: This keyword lets the element use the normal behavior, that is it is laid out in its current position in the flow. The top, right, bottom, left and z-index properties do not apply. .element{ position:static; }
This example limits SELECT result to 100 rows. SELECT TOP 100 * FROM table_name; It is also possible to use a variable to specify the number of rows: DECLARE @CountDesiredRows int = 100; SELECT TOP (@CountDesiredRows) * FROM table_name;
You can define implementation for specific instantiations of a template class/method. For example if you have: template <typename T> T sqrt(T t) { /* Some generic implementation */ } You can then write: template<> int sqrt<int>(int i) { /* Highly optimized integer implement...
$orderid = 12345; $order = Mage::getModel('sales/order')->load($orderid); The above code is roughly analogous to the following SQL query. select * from sales_flat_order where entity_id=12345;
$incrementid = 100000000; $order = Mage::getModel('sales/order')->loadByIncrementId($incrementid); The above code is roughly analogous to the following SQL query. select * from sales_flat_order where increment_id=100000000; The increment_id is the customer facing order identifier, whereas...
Filter an enumeration by using a conditional expression Synonyms: Where-Object where ? Example: $names = @( "Aaron", "Albert", "Alphonse","Bernie", "Charlie", "Danny", "Ernie", "Frank") $names | Where-Object {...
Sort an enumeration in either ascending or descending order Synonyms: Sort-Object sort Assuming: $names = @( "Aaron", "Aaron", "Bernie", "Charlie", "Danny" ) Ascending sort is the default: $names | Sort-Object $names | sort Aaron Aa...
You can group an enumeration based on an expression. Synonyms: Group-Object group Examples: $names = @( "Aaron", "Albert", "Alphonse","Bernie", "Charlie", "Danny", "Ernie", "Frank") $names | Group-Object -Prope...
Projecting an enumeration allows you to extract specific members of each object, to extract all the details, or to compute values for each object Synonyms: Select-Object select Selecting a subset of the properties: $dir = dir "C:\MyFolder" $dir | Select-Object Name, FullName, Att...
Class methods present alternate ways to build instances of classes. To illustrate, let's look at an example. Let's suppose we have a relatively simple Person class: class Person(object): def __init__(self, first_name, last_name, age): self.first_name = first_name self.last...
raw_data = {'first_name': ['John', 'Jane', 'Jim'], 'last_name': ['Doe', 'Smith', 'Jones'], 'department': ['Accounting', 'Sales', 'Engineering'],} df = pd.DataFrame(raw_data,columns=raw_data.keys()) df.to_csv('data_file.csv')
This is a very common Exception. It causes your application to stop during the start or execution of your app. In the LogCat you see the message: android.content.ActivityNotFoundException : Unable to find explicit activity class; have you declared this activity in your AndroidManifest.xml? In ...
The cx and cy values designate the location of the center of the circle. The r attribute specifies the size of the radius of the circle. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <circle cx="40" cy="40&q...
In this example we use the constructor to declare a public property position and a protected property speed in the base class. These properties are called Parameter properties. They let us declare a constructor parameter and a member in one place. One of the best things in TypeScript, is automatic ...
Create a directory called ansible-helloworld-playbook mkdir ansible-helloworld-playbook Create a file hosts and add remote systems how want to manage. As ansible relies on ssh to connect the machines, you should make sure they are already accessible to you in ssh from your computer. 192.168.1.1...
public class Singleton { private static final Singleton INSTANCE = new Singleton(); private Singleton() {} public static Singleton getInstance() { return INSTANCE; } } It can be argued that this example is effectively lazy initialization. Section 12.4.1 of ...
To increment date objects in Javascript, we can usually do this: var checkoutDate = new Date(); // Thu Jul 21 2016 10:05:13 GMT-0400 (EDT) checkoutDate.setDate( checkoutDate.getDate() + 1 ); console.log(checkoutDate); // Fri Jul 22 2016 10:05:13 GMT-0400 (EDT) It is possible to use setD...
countMatches method from org.apache.commons.lang3.StringUtils is typically used to count occurences of a substring or character in a String: import org.apache.commons.lang3.StringUtils; String text = "One fish, two fish, red fish, blue fish"; // count occurrences of a substring Str...
Method references allow predefined static or instance methods that adhere to a compatible functional interface to be passed as arguments instead of an anonymous lambda expression. Assume that we have a model: class Person { private final String name; private final String surname; ...
Start with an iterable which needs to be grouped lst = [("a", 5, 6), ("b", 2, 4), ("a", 2, 5), ("c", 2, 6)] Generate the grouped generator, grouping by the second element in each tuple: def testGroupBy(lst): groups = itertools.groupby(lst, key=lambda...

Page 142 of 1038