Creating Hadoop User:
sudo addgroup hadoop
Adding a user:
sudo adduser --ingroup hadoop hduser001
Configuring SSH:
su -hduser001
ssh-keygen -t rsa -P ""
cat .ssh/id rsa.pub >> .ssh/authorized_keys
Note: If you get errors [bash: .ssh/authorized_keys: No such file or di...
To check if a Dictionary has an specifique key, you can call the method ContainsKey(TKey) and provide the key of TKey type. The method returns a bool value when the key exists on the dictionary. For sample:
var dictionary = new Dictionary<string, Customer>()
{
{"F1", new Custom...
A drawable can be tinted a certain color. This is useful for supporting different themes within your application, and reducing the number of drawable resource files.
Using framework APIs on SDK 21+:
Drawable d = context.getDrawable(R.drawable.ic_launcher);
d.setTint(Color.WHITE);
Using android...
There are two types of npm scripts, and the command to run each is slightly different. The first type of npm scripts are "pre-recognized" scripts. These scripts are automatically recognized by npm and don't need a special prefix (as you will see for the other type) to run them. The othe...
Notepad++ provides 2 types of features for auto-completion and suggestions:
Auto-completion that reads the open file and provide suggestion of words and/or functions within the file
Suggestion with the arguments of functions (specific to the language)
To enable it, you need to change a settin...
Parameters hints can be customized by the user as indicated in this link: http://docs.notepad-plus-plus.org/index.php/Auto_Completion#How_to_create_keyword_auto-completion_definition_files
How to create keyword auto-completion definition files
Since version 5.0 Notepad++ has support for so calle...
// Generate stream that references itself in its evaluation
lazy val primes: Stream[Int] =
2 #:: Stream.from(3, 2)
.filter { i => primes.takeWhile(p => p * p <= i).forall(i % _ != 0) }
.takeWhile(_ > 0) // prevent overflowing
// Get list of 10 primes
assert(primes.take(...
ODS (on-disk structure) version is a number representing version of the database low-level data layout structure (ODS). When a new feature is added to Firebird it might or might not require the structure of database pages or system tables (database metadata) to change. If it does, the ODS version mu...
For some use cases, you can use the using syntax to help define a custom scope. For example, you can define the following class to execute code in a specific culture.
public class CultureContext : IDisposable
{
private readonly CultureInfo originalCulture;
public CultureContext(string ...
Copy the package installer unit file to /etc where changes will not be overwritten on an upgrade:
cp /lib/systemd/system/docker.service /etc/systemd/system/docker.service
Update /etc/systemd/system/docker.service with your options on ExecStart:
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0...
So you've just created your first class in Python, a neat little class that encapsulates a playing card:
class Card:
def __init__(self, suit, pips):
self.suit = suit
self.pips = pips
Elsewhere in your code, you create a few instances of this class:
ace_of_spades = Card('S...
Return the index of the first occurrence of a substring (zero if not found)
Syntax: INSTR ( string, substring )
SELECT INSTR('FooBarBar', 'Bar') -- return 4
SELECT INSTR('FooBarBar', 'Xar') -- return 0
In simple terms:
UNION joins 2 result sets while removing duplicates from the result set
UNION ALL joins 2 result sets without attempting to remove duplicates
One mistake many people make is to use a UNION when they do not need to have the duplicates removed. The additional performance cost...
Ionic uses Gulp, so install gulp-babel and gulp-plumber.
npm install --save-dev gulp-babel gulp-plumber
Add babel to gulpfile.js like so:
//...
var babel = require("gulp-babel");
var plumber = require("gulp-plumber");
var paths = {
es6: ['./src/es6/*.js'],
sass: ...