Wednesday, March 25, 2015

Eclipse Luna update problem

On update got next error:

An error occurred while collecting items to be installed
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,org.springsource.ide.eclipse.commons.quicksearch,3.6.4.201503050855-RELEASE
No repository found containing: org.eclipse.update.feature,org.springsource.ide.eclipse.commons.quicksearch.feature,3.6.4.201503050855-RELEASE

Steps helped me:

  1. Review and delete excess old repositories. Help > Install New Software > Available Software Sites and deselect all Update Sites for older Eclipse versions. I had two Spring repositories for 4.3 and 4.4 version.
  2. Clear <eclipse folder>/p2/org.eclipse.equinox.p2.repository/cache directory.
  3. Check for updates again.

Wednesday, March 11, 2015

Mercurial HG. How to restore corrupted repository: unknown format 114

Working with Eclipse and installed MercurialEclipse faced with error "unknown format 114". My repository contained committed, inactive and not pushed revision in bookmark. Problem occurred in the middle of revision history, don't know how.


C:\U\DL\workspace\broken> hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
 src/com/projectname/rfp/web/helpers/ProjectReplicationSettings.java@2660: broken revlog! (index data/src/com/projectname/rfp/web/helpers/ProjectReplicationSettings.java.i unknown format 114)
warning: orphan revlog 'data/src/com/projectname/rfp/web/helpers/ProjectReplicationSettings.java.i'
5599 files, 3098 changesets, 19303 total revisions
1 warnings encountered!
1 integrity errors encountered!
(first damaged changeset appears to be 2660)

Thursday, March 5, 2015

HackerRank. Contest 101. Marble Cut

Problem Statement

Given a marble of size l * b, your task is to find out if it can be cut into pieces of size 3×1 or not.


Input Format

First line will contain T i.e. number of the test cases.
Next T lines will contain pair of integers l and b separated by a single space.


Constraints

1≤T≤10^5
1≤l,b≤10^9


Output Format

Print "YES" if it is possible to cut the given marble without any area left, else print "NO" followed by remaining area.
Link: https://www.hackerrank.com/contests/101hack22/challenges/marble-cut