Tutorial by Examples: f

The @import statement allows you to insert CSS/Less code from another file into your own CSS/Less file. .foo { background: #900; } @import "my-other-css-file.css"; @import "my-other-less-file.less";
Import the class, which contains the method to be tested. Perform the operation with dummy data. Now compare the result of operation with expected result. - (void)testReverseString{ NSString *originalString = @"hi_my_name_is_siddharth"; NSString *reversedString = [self.someObject ...
- (void)testDoSomethingThatTakesSomeTime{ XCTestExpectation *completionExpectation = [self expectationWithDescription:@"Long method"]; [self.someObject doSomethingThatTakesSomeTimesWithCompletionBlock:^(NSString *result) { XCTAssertEqualObjects(@"result", result, @"Re...
1. For Synchronous methods : - (void)testPerformanceReverseString { NSString *originalString = @"hi_my_name_is_siddharth"; [self measureBlock:^{ [self.someObject reverseString:originalString]; }]; } 2. For Asynchronous methods : - (void)testPerformanceOfAsynch...
You want to add a signature to a PDF in a way that a standard conform PDF viewer (e.g. Adobe Reader) will recognize, display, and validate as an integrated PDF signature. In that case you cannot simply externally create a signature covering the original PDF as is and expect to now have to merely so...
If multiple signatures are to be integrated into a PDF, this is done by means of incremental PDF updates (explicitly not by adding multiple SignerInfo structures to a single integrated CMS signature container!): The cryptographic verification of these signatures merely guarantees that the byte ra...
Install PDFTK Server from https://www.pdflabs.com/tools/pdftk-server/ PDFtk Server is a command line tool which can: • Merge PDF Documents or Collate PDF Page Scans • Split PDF Pages into a New Document • Rotate PDF Documents or Pages • Decrypt Input as Necessary (Password Required...
Functions are found by first collecting a set of "associated classes" and "associated namespaces" that include one ore more of the following, depending on the argument type T. First, let us show the rules for classes, enumeration and class template specialization names. If T i...
This example demonstrates how you can respond to a button click by performing some work on a worker thread and then update the user interface to indicate completion void MyButton_OnClick(object sender, EventArgs args) { Task.Run(() => // Schedule work using the thread pool { ...
C++11 Motivational example When you have a variadic template pack in the template parameters list, like in the following code snippet: template<typename ...Args> void func(Args &&...args) { //... }; The standard library (prior to C++17) offers no direct way to write enable_if...
IRandomAccessStreamReference bitmap = GetBitmap(); IRandomAccessStreamWithContentType stream = await bitmap.OpenReadAsync(); BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream); var pixels = await decoder.GetPixelDataAsync(); var outStream = new InMemoryRandomAccessStream(); // Cr...
Factory is available in run phase. The Factory recipe constructs a new service using a function with zero or more arguments (these are dependencies on other services). The return value of this function is the service instance created by this recipe. Factory can create a service of any type, w...
ImageSource result = new BitmapImage(new Uri("ms-appx:///Assets/Windows_10_Hero.png")); Use result to set the Source property of an Image control either though a Binding or code-behind
public static async Task<ImageSource> FromStorageFile(StorageFile sf) { using (var randomAccessStream = await sf.OpenAsync(FileAccessMode.Read)) { var result = new BitmapImage(); await result.SetSourceAsync(randomAccessStream); return result; } } ...
Quick start A rule describes when and how certain files (rule's targets) are created. It can also serve to update a target file if any of the files required for its creation (target's prerequisites) are newer than the target. Rules follow the syntax below: (Note that commands following a rule are ...
In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. Wikipedia reference protocol SenderProtocol { func send(packa...
nrs = [1, 2, 3, 4, 5, 6, 7, 8, 9] lets = ['a', 'b', 'c', 'd', 'e', 'f'] println GroovyCollections.transpose([nrs, lets]) .collect {le -> [(le[0]):le[1]]}.collectEntries { it } or println [nrs,lets].transpose().collectEntries{[it[0],it[1]]} // [1:a, 2:b, 3:c, 4:d, 5:e, 6:f...
A BroadcastReceiver is basically a mechanism to relay Intents through the OS to perform specific actions. A classic definition being "A Broadcast receiver is an Android component which allows you to register for system or application events." LocalBroadcastManager is a way to send ...
AsyncTask is an abstract Class and does not inherit the Thread class. It has an abstract method doInBackground(Params... params), which is overridden to perform the task. This method is called from AsyncTask.call(). Executor are part of java.util.concurrent package. Moreover, AsyncTask contains 2 ...
Using Picasso as ImageGetter for Html.fromHtml public class PicassoImageGetter implements Html.ImageGetter { private TextView textView; private Picasso picasso; public PicassoImageGetter(@NonNull Picasso picasso, @NonNull TextView textView) { this.picasso = picasso; this.textView...

Page 238 of 457