Tutorial by Examples: attribut

[TestCase(0, 0, 0)] [TestCase(34, 25, 59)] [TestCase(-1250, 10000, 8750)] public void AddNumbersTest(int a, int b, int expected) { // Act int result = a + b; // Assert Assert.That(result, Is.EqualTo(expected)); }
[TestCase(0, 0, 0)] [TestCase(34, 25, 59)] [TestCase(-1250, 10000, 8750)] public void AddNumbersTest(int a, int b, int expected) { // Act int result = a + b; // Assert Assert.That(result, Is.EqualTo(expected)); }
HTML Tag: Tag attributes look similar to html, however their values are just regular JavaScript. a(href='google.com') Google a(class='button', href='google.com') Google Result: <a href="google.com">Google</a><a href="google.com" class="button">G...
By default, all attributes are escaped (replacing special characters with escape sequences) to prevent attacks such as cross site scripting. If you need to use special characters you can use != instead of =. Code: div(escaped="<code>") div(unescaped!="<code>") R...
Boolean attributes are mirrored by Jade, and accept bools, aka true or false. When no value is specified true is assumed. Code: input(type='checkbox', checked) input(type='checkbox', checked=true) input(type='checkbox', checked=false) input(type='checkbox', checked=true.toString()) Result: ...
The style attribute can be a string (like any normal attribute) but it can also be an object, which is handy when parts of the style are generated by JavaScript. Code: a(style={color: 'red', background: 'green'}) Result: <a style="color:red;background:green"></a>
The class attribute can be a string (like any normal attribute) but it can also be an array of class names, which is handy when generated from JavaScript. Code: - var classes = ['foo', 'bar', 'baz'] a(class=classes) //- the class attribute may also be repeated to merge arrays a.bing(class=class...
Pronounced "and attributes", the &attributes syntax can be used to explode an object into attributes of an element. Code: div#foo(data-bar="foo")&attributes({'data-foo': 'bar'}) Result: <div id="foo" data-bar="foo" data-foo="bar">&l...
inputype attribute in EditText widget: (tested on Android 4.4.3 and 2.3.3) <EditText android:id="@+id/et_test" android:inputType="?????"/> textLongMessage= Keyboard: alphabet/default. Enter button: Send/Next. Emotion: yes. Case: lowercase. Suggestion: yes. Add. chars: ,...
The preserveAspectRatio attribute has an optional parameter: meet | slice. The default behavior is meet which stretches the content in both the x and y dimension until it fills either the width or height of the viewBox. The alternative - slice preserves the aspect ratio of the content but scales up ...
All instances of an entity class with one of the class attributes matching a specified value can be retrieved as follows: public interface FooRepository extends CrudRepository<Foo, Long> { List<Foo> findAllByName(String name); } Invoking the findAllByName method results in the JP...
Frontend Interface /** * Entity attribute frontend interface * * Frontend is providing the user interface for the attribute * */ interface Mage_Eav_Model_Entity_Attribute_Frontend_Interface { } Source Interface /** * Entity attribute select source interface * * Source is providing ...
Attributes can be useful for denoting metadata on enums. Getting the value of this can be slow, so it is important to cache results. private static Dictionary<object, object> attributeCache = new Dictionary<object, object>(); public static T GetAttribute<T, V>(this V va...
XPath selectors can be used to select elements with specific attributes, such as class, id, title etc. By Class View: <div class="HakunaMatata"> Hakuna Matata </div> Code: var theLionKing= element(by.xpath('//div[@class="HakunaMatata"]')); expect(theLionKing.g...
Query: query:/sitecore/content/[@@templatename='Homepage'] Result: home (name: home, path: /sitecore/content/home, template name: Homepage)
HTML to NSAttributedString conversion Code :- //HTML String NSString *htmlString=[[NSString alloc]initWithFormat:@"<!DOCTYPE html><html><body><h1>My First Heading</h1><p>My first paragraph.</p></body></html>"]; //Converting HTML s...
Objective-C NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Hello. That is a test attributed string."]; [str addAttribute:NSBackgroundColorAttributeName value:[UIColor yellowColor] range:NSMakeRange(3,5)]; [str addAttribute:NSForegroundColorAttrib...
NSMutableAttributedString * string = [[NSMutableAttributedString alloc] initWithString:@"firstsecondthird"]; [string addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0,5)]; [string addAttribute:NSForegroundColorAttributeName value:[UIColor greenColo...
Using srcset with sizes <img sizes="(min-width: 1200px) 580px, (min-width: 640px) 48vw, 98vw" srcset="img/hello-300.jpg 300w, img/hello-600.jpg 600w, img/hello-900.jpg 900w, img/hello-1200.jpg 1200w" src="img/hello-900.jpg&quo...
3.3 Instancing can be done via modifications to how vertex attributes are provided to the vertex shader. This introduces a new way of accessing attribute arrays, allowing them to provide per-instance data that looks like a regular attribute. A single instance represents one object or group of vert...

Page 8 of 10