Tutorial by Examples: sin

To easily select a buffer by filename, you can use: :b [part_of_filename]<Tab><Tab><Tab>...<Enter> The first Tab will expand the word to a full filename, and subsequent Tab presses will cycle through the list of possible matches. When multiple matches are available, you ...
public interface ILogger { void Log(string message); } [Export(typeof(ILogger))] [ExportMetadata("Name", "Console")] public class ConsoleLogger:ILogger { public void Log(string message) { Console.WriteLine(message); } } [Export(typeof(IL...
Marks are like bookmarks; they help you find places you've already been. TLDR Set them in normal mode with m{a-zA-Z}, and jump to them in normal or visual mode with '{a-zA-Z} (single quote) or `{a-zA-Z} (backtick). Lowercase letters are for marks within a buffer, and capital letters and digits are...
You can close a notification by using the .close() method. let notification = new Notification(title, options); // do some work, then close the notification notification.close() You can utilize the setTimeout function to auto-close the notification sometime in the future. let notification = n...
import java.awt.EventQueue; import java.awt.GridLayout; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.sw...
Create a font extension using the IDE. See the iReport or Jaspersoft Studio documentation for details. The font extension can also be created manually. What are font extensions? Using a textElement you can specify a font (if not specified default font SansSerif is used) <textElement> &...
An event stream to the server can be closed using the EventSource.close() method var eventSource = new EventSource("api/my-events"); // do things ... eventSource.close(); // you will not receive anymore events from this object The .close() method does nothing is the stream is already...
Objective-C NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(id item, NSDictionary *bindings) { return [item isKindOfClass:[UILabel class]]; }]; Swift let predicate = NSPredicate { (item, bindings) -> Bool...
Objective-C NSPredicate *predicate = [NSPredicate predicateWithFormat: @"self[SIZE] = %d", 5)]; Swift let predicate = NSPredicate(format: "self[SIZE] >= %d", 5) In this example, the predicate will match items that are arrays with length of at least 5.
Objective-C NSArray *heroes = @[@"tracer", @"bastion", @"reaper", @"junkrat", @"roadhog"]; NSPredicate *template = [NSPredicate predicateWithFormat:@"self BEGINSWITH $letter"]; NSDictionary *beginsWithRVariables = @{ @"letter&qu...
To prevent memory leaks, one should not forget to close an input stream or an output stream whose job is done. This is usually done with a try-catch-finally statement without the catch part: void writeNullBytesToAFile(int count, String filename) throws IOException { FileOutputStream out = null...
GET your REST data and store in a PowerShell object: $Post = Invoke-RestMethod -Uri "http://jsonplaceholder.typicode.com/posts/1" Modify your data: $Post.title = "New Title" PUT the REST data back $Json = $Post | ConvertTo-Json Invoke-RestMethod -Method Put -Uri "h...
GET your REST data and store in a PowerShell object: $Users = Invoke-RestMethod -Uri "http://jsonplaceholder.typicode.com/users" Modify many items in your data: $Users[0].name = "John Smith" $Users[0].email = "[email protected]" $Users[1].name = "Jane S...
Identify the item that is to be deleted and delete it: Invoke-RestMethod -Method Delete -Uri "http://jsonplaceholder.typicode.com/posts/1"
If you have void F1(MyType1 x) { // do something } void F1(MyType2 x) { // do something else } and for some reason you need to call the first overload of F1 but with x = null, then doing simply F1(null); will not compile as the call is ambiguous. To counter this you can do F1...
A user is looking to use caffe for CNN training and testing. The user decides upon the CNN architecture design (e.g - No. of layers, No. of filters and their details etc). The user also decides the optimization technique for training and learning parameters in case training is to be carried out...
Draper automatically matches up models with their decorators by convention. # app/decorators/user_decorator.rb class UserDecorator < Draper::Decorator def full_name "#{object.first_name} #{object.last_name}" end def created_at Time.use_zone(h.current_user.timezone...
String macros are syntactic sugar for certain macro invocations. The parser expands syntax like mymacro"my string" into @mymacro_str "my string" which then, like any other macro call, gets substituted with whatever expression the @mymacro_str macro returns. Base Julia com...
Consider this CSV data: #id,title,text 1,hello world,"This is a ""blog""." 2,second time,"My second entry." This data can be read with the following code: // r can be any io.Reader, including a file. csvReader := csv.NewReader(r) // Set comment char...
The quickest way to get started with Watson services is to use the Watson Developer Cloud SDKs. The following GitHub repositories contain installation instructions and basic usage examples: Android iOS Java Node.js Python Unity For example, here's how to make an AlchemyLanguage API call w...

Page 97 of 161