Tutorial by Examples: a

The export tool exports a set of files from HDFS back to an RDBMS. The target table must already exist in the database. The input files are read and parsed into a set of records according to the user-specified delimiters. Example : sqoop export \ --connect="jdbc:<databaseconnector>&quo...
One implementation of the io.Reader interface can be found in the bytes package. It allows a byte slice to be used as the source for a Reader. In this example the byte slice is taken from a string, but is more likely to have been read from a file or network connection. message := []byte("Hello...
Send a Razor part to a @helper, for example a HTML div. @helper WrapInBox(Func<Object, HelperResult> content) { <div class="box">@content(null) </div> } //call @WrapInBox(@<div> I'm a inner div </div>)
@Helpers could be shared between views. They should be created in the folder App_Code @helper CreatePrimaryBootstrapButton(string label) { <button type="button" class="btn btn-primary">@label</button> } //call @MenuHelpers.CreatePrimaryBootstrapButton...
Sometimes it may be required to find out which directory consuming how much disk space especially when you are used df -h and realized your available disk space is low. du: du command summarizes disk usage of the set of FILEs, recursively for directories. It's often uses with -sh option: -s, --s...
The following example is high level coverage of the key concepts and basic skeletal setup:- Collects credentials from the user (Usually from a login screen you've created) Authenticates the credentials with the server (stores custom authentication) Stores the credentials on the device Exte...
A frequent reason why your read operation may not work is because your security rules reject the operation, for example because you're not authenticated (by default a database can only be accessed by an authenticated user). You can see these security rule violations in the JavaScript console of you...
Add a -behaviour directive to your module to indicate that it follows a behaviour: -behaviour(gen_server). The American spelling is also accepted: -behavior(gen_server). Now the compiler will give a warning if you've forgotten to implement and export any of the functions required by the beha...
You can define your own behaviour by adding -callback directives in your module. For example, if modules implementing your behaviour need to have a foo function that takes an integer and returns an atom: -module(my_behaviour). -callback foo(integer()) -> atom(). If you use this behaviour in...
It's easiest to show a binary search on numbers using pseudo-code int array[1000] = { sorted list of numbers }; int N = 100; // number of entries in search space; int high, low, mid; // our temporaries int x; // value to search for low = 0; high = N -1; while(low < high) { mid = (...
In this iText 5 example, we'll create a text field and we'll add it to a PDF: public void manipulatePdf(String src, String dest) throws DocumentException, IOException { PdfReader reader = new PdfReader(src); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest)); T...
In this iText 7 example, we'll create a text field and we'll add it to a PDF: public void manipulatePdf(String src, String dest) throws IOException { PdfReader reader = new PdfReader(src); PdfDocument pdf = new PdfDocument(reader, new PdfWriter(dest)); PdfAcroForm form = PdfAcroFor...
In this iText 5 example, we'll change the properties and the value of a text field: public void manipulatePdf(String src, String dest) throws DocumentException, IOException { PdfReader reader = new PdfReader(src); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest)); ...
In this iText 7 example, we'll change the properties and the value of a text field: public void manipulatePdf(String src, String dest) throws IOException { PdfReader reader = new PdfReader(src); PdfDocument pdf = new PdfDocument(reader, new PdfWriter(dest)); PdfAcroForm form = PdfA...
Real Number Basics - 6.0; val it = 6.0 : real - ~6.0; val it = ~6.0 : real - 6.0 + ~6.0; val it = 0.0 : real - 6.0 / 3.0; val it = 2.0 : real - 4.0 / 6.0; val it = 0.666666666667 : real Real Value Bounds Using Real Basis Library Functions - Real.maxFinite; val it = 1.79769313486E308 ...
Rounding Values midway between two integers go toward the nearest even value. - round(4.5); val it = 4 : int - round(3.5); val it = 4 : int Truncation val it = 4 : int - trunc(4.5); val it = 4 : int - trunc(3.5); val it = 3 : int Floor and Ceiling - ceil(4.5); val it = 5 : int - f...
Cannot add Integer and Real* - 5 + 1.0; stdIn:1.2-10.4 Error: operator and operand don't agree [overload conflict] operator domain: [+ ty] * [+ ty] operand: [+ ty] * real in expression: 5 + 1.0
- real(6); val it = 6.0 : real
Instead of running intensive tasks into JavaFX Thread that should be done into a Service.So what basically is a Service? A Service is a class which is creating a new Thread every time you are starting it and is passing a Task to it to do some work.The Service can return or not a value. Below is ...
Standard ML doesn't have built-in support for lazy evaluation. Some implementations, notably SML/NJ, have nonstandard lazy evaluation primitives, but programs that use those primitives won't be portable. Lazy suspensions can also be implemented in a portable manner, using Standard ML's module system...

Page 771 of 1099