Tutorial by Examples

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...
Sometimes there will be properties that aren't available in jQuery event. To access the underlying properties use Event.originalEvent Get Scroll Direction $(document).on("wheel",function(e){ console.log(e.originalEvent.deltaY) // Returns a value between -100 and 100 depending o...
Install the required dependencies: 'org.apache.solr:solr-solrj:5.5.1' 'org.apache.httpcomponents:httpclient:4.3.6' 'com.ibm.watson.developer_cloud:java-sdk:3.2.0' The code below assumes you have a Solr collection with documents and you have trained a ranker, otherwise follow this tutorial pub...
Bootstrap components are a collection of optional jQuery plugins which bundled with Bootstrap. The purpose of Bootstrap components is to provide extended features and capabilities which would be difficult (or impossible) to accomplish without the use of Javascript. Some components provide are pure...
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...
To list all the git repository locations on your you can run the following find $HOME -type d -name ".git" Assuming you have locate, this should be much faster: locate .git |grep git$ If you have gnu locate or mlocate, this will select only the git dirs: locate -ber \\.git$
To comment on the same line as the code you can use &:: or &rem. You can also use && or || to replace &. Example : @echo off echo This is a test &::This is a comment echo This is another test &rem This is another comment pause A curiosity: SET command allows limit...
var Vehicle = Backbone.Model.extend({ description: function () { return 'I have ' + this.get('wheels') + ' wheels'; } }); var Bicycle = Vehicle.extend({ defaults: { wheels: 2 } }); var Car = Vehicle.extend({ defaults: { wheels: 4 } })...
To find a file in the Hadoop Distributed file system: hdfs dfs -ls -R / | grep [search_term] In the above command, -ls is for listing files -R is for recursive(iterate through sub directories) / means from the root directory | to pipe the output of first command to the second grep command t...
the easiest way is to have the local branch checked out: git checkout old_branch then rename the local branch, delete the old remote and set the new renamed branch as upstream: git branch -m new_branch git push origin :old_branch git push --set-upstream origin new_branch
Note: The shown CMake error messages already include the fix for "non-standard" library/tool installation paths. The following examples just demonstrate more verbose CMake find_package() outputs. CMake internally supported Package/Module If the following code (replace the FindBoost modul...
In order to build an IPA file in XCode, you require to sign your application with a certificate and provisioning profile. These can be created at https://developer.apple.com/account/ios/profile/create Provisioning Profile Types Provisioning Profiles are split into two types, Development, and Distr...
vagrant reload --provision
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...
String fileName = "Fruit.xlsx"; String sheetName = "Apples"; XSSFWorkbook wb = new XSSFWorkbook(); XSSFSheet sheet = wb.createSheet(sheetName) ; for (int r=0;r < 3; r++ ) { XSSFRow row = sheet.createRow(r); //iterating c ...

Page 837 of 1336