Tutorial by Examples: c

In this example, we use the default, no-args GridLayout() constructor to create a layout with a single column. public class SingleColumnGridLayoutExample { private final Display display; private final Shell shell; public SingleColumnGridLayoutExample() { display = new Di...
Similar to the Single-Column Example above, if we instead use the GridLayout(int, boolean) constructor, we can create a layout with multiple columns. In this case we create two columns, each of which are the same width. public class MultiColumnGridLayoutExample { private final Display displ...
By leveraging some of the member variables in the GridLayout instance, we can change the margins around the layout, and spacing between cells. In this example we set the following: verticalSpacing = 0 - Sets the vertical spacing between cells to 0px. horizontalSpacing = 20 - Sets the horizontal ...
Just add these lines to the initialization RecyclerView mRecyclerView = (RecyclerView) view.findViewById(recyclerView); mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL))...
If you care about your indices (yes, that's the plural of index), you should maintain them, especially if you do frequent inserts or deletes that affect them. Azure Automation provides an almost ready runbook that you can use and schedule to perform automated index rebuilding. Here's what you have ...
The Symfony Installer is a command line tool that helps you to create new Symfony applications. It requires PHP 5.4 or higher. Downloading and installing the Symfony Installer on Linux / MacOS Open a terminal and execute the following commands: sudo mkdir -p /usr/local/bin sudo curl -LsS https:/...
To be able to run tests Chrome broser should be pre-installed on Android device,
To be able to work with web-application on Android device using Selenium below pre-conditions should be met: Android SDK installed on computer Chrome browser installed on Android device Debugging mode enabled on Android device Start adb and chromedriver server with below commands from cmd/Te...
Create your own WSMessageSender: import java.io.IOException; import java.net.HttpURLConnection; import org.springframework.ws.transport.http.HttpUrlConnectionMessageSender; import sun.misc.BASE64Encoder; public class CustomWSMessageSender extends HttpUrlConnectionMessageSender{ @Ov...
Example for a functional view to create an object. Excluding comments and blank lines, we need 15 lines of code: # imports from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from .models import SampleObject from .forms import SampleObjectForm # vie...
The above example only works if your tasks are entirely standard tasks. You do not add extra context here, for example. Let's make a more realistic example. Assume we want to add a page title to the template. In the functional view, this would work like this - with just one additional line: def cr...
The true power of generic views unfolds when you combine them with Mixins. A mixin is a just another class defined by you whose methods can be inherited by your view class. Assume you want every view to show the additional variable 'page_title' in the template. Instead of overriding the get_context...
How to center an element, column, or content inside a column works differently in Bootstrap 4. Horizontal Center text-center is still used for display:inline elements mx-auto replaces center-block to center display:block elements offset-* or mx-auto can be used to center grid columns mx-aut...
typealias StringValidator = (String) -> Boolean typealias Reductor<T, U, V> = (T, U) -> V
typealias Parents = Pair<Person, Person> typealias Accounts = List<Account>
cx_Freeze - a tool can package your project to excutable/installer after install it by pip, to package demo.py, we need setup.py below. import sys from cx_Freeze import setup, Executable # Dependencies are automatically detected, but it might need fine tuning. build_exe_options = { &...
The core idea of VLOOKUP is to look up information in a spreadsheet table and place it in another. For example, suppose this is the table in Sheet1: John 12/25/1990 Jane 1/1/2000 In Sheet2, place John, Andy, and Jane in A1, A2, and A3. In B1, to the right of John, I placed: =VL...
HeroChildComponent has two input properties, typically adorned with @Input decorations. import { Component, Input } from '@angular/core'; import { Hero } from './hero'; @Component({ selector: 'hero-child', template: ` <h3>{{hero.name}} says:</h3> <p>I, {{hero.nam...
When creating a model for a table that has a composite primary key, additional work is required on the Object for the model Entity to respect those constraints. The following example SQL table and Entity demonstrates the structure to store a review left by a customer for an item in an online store....
Spacemacs (http://spacemacs.org/) is a variant of Emacs that attempts to end the long-term conflict between Emacs and vim users, by making an Emacs that behaves like vim.

Page 737 of 826