First, import modules and set connection strings. If you need parameters, you can either put them directly in the URL string (an API in this case) or build them as a dict and pass them to the params argument.
import requests
import json
params = {'id': 'blahblah', 'output': 'json'} # You could ...
To make an app more cohesive, we often need to keep user's personal settings and preferences consistent across multiple devices that have been logged in with one Microsoft account. In this sample, we use roaming data to store and to load UI settings, game process and user info. But the roaming data ...
By using the Grid.RowSpan and Grid.ColumnSpan attached properties, children of a Grid can span multiple rows or columns.
In the following example the second TextBlock will span the second and third column of the Grid.
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/&...
The row heigths or column widths of multiple Grids can be synchronized by setting a common SharedSizeGroup on the rows or columns to synchronize. Then a parent control somewhere up in the tree above the Grids needs to have the attached property Grid.IsSharedSizeScope set to True.
<StackPanel Gri...
Imagine the following XML:
<root>
<element foobar="hello_world" />
<element example="this is one!" />
</root>
/root/element[@foobar]
and will return the <element foobar="hello_world" /> element.
Imagine the following XML:
<root>
<element foobar="hello_world" />
<element example="this is one!" />
</root>
The following XPath expression:
/root/element[@foobar = 'hello_world']
will return the <element foobar="hello_world&quo...
Let's say you don't want the fields houseNum and street in the address field of the final populated doc, use the populate() as follows,
Person.findOne({_id: req.params.id})
.populate('address', '-houseNum -street') // note the `-` symbol
.exec(function(err, person) {
// do somet...
The simplest way to write a parser is to use the recursive descent technique. This creates a top-down parser (which may formally be described a LL(1)). To start the example we first have to establish the grammar rules for our language. In this example we will use simple arithmetic expression assignm...
When sending a notification to an iOS device, you must set priority: "high" for it to wake up. Otherwise, the notification will not be received while the phone is asleep.
Sets the priority of the message. Valid values are "normal" and "high." On iOS, these correspond...
OpenCL is low level api so it must be implemented in "C space" first. For that, one needs to download header files from Khronos' site. My hardware is AMD and capable of version 1.2, downloading
opencl.h
cl_platform.h
cl.h
cl_ext.h
cl_egl.h
cl_dx9_media_sharing.h
cl_d3d10.h
c...
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...
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...
QML came with rich set of visual elements. Using only QML we can build complex applications with these elements.
Also it's very easy to build your own element based on set of standard items like Rectangle, Button, Image etc.
Moreover, we can use items like Canvas to build element with custom paint...
[TestCase(0, 0, 0)]
[TestCase(34, 25, 59)]
[TestCase(-1250, 10000, 8750)]
public void AddNumbersTest(int a, int b, int expected)
{
// Act
int result = a + b;
// Assert
Assert.That(result, Is.EqualTo(expected));
}