Tutorial by Examples: al

To check that the connection to the server is valid: sqoop list-tables --connect "jdbc:sqlserver://<server_ip>:1433;database=<database_name>" --username <user_name> --password <password> Before doing this it is recommended ...
To import data from SQL Server to Hadoop: sqoop import --table TestTable --connect "jdbc:sqlserver://192.168.1.100:1433;database=Test_db" --username user --password password --split-by id --target-dir /user/test ...
Query can be used instead of table in import operation: sqoop import --query 'select Id,Message from TestTable where $CONDITIONS' --where 'id>100' --connect "jdbc:sqlserver://192.168.1.100:1433;database=Test_db --username user -–pas...
Streams, and especially IntStreams, are an elegant way of implementing summation terms (∑). The ranges of the Stream can be used as the bounds of the summation. E.g., Madhava's approximation of Pi is given by the formula (Source: wikipedia): This can be calculated with an arbitrary precision. E....
Rust tuples, as in most other languages, are fixed-size lists whose elements can all be of different types. // Tuples in Rust are comma-separated values or types enclosed in parentheses. let _ = ("hello", 42, true); // The type of a tuple value is a type tuple with the same number of el...
Rust programs use pattern matching extensively to deconstruct values, whether using match, if let, or deconstructing let patterns. Tuples can be deconstructed as you might expect using match fn foo(x: (&str, isize, bool)) { match x { (_, 42, _) => println!("it's 42"),...
In the Project.pro file we add : CONFIG += sql in MainWindow.h we write : #include <QMainWindow> #include <QSql> #include <QDebug> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget...
How to install the Android Debugging Bridge (ADB) to a Linux system with the terminal using your distro's repositories. Install to Ubuntu/Debian system via apt: sudo apt-get update sudo apt-get install adb Install to Fedora/CentOS system via yum: sudo yum check-update sudo yum install androi...
ShortcutDescriptionCtrl + rsearch the history backwardsCtrl + pprevious command in historyCtrl + nnext command in historyCtrl + gquit history searching modeAlt + .use the last word of the previous commandrepeat to get the last word of the previous + 1 commandAlt + n Alt + .use the nth word of the pr...
Converter between boolean and visibility. Get bool value on input and returns Visibility value. NOTE: This converter have already exists in System.Windows.Controls namespace. public sealed class BooleanToVisibilityConverter : IValueConverter { /// <summary> /// Convert bool or Nu...
Show how to create simple converter with parameter via property and then pass it in declaration. Convert bool value to Visibility. Allow invert result value by setting Inverted property to True. public class BooleanToVisibilityConverter : IValueConverter { public bool Inverted { get; set; } ...
Show how to create simple IMultiValueConverter converter and use MultiBinding in xaml. Get summ of all values passed by values array. public class AddConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { ...
If you use the paste command from your terminal emulator program, Vim will interpret the stream of characters as if they were typed. That will cause all kind of undesirable effects, particularly bad indendation. To fix that, from command mode: :set paste Then move on to insert mode, with i, for...
$ IFS= read -r foo <<EOF > this is a \n line >EOF $ printf '%s\n' "$foo" this is a \n line
$ read -r foo <<EOF > this is a line >EOF $ printf '%s\n' "$foo" this is a line
Using some setters, without setting all needed properties in the constructor(s) public final class Person { // example of a bad immutability private final String name; private final String surname; public Person(String name) { this.name = name; } public String ge...
When working with existing model that is quite big and is being regenerated quite often in cases where abstraction needed it might be costly to manually go around redecorating model with interfaces. In such cases one might want to add some dynamic behavior to model generation. Following example wil...
:s/foo/bar/c Marks the first instance of foo on the line and asks for confirmation for substitution with bar :%s/foo/bar/gc Marks consecutively every match of foo in the file and asks for confirmation for substitution with bar
Some ADO.NET providers (most notably: OleDB) do not support named parameters; parameters are instead specified only by position, with the ? place-holder. Dapper would not know what member to use for these, so dapper allows an alternative syntax, ?foo?; this would be the same as @foo or :foo in other...
ggplot(data = diamonds, aes(x = cut, fill =color)) + geom_bar(stat = "count", position = "dodge") it is possible to obtain an horizontal bar chart simply adding coord_flip() aesthetic to the ggplot object: ggplot(data = diamonds, aes(x = cut, fill =color)) + geom_ba...

Page 104 of 269