Tutorial by Examples: f

When you are getting started with ElasticSearch (ES) it might be good to have a graphical tool that helps you explore your data. A plugin called elasticsearch-head does just that. To install it, do the following: Find out in which folder ES is installed: ls -l $(which elasticsearch) cd into this...
FOR XML PATH and STUFF to concatenate the multiple rows into a single row: select distinct t1.id, STUFF( (SELECT ', ' + convert(varchar(10), t2.date, 120) FROM yourtable t2 where t1.id = t2.id FOR XML PATH ('')) , 1,...
User defined table functions represented by org.apache.hadoop.hive.ql.udf.generic.GenericUDTF interface. This function allows to output multiple rows and multiple columns for a single input. We have to overwrite below methods : 1.we specify input and output parameters abstract StructObjectInspe...
Sample XML <Students> <Student> <Name> <First>Ashley</First> <Last>Smith</Last> </Name> <Grades> <Exam1>A</Exam1> <Exam2>B</Exam2> ...
Update build.sbt with : scalaVersion := "2.11.8" // Make sure to have installed Scala 11 sparkVersion := "2.0.0" // Make sure to have installed Spark 2.0 Note that when compiling with sbt package, the .jar will now be created in target/scala-2.11/, and the .jar name will al...
package com.example.domain; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.data.rest.core.annotation.RestResource; /...
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> ...
This custom UserControl will appear as a regular combobox, but unlike the built-in ComboBox object, it can show the user a default string of text if they have not made a selection yet. In order to accomplish this, our UserControl will be made up of two Controls. Obviously we need an actual ComboBox...
Denormalization and a flat database structure is neccessary to efficiently download separate calls. With the following structure, it is also possible to maintain two-way relationships. The disadvantage of this approach is, that you always need to update the data in multiple places. For an example, ...
You can use the COUNT() function to return the number of records that match a query. The following 'Employee' table contains employee ID numbers and their associated manager's ID number. Employee_IDManager_ID123722373763424545635745594563 A COUNT() statement can be used to find out how many employ...
A DataFrame is a distributed collection of data organized into named columns. It is conceptually equivalent to a table in a relational database. DataFrames can be constructed from a wide array of sources such as: structured data files, tables in Hive, external databases, or existing RDDs. Reading a...
To set a custom row height, override UITableViewSource.GetHeightForRow(UITableView,NSIndexPath): public class ColorTableDataSource : UITableViewSource { List<DomainClass> Model { get; set; } public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath) ...
shopt -q login_shell && echo 'login' || echo 'not-login'
#!/usr/bin/env node var fs = require('fs'); var path = require('path'); var jshint = require('jshint').JSHINT; var async = require('async'); var foldersToProcess = [ 'js' ]; foldersToProcess.forEach(function(folder) { processFiles("www/" + folder); }); function proce...
class MyClass { private String privateField } def prvtClss = new MyClass(privateField: 'qwerty') println prvtClss.privateField will print us 'qwerty' This issue is known since version 1.1 and there is a bug report on that: http://jira.codehaus.org/browse/GROOVY-1875. It is not reso...
onView(withText("Pay")) onView(withText(R.string.pay))
PHPUnit provides the following function to assert whether an object is an instance of a class: assertInstanceOf($expected, $actual[, $message = '']) The first parameter $expected is the name of a class (string). The second parameter $actual is the object to be tested. $message is an optional ...
For the following schema: {name: 'Tom', age: 28, marks: [50, 60, 70]} Update Tom's marks to 55 where marks are 50 (Use the positional operator $): db.people.update({name: "Tom", marks: 50}, {"$set": {"marks.$": 55}}) For the following schema: {name: 'Tom', age:...

Page 301 of 457