You can set the desired UI widget's stylesheet using any valid CSS. The example below will set a QLabel's text color a border around it.
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Mai...
Simply specifying a file destination, echo will create, write, or append to a file.
<echo file=example.txt" append="false">
hello world
</echo>
To print the contents of a file, we can use loadfile to read a file into a local property, and then use echo to print the value of it.
<loadfile property="contents" srcFile="example.txt" />
<echo message="${contents}" />
requests uses specific environment variables automatically for proxy detection.
HTTP_PROXY will define the proxy URL to use for HTTP connections
HTTPS_PROXY will define the proxy URL to use for HTTPS connections
Once these environment variables are set, the Python code does not need to pass a...
To make the table more readable, following are the ways to color it:
Rows
Columns
Lines
Cells
Coloring Rows
Use \rowcolor (provided by colortbl; also loaded by xcolor under the [table] package option). Example:
\documentclass{article}
\usepackage[table]{xcolor}
\begin{document}
\be...
Writing and executing a simple TestNG program is mainly 3 step process.
Code - write business logic of your test and annotate it with TestNG annotations
Configure - add information of your test in testng.xml or in build.xml
Run TestNG - it can be invoked from command line, ANT, IDE like Eclipse...
<?php
// hook into the init action and call create_book_taxonomies when it fires
add_action( 'init', 'create_book_taxonomies', 0 );
// create taxonomy genres for the post type "book"
function create_book_taxonomies() {
// Add new taxonomy, make it hierarchical (like categorie...
Given:
---
variable_name: True
Then, these tasks with always run.
- name: This is a conditional task
module: src=/example/ dest=/example
when: variable_name
- name: This is a conditional task
module: src=/example/ dest=/example
when: True
This task will never run.
- name: T...
Real life use cases for Singleton pattern;
If you are developing a client-server application, you need single instrance of ConnectionManager, which manages the life cycle of client connections.
The basic APIs in ConnectionManager :
registerConnection: Add new connection to existing list of connec...
In most cases, the range_lookup is used as FALSE (an exact match). The default for this parameter is TRUE - it is less commonly used in this form, but this example shows one usecase.
A supermarket gives a bonus based on the customers monthly spend.
If the customer spends 250 EUR or more in a mon...
Single-quotes are literal strings, and the lack of escape characters means that the only character that can not occur inside of a single-quoted string is a single-quote.
$ echo '$var \$var \\$var \\\$var'
$var \$var \\$var \\\$var
$ echo '"quoted string"'
"quoted string"
$ e...
Double-quotes preserve all characters other than " terminator, $ expansions, ` command substitutions, and \ escapes of any of these characters (and newline removal). Note that the literal \ is preserved unless followed by a special character.
General escapes:
$ printf "\"quoted str...
While standard LaTeX is all that is needed for most simple mathematical formulae and equations, sometimes more symbols and tools are needed. There are multiple packages available that will enhance your equations and provide you with more to work with. Three of the main packages are described below. ...
By default, Jsoup will display only block-level elements with a trailing line break. Inline elements are displayed without a line break.
Given a body fragment, with inline elements:
<select name="menu">
<option value="foo">foo</option>
<option va...
The gridspec package allows more control over the placement of subplots. It makes it much easier to control the margins of the plots and the spacing between the individual subplots. In addition, it allows for different sized axes on the same figure by defining axes which take up multiple grid loca...
You can also set multiple sort descriptors, to sort by one attribute within another. For example, return all entries ordered by date, and by name within each date:
let fetchRequest = NSFetchRequest(entityName: "NAME_OF_ENTITY")
let sortDescriptor1 = NSSortDescriptor(key: "name"...