Tutorial by Examples: ce

it often happened some rows with format issue, data type issue rejected by copy command while try load it by copy command. the query return succeed but some of data rejected. To do troubleshooting save Rejected Data and Exceptions COPY large_tbl FROM :file1 ON site01, :file2 O...
Before deploying the angular project in server we need to build angular project for production. We also need to change the routing path in index.html file from <base href=”/”> to <base href=”./”> if it is not done then your project wouldn’t get loaded properly there will be some routing ...
interface IArrayWrapper { public function getProperties(): array; public function has(string $name): bool; public function __toString(); // ... }; /** * Lightweight in-place data wrapper. * Demonstrates usage of anonymous class in conjunction with interface. * * Pro...
Service that is used for communication: import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; @Injectable() export class ComponentCommunicationService { private componentChangeSource = new Subject(); private newDateCreationSource = new Subject<Date&...
JavaScript uses reference counting technique to detect unused objects. When reference count to an object is zero, that object will be released by the garbage collector. Weakmap uses weak reference that does not contribute to reference count of an object, therefore it is very useful to solve memory l...
public FontFamily Maneteke = GetResourceFontFamily(Properties.Resources.manteka);
std::call_once ensures execution of a function exactly once by competing threads. It throws std::system_error in case it cannot complete its task. Used in conjunction with std::once_flag. #include <mutex> #include <iostream> std::once_flag flag; void do_something(){ std::ca...
Kernel manages operating system resources. User program can only access to those resources by making system calls to the kernel. System call is similar to an API of kernel, which in term, runs kernel tasks your program needs. str = "something" // run on user space x = x + 1 // run on use...
Use top command to exam CPU time allocation between user space and kernel space. Explanation: 24.8 us (user space): 24.8% of CPU time is spent on user process. 0.5 sy (system): 0.5% of CPU time is spent on kernel space. ni (niceness): the ratio of CPU time spent on low priority processes. i...
Use time command. time ./perl-timeout-example 100.100.100 We could not ping the desired address! real 0m5.0013s user 0m0.004s sys 0m0.008s Real: Total time from start to finish of the call, including the CPU time spent on other processes. User: The amount of CPU time spent i...
Often you want to lock the entire object while you perform multiple operations on it. For example, if you need to examine or modify the object using iterators. Whenever you need to call multiple member functions it is generally more efficient to lock the whole object rather than individual member fu...
The Roslyn Quoter A tool for converting an sample C# program to syntax tree API calls. The tool itself can be found here. Enhanced source viewer An easy way to view the Roslyn source code can be found here.
The TestProducerfrom this example produces Integerobjects in a given range and pushes them to its Subscriber. It extends the Flowable<Integer> class. For a new subscriber, it creates a Subscription object whose request(long) method is used to create and publish the Integer values. It is impor...
Use Redirect to force users to connect to the secure URL. <VirtualHost *:80> ServerName example.com SSLProxyEngine on Redirect permanent / https://secure_example.com/ </VirtualHost> The rest of the configuration can be put in the ssl virtual host (port 443) since ever...
To initialise chat service use: QBChatService.setDebugEnabled(true); // enable chat logging QBChatService.setDefaultPacketReplyTimeout(10000);//set reply timeout in milliseconds for connection's packet. Can be used for events like login, join to dialog to increase waiting response time from ...
var _activitiesGridName = ''; function SetupActivityGridOnload(gridName) { var btnsToHide = [ 'AddserviceappointmentButton', 'AddcampaignresponseButton', 'AddappointmentButton' ]; _activitiesGridName = gridName; setTimeout(function () { //...
This code implements a version of std::async, but it behaves as if async were always called with the deferred launch policy. This function also does not have async's special future behavior; the returned future can be destroyed without ever acquiring its value. template<typename F> auto asyn...
def main(): if len(sys.argv) != 4 or '--help' in sys.argv[1:]: print('usage: my_program <arg1> <arg2> <arg3>', file=sys.stderr) sys.exit(1) # use an exit code to signal the program was unsuccessful process_data()
Some programming languages have its own Regex peculiarities, for example, the $+ term (in C#, Perl, VB etc.) which replaces the matched text to the last group captured. Example: using System; using System.Text.RegularExpressions; public class Example { public static void Main() { ...
Bukkit uses an event based system that allows plugin developers to interact with and modify the server and specific actions that occur in the world. Creating an Event Handler Event handlers are methods that get called when their event occurs. They are generally public and void as well as named o...

Page 123 of 134