Tutorial by Examples

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...
Here is an example of image pulling using Go and Docker Engine API and the same progress bars as the ones shown when you run docker pull your_image_name in the CLI. For the purposes of the progress bars are used some ANSI codes. package yourpackage import ( "context" "en...
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 });
Configure For web request you can also use library axios. It's easy to configure. For this purpose you can create file axios.js for example: import * as axios from 'axios'; var instance = axios.create(); instance.defaults.baseURL = serverURL; instance.defaults.timeout = 20000;] //... //and...
Set the token on <head> of your default.blade.php. <meta name="csrf-token" content="{{csrf_token()}}"> Add ajaxSetup on the top of your script, that will be accessible to everywhere. This will set headers on each ajax call $.ajaxSetup({ headers: { '...
Add below function to your <form> tag. This function will generate a hidden field named _token and filled value with the token. {{csrf_field()}} Add csrf_token () function to your hidden _token in the value attribute. This will generate only encrypted string. <input type="hidden&q...
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...
There are many ways to send _token on AJAX call Get all input field's value within <form> tag using var formData = new FormData($("#cart-add")[0]); Use $("form").serialize(); or $("form").serializeArray(); Add _token manually on data of Ajax. using $('meta[n...
Detailed instructions on getting sqlite3 set up or installed.
First some general information about how arrays behave in Coldfusion as compared to other programming languages. Arrays can have numeric indexes only (if you want to have a string index use structs instead) Arrays begin at index [1] Arrays can have one ore more dimensions
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate ...
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate ...
<?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...
@Controller @RequestMapping("/appointments") public class AppointmentsController { //your handlers here, for example: @RequestMapping(path = "/new", method = RequestMethod.GET) public AppointmentForm getNewForm() { return new AppointmentForm(); } @RequestMapping...

Page 1298 of 1336