SELECT 1,22,44
UNION
SELECT 2,33,55
SELECT 1,22,44
UNION
SELECT 2,33,55
UNION
SELECT 2,33,55
The result is the same as above.
use UNION ALL
when
SELECT 1,22,44
UNION
SELECT 2,33,55
UNION ALL
SELECT 2,33,55
In InnoDB, having a long PRIMARY KEY (either a single column with a
lengthy value, or several columns that form a long composite value)
wastes a lot of disk space. The primary key value for a row is duplicated in all the secondary index records that point to the same
row. Create an AUTO_INCREME...
You may want to re-seed your database without affecting your previously created seeds. For this purpose, you can use firstOrCreate in your seeder:
EmployeeType::firstOrCreate([
'type' => 'manager',
]);
Then you can seed the database:
php artisan db:seed
Later, if you want to add a...
To automatically reload vimrc upon save, add the following to your vimrc:
if has('autocmd') " ignore this section if your vim does not support autocommands
augroup reload_vimrc
autocmd!
autocmd! BufWritePost $MYVIMRC,$MYGVIMRC nested source %
augroup END
endif
a...
To integrate Siri capabilities in your app, you should add an extensions as you would do while creating an iOS 10 Widget (old Today View Extension) or a custom keyboard.
Adding capability
1- In the project settings, select your iOS app target and go to Capabilities tab
2- Enable the Siri capabili...
Method 1:
proc sql;
create table foo like sashelp.class;
quit;
Method 2:
proc sql;
create table bar as
select * from sashelp.class (obs=0);
quit;
Method 1 should be the preferred option
Here is an example of a pipeline script that builds a Docker container, then runs the tests inside of it. The entrypoint is assumed to be either manage.py or invoke/fabric with a runtests command available.
#!/usr/bin/groovy
node {
stage 'Checkout'
checkout scm
sh 'git submodule update ...
The Maven Surefire plugin runs during the test phase of the Maven build process or when test is specified as a Maven goal. The following directory structure and minimum pom.xml file will configure Maven to run a test.
Directory structure inside the project's root directory:
─ project_root
├─ p...
Most of linux distros stores its version info in the /etc/lsb-release (debian) or /etc/redhat-release (RPM based) file. Using below generic command should get you past most of the Debian and RPM derivatives as Linux Mint and Cent-Os.
Example on Ubuntu Machine:
cat /etc/*release
DISTRIB_ID=Ubuntu
...
The sample content used here is Tears of Steel, by Blender Foundation. Specifically, we will use the download titled "HD 720p (~365MB, mov, 2.0)". This is a single file that ends with the extension "mov" and will play in just about any modern media player.
Note that the download...
This example will explore how to see the layout of a video track and how to extract the individual pictures within it.
The sample content used here is Tears of Steel, by Blender Foundation. Specifically, we will use the download titled "HD 720p (~365MB, mov, 2.0)". This is a single file t...
DASH is the most widely deployed adaptive streaming technology in modern solutions, used to deliver video in a wide variety of scenarios. The best way to understand DASH presentations is to observe the network activity that takes place during playback.
This example uses Fiddler to capture and analy...
Mongoose connect has 3 parameters, uri, options, and the callback function. To use them see sample below.
var mongoose = require('mongoose');
var uri = 'mongodb://localhost:27017/DBNAME';
var options = {
user: 'user1',
pass: 'pass'
}
mongoose.connect(uri, options, function(err){...
I.Overview
A significant difference between MongoDB & RDBMS is MongoDB has many kinds of operators. One of them is update operator, which is used in update statements.
II.What happen if we don't use update operators?
Suppose we have a student collection to store student information(Table view...
If you want to execute synchronous code asynchronous (for example CPU extensive calculations), you can use Task.Run(() => {}).
public async Task DoStuffAsync()
{
await DoCpuBoundWorkAsync();
}
private async Task DoCpuBoundWorkAsync()
{
await Task.Run(() =>
{
fo...
You can use void (instead of Task) as a return type of an asynchronous method. This will result in a "fire-and-forget" action:
public void DoStuff()
{
FireAndForgetAsync();
}
private async void FireAndForgetAsync()
{
await Task.Delay(1000);
throw new Exception(); ...
By default, all the controllers you generate with Symfony's built-in generate:controller command will make use of Symfony annotations for routing:
namespace AppBundle\Controller;
// You have to add a use statement for the annotation
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
...