PHP: Diagonal Difference Algorithm

Case Study Given a square matrix of size , calculate the absolute difference between the sums of its diagonals. Input Format The first line contains a single integer, . The next lines denote the matrix’s rows, with each line containing space-separated integers describing the columns. Constraints Output Format Print the absolute difference between the two […]

PHP: Big Sum Algorithm

Case Study You are given an array of integers of size . You need to print the sum of the elements in the array, keeping in mind that some of those integers may be quite large. Input Format The first line of the input consists of an integer . The next line contains space-separated integers […]

PHP: Compare the Triplets Algorithms

Case Study: Alice and Bob each created one problem for HackerRank. A reviewer rates the two challenges, awarding points on a scale  from 1  to 100  for three categories: problem clarity, originality, and difficulty. We define the rating for Alice’s challenge to be the triplet A = (a0,a1,a2) , and the rating for Bob’s challenge to […]

Learning with Android Development

Today I have decided to begin with Android development so here my journey begins….. Installed Android Studio Only issue I faced was that my computer was not installed with jdk so I have install first then can proceed with the installation. Use this link if you want to install java development kit. During my installation it […]

HR Challenge – Day 0 (PHP)

Hi there!!! This year my focus is more on coding and fitness. I have decided to take challenge from hackerrank. To begin with I have decided to take the 30 days of coding in php. Day 0: Hello World Problem: Objective In this challenge, we review some basic concepts that will get you started with […]

Perl -Grep and Hash

Grep with Array Grep returns a list, bracket will return the actual value. The first argument needs to evaluate as true or false to return the match. if (my ($matched) = grep $_ eq $match, @array) { print “found it: $matched\n”; } Convert Array into hash Converting array to hash with array elements as the […]

Css Tips #3 :Stop floating divs from wrapping

If you want to display divs in a row horizontally, sometimes we use float:left. This has problems with wrapping to container div. This can work if the parent container has width or min-width defined. But the width of the parent needs to be equal to the total of its children including the margins/paddings/borders. And also […]

Repaint vs Reflow

Repaint vs Reflow Repaint is just affect the DOM itself, but reflow affect the whole page. Repaint occur when some changes which only its skin styles, such as color and vibility. Reflow occur when the page of DOM changes its layout. This link provides list of css triggers attribute will trigger repaint or reflow.

jQuery – adding CSS with jquery

css(height) height() cssText   jQuery adding height $(‘.ui-widget-overlay’).css(“height”, “985px !important”); $j(“#wowslider_2542”).height(new_height+’px’); height() – can be use to set or get the height of the selected element. If you need height for calculation reason than height() is best option to use because it returns in pixels. Height  in css returns value in units. Sometimes the css(height) […]