Tutorial by Examples: ti

Create a new application here: create application Choose standalone applicaton and confirm app creation via SMS. Fill Package namefor Android as your current package name. You can get your package name inside android manifest file, at the very begginning. Get your Certificate fingerprint by exe...
What is an exception? Exception in PL/SQL is an error created during a program execution. We have three types of exceptions: Internally defined exceptions Predefined exceptions User-defined exceptions What is an exception handling? Exception handling is a possibility to keep o...
An internally defined exception doesn't have a name, but it has its own code. When to use it? If you know that your database operation might raise specific exceptions those which don't have names, then you can give them names so that you can write exception handlers specifically for them. Otherwis...
Predefined exceptions are internally defined exceptions but they have names. Oracle database raise this type of exceptions automatically. Example create or replace procedure insert_emp is begin insert into emp (emp_id, ename) values ('1','Jon'); exception when dup_val_on_index then ...
As the name suggest user defined exceptions are created by users. If you want to create your own exception you have to: Declare the exception Raise it from your program Create suitable exception handler to catch him. Example I want to update all salaries of workers. But if there are no work...
using CLI: $ opennlp SentenceDetector ./en-sent.bin < ./input.txt > output.txt using API: import static java.nio.file.Files.readAllBytes; import static java.nio.file.Paths.get; import java.io.IOException; import java.util.Objects; public class FileUtils { /** * Get file data as...
This command, given a commit range commit1..commit2, rewrites history so that git commit author becomes also git committer: git filter-branch -f --commit-filter \ 'export GIT_COMMITTER_NAME=\"$GIT_AUTHOR_NAME\"; export GIT_COMMITTER_EMAIL=\"$GIT_AUTHOR_EMAIL\"; exp...
DateUtils.formatDateTime() allows you to supply a time, and based on the flags you provide, it creates a localized datetime string. The flags allow you to specify whether to include specific elements (like the weekday). Date date = new Date(); String localizedDate = DateUtils.formatDateTime(contex...
Format a date: Date date = new Date(); DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM); String localizedDate = df.format(date) Format a date and time. Date is in short format, time is in long format: Date date = new Date(); DateFormat df = DateFormat.getDateTimeInstance(DateFor...
Date date = new Date(); df = new SimpleDateFormat("HH:mm", Locale.US); String localizedDate = df.format(date) Commonly used patterns: HH: hour (0-23) hh: hour (1-12) a: AM/PM marker mm: minute (0-59) ss: second dd: day in month (1-31) MM: month yyyy: year
Based on this blog post. Assume you have a method like this: def get[T]: Option[T] = ??? When you try to call it without specifying the generic parameter, Nothing gets inferred, which is not very useful for an actual implementation (and its result is not useful). With the following solution t...
Grunt is a JavaScript Task Runner, used for automation of repetitive tasks like minification, compilation, unit testing, linting, etc. In order to get started, you'll want to install Grunt's command line interface (CLI) globally. npm install -g grunt-cli Preparing a new Grunt project: A typica...
Guice is the default dependency injection (further DI) framework of Play. Other frameworks may be used as well, but using Guice makes development efforts easier, since Play takes care for things under the veil. Injection of Play API-s Starting from Play 2.5 several API-s, which were static in the ...
Premise These instruction shows a procedure to install native OCaml binaries in Windows. If your operative system is Windows 10 (Insider Preview) build 14316 or later you can also install OCaml through Bash on Ubuntu on Windows. In this case, follow the instruction to install OCaml on Ubuntu. Inst...
CountDownTimer is useful for repeatedly performing an action in a steady interval for a set duration. In this example, we will update a text view every second for 30 seconds telling how much time is remaining. Then when the timer finishes, we will set the TextView to say "Done." TextView ...
After installing gnuplot it's a good idea to run a simple example to ensure all is working fine. Open your terminal Type gnuplot. Your prompt should now change to gnuplot> Type: plot sin(x) If all is well you should see now a sin(x) graphic generated by gnuplot. Note: if you are on Wind...
As mentioned in "Remarks", a partition is a part/slice/chunk of an RDD. Below is a minimal example on how to request a minimum number of partitions for your RDD: In [1]: mylistRDD = sc.parallelize([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 2) In [2]: mylistRDD.getNumPartitions() Out[2]: 2 No...
Sometimes we want to repartition an RDD, for example because it comes from a file that wasn't created by us, and the number of partitions defined from the creator is not the one we want. The two most known functions to achieve this are: repartition(numPartitions) and: coalesce(numPartitions, s...
As rule of thumb, one would want his RDD to have as many partitions as the product of the number of executors by the number of used cores by 3 (or maybe 4). Of course, that's a heuristic and it really depends on your application, dataset and cluster configuration. Example: In [1]: data = sc.textF...
interface IService { void ProcessRequest(); } interface IRepository { IEnumerable<string> GetData(); } class HelloWorldRepository : IRepository { public IEnumerable<string> GetData() { return new[] { "Hello", "World" }; } ...

Page 315 of 505