Tutorial by Examples: f

The Builder Pattern decouples the creation of the object from the object itself. The main idea behind is that an object does not have to be responsible for its own creation. The correct and valid assembly of a complex object may be a complicated task in itself, so this task can be delegated to anoth...
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...
Renaming the server.php to index.php Copy the .htaccess from public folder to root folder Changing .htaccess a bit as follows for statics: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|ro...
Different procedures can give out the same result, but they would use different processing time. In order to check out which one is faster, a code like this can be used: time1 = Timer For Each iCell In MyRange iCell = "text" Next iCell time2 = Timer For i = 1 To 30 MyRan...
$service = new NetSuiteService(); $search = new TransactionSearchAdvanced(); $internalId = '123';//transaction internalId $search->criteria->basic->internalIdNumber->searchValue = $internalId; $search->criteria->basic->internalIdNumber->operator = "equalTo"; ...
typeof is the 'official' function that one uses to get the type in javascript, however in certain cases it might yield some unexpected results ... 1. Strings typeof "String" or typeof Date(2011,01,01) "string" 2. Numbers typeof 42 "number" 3. Bool typeo...
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...
You can define the signing configuration to sign the apk in the build.gradle file. You can define: storeFile : the keystore file storePassword: the keystore password keyAlias: a key alias name keyPassword: A key alias password You have to define the signingConfigs block to create a signin...
In this app i am directly opening InAppBrowser when the user tap the app icon instead of loading first page of app. So that would look like to user that they are viewing the app of the same website/webapp.
<iframe "id="iframe_Login1"> <iframe "id="iframe_Login2"> <iframe "id="iframe_Login3"> </iframe> </iframe> </iframe> To switch into frame in selenium use swithTo() and frame()...
Here we are having a list of todo items that is passed to the props of our component. Each todo item has a text and id property. Imagine that the id property comes from a backend datastore and is a unique numeric value: todos = [ { id: 1, text: 'value 1' }, { id: 2, te...
In certain cases (e.g. logging) it might be useful to run task and do not await for the result. The following extension allows to run task and continue execution of the rest code: public static class TaskExtensions { public static async void RunAndForget( this Task task, Action<E...
To find your existing .cs files, right click on the project in your instance of Visual Studio, and click Open Folder in File Explorer. Visual Studio --> Your current project (Windows Form) --> Solution Explorer --> Project Name --> Right Click --> Add --> Existing Item --> ...
Required External Jar: mysql-connector-java-5.1.40-bin.jar to connect to Data Base. Add this jar by right clicking the project -->Build Path--> Add external Archieve. Create the Flow as Flowing 2) Database Connector Configuration: Select MySQL as your database by double clicking the Data...
Step1 Message Flow: [![enter image description here][1]][1] Step 2: Databse Connector Configuration For this you need mysql-connector-java-5.1.40-bin.jar . Right click on Project -->build Path--> Add external archieve and add the jar(without jar it cannot be connected) Enter all the value...
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...
class Monad m where return :: a -> m a (>>=) :: m a -> (a -> m b) -> m b The most important function for dealing with monads is the bind operator >>=: (>>=) :: m a -> (a -> m b) -> m b Think of m a as "an action with an a result". ...
To fetch large data we can use generators in pandas and load data in chunks. import pandas as pd from sqlalchemy import create_engine from sqlalchemy.engine.url import URL # sqlalchemy engine engine = create_engine(URL( drivername="mysql" username="user", ...
GitHub Flavored Markdown (sometimes abbreviated to GFM) makes it easier to work with markdown on GitHub.com. Key features of GFM include: code indentation task list support easy GitHub issue referencing automatic GitHub username and SHA detection automatic url detection emoji support GFM...
Stack corruptions are annoying bugs to look at. As the stack is corrupted, the debugger often can't give you a good stack trace of where you are and how you got there. This is where safe-stack comes into play. Instead of using a single stack for your threads, it will use two: A safe stack and a dan...

Page 421 of 457