Tutorial by Examples: c

Scale the image using START. Scale the image using END. Official Docs FitStart This will fit to the smallest size of the container, and it will align it to the start. <ImageView android:layout_width="200dp" android:layout_height="200dp" android:src...
Scale the image using CENTER. Official Docs This expands the image to try to match the container and it will align it to the center, it will fit to the smaller size. Bigger height ( fit to width ) Same width and height.
Scale the image using FILL. Official Docs <ImageView android:layout_width="100dp" android:layout_height="200dp" android:src="@mipmap/ic_launcher" android:id="@+id/imageView" android:scaleType="fitXY&quo...
How to create User Model Class namespace App\Model\Table; use Cake\ORM\Table; class UsersTable extends Table { public function initialize(array $config) { $this->table('users'); //define table name $this->displayField('username'); // unique or other special field of...
There are 4 types of associations(relationships) we can define in CakePHP class PostsTable extends Table { public function initialize(array $config) { // table initialization code should be here $this->belongsTo('Authors', [ 'className' => 'Authors', ...
This is a client-server example. The process forks and runs client in the parent process and server in the child process: client connects to server and waits until server exits; server accepts connection from client, enables keepalive, and waits any signal. Keepalive is configured using the f...
Dependencies To install electron you must first install Node.js, which comes with npm. How to install it? Use npm: # Install the `electron` command globally in your $PATH npm install electron -g # OR # Install as a development dependency npm install electron --save-dev
This is a TCP daytime iterative server kept as simple as possible. #include <sys/types.h> /* predefined types */ #include <unistd.h> /* unix standard library */ #include <arpa/inet.h> /* IP addresses conversion utilities */ #include <netinet/in.h> /* sockaddr...
If, during the conversion of: an integer type to a floating point type, a floating point type to an integer type, or a floating point type to a shorter floating point type, the source value is outside the range of values that can be represented in the destination type, the result is undefine...
When starting Zsh, it'll source the following files in this order by default: /etc/zsh/zshenv Used for setting system-wide environment variables; it should not contain commands that produce output or assume the shell is attached to a tty. This file will always be sourced, this cannot be overrid...
function onButtonClick() { navigator.bluetooth.requestDevice({filters: [{services: ['battery_service']}]}) .then(device => { // Connecting to GATT Server... return device.gatt.connect(); }) .then(server => { // Getting Battery Service... return server.getPri...
function onButtonClick() { navigator.bluetooth.requestDevice({filters: [{services: ['heart_rate']}]}) .then(device => { // Connecting to GATT Server... return device.gatt.connect(); }) .then(server => { // Getting Heart Rate Service... return server.getP...
Jersey is one of the many frameworks available to create Rest Services, This example will show you how to create Rest Services using Jersey and Spring Boot 1.Project Setup You can create a new project using STS or by using the Spring Initializr page. While creating a project, include the followi...
All proxy services events are logged in the wso2carbon log file (located in %CARBON_HOME%/repository/logs). If you want, you can have separate log files for each proxy service. Keep in mind, though, that they will still be logged in wso2carbon log file as well. To do so, you should change the log4...
The "child" components of a component are available on a special prop, props.children. This prop is very useful for "Compositing" components together, and can make JSX markup more intuitive or reflective of the intended final structure of the DOM: var SomeComponent = function ...
To check if a method was called on a mocked object you can use the Mockito.verify method: Mockito.verify(someMock).bla(); In this example, we assert that the method bla was called on the someMock mock object. You can also check if a method was called with certain parameters: Mockito.verify(som...
Setting overflow value to hidden,auto or scroll to an element, will clear all the floats within that element. Note: using overflow:scroll will always show the scrollbox
<target name="compile" description="Compiles report designs specified using the 'srcdir' in the <jrc> tag." depends="prepare-compile-classpath"> <mkdir dir="./build/reports"/> <taskdef name="jrc" classname=&quot...
Multiple operations can be executed against a single transaction so that changes can be rolled back if any of the operations fail. using (var context = new PlanetContext()) { using (var transaction = context.Database.BeginTransaction()) { try { //Lets assum...
Using git show we can view a single commit git show 48c83b3 git show 48c83b3690dfc7b0e622fd220f8f37c26a77c934 Example commit 48c83b3690dfc7b0e622fd220f8f37c26a77c934 Author: Matt Clark <[email protected]> Date: Wed May 4 18:26:40 2016 -0400 The commit message will be show...

Page 419 of 826