To avoid unsightly #DIV/0 errors in a spreadsheet, a custom function can be used.
/**
* Divides n by d unless d is zero, in which case, it returns
* the given symbol.
*
* @param {n} number The numerator
* @param {d} number The divisor
* @param {symbol} string The symbol to display...
This is a jumbotron with a title, a content and a button.
Code
<div class="jumbotron">
<h1>Title text</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tortor ipsum, convallis sit.</p>
<p><a class="btn btn-default&...
Given the following custom Boolean type we want to wrap:
typedef char MYBOOL;
#define TRUE 1
#define FALSE 0
A simple approach might be to write the following typemaps in our SWIG interface:
%typemap(in) MYBOOL %{
// $input is what we got passed from Python for this function argument
$1...
If you do not only wish to display static objects, but have your UI respond to changes to correlating objects, you need to understand the basics of the INotifyPropertyChanged interface.
Assuming we have our MainWindowdefined as
<Window x:Class="Application.MainWindow"
xmlns="...
This example will go over the basic structure of a Cucumber feature file in Gherkin. Feature files use several keywords in the basic syntax.
Lets look at the basic keywords:
Feature: this keyword signifies that what follows is a basic description or name of the feature being tested or documented...
import sys
from PyQt4 import QtGui
def window():
app = QtGui.QApplication(sys.argv)
w = QtGui.QWidget()
b = QtGui.QLabel(w)
b.setText("<h1>Welcome to PyQt4 SO Documentation!</h1>")
w.setGeometry(100,100,550,65)
b.move(50,20)
w.setWindowTitle(&quo...
A splash screen is just like any other activity, but it can handle all of your startup-needs in the background. Example:
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="...
A function is defined by at least its return type and an unique name.
void say_hello () {
print ("Hello, world!\n");
}
Then, to call it just use the name of the function followed by a parenthese.
say_hello ();
Functions can also have parameters between the parentheses, d...
A typedef declaration has the same syntax as a variable or function declaration, but it contains the word typedef. The presence of typedef causes the declaration to declare a type instead of a variable or function.
int T; // T has type int
typedef int T; // T is an alias for int
int A[1...
$pwd
Displays the present working directory.
$who
Displays all the users logged in.
$who am i
Shows the username of the current user.
$date
Displays the current system date
$which <command>
Shows the path of the specified command.
For example "$which pwd" will sho...
The example assumes you have successfully run and fully understand the tutorial of MNIST(Deep MNIST for expert).
%matplotlib inline
import matplotlib.pyplot as plt
# con_val is a 4-d array, the first indicates the index of image, the last indicates the index of kernel
def display(con_val, kern...
The vertical layout set up the object inside it vertically.
#include "mainwindow.h"
#include <QApplication>
#include <QMainWindow>
#include <QWidget>
#include <QVBoxLayout>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication...
QtCreator is, at the moment, the best tool to create a Qt application. In this example, we will see how to create a simple Qt application which manage a button and write text.
To create a new application click on File->New File or Project:
Then choose the Projects->Application->Qt Widge...
Filename myEmail EMAIL
Subject = "My Email Subject"
From = "[email protected]"
To = '[email protected]'
CC = '[email protected]'
Type = 'Text/Plain';
Data _null_; File myEmail;
PUT "Email content";
PUT &q...
Let's first create a simple "Hello world!" MailboxProcessor which processes one type of message and prints greetings.
You'll need the message type. It can be anything, but Discriminated Unions are a natural choice here as they list all the possible cases on one place and you can easily us...
Let's consider the predicate sumDif/2, verified if the structure of a list matches several constraints. The first term represents the list to analyze and the second term another list that holds the part of the first list that is unknown to our constraints.
For the demonstration, sumDif/2 recognizes...