Friday, 31 October 2008

Acer Aspire 4520 Wireless Driver Failed On Intrepid

I tried to compile wireless driver for my PC Acer Aspire 4520 and it doesn't went well. First I think it because of incomplete installation of build-essential package but the package is successfully installed on Ubuntu Intrepid Ibex.

MAybe, it's time for me to reinstall Ubuntu Hardy Heron.

Ubuntu Intrepid Ibex is Coming

Ubuntu Intrepid Ibex is coming. Let's download. I still downloading it and I will write more about Intrepid after I installed it on my PC.

Sunday, 12 October 2008

Malaysian Mobile Phone Number Wordlist Generator

Save this code as MalaysiaWirelessWordlistGenerator.java

/**

* This wordlist generator brought to you by:

* KaibaTheLegacy "The Elite Blog For All"

* http://kaibathelegacy.blogspot.com

*

* This generator has been coded by me (KaibaTheLegacy) .

* This code is protected under

* GNU Public Licence by Free Software Foundation.

*

* This code is given by me for free by meaning of freedom

* and price. You are prohibited to sell my wordlist

* generator source code. If you modified this code,

* please credit me and please give your code free

* to others too.

*

* This code is absolutely NO WARRANTY. Use this code

* at your own risk. Neither the programmer or anybody

* else responsible

* for any damage regarding to this code.

*

* KaibaTheLegacy 2008. Copyleft and Free/Libre Open Source Software

* No Copyright in Islam. Feel Free to share.

* Sharing is not a crime

* because sharing is caring.

*/


 

/**

* @author KaibaTheLegacy

*

*/

import java.io.*;

import java.text.DecimalFormat;

public class MalaysiaWirelessWordlistGenerator {


 

    /**

     * @param args

     */

    public static void main(String[] args) {

        // TODO Auto-generated method stub

        PrintWriter out=null;

        try {

             out

             = new PrintWriter(new BufferedWriter

                     (new FileWriter

                    ("WirelessWordlist019.txt")));

             //The output will be stored in WirelessWordlist019.txt

        } catch (IOException e) {

            // TODO Auto-generated catch block

            e.printStackTrace();

        }


 

        DecimalFormat df = (DecimalFormat) DecimalFormat.getNumberInstance();

        

        df.setMaximumIntegerDigits(7);

        df.setMinimumIntegerDigits(7);

        df.setGroupingUsed(false);

        String phoneNumber = "";

        

        /*Change the value of i according

         * to your country phone number

         * system.

         */

        for (int i=0;i<=9999999;i++) {

         phoneNumber= df.format(i);

        out.println("019" + phoneNumber);

        /*019 is extension for a Malaysian

         * mobile phone company

         */

        out.flush();

        /*Don't remove out.flush()

         * or your computer may hang due to

         * large memory consumption.*/

        }    

        out.close();

        System.out.println("Finished!!!");

        /*Finished!!! will be appeared in console

         * after your wordlist generation session

         * complete. It will take a long time if

         * you will generate a large wordlist.

         */

         }

        
 

        


 

    }

Sunday, 5 October 2008

SquareNumbers.java : Solution for Al-Khawarizmi 08,Question A (UPDATED)

Sorry for late submission of this article which I promised long ago to publish it.

Questions of Al-Khawarizmi 08 can be viewed here:

http://www.scribd.com/doc/6403834/alkhawarizmi08

Questions of Al-Khawarizmi 08 can be downloaded here:

http://www.usaupload.net/d/1f40e9jjzl7

/**

* @author KaibaTheLegacy

* My modified ICPC Al-Khawarizmi 08 Question A

* solution in Java. Refer to Original question for

* more details.

*

* My team (USIM Spyjak) solved only this question

* during the competition. ;-)

*/

import java.util.*;

public class SquareNumbers {


/**

* @param args

*/

public static void main(String[] args)

{

// TODO Auto-generated method stub

int a,b,sum=0,c[] = new int [10000]; //Create an array contain of 10000 elements.


for ( int i=0; i<c.length;i++)

{

c[i] = i*i; //Create array of square numbers from 1^2 to 10000^2

}

/*

Another interesting use of Scanner to read from file

java SquareNumbers <>

create text.txt with this format:

1 20

1 50

1 36

0 0

*/

Scanner s = new Scanner (System.in);

while (s.hasNext()==true)

{

sum=0;

a=s.nextInt();

b=s.nextInt();

if (a==0 && b==0) {System.exit(0);} //if a and b are 0, the program will terminate

for (int i =a;i<=b;i++)

{

/*Using binary search to find whether i is a square number or not.

if true Arrays.binarySearch(c,i) >=0

if false, Arrays.binarySearch (c,i) < 0

*/

if (Arrays.binarySearch(c, i) >=0)


{

sum++;


}


}

System.out.println(sum);}

}


}


Google custom search

Custom Search