Tutorial by Examples: is

Use Nuget to find the Web Api Package. You can do that either by using the Manage Nuget Packages and searching for the Web Api package or use Nuget Package Manager and type PM> Install-Package Microsoft.AspNet.WebApi Add WebApiConfig.cs to the App_Start/ folder The config file should contain...
Getting all serial ports information from Windows is often necessary, you may want to give the user a choice of ports to open, or check if your device is connected. In addition, some ports just cannot be opened using a "COMx" string and need to be opened using a device name. Some older v...
this in function refers to instance object used to call that function but this in arrow function is equal to this of function in which arrow function is defined. Let's understand using diagram Understanding using examples. var normalFn = function(){ console.log(this) // refers to global/windo...
Celery requires a broker to handle message-passing. We use RabbitMQ because it’s easy to setup and it is well supported. Install rabbitmq using the following command sudo apt-get install rabbitmq-server Once the installation is complete, create user, add a virtual host and set permissions. sud...
This example will help to have the Edit text with the icon at the right side. Note: In this just I am using setCompoundDrawablesWithIntrinsicBounds, So if you want to change the icon position you can achieve that using setCompoundDrawablesWithIntrinsicBounds in setIcon. public class MKEditTe...
There are three different properties for styling list-items: list-style-type, list-style-image, and list-style-position, which should be declared in that order. The default values are disc, outside, and none, respectively. Each property can be declared separately, or using the list-style shorthand p...
Here the simplest recursive function over list type. This function only navigate into a list from its start to its end and do nothing more. -spec loop(list()) -> ok. loop([]) -> ok; loop([H|T]) -> loop(T). You can call it like this: loop([1,2,3]). % will return ok. Here the ...
Like list, simplest function over iolist and bitstring is: -spec loop(iolist()) -> ok | {ok, iolist} . loop(<<>>) -> ok; loop(<<Head, Tail/bitstring>>) -> loop(Tail); loop(<<Rest/bitstring>>) -> {ok, Rest} You can call it like this: lo...
You can make function passed to test() method async - then you can use await keyword. Your test will wait until Promises resolve and testing asynchronous code becomes easier and more readable. In the following example call that returns a Promise is changeset.validate(). Please notice also wrapping s...
Let's say that Bob owns a social website that allows users to personalize their profiles. Alice goes to Bob's website, creates an account, and goes to her profile settings. She sets her profile description to I'm actually too lazy to write something here. When her friends view her profile, this co...
Let's say that Bob owns a site that lets you post public messages. The messages are loaded by a script that looks like this: addMessage("Message 1"); addMessage("Message 2"); addMessage("Message 3"); addMessage("Message 4"); addMessage("Message 5&qu...
If you don't think that malicious scripts can harm your site, you are wrong. Here is a list of what a malicious script could do: Remove itself from the DOM so that it can't be traced Steal users' session cookies and enable the script author to log in as and impersonate them Show a fake "Yo...
A Django model typically refers to a table in the database, attributes of that model becomes the column of that table. In more of a real-world example, you would create a model for any entity in your application, and store its attributes with django fields which automatically handles data-types conv...
Two main techniques allow passing data between GUI functions and Callbacks: setappdata/getappdata and guidata (read more about it). The former should be used for larger variables as it is more time efficient. The following example tests the two methods' efficiency. A GUI with a simple button is cre...
The procedures bellow will temporarily disable all Excel features at WorkBook and WorkSheet level FastWB() is a toggle that accepts On or Off flags FastWS() accepts an Optional WorkSheet object, or none If the ws parameter is missing it will turn all features on and off for all WorkSh...
You can read all items either from any config file or type it inline. Considering if its saved in Config File // Read all list items from config file string[] countryDV = ConfigurationManager.AppSettings["countryDV"].Split(',').Select(s => s.Trim().ToUpper()).ToArray(); int DVRowLim...
Approach in this case will be different than previous example because Excel file supports the Data validation for list of items with total character count less than 256 if all items are binded directly as in previous example. But in many situation list items can be longer than 256 characters and in ...
dvConstraint = (XSSFDataValidationConstraint)validationHelper.CreateExplicitListConstraint(new string[] { "MON", "TUE" , "WED", "THU", "FRI"});
2 in [2, 3] In Python this evaluates to True, but in JavaScript to false. This is because in Python in checks if a value is contained in a list, so 2 is in [2, 3] as its first element. In JavaScript in is used with objects and checks if an object contains the property with the name expressed by t...

Page 107 of 109