Tutorial by Examples

Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding). Official Docs It will center the image and resize it to the smaller size, if both container s...
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...
Django supports MySQL 5.5 and higher. Make sure to have some packages installed: $ sudo apt-get install mysql-server libmysqlclient-dev $ sudo apt-get install python-dev python-pip # for python 2 $ sudo apt-get install python3-dev python3-pip # for python 3 As well as ...
Make sure to have some packages installed: sudo apt-get install libpq-dev pip install psycopg2 Database settings for PostgreSQL: #myapp/settings/settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'myprojectDB', 'USER': '...
sqlite is the default for Django. It should not be used in production since it is usually slow. #myapp/settings/settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'db/development.sqlite3', 'USER': '', 'PASSWORD': '', ...
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...
When write() is called for a named or unnamed pipe or stream socket whose reading end is closed, two things happen: POSIX.1-2001 SIGPIPE signal is sent to the process that called write() POSIX.1-2004 SIGPIPE signal is sent to the thread that called write() EPIPE error is returned ...
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...
FFmpeg can be installed on a mixture of Operating Systems, including Unix and OS X. Using a command line extension, this utility can also be installed on Windows using a dll. OS X To install this utility on OS X, just head over to ffmpeg.org, download the release relative to your Macs architec...
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...

Page 676 of 1336