Tutorial by Examples: c

This is a step-by-step guide to installing OpenCV 3 on a Debian-based Linux system from source. The steps should stay the same for other distros, just replace the relevant package manager commands when installing packages for the build. Note: If you don't feel like wasting time building stuff or di...
The result of casting a pointer to an integer using reinterpret_cast is implementation-defined, but "... is intended to be unsurprising to those who know the addressing structure of the underlying machine." int x = 42; int* p = &x; long addr = reinterpret_cast<long>(p); std::...
PROGRAM zhello_world. CLASS main DEFINITION FINAL CREATE PRIVATE. PUBLIC SECTION. CLASS-METHODS: start. ENDCLASS. CLASS main IMPLEMENTATION. METHOD start. cl_demo_output=>display( 'Hello World!' ). ENDMETHOD. ENDCLASS. START-OF-SELECTION. main=>start( ).
this topic is a classical issue in iOS development, and its solution is various as other example already shown. In this example I'll show another daily common use one: passing data using closure by adapting delegate pattern example on this page into callback closure! one thing this method is superi...
Store data in SEQUENCEFILE if the data needs to be compressed. You can import text files compressed with Gzip or Bzip2 directly into a table stored as TextFile. The compression will be detected automatically and the file will be decompressed on-the-fly during query execution. CREATE TABLE raw_seque...

ORC

The Optimized Row Columnar (ORC) file format provides a highly efficient way to store Hive data. It was designed to overcome limitations of the other Hive file formats. Using ORC files improves performance when Hive is reading, writing, and processing data. ORC file can contain lightweight indexes a...
Using dotnet new will scaffold a new console application. To scaffold other types of projects, use the -t or --type flag: dotnet new -t web dotnet restore dotnet run The available templates vary by language. C# Templates console (default) - A console application. web - An ASP.NET Core app...
By default, dotnet new creates C# projects. You can use the -l or --lang flag to scaffold projects in other languages: dotnet new -l f# dotnet restore dotnet run Currently, dotnet new supports C# and F#.
To create a NuGet package from a project, run this command from a directory that contains project.json: dotnet pack The resulting .nupkg file will be named and versioned according to the properties in project.json. If there are multiple frameworks targeted in the project file, the package will s...
Command line scripts inside python packages are common. You can organise your package in such a way that when a user installs the package, the script will be available on their path. If you had the greetings package which had the command line script hello_world.py. greetings/ greetings/ ...
If you don't need automatically generated apk files with unaligned suffix (which you probably don't), you may add the following code to build.gradle file: // delete unaligned files android.applicationVariants.all { variant -> variant.assemble.doLast { variant.outputs.each { output ->...
C++11 threading primitives are still relatively low level. They can be used to write a higher level construct, like a thread pool: C++14 struct tasks { // the mutex, condition variable and deque form a single // thread-safe triggered queue of tasks: std::mutex m; std::condition_variab...
The Composite pattern is a design pattern that allows to treat a group of objects as a single instance of an object. It is one of the Gang of Four's structural design patterns. Example below demonstrate how Composite can be used to log to multiple places using single Log invocation. This approach a...
Facade is structural design pattern. It hides the complexities of large system and provides a simple interface to client. Client uses only Facade and it's not worried about inter dependencies of sub-systems. Definition from Gang of Four book: Provide a unified interface to a set of interfaces i...
MySQL provides the following arithmetic operators OperatorNameExample+AdditionSELECT 3+5; -> 8 SELECT 3.5+2.5; -> 6.0 SELECT 3.5+2; -> 5.5-SubtractionSELECT 3-5; -> -2*MultiplicationSELECT 3 * 5; -> 15/DivisionSELECT 20 / 4; -> 5 SELECT 355 / 113; -> 3.1416 SELECT 10.0 / 0; -...
Pi The following returns the value of PI formatted to 6 decimal places. The actual value is good to DOUBLE; SELECT PI(); -> 3.141593
Angles are in Radians, not Degrees. All computations are done in IEEE 754 64-bit floating point. All floating point computations are subject to small errors, known as machine ε (epsilon) errors, so avoid trying to compare them for equality. There is no way to avoid these errors when using floating p...
Round a decimal number to an integer value For exact numeric values (e.g. DECIMAL): If the first decimal place of a number is 5 or higher, this function will round a number to the next integer away from zero. If that decimal place is 4 or lower, this function will round to the next integer value cl...
public class ConnectSocketExample { private int HTTP_PORT = 80; /** * example method to create unconnected socket * then connect to it * at end return connected socket * * @param httpHostName - endpoint host name fot socket connection * @throws IOEx...

Page 379 of 826