The members of a union share the same space in memory. This means that writing to one member overwrites the data in all other members and that reading from one member results in the same data as reading from all other members. However, because union members can have differing types and sizes, the da...
Install Anaconda(PyQt5 is build-in), especially for windows user.
Integrate QtDesigner and QtUIConvert in PyCharm(External Tools)
Open PyCharm Settings > Tools > External Tools
Create Tool(QtDesigner) - used to edit *.ui files
Create Tool(PyUIConv) - used to convert *.ui to *.py
...
Carthage Setup
Download the latest version of Carthage from the given link Download Link
Down in the Download section download the Carthage.pkg file.
Once the download is complete install it by double clinking on the download pkg file.
To check for successful download run the following command i...
DECLARE @ID AS INT;
SET @ID = (SELECT MIN(ID) from TABLE);
WHILE @ID IS NOT NULL
BEGIN
PRINT @ID;
SET @ID = (SELECT MIN(ID) FROM TABLE WHERE ID > @ID);
END
Catalan numbers algorithm is Dynamic Programming algorithm.
In combinatorial mathematics, the Catalan numbers form a sequence of natural numbers that occur in various counting problems, often involving recursively-defined objects. The Catalan numbers on nonnegative integers n are a set of numbers t...
According to Wikipedia:
[A] software design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve ...
Viewchild offers one way interaction from parent to child. There is no feedback or output from child when ViewChild is used.
We have a DataListComponent that shows some information. DataListComponent has PagerComponent as it's child. When user makes a search on DataListComponent, it gets a data fro...
If you want to create a custom validation rule, you can do so for instance in the boot method of a service provider, via the Validator facade.
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Validator;
class AppServiceProvider extends ServiceProvider
{
...
public class KnapsackProblem
{
private static int Knapsack(int w, int[] weight, int[] value, int n)
{
int i;
int[,] k = new int[n + 1, w + 1];
for (i = 0; i <= n; i++)
{
int b;
for (b = 0; b <= w; b++)
{
...
Creating a connection
According to PEP 249, the connection to a database should be established using a connect() constructor, which returns a Connection object. The arguments for this constructor are database dependent. Refer to the database specific topics for the relevant arguments.
import MyDBA...
In this Example we are going to take a sqaure shaped line plotted using line and perform transformations on it. Then we are going to use the same tranformations but in different order and see how it influences the results.
First we open a figure and set some initial parameters (square point coordin...
By default, PHP Curl supports GET and POST requests. It is possible to also send custom requests, such as DELETE, PUT or PATCH (or even non-standard methods) using the CURLOPT_CUSTOMREQUEST parameter.
$method = 'DELETE'; // Create a DELETE request
$ch = curl_init($url);
curl_setopt($ch, CURLOPT...
Assuming a default server running on localhost with the default port, the command to connect to that Redis server would be:
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
The Redis PHP module gives access to the same commands as the Redis CLI client so it is quite straightforward to use.
The syntax is as follow:
// Creates two new keys:
$redis->set('mykey-1', 123);
$redis->set('mykey-2', 'abcd');
// Gets one key (prints '123')
var_dump($redis->get('m...
Maya supports 3 main programming environments. Each has different setup requirements.
MEL
MEL scripting language is included with the Maya application. Enabled by default, users can test MEL in the script listener window in a running copy of Maya.
MEL files are text files with the extension .mel...