Tutorial by Examples: er

Set High resolution programmatically. Camera mCamera = Camera.open(); Camera.Parameters params = mCamera.getParameters(); // Check what resolutions are supported by your camera List<Size> sizes = params.getSupportedPictureSizes(); // Iterate through all available resolutions and choos...
I have created GeoFenceObserversationService singleton class. GeoFenceObserversationService.java: public class GeoFenceObserversationService extends Service implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, ResultCallback<Status> { protected s...
As described in the remarks section you can specify the Gradle version used by each project editing the Gradle distribution reference in the gradle/wrapper/gradle-wrapper.properties file. For example: ... distributionUrl = https\://services.gradle.org/distributions/gradle-2.14.1-all.zip ... ...
Like for 1D signals, it's possible to filter images by applying a Fourier transformation, multiplying with a filter in the frequency domain, and transforming back into the space domain. Here is how you can apply high- or low-pass filters to an image with Matlab: Let image be the original, unfiltere...
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\GenericEvent; // you may store this in a dependency injection container for use as a service $dispatcher = new EventDispatcher(); // you can attach liste...
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\Event; $dispatcher = new EventDispatcher(); // you can attach event subscribers, which allow a single object to subscribe // to many ...
In [1]: import pandas as pd In order to run a query in BigQuery you need to have your own BigQuery project. We can request some public sample data: In [2]: data = pd.read_gbq('''SELECT title, id, num_characters ...: FROM [publicdata:samples.wikipedia] ...: ...
If you have created service account and have private key json file for it, you can use this file to authenticate with pandas In [5]: pd.read_gbq('''SELECT corpus, sum(word_count) words FROM [bigquery-public-data:samples.shakespeare] GROUP BY co...
import java.time.LocalTime; import java.time.ZoneId; import java.time.temporal.ChronoUnit; public class Test { public static void main(String[] args) { ZoneId zone1 = ZoneId.of("Europe/Berlin"); ZoneId zone2 = ZoneId.of("Brazil/East"); ...
BooleanQuery is used to combine other queries. They can be combined using three BooleanClause.Occur parameters: BooleanClause.Occur.MUST - The subquery must be matched. BooleanClause.Occur.SHOULD - The subquery may not be matched, but will be scored more highly if it is. If there are no MUST...
PhraseQuery is used to search for a sequence of terms. The following matches the phrase "Hello World" (after being indexed with StandardAnalyzer) Query query = new PhraseQuery.Builder() .add(new Term("text", "hello")) .add(new Term("text"...
This combines queries such that the best (that is, highest-scoring) match of it's subqueries contributes to the final score. List<Query> disjuncts = new ArrayList<Query>(); disjuncts.add(new TermQuery(new Term("fieldname", "hello"))); disjuncts.add(new TermQuery(...
A query can be boosted to increase it's score relative to other subqueries. This is done by wrapping it with a BoostQuery Query lessRelevantQuery = new TermQuery(new Term("fieldname", "ipsum")); //Five times as interesting Query highlyRelevantQuery = new BoostQuery( ...
When a table has an AUTO_INCREMENT PRIMARY KEY, normally one does not insert into that column. Instead, specify all the other columns, then ask what the new id was. CREATE TABLE t ( id SMALLINT UNSIGNED AUTO_INCREMENT NOT NULL, this ..., that ..., PRIMARY KEY(id) ); INSERT I...
Colored text can be created by passing the text and a font color name to the following function: private String getColoredSpanned(String text, String color) { String input = "<font color=" + color + ">" + text + "</font>"; return input; } The ...
Defining the base class: open class BaseClass { val x = 10 } Defining the derived class: class DerivedClass: BaseClass() { fun foo() { println("x is equal to " + x) } } Using the subclass: fun main(args: Array<String>) { val derivedClass = Deri...
Defining the base class: open class Person { fun jump() { println("Jumping...") } } Defining the derived class: class Ninja: Person() { fun sneak() { println("Sneaking around...") } } The Ninja has access to all of the methods in Pe...
Prepare First create a "message.properties" file in Resources/Files/. Example: ############## # Test message.properties ############## label.age=Enter your age: validate.error.reqired.age=Sorry, but you have to give away the secret of your age ... Next, connect the resource with y...
PostScript is a Turing-complete general programming language, designed and developed by Adobe Systems. Many of the ideas which blossomed in PostScript had been cultivated in projects for Xerox and Evans & Sutherland. Its main real-world application historically is as a page description language...
Create example table Employee: CREATE TABLE Employee ( Id INT, EmpName VARCHAR(25), EmpGender VARCHAR(6), EmpDeptId INT ) Creates stored procedure that checks whether the values passed in stored procedure are not null or non empty and perform insert operation in Employee ta...

Page 247 of 417