Tutorial by Examples: c

Let's look at a sample of logging which you can see in many programs: public class LoggingComplex { private static final Logger logger = Logger.getLogger(LoggingComplex.class.getName()); private int total = 50, orders = 20; private String username = "Bob";...
In MATLAB, we can set new default custom orders, such as a colour order and a line style order. That means new orders will be applied to any figure that is created after these settings have been applied. The new settings remains until MATLAB session is closed or new settings has been made. Default ...
Add the required network permissions to the application manifest file: <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android....
Add below dependencies to your build.gradle // Facebook login compile 'com.facebook.android:facebook-android-sdk:4.21.1' Add below helper class to your utility package: /** * Created by Andy * An utility for Facebook */ public class FacebookSignInHelper { private static final...
The %s conversion of printf states that the corresponding argument a pointer to the initial element of an array of character type. A null pointer does not point to the initial element of any array of character type, and thus the behavior of the following is undefined: char *foo = NULL; printf(&quo...
Extension Resources in Azure are resources that extend other resources. This template creates an Azure Key Vault as well as a DiagnosticSettings extension. Things to note: The extension resource is created under the resources attribute of the parent resource It needs to have a dependsOn attrib...
Create interface for clickHandler public interface ClickHandler { public void onButtonClick(View v); } Layout XML <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android"> <data> ...
Define Interface public interface ClickHandler { public void onButtonClick(User user); } Create Model class public class User { private String name; public User(String name) { this.name = name; } public String getName() { return name; } ...
Starting from a dataframe df: U L 111 en 112 en 112 es 113 es 113 ja 113 zh 114 es Imagine you want to add a new column called S taking values from the following dictionary: d = {112: 'en', 113: 'es', 114: 'es', 111: 'en'} You can use map to perform a lookup on keys returni...
For accessing the MS SQL Server database Sqoop requires an additional JDBC driver which can be downloaded from Microsoft. The following steps will install MSSQL Server JDBC driver to Sqoop: wget 'http://download.microsoft.com/download/0/2/A/02AAE597-3865-456C-AE7F-613F99F850A8/sqljdbc_4.0.2206.100_...
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 ...
The data can be imported directly into Hive: sqoop import --hive-import --table EventLog --connect "jdbc:sqlserver://192.168.1.99:1433;database=Test_db" --username user --password password --split-by id ...
PhantomJS is a fully featured headless web browser with JavaScript support. Before you start you will need to download a PhantomJS driver, and make sure to put this in the beginning of your code: using OpenQA.Selenium; using OpenQA.Selenium.PhantomJS; Great, now onto the initialization: var d...
SimpleBrowser is a lightweight WebDriver without JavaScript support. It is considerably faster than an aforementioned PhantomJS, however when it comes to functionality, it is limited to simple tasks with no fancy features. Firstly, you will need to download the SimpleBrowser.WebDriver package and ...
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....
arguments object behave different in strict and non strict mode. In non-strict mode, the argument object will reflect the changes in the value of the parameters which are present, however in strict mode any changes to the value of the parameter will not be reflected in the argument object. function...
PhpStorm offers default settings for code styling for a large amount of languages based on best practices and common standards. But you can customize the styling for each language on a per-project base within the PhpStorm Settings > Editor > Code Style. Schemes Schemes are collections of ...
Currently there is no one-click-button method to actually enforce any code style guidelines across a team but there are two methods to make sure a certain code style is applied to your product. Import PhpStorm Code Style Schemes The first and more easier solution is to set up a code style scheme o...
PhpStorm already ships with a lot of predefined language schemes that are based on common code style guidelines and standards like PSR-2. There is kind of a hidden feature in the code style settings pages where you can import these standards and set them as your current configuration. To do so simp...

Page 327 of 826