Tutorial by Examples: c

The Xamarin Forms Entry control does not have a MaxLength property. To achieve this you can extend Entry as below, by adding a Bindable MaxLength property. Then you just need to subscribe to the TextChanged event on Entry and validate the length of the Text when this is called: class CustomEntry ...
Gpars offers intuitive ways to handle tasks concurrently import groovyx.gpars.* GParsPool.withPool { def result = dataList.collectParallel { processItem(it) } }
With the help of react-navigation, you can add navigation to your app really easy. Install react-navigation npm install --save react-navigation Example: import { Button, View, Text, AppRegistry } from 'react-native'; import { StackNavigator } from 'react-navigation'; const App = StackNavigat...
app.module.ts import {appStoreProviders} from "./app.store"; providers : [ ... appStoreProviders, ... ] app.store.ts import {InjectionToken} from '@angular/core'; import {createStore, Store, compose, StoreEnhancer} from 'redux'; import {AppState, default as reduce...
import * as Redux from 'redux'; import {Inject, Injectable} from '@angular/core'; @Injectable() export class exampleService { constructor(@Inject(AppStore) private store: Redux.Store<AppState>) {} getExampleState(){ console.log(this.store.getState().example); } } ...
import * as Redux from 'redux'; import {Inject, Injectable} from '@angular/core'; @Injectable() export class exampleService { constructor(@Inject(AppStore) private store: Redux.Store<AppState>) {} setExampleState(){ this.store.dispatch(updateExample("new value"...
app.store.ts import {InjectionToken} from '@angular/core'; import {createStore, Store, compose, StoreEnhancer} from 'redux'; import {AppState, default as reducer} from "../app.reducer"; export const AppStore = new InjectionToken('App.store'); const devtools: ...
MCVE's should start the Shiny app when they are copied in the console. An easy way to do this is using the shinyApp function. For example: why is my checkbox not responding? library(shiny) ui <- fluidPage( checkboxInput('checkbox', 'click me'), verbatimTextOutput('text') ) serv...
In practice, shiny Apps are often very complicated and full of features that have been developed over time. More often than not, those additional details are not necessary to reproduce your issue. It is best if you skip such details when writing MCVE's. WRONG Why is my plot not showing? libra...
The simplest way to include plots in your shinyApp is to use plotOutput in the ui and renderPlot in the server. This will work with base graphics as well as ggPlots library(shiny) library(ggplot2) ui <- fluidPage( plotOutput('myPlot'), plotOutput('myGgPlot') ) server <- function...
animated_android_dialog_box.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="16dp"> &...
You can restrict the directions the user is able to scroll to using the following code: func scrollViewDidScroll(_ scrollView: UIScrollView) { if scrollView.contentOffset.x != 0 { scrollView.contentOffset.x = 0 } } Every time the user scrolls on the x-axis, the scrollView's c...
When using cURL for some queries to the Docker API, it might be a bit tricky to pass some complex structures. Let's say, getting a list of images allows using filters as a query parameter, which have to be a JSON representation of map[string][]string (about the maps in Go you can find more here). H...
Install the Cordova and Ionic Native plugins: $ ionic cordova plugin add cordova-plugin-camera $ npm install --save @ionic-native/camera Your app.module.ts will need to inject camera: import { Camera } from '@ionic-native/camera'; .......... @NgModule({ declarations: [ MyApp ], ...
Sometimes, we may need to ignore the case of our query, with respect to the match in the document. An analyzer can be used in this case to ignore the case while searching. Each field will have to contain this analyzer in it's property, in order to work: "settings": { "analys...
The multi_search option allows us to search for a query in multiple fields at once. GET /_search { "query": { "multi_match" : { "query": "text to search", "fields": [ "field_1", "field_2" ] } }...
function REReplaceCallback(re,str,callback) { /* Thanks to Ben Nadel "Learning ColdFusion 8: REMatch() For Regular Expression Matching" from 2007-06-13 https://www.bennadel.com/blog/769-learning-coldfusion-8-rematch-for-regular-expression-matching.h...
REReplaceCallback('YOUR REGEX GOES HERE','AND YOUR STRING HERE',function(groups) { //now you can access the 'groups' array containing all the captured groups return result; //return whatever you've processed inside });
Here I assume that project app url is APP_URL=http://project.dev/ts/toys-store Set the writable permission to storage_path('framework/sessions') the folder. Check the path of your laravel project 'path' => '/ts/toys-store', the root of your laravel project. Change the name of your cookie 'co...
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context=&quot...

Page 803 of 826