Category Archives: Problem Solution

Install PadWalker to Windows

To install Padwalker on your windows machine follow the steps:

I have PPM Version v4.10 and ActiveState perl v5.8.9
1. Download PadWalker-1.9.tar.gz it from CPAN http://search.cpan.org/dist/PadWalker
2. unzip and extract it to your Perllib folder (should find it over here C:Perllib)
3. In command line go to the extracted folder and execute: PPM install PadWalker

you have successfully installed Padwalker on windows

Share

A solution for a Greedy Choice Algorithm Solution from TopCoder


/**
 * You are playing a computer game and a big fight is planned between two armies.
 * You and your computer opponent will line up your respective units in two rows,
 * with each of your units facing exactly one of your opponent's units and vice versa.
 * Then, each pair of units, who face each other will fight and the stronger one will be
 * victorious, while the weaker one will be captured. If two opposing units are equally strong,
 * your unit will lose and be captured. You know how the computer will arrange its units,
 * and must decide how to line up yours. You want to maximize the sum of the strengths of
 * your units that are not captured during the battle.
 * You will be given a int[] you and a int[] computer that specify the strengths of
 * the units that you and the computer have, respectively. The return value should be an int,
 * the maximum total strength of your units that are not captured.
 *
 * FROM TOP CODER
 *
 * your array
 * {651, 321, 106, 503, 227, 290, 915, 549, 660, 115,
 * 491, 378, 495, 789, 507, 381, 685, 530, 603, 394,
 * 7, 704, 101, 620, 859, 490, 744, 495, 379, 781,
 * 550, 356, 950, 628, 177, 373, 132, 740, 946, 609,
 * 29, 329, 57, 636, 132, 843, 860, 594, 718, 849}
 *
 * computer array
 * {16, 127, 704, 614, 218, 67, 169, 621, 340, 319,
 * 366, 658, 798, 803, 524, 608, 794, 896, 145, 627,
 * 401, 253, 137, 851, 67, 426, 571, 302, 546, 225,
 * 311, 111, 804, 135, 284, 784, 890, 786, 740, 612,
 * 360, 852, 228, 859, 229, 249, 540, 979, 55, 82}
 *
 * Returns: 25084
 *
 */

import java.util.Arrays;
public class Main {

	public void findMaxStrength(int[] computer, int[] player){
		Arrays.sort(computer);
		Arrays.sort(player);
		int index = computer.length-1;
		int smallIndex = 0;
		for(int i = computer.length-1; i>=0; i--){
			if(player[index] <= computer[i]){
				shift(player, smallIndex, index);
				index--;
			}else{
				index--;
			}
		}
	}

	public int[] shift(int[] a, int index1, int index2){
		int e = a[index1];
		for(int i = index1; i
Share

Getting Rid Of Bayblon Search Engine on Firefox

There is a known issues about the babylon search engine direction while you want to use the default search engine of your browser (like I lived 🙂 so I search about the solution and concluded such a solution:

Step1: Uninstall your Firefox (included all your personal information in Firefox) and reboot.

Step2: Instal "CCleaner" free edition (since the problem is about the register file of your browser about the babylon toolbar. It infects on the registers that you  need to delete)

Step3: Delete all cookies about the babylon in the program and fix the registry files by again the program

Step4: Re install Firefox

That's all 🙂

Share

Java Ant Compiling Problem Solution

I was working on a Strunt2 framework project and I needed to use ant in eclipse. I got a problem like this:

BUILD FAILED: D:workspacespschemabuild.xml:37:
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

The solution is to go Window>>Preferences>>Ant>>Runtime than add the "tools.jar" file (somewhere in the JDK's folder) to jars that are in the Heading "Ant Home Entries".

That's it 🙂 have fun!

Share