Tutorial by Examples: ti

Function EnableShift() 'This function enables the SHIFT key at startup. This action causes 'the Autoexec macro and the Startup properties to be bypassed 'if the user holds down the SHIFT key when the user opens the database. On Error GoTo errEnableShift Dim db As DAO.Database Dim p...
Tuples can be compared based on their elements. As an example, an enumerable whose elements are of type Tuple can be sorted based on comparisons operators defined on a specified element: List<Tuple<int, string>> list = new List<Tuple<int, string>>(); list.Add(new Tuple<...
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;
This example limits SELECT result to 15 percentage of total row count. SELECT TOP 15 PERCENT * 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...
$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...
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...
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 ...
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 ...
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...
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...
To use multiple filters, separate each value with a space. HTML <img src='donald-duck.png' alt='Donald Duck' title='Donald Duck' /> CSS img { -webkit-filter: brightness(200%) grayscale(100%) sepia(100%) invert(100%); filter: brightness(200%) grayscale(100%) sepia(100%) invert(1...
Carousel components can be instantiated via jQuery with the function $('.carousel').carousel(options), where $('.carousel') is a top-level reference to the specific carousel and options is a Javascript object specifying the carousel's default attributes. The options object allows for multiple prope...
using System; using Xamarin.Forms; namespace NavigationApp { public class App : Application { public App() { MainPage = new NavigationPage(new FirstPage()); } } public class FirstPage : ContentPage { Label FirstPage...
To generate random permutation of 5 numbers: sample(5) # [1] 4 5 3 1 2 To generate random permutation of any vector: sample(10:15) # [1] 11 15 12 10 14 13 One could also use the package pracma randperm(a, k) # Generates one random permutation of k of the elements a, if a is a vector, # ...
Create an individual Localizable.strings file for each language. The right side would be different for each language. Think of it as a key-value pair: "str" = "str-language"; Access str in Objective-C: //Try to provide description on the localized string to be able to create...
Swift myButton.titleLabel?.font = UIFont(name: "YourFontName", size: 20) Objective C myButton.titleLabel.font = [UIFont fontWithName:@"YourFontName" size:20];
Arrays You can iterate over nested arrays: [[1, 2], [3, 4]].each { |(a, b)| p "a: #{ a }", "b: #{ b }" } The following syntax is allowed too: [[1, 2], [3, 4]].each { |a, b| "a: #{ a }", "b: #{ b }" } Will produce: "a: 1" "b: 2" ...

Page 75 of 505