Tutorial by Examples: f

To check if a method was called on a mocked object you can use the Mockito.verify method: Mockito.verify(someMock).bla(); In this example, we assert that the method bla was called on the someMock mock object. You can also check if a method was called with certain parameters: Mockito.verify(som...
If a scoped enum is converted to an integral type that is too small to hold its value, the resulting value is unspecified. Example: enum class E { X = 1, Y = 1000, }; // assume 1000 does not fit into a char char c1 = static_cast<char>(E::X); // c1 is 1 char c2 = static_cast<c...
Setting overflow value to hidden,auto or scroll to an element, will clear all the floats within that element. Note: using overflow:scroll will always show the scrollbox
Using git show we can view a single commit git show 48c83b3 git show 48c83b3690dfc7b0e622fd220f8f37c26a77c934 Example commit 48c83b3690dfc7b0e622fd220f8f37c26a77c934 Author: Matt Clark <[email protected]> Date: Wed May 4 18:26:40 2016 -0400 The commit message will be show...
When committing changes it is possible to specify that the commit will in future be squashed to another commit and this can be done like so, git commit --squash=[commit hash of commit to which this commit will be squashed to] One might also use, --fixup=[commit hash] alternatively to fixup. It is...
Sitecore Instance Manager is open-source tool which is used for managing the local park of Sitecore instances. You can install, locate, maintain, reinstal or delete Sitecore products. It also helps you install your sitecore instance with any sitecore packages, modules and only thing you need to do i...
What you need is to get an entitlements file so the app can access your iCloud and write records using CloudKit. Follow the steps to grant access to iCloud from your app: 1- Select the project in the Project Navigator, and then open the General tab. 2- In the Identity section, set your developer ...
HTML <div> This div is too small to display its contents to display the effects of the overflow property. </div> CSS div { width:100px; height:100px; overflow:scroll; } Result The content above is clipped in a 100px by 100px box, with scrolling available ...
overflow-wrap tells a browser that it can break a line of text inside a targeted element onto multiple lines in an otherwise unbreakable place. Helpful in preventing an long string of text causing layout problems due to overflowing it's container. CSS div { width:100px; outline: 1px dash...
c++11 The alignment requirement of a type can be queried using the alignof keyword as a unary operator. The result is a constant expression of type std::size_t, i.e., it can be evaluated at compile time. #include <iostream> int main() { std::cout << "The alignment requiremen...
Check this out: :help holy-grail
Fixtures are initial data for the database. The most straightforward way when you have some existing data already is to use the command dumpdata ./manage.py dumpdata > databasedump.json # full database ./manage.py dumpdata myapp > databasedump.json # only 1 app ....
Following are the page life cycle events: PreInit - PreInit is the first event in page life cycle. It checks the IsPostBack property and determines whether the page is a postback. It sets the themes and master pages, creates dynamic controls, and gets and sets profile property values. This event ca...
Asp.net is web application framework developed by Microsoft to build dynamic data-driven Web Application and WebServices. Asp.net is basically a subset of wider .NET framework. A framework is nothing but a collection of classes. In .NET Framework you can build Console application. Web Applicatio...
This is how the right fold is implemented: foldr :: (a -> b -> b) -> b -> [a] -> b foldr f z [] = z foldr f z (x:xs) = f x (foldr f z xs) -- = x `f` foldr f z xs The right fold, foldr, associates to the right. That is: foldr (+) 0 [1, 2, 3] -- is equivalen...
To create a UDF, we need to extend UDF (org.apache.hadoop.hive.ql.exec.UDF) class and implement evaluate method. Once UDF is complied and JAR is build, we need to add jar to hive context to create a temporary/permanent function. import org.apache.hadoop.hive.ql.exec.UDF; class UDFExample ex...
Current date and time can be found with getCurrentTime: import Data.Time print =<< getCurrentTime -- 2016-08-02 12:05:08.937169 UTC Alternatively, just the date is returned by fromGregorian: fromGregorian 1984 11 17 -- yields a Day
Like Getting a result from another Activity you need to call the Fragment's method startActivityForResult(Intent intent, int requestCode). note that you should not call getActivity().startActivityForResult() as this will take the result back to the Fragment's parent Activity. Receiving the result c...
Here a simple portable way to get the current device family: /// <summary> /// All the device families /// </summary> public enum DeviceFamily { Desktop, Mobile, Iot, Xbox, } /// <summary> /// The helper to get the current device family /// </summ...
Depending on the device/release version of the system, some API may not be available. You can check which contract is supported by using ApiInformation.IsApiContractPresent() For example, this will return true on phone devices and false on the others ApiInformation.IsApiContractPresent(typeof(Cal...

Page 227 of 457