Tutorial by Examples: f

Let's say we have a component that should only be displayed if the user is logged in. So we create a HOC that checks for the authentication on each render(): AuthenticatedComponent.js import React from "react"; export function requireAuthentication(Component) { return class Auth...
PageTS Settings: ## Default Image cropping ## TCEFORM.sys_file_reference.crop.config.cropVariants { default { title = Desktop selectedRatio = NaN allowedAspectRatios { NaN { title = Free value = 0.0 } ...
(defrecord Logline [datetime action user id]) (def pattern #"(\d{8}-\d{2}:\d{2}:\d{2}.\d{3})\|.*\|(\w*),(\w*),(\d*)") (defn parser [line] (if-let [[_ dt a u i] (re-find pattern line)] (->Logline dt a u i))) Define a sample line : (def sample "20170426-17:20:04...
app.module.ts Add these into your app.module.ts file to use reactive forms import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; @...
The NgFor directive instantiates a template once per item from an iterable. The context for each instantiated template inherits from the outer context with the given loop variable set to the current item from the iterable. To customize the default tracking algorithm, NgFor supports trackBy option. ...
One common scenario is to wait for a number of requests to finish before continuing. This can be accomplished using the forkJoin method. In the following example, forkJoin is used to call two methods that return Observables. The callback specified in the .subscribe method will be called when both O...
A for loop iterate through items in an enumeration program EnumLoop; uses TypInfo; type TWeekdays = (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday); var wd : TWeekdays; begin for wd in TWeekdays do WriteLn(GetEnumName(TypeInfo(TWeekdays), Ord(wd))); ...
CREATE SCHEMA IF NOT EXISTS `backgammon`; USE `backgammon`; DROP TABLE IF EXISTS `user_in_game_room`; DROP TABLE IF EXISTS `game_users`; DROP TABLE IF EXISTS `user_in_game_room`; CREATE TABLE `game_users` ( `user_id` BIGINT NOT NULL AUTO_INCREMENT, `first_name` VARCHAR(255) NOT N...
@SpringBootApplication @RestController public class SpringBootJdbcApplication { @Autowired private JdbcTemplate template; @RequestMapping("/cars") public List<Map<String,Object>> stocks(){ return template.queryForList("select * from c...
var _activitiesGridName = ''; function SetupActivityGridOnload(gridName) { var btnsToHide = [ 'AddserviceappointmentButton', 'AddcampaignresponseButton', 'AddappointmentButton' ]; _activitiesGridName = gridName; setTimeout(function () { //...
Firstly it's important to note that when a new socket is created it is assigned a unique Id which is retrieved by calling socket.id. This id can then be stored within a user object and we can assign an identifier such as a username which has been used in this example to retrieve user objects. /** ...
Code to receive Chat dialogs from Quickblox server of Logged in user (Example with listview) private void receiveChatList() { QBRequestGetBuilder requestBuilder = new QBRequestGetBuilder(); requestBuilder.setLimit(100); QBRestChatService.getChatDialogs(null, requestBuilder).performAsync( ...
The following example sets a promise to be consumed by another thread: { auto promise = std::promise<std::string>(); auto producer = std::thread([&] { promise.set_value("Hello World"); }); auto fut...
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...
std::packaged_task bundles a function and the associated promise for its return type: template<typename F> auto async_deferred(F&& func) -> std::future<decltype(func())> { auto task = std::packaged_task<decltype(func())()>(std::forward<F>(func)); aut...
<h:form> <p:dialog widgetVar="myDialog"></p:dialog> <p:commandButton onclick="PF('myDialog').show();" /> </h:form>
In general, there are two types of Bash scripts: System tools which operate from the current working directory Project tools which modify files relative to their own place in the files system For the second type of scripts, it is useful to change to the directory where the script is stored. T...
Such a group is made of radiobuttons that share a control variable so that no more than one can be selected. # control variable var = tk.IntVar(parent, 0) # group of radiobuttons for i in range(1,4): tk.Radiobutton(parent, text='Choice %i' % i, value=i, variable=var).pack() tk.Button(p...
If constraints for std::promise and std::future are not met an exception of type std::future_error is thrown. The error code member in the exception is of type std::future_errc and values are as below, along with some test cases: enum class future_errc { broken_promise = /* the t...
To complete this objective following tasks are required. Foreach Loop Container: To iterate over a user configured directory for files. Expression Task: To update a variable if file exists. Steps First goto Solution Explorer double click on Project.params and create a parameter FolderPat...

Page 422 of 457