Pages

July 29, 2018

Exceptions in Java 8 Streams and Lambda Expressions

Java 8 Lambda Expressions allow us to do functional programming, but sadly they don't deal with exceptions very well.

Handling Unchecked Exceptions
Let's say we have a list of integers and we are dividing a constant number (lets say 16) with every element of this list, we need to print result of this division.

List < Integer > myList = Arrays.asList(7, 9, 16, 25, 27);
myList.forEach(i - > System.out.println(16 / i));

July 27, 2018

#Algorithm: Find first non-repeating character from a String


Write a method to find the first non-repeating character from a String?

GIT URL: Java Solution to find the first non-repeating character from a String

Solution 1: Using LinkedHashMap.
1). Create a LinkedHashMap, which will maintain the count.
2). Convert the input string into a char array, start iterating it and add each character in LinkedHashMap. If the character is already present in LinkedHashMap, increment the count.
3). Loop through LinkedHashMap and find the character with the count as 1.

#Algorithm: Generate Fibonacci In Java

Generate the Fibonacci recursively and iteratively in Java
In fibonacci series, next number is the sum of previous two numbers for example 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc. The first two numbers of fibonacci series are 0 and 1.

There are two ways to generate the fibonacci series: With iteration and with recursion.

July 26, 2018

BARC TV Ratings (Impressions)- Week 29, 2018

Top 10 Hindi GEC Channel
  1. Zee Anmol : 715928
  2. Zee TV : 612711
  3. Colors : 608701
  4. STAR Bharat : 591833
  5. Sony Pal : 586868
  6. STAR Utsav : 585245
  7. STAR Plus : 532629
  8. SONY SAB : 468725
  9. Rishtey : 458122
  10. Sony Entertainment Television : 447894

July 25, 2018

Roop Kumar Rathod launches 'Taa-Dhaa'

First time ever Sandip Mahavir and Taufiq Qureshi comes up with something very different in the field of Dance, Music, & Rythm. “Taal Se” is a treat to everyone as it brings Sandip Mahavir and Taufiq Qureshi together and also a gorgeous, vibrant danseues Mugddha Mane.

Urvashi Rautela off to New York for acting lessons

Urvashi Rautela has always graced films with her personality like Hate Story 4 which can be seen in her dance numbers like Saara Zamana from Kaabil as well. She has mastered 13 dance forms and is currently working on polishing her acting skills.

July 23, 2018

Spring Singleton vs Singleton Pattern

What is the difference between Spring Singleton and Java Singleton?
Difference between Spring Singleton and Java Singleton is one of the common misunderstanding among Spring Framework developers.

If you are not already familiar about the Singleton design pattern, please read the blog-post related to various Design Patterns.

I never considered having a different title for Laila Majnu: Imtiaz Ali

Imtiaz Ali has given Bollywood some of the most romantic tales in the recent past. His take on modern times love and relationships make him the most loved filmmaker amongst youth. He accepts that having to make a modern-day adaptation of the legendary Laila Majnu brought him sheer happiness but what was incommodious was to get the title of the movie – Laila Majnu.

July 21, 2018

Annup Soni returns to theatre, his first love!

After a gap of eight years, Annup Sonii has returned to his first love, theatre. The versatile actor, who has for long been anchoring the reality-based television show, Crime Patrol on television, couldn’t take up any other project because of the hectic shoot schedule.

July 20, 2018

ALTBalaji announces new show 'Baby Come Naa'

ALTBalaji is India’s largest platform for original and exclusive digital content with more than 15 million mobile plus web users and is available in over 90 countries. The digital platform currently offers 22 original shows in Indian languages across various genres such as romance, mystery, drama, and comedy. ALTBalaji also offers entertaining original shows for kids and have launched short, hilarious regional stand-up comedy videos in Marathi, Punjabi, Hindi, Gujarati, Tamil, and Telugu.

July 19, 2018

BARC TV Ratings (Impressions)- Week 28, 2018

Top 10 Hindi GEC Channel
  1. Zee Anmol: 651719
  2. Zee TV: 577951
  3. Sony Pal: 551727
  4. STAR Bharat: 541652
  5. Colors: 538323
  6. STAR Utsav: 504288
  7. STAR Plus: 493095
  8. Rishtey: 429347
  9. SONY SAB: 410532
  10. Sony Entertainment Television: 407029

Sacred Games glamour girl Elnaaz Norouzi looks promising for Bollywood

When Elnaaz Norouzi made her Netflix debut with Sacred Games, little did she realize that controversy would not only follow the first Indian original series of the streaming giant in the form of political debates, but also engulf her character in the series.

#Algorithm: Detect duplicate elements in Array


How to detect duplicate elements in Array in Java?
1). Brute Force: In this approach we will compare each element of Array to all other elements and returns true if it founds duplicates. FYI, this is not an efficient choice.

2). Using HashSet: If you just need to find if whther the array has duplicates of not, convert that array into Set. Since Set doesn’t allow duplicates, the size of the corresponding Set will be smaller than the original Array if Array contains duplicates otherwise the size of both Array and Set will be the same.

#Algorithm: Implement Stack using two Queues

How can we implement Stack using two Queues?
We are given a queue data structure, and we need to implement Stack using it.

Solution 1:
Queue has FIFO, but Stack is FILO. We will use two queues q1 and q2. We can make sure that newly entered element is always at the front of q1, so that pop operation just dequeues from q1. q2 is used to put every new element at front of q1.

July 18, 2018

Jassie Gill's Tru Talk sets a new benchmark!

Jassie Gill, who will be next seen in Colour Yellow Productions and Eros International’s upcoming family entertainer, Happy Phir Bhag Jayegi, has recently unveiled his brand new single, Tru Talk with Speed Records.

July 17, 2018

#LeetCode: Maximum consecutive one's

Let's say we want to find maximum consecutive one’s in a binary array.

Algorithm:
1). Maintain two counters current and max.
2). Start iterating the array, if 3.a). the current number is 1, we need to increment 'current'.
3). If the current number is 0, then we need perfom below checks:
3.a) If the 'current' is greater than 'max', we set 'current' in 'max'.
3.b). If max is greater than equal to half of array length, so we should return max as there is no point in checking the array further.
3.c). Set the 'current' as zero.
4). Return 'current' or 'max', which ever is higher.

July 12, 2018

BARC TV Ratings (Impressions)- Week 27, 2018


Top 10 Hindi GEC Channel
  1. Zee Anmol : 698822
  2. Zee TV : 614367
  3. Sony Pal : 552330
  4. Colors : 552010
  5. STAR Bharat : 545871
  6. STAR Utsav : 508738
  7. STAR Plus : 487574
  8. Rishtey : 445400
  9. SONY SAB : 401353
  10. Sony Entertainment Television : 362280

Netflix's Sacred Games needs stronger villains, feels James Bond baddie Alex Reece

Last week, amid a lot of hype and hoopla, Netflix released its first Indian original series Sacred Games which met with a relatively positive response, critically as well as with the masses. Starring Saif Ali Khan as a cop and Nawazuddin Siddiqui as a don, it has the police officer stumbling upon clues given by the gangster, and going on a wild goose chase behind a foreign white guy smuggling ammunition into Mumbai.

July 10, 2018

Sunny Deol starrer Bhaiaji Superhit To Hit The Theaters on 19th Ocotber


Bhaiaji Superhit starring Sunny Deol, Preity G Zinta, Arshad Warsi, Shreyas Talpade, Ameesha Patel, Sanjay Mishra, Brijendra Kala, Jaydeep Alahwat, Mukul Dev, Pankaj Tripathi and Pankaj Jha will be releasing on 19th October 2018. The action comedy directed by Neerraj Pathak will see Sunny Deol playing a double role for the first time.

Punjabi superstar Gippy Grewal’s new single is out..

With music by well-known B Praak, composed and written by the very successful Jaani, Sooraj’s theme is a marked departure from the Punjabi superstars’ recent work which has mostly been upbeat, dance numbers.  The video, shot in Vancouver, is directed by Baljit Singh Deo and features Shinda Grewal and Navpreet Banga.

July 09, 2018

#Shocking : Kavi Kumar Azad aka Dr Haathi of Taarak Mehta Ka Ooltah Chashma is no more..

Kavi Kumar Azad, popularly knows as 'Dr Hansraj Hathi' from 'Taarak Mehta Ka Ooltah Chashmah' died because of a massive cardiac arrest.

July 07, 2018

Swagger Questions and Answers

How can you document your RESTful API?
One of the outdated option is to maintain documentation manually. Or, you can generate documentation from code by using: WADL, RESTDocs or Swagger.

Swagger is one of the mostly used and popular REST API documentation standard.

What is Swagger?
Swagger is a specification for documenting REST API, which specifies the format (URL, method, and representation) to describe REST web services.

July 05, 2018

BARC TV Ratings (Impressions)- Week 26, 2018

Top 10 Hindi GEC Channel
  1. Zee Anmol : 719829
  2. Zee TV : 582960
  3. STAR Bharat : 565587
  4. Colors : 564746
  5. Sony Pal : 540331
  6. STAR Plus : 502843
  7. STAR Utsav : 479691
  8. Rishtey : 456356
  9. SONY SAB : 367955
  10. Sony Entertainment Television : 344737

Surveen Chawla set to play a crucial part in sacred games

Surveen Chawla is eagerly anticipating the launch of her forthcoming web series, Sacred Games also featuring Saif Ali Khan and Nawazuddin Siddiqui. 

July 04, 2018

Sonchiriya first look out..

The makers of Sonchiriya have released the first look poster of the film!

July 03, 2018

Difference Between @RestController and @Controller

What is the difference between @RestController and @Controller Annotation in Spring MVC and REST?
@RestController was added into Spring 4.0 to make the development of RESTful Web Services in Spring framework easier. But @Controller was added on Spring 2.5 version.

A web application is generally returns a view (HTML + CSS + JavaScript) because they are intended for human viewers. Where as REST API just returns data in form of JSON or XML.

Mental Hai Kya to release on 22nd Feb, 2018!

Balaji Motions Pictures & karma Media and Entertainment's much awaited film Mental Hai Kya, starring Kangana Ranaut and Rajkummar Rao is all set for a release on 22nd February, 2019.

Family time for Annup Sonii!

Annup Sonii, who has for long been anchoring the reality-based television show, Crime Patrol, has taken some time off from work and is currently in Sri Lanka for a family vacation.

July 02, 2018

History TV18 Presents Amelia Earhart

Amelia Earhart, American aviation pioneer and author was the first pilot aviator to fly solo across the Atlantic. On July 2, 1937, during an attempt to circumnavigate the world, Earhart and her fellow navigator mysteriously vanished over the Central Pacific Ocean. All search efforts made during the period were unable to locate the pair or their airplane. HISTORY TV18’s upcoming show ‘Amelia Earhart: The Lost Evidence’ airing 1st July, 2018 at 9 PM will unfold this mystery, as the two hour special documentary reveals some shocking evidence.

Difference between RANK, DENSE_RANK and ROW_NUMBER functions

RANK
The RANK function is used to retrieve ranked rows based on the condition of the ORDER BY clause. For example, if you want to find the name of the employee with third highest salary, you can use RANK Function.

July 01, 2018

#WelcomeJuly