Tutorial by Examples

#include <stdio.h> void print_all(FILE *stream) { int c; while ((c = getc(stream)) != EOF) putchar(c); } int main(void) { FILE *stream; /* call netstat command. netstat is available for Windows and Linux */ if ((stream = popen("netstat", &qu...
The POSIX C library defines the getline() function. This function allocates a buffer to hold the line contents and returns the new line, the number of characters in the line, and the size of the buffer. Example program that gets each line from example.txt: #include <stdlib.h> #include <s...
import ( "io/ioutil" "path/filepath" "gopkg.in/yaml.v2" ) func main() { filename, _ := filepath.Abs("config/config.yml") yamlFile, err := ioutil.ReadFile(filename) var config Config err = yaml.Unmarshal(yamlFile, &c...
String hubUrl = "http://localhost:4444/wd/hub" DesiredCapabilities capability = DesiredCapabilities.firefox(); //or which browser you want RemoteWebDriver driver = new RemoteWebDriver(hubUrl, capability);
Creating a hub A quick configuration for a hub and node setup in selenium grid. For more information see: Grid 2 docs Requirements To set up a grid hub you need the flowing: Selenium-server-standalone-.jar Creating the hub To Create a Hub you need to run the selenium server. Download Se...
Extension methods are useful for adding functionality to enumerations. One common use is to implement a conversion method. public enum YesNo { Yes, No, } public static class EnumExtentions { public static bool ToBool(this YesNo yn) { return yn == YesNo.Yes; ...
Using a custom inspector allows you to change the way a script is drawn in the Inspector. Sometimes you want to add extra information in the inspector for your script that isn't possible to do with a custom property drawer. Below is a simple example of a custom object that with using a custom inspe...
Sometimes you have custom objects that contain data but do not derive from MonoBehaviour. Adding these objects as a field in a class that is MonoBehaviour will have no visual effect unless you write your own custom property drawer for the object's type. Below is a simple example of a custom object,...
By default, the navigation pattern works like a stack of pages, calling the newest pages over the previous pages. You will need to use the NavigationPage object for this. Pushing new pages ... public class App : Application { public App() { MainPage = new NavigationPage(new ...
Modal pages can created in three ways: From NavigationPage object for full screen pages For Alerts and Notifications For ActionSheets that are pop-ups menus Full screen modals ... // to open await Navigation.PushModalAsync(new ModalPage()); // to close await Navigation.PopModalAsync(); ...
In CSS3, we can stack multiple background in the same element. #mydiv { background-image: url(img_1.png), /* top image */ url(img_2.png), /* middle image */ url(img_3.png); /* bottom image */ background-position: right bottom, ...
SELECT Name FROM Customers WHERE PhoneNumber IS NULL Selection with nulls take a different syntax. Don't use =, use IS NULL or IS NOT NULL instead.
The below code will turn the table with an id of tableid into a DataTable, as well as return a DataTables API instance: $(document).ready(function() { $('#tableid').DataTable(); }); Compare this to the below code, which will turn the table into a DataTable but will not return a DataTables ...
The interface defines the behaviour that you want to expose through the DependencyService. One example usage of a DependencyService is a Text-To-Speech service. There is currently no abstraction for this feature in Xamarin.Forms, so you need to create your own. Start off by defining an interface for...
The interface you defined needs to be implemented in every targeted platform. For iOS this is done through the AVFoundation framework. The following implementation of the ITextToSpeech interface handles speaking a given text in English. using AVFoundation; public class TextToSpeechiOS : ITextToS...
After you've created and registered your platform-specific classes you can start hooking them up to your shared code. The following page contains a button that triggers the text-to-speech functionality using a pre-defined sentence. It uses DependencyService to retrieve a platform-specific implementa...
The Android specific implementation is a bit more complex because it forces you to inherit from a native Java.Lang.Object and forces you to implement the IOnInitListener interface. Android requires you to provide a valid Android context for a lot of the SDK methods it exposes. Xamarin.Forms exposes ...
' Sometimes we don't need to evaluate all the conditions in an if statement's boolean check. ' Let's suppose we have a list of strings: Dim MyCollection as List(Of String) = New List(of String)() ' We want to evaluate the first value inside our list: If MyCollection.Count > 0 And MyCo...
' The OrElse operator is the homologous of AndAlso. It lets us perform a boolean ' comparison evaluating the second condition only if the first one is False If testFunction(5) = True OrElse otherFunction(4) = True Then ' If testFunction(5) is True, otherFunction(4) is not called. ' In...
Yes, you need to SETKEY pre 1.9.6 In the past (pre 1.9.6), your data.table was sped up by setting columns as keys to the table, particularly for large tables. [See intro vignette page 5 of September 2015 version, where speed of search was 544 times better.] You may find older code making use of t...

Page 313 of 1336