Tutorial by Examples: c

A switch is a command line argument which takes no value. It can be specified with: desc.add_options() ("hidden", po::bool_switch()->default_value(false), "Hide your name"); And used with: if (vm["hidden"].as<bool>()) std::cout << "Hello ...
Introduction: Swagger is a set of rules/specifications for a format describing REST APIs. It provides a powerful and actively developed ecosystem of tools around this formal specification like code generators and editors. The best part of Swagger is that the documentation of methods, parameters, an...
One useful feature of extension methods is that you can create common methods for an interface. Normally an interface cannot have shared implementations, but with extension methods they can. public interface IVehicle { int MilesDriven { get; set; } } public static class Extensions { ...
If you're using an icon to add some extra decoration or branding, it does not need to be announced to users as they are navigating your site or app aurally. Additionally, if you're using an icon to visually re-emphasize or add styling to content already present in your HTML, it does not need to be r...
Rather than use clearRect which makes all pixels transparent you may want a background. To clear with a gradient // create the background gradient once var bgGrad = ctx.createLinearGradient(0,0,0,canvas.height); bgGrad.addColorStop(0,"#0FF"); bgGrad.addColorStop(1,"#08F"); ...
This example show you how to trim a bezier. The function trimBezier trims the ends off of the curve returning the curve fromPos to toPos. fromPos and toPos are in the range 0 to 1 inclusive, It can trim quadratic and cubic curves. The curve type is determined by the last x argument x4. If not undef...
Given the 4 points of a cubic Bezier curve the following function returns its length. Method: The length of a cubic Bezier curve does not have a direct mathematical calculation. This "brute force" method finds a sampling of points along the curve and calculates the total distance spanne...
PM> uninstall-Package EntityFramework -Version 6.1.2
When writing wrappers for unmanaged resources, you should subclass SafeHandle rather than trying to implement IDisposable and a finalizer yourself. Your SafeHandle subclass should be as small and simple as possible to minimize the chance of a handle leak. This likely means that your SafeHandle imple...
Right click on the solution, Add new project From the Test section, select an Unit Test Project Pick a name for the assembly - if you are testing project Foo, the name can be Foo.Tests Add a reference to the tested project in the unit test project references
MSTest (the default testing framework) requires you to have your test classes decorated by a [TestClass] attribute, and the test methods with a [TestMethod] attribute, and to be public. [TestClass] public class FizzBuzzFixture { [TestMethod] public void Test1() { //arrange...
var serialPort = new SerialPort("COM1", 9600, Parity.Even, 8, StopBits.One); serialPort.Open(); serialPort.WriteLine("Test data"); string response = serialPort.ReadLine(); Console.WriteLine(response); serialPort.Close();
void SetupAsyncRead(SerialPort serialPort) { serialPort.DataReceived += (sender, e) => { byte[] buffer = new byte[4096]; switch (e.EventType) { case SerialData.Chars: var port = (SerialPort)sender; int bytesToRead = p...
using System.IO.Ports; namespace TextEchoService { class Program { static void Main(string[] args) { var serialPort = new SerialPort("COM1", 9600, Parity.Even, 8, StopBits.One); serialPort.Open(); string message = &quot...
using System; using System.Collections.Generic; using System.IO.Ports; using System.Text; using System.Threading; namespace AsyncReceiver { class Program { const byte STX = 0x02; const byte ETX = 0x03; const byte ACK = 0x06; const byte NAK = 0x15...
An integer type large enough to represent all characters of the largest supported extended character set, also known as the wide-character set. (It is not portable to make the assumption that wchar_t uses any particular encoding, such as UTF-16.) It is normally used when you need to store character...
php bin/magento setup:di:compile You might need to delete var/di (including the folder) in order to go through compilation. rm -rf var/di
Flush all Magento Cache php bin/magento cache:clean php bin/magento cache:flush Check cache status php bin/magento cache:status
Enable and upgrade setup php bin/magento module:enable YKM_Custom php bin/magento setup:upgrade Disable the Module php bin/magento module:disable YKM_Custom Another One - module uninstall script is executed and whole module gets deleted afterwards. Only modules installed through Composer ca...
This analyzes a python script and, for each defined function, reports the line number where the function began, where the signature ends, where the docstring ends, and where the function definition ends. #!/usr/local/bin/python3 import ast import sys """ The data we collect. ...

Page 462 of 826