Tuesday 20 November 2018

Excerpts from my book "Logical Reasoning for 9th Grade" (OFF TOPIC)



I have authored the book "Logical Reasoning for 9th Grade" which is available for purchase
@Notionpress

The Logical reasoning for 9th Grade book is all about using logical reasoning to go through a maze of rules and arrive at a perfect solution.

Excerpts from the book below



1. IPA BEER


A bartender is organizing a taste test of the newest IPA beer selections. Exactly seven different varieties of beer will be
tasted—Long Lake, Moon Rune, Newtonbury, Olenguard,
Pumpkin Pale, Quest, and Roundabout—one at a time and
consecutively. No other beers are to be tasted. The Bartender
must adhere to the following rules:
Olenguard must be the third beer tasted.
There is exactly one beer tasted between Newtonbury and
Quest.
Either Long Lake or Pumpkin Pale is the fifth beer tasted.
Either Pumpkin Pale is tasted before Roundabout or Moon
Rune is tasted before Newtonbury, but not both.
1. Which one of the following could represent the order in
which the beers are tasted, from first to last?
(A) Long Lake, Newtonbury, Olenguard, Pumpkin
Pale, Quest, Roundabout, Moon Rune
(B) Long Lake, Moon Rune, Olenguard, Newtonbury,
Pumpkin Pale, Quest, Roundabout
(C) Long Lake, Quest, Olenguard, Newtonbury,
Roundabout, Pumpkin Pale, Moon Rune
(D) Long Lake, Newtonbury, Moon Rune, Quest,
Pumpkin Pale, Olenguard, Roundabout
(E) Long Lake, Quest, Olenguard, Newtonbury,
Pumpkin Pale, Roundabout, Moon Rune

Answer:-(E) is the right answer

Analysis:- Always eliminate the wrong answers based on the rules given to easily arrive at the correct answer

For example

(A) is not the correct answer since 5th beer tasting is not the Long lake or Pumpkin Pale
(B)is not the correct answer because both Pumpin Pale is tasted before Roundabout and Moon rune is tasted before Newtonbury which violates the last rule
(C)Same as (A)
(D)Olenguard must be the third beer tasted
(E) is the right answer since it satisfies all rules
1)Olenguard is the third beer tasted
2)There is exactly one beer between Newtonbury and Quest
3)Pumpkin Pale is the fifth beer tasted
4)Pumpkin pale is tasted before Roundabout but Moon rune is tasted after Newtonbury which satisfies the last condition




2. Which one of the following must be true?
(A) Long Lake must be the first beer tasted.
(B) Moon Rune must be the last beer tasted.
(C) Pumpkin Pale must be the fifth beer tasted.
(D) Either Newtonbury or Quest must be tasted
fourth.
(E) Either Long Lake or Pumpkin Pale must be tasted
first.

Answer:-(D) is the right answer

Analysis:- Whenever attempting such questions try to build a list which eliminates wrong answers based on the rules

For example 1:- Roundabout, Moon Rune, Olenguard, Quest, Long lake, Newtonbury, Pumpkin Pale is a valid list
(A)The long lake can be the fifth beer tasted(I used the rule that either Long lake or Pumpkin Pale must be fifth beer tasted based on which I wrote the Example 1)
(B)Moon rune can be the second beer tasted
(C)Pumpkin Pale can be seventh beer tasted
(D)Let us say Newtonbury is tasted first then as per the rule there should be at least one beer between Newtonbury and Quest, Quest has to be tasted third but Olenguard should be tasted third, Hence they cannot be tested 1 and 3,3 and 5
Similarly, they cannot be tasted 5 and 7 for the same reason that 5th beer tasted should be the long lake or Pumpkin Pale
Remaining is 2 and 4, 4 and 6 hence at least one of them should be tasted in 4th position

(E) Either Long Lake or Pumpkin Pale must be tasted
First is also false based on Example 1

Hence (D) is the right answer


3. If Roundabout is tasted first, which one of the following
must be true?
(A) Pumpkin Pale is tasted before Moon Rune.
(B) Pumpkin Pale is tasted before Long Lake.
(C) Moon Rune is the second beer tasted.
(D) Newtonbury is the sixth beer tasted.
(E) Quest is the sixth beer tasted.
Answer:-(C) Moon Rune is the second beer tested
Analysis:-
Whenever you have these type of question try to use the rule which has relation with Roundabout which is tasted first as per the question and eliminate wrong answers
For example 1)Roundabout, Moon Rune, Olenguard, Quest, Long lake, Newtonbury, Pumpkin Pale
For example 2)Roundabout, Moon Rune, Olenguard, Newtonbury, Long lake, Quest, Pumpkin Pale
Now example 1 and 2 eliminates answers (A),(B),(D),(E)

(C) Moon Rune is the second beer tested is the right answer
Now we reason for the correct answer
Let's say Moon rune is not the second beer tested
It cannot be the third since third is Olenguard, it cannot be fourth since it has to be either Quest or Newtunbury
in fourth place, it cannot be fifth since it is either Long lake or Pumpkin pale
It cannot be 6 or 7 Since it has to be before Newtunbury since Roundabout is tasted first and this rule has to be satisfied
"Either Pumpkin Pale is tasted before Roundabout or Moon
Rune is tasted before Newtonbury, but not both."






Monday 12 November 2018

Debugging Oracle Berkeley DB


Troubleshooting common Berkeley DB problems

The following are some common problems that applications encounter in the link given below

How to Debug an Oracle ADF Application




Oracle ADF is an end-to-end Java EE framework that simplifies application development by providing out-of-the-box infrastructure services and a visual and declarative development experience.
Please find the below article for debugging the Oracle ADF Application

how-to-debug-adf-application/

How to setup remote debug with WebLogic Server and Eclipse


There is a nice blog on how to remote debug Weblogic server using Eclipse in the below link

how-to-setup-remote-debug-with-weblogic.html

Debugging Oracle Big Data Analytics using BigSift



BigSift combines insights from automated fault isolation in software engineering and data provenance in database systems to find a minimum set of failure-inducing inputs. It redefines data provenance for the purpose of debugging using a test oracle function and implements several unique optimizations, specifically geared towards the iterative nature of automated debugging workloads.

BigSift exposes an interactive web interface where a user can monitor a big data analytics job running remotely on the cloud, write a user-defined test oracle function, and then trigger the automated debugging process.

BigSift also provides a set of predefined test oracle functions, which can be used for explaining common types of anomalies in big data analytics







More on Bigdata from Oracle at the below link

https://blogs.oracle.com/datawarehousing/big-data-8

Wednesday 5 September 2018

Insert data in Table containing Long column in Oracle database(OFF TOPIC)



We can use the copy command in sqlplus to insert data in table containing a long column in the database. This will only work for long column and will not work for long raws.

First, we need to login to the database using sqlplus


> SQLPLUS tkyte/tkyte@aria 


we have the below table with the long column


create table foo
( The_Whole_View   varchar2(65),
  TextLength       number,
  TheText          Long )
/


Next, we can set the below set commands to define the parameters for the copy command to be used to insert into the table which has the long column

  • set arraysize N -- the number of rows the copy command will copy with each fetch
  • set long N -- the size of your longest long
  • set copycommit M -- the number of fetches to do before commit (N*M rows!!)

Then we can use the copy command to insert data into the table which has the long column


SQL> copy from tkyte/tkyte@aria insert foo (the_whole_view, textlength, thetext ) using select owner||'.'||view_name, text_length, text from all_views;


This article is also available in the link Moving LONGS Around

Thursday 4 May 2017