exFAT is natively supported by OSX and Windows (even XP!) the only thing was to make it work with Ubuntu. So here we go:

Execute these commands one by one
sudo add-apt-repository ppa:relan/exfat
sudo apt-get update
sudo apt-get install fuse-exfat

Now we are able to manualy mount exFAT-formatted drives. To automate it we have to install couple more things:
sudo apt-get install build-essential
sudo apt-get install ncurses-dev
sudo apt-get install util-linux

Everything should be working nicely now

Troubleshooting:
If repository cannot be added:
sudo -E add-apt-repository ppa:relan/exfat
If install failed, because of fuse-utils:
sudo apt-get install exfat-fuse exfat-utils
// All the words are in the file Dictionary.txt

import java.io.*;
import java.util.*;
public class Anag
{
    static String[] words;
    public static void main(String args[]) throws IOException
    {
        Hashtable<String, List> ht;
        try {
            FileInputStream fstream = new FileInputStream("Dictionary.txt");
            DataInputStream in = new DataInputStream(fstream);
            BufferedReader br = new BufferedReader(new InputStreamReader(in));
            List<String> lines = new ArrayList<String>();
            String ele;
            while ((ele = br.readLine()) != null)
                lines.add(ele);
            words = lines.toArray(new String[lines.size()]);
            in.close();
        } catch (Exception e) {
            System.err.println("Error: " + e.getMessage());
        }
        ht = getAnagrams();
        BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));
        System.out.print("Enter key number:");
        String wd = br1.readLine();
        char[] chars = wd.toCharArray();
        Arrays.sort(chars);
        String key = String.valueOf(chars);
        System.out.println(ht.get(key));
    }

    public static Hashtable<String, List> getAnagrams() {
        Hashtable<String, List> ht = new Hashtable<String, List>();
        Set<String> hasAnagram = new HashSet<String>();
        for (String wd : words) {
            if (wd.length() <= 1)
                continue;
            // sort the characters in this word
            char[] chars = wd.toCharArray();
            Arrays.sort(chars);
            String anaKey = String.valueOf(chars);
            // update the list of anagrams
            List<String> anagramList = null;
            if (ht.containsKey(anaKey)) {
                anagramList = ht.get(anaKey);
                hasAnagram.add(anaKey);
            }
            if (anagramList == null) {
                anagramList = new ArrayList<String>();
                anagramList.add(wd);
                ht.put(anaKey, anagramList);
            }
            if (!anagramList.contains(wd)) {
                anagramList.add(wd);
            }
        }
        return ht;
    }
}
First you need to get ready with the phonegap running properly.It's here. First download the source from here

Now follow these procedure:
 1. To install the plugin, move www/childbrowser.js to your project's www folder and include a reference to it in your html file after phonegap<version>.js.

<script type="text/javascript" charset="utf-8" src="phonegap<version>.js"></script>
<script type="text/javascript" charset="utf-8" src="childbrowser.js"></script>
2. Copy the image files folder www/childbrowser to your project's www folder.Here you can edit the code or add any other files, but keep the folder named "ChildBrowser" as it is. Because, it is being referenced from others locations.
3. Create a directory within your project called "src/com/phonegap/plugins/childBrowser" and copy "src/com/phonegap/plugins/childBrowser/ChildBrowser.java" into it.

3.1. If you would like to add these folder(childBrowser folder with file ChildBrowser.java) into your existing 'src' folder, then there are some minor changes. Open ChildBrowser.java and change the package name to the relevant one.
4. In your res/xml/plugins.xml file add the following line:

<plugin name="ChildBrowser" value="com.phonegap.plugins.childBrowser.ChildBrowser"/>

4.1. If you followed the step-3.1, ie., if you added the folder elsewhere, change the "value" tag.

5. Customize the links as per your need and build the project.


-------------------------------------------------------------------------------------------------------------------------------------------------

index.html
<html>

  <head>

    <meta name="viewport" content="width=320; user-scalable=no" />

    <meta http-equiv="Content-type" content="text/html; charset=utf-8">

    <title>Child Browser Example</title>

    <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8">

    <script type="text/javascript" charset="utf-8" src="phonegap-1.0.0.js"></script>

    <script type="text/javascript" charset="utf-8" src="childbrowser.js"></script>

    <script type="text/javascript" charset="utf-8">

    function init(){

        document.addEventListener("deviceready", onDeviceReady, false);

    }


     function onDeviceReady() {

        console.log("PhoneGap is ready");

    }


    function locationChanged(newurl) {

        console.log("The JS got this url = " + newurl);

    }

    function closed() {

        console.log("The JS got a close event");

    }

    function showToolbar(locbar) {

        window.plugins.childBrowser.onLocationChange = locationChanged;

        window.plugins.childBrowser.onClose = closed;
         window.plugins.childBrowser.showWebPage("http://thechaithanya.wordpress.com",{

            showLocationBar: locbar

        });

    }

    </script>

  </head>

  <body onload="init()">

    <a href="#" onclick="showToolbar(true);">Page with Toolbar</a>

    <a href="#" onclick="showToolbar(false);">Page without Toolbar</a>

  </body>

</html>

-------------------------------------------------------------------------------------------------------------------------------------------------

Example: If your source file is at src/com/chaithanya/sample,then

if "ChildBrowser.java" is at "src/com/chaithanya/sample/childBrowser", then in res/xml/plugins.xml add
<plugin name="ChildBrowser" value="com.chaithanya.sample.childBrowser.ChildBrowser"/>
else if "ChildBrowser.java" is at "src/com/phonegap/plugins/childBrowser", then in res/xml/plugins.xml add
<plugin name="ChildBrowser" value="com.phonegap.plugins.childBrowser.ChildBrowser"/>
Today I tried to simplify the ChildBrowser execution in xCode, which I follwed earlier. To my surprise, I don't need to do anything rather than simply ignoring some steps. Here is the procedure:
  1. Download the ChildBrowser plugins here.
  2. Start xCode and create a phonegap-based application.
  3. In Supporting Files > PhoneGap.plist, add under Plugins (click the down arrow to the left of Plugins, then click on the + symbol to open a new row):
    Key: ChildBrowserCommand

    Type: String (default)

    Value: ChildBrowserCommand 
  4. You need to associate your external URLs on this page, too. In Supporting Files > PhoneGap.plist, add them under
    ExternalHosts, like:
    Key: Item 0

    Type: String (default)

    Value:  * or whatever URL you are using in the code(* is enough)
  5. Right-click on the Plugins folder in Xcode and select to “Add Files to…” the folder.
  6. Navigate to the phonegap-plugins > iPhone > Childbrowser folder, and select the ChildBrowser folder. Check “Copy items into. . .” and “Create groups for. . .” A ChildBrowser folder is added to the Plugins folder.

Sample Code:

<html>

<head>

<script type=”text/javascript” charset="utf-8" src=”phonegap.<version>.js”></script>

<script type=”text/javascript” charset="utf-8" src=”ChildBrowser.js”></script>
            <script type=”text/javascript” charset="utf-8">

                        var cb;

                        function onDeviceReady()    {
                                 cb = ChildBrowser.install();
                        }
                        function showChild()  {
                                 cb.showWebPage(“http://google.com”);
                        }

</script>

</head>
<body onload=”onDeviceReady()”>

<a href="#" onclick="showChild()">Click here</a>

</body>
</html>

//Josephus.java
//Out of  n members, every m'th person will be eliminated
import java.io.*;

//Stack---------------
class Node<T> {
    T value;
    Node<T> link;
}

class Stack<T> {
    Node<T> top;
    public Stack() {
        top = null;
    }
    public void push(T item) {
        Node<T> n = new Node<T>();
        n.value = item;
        n.link = top;
        top = n;
    }
    public T pop() {
        T item;
        item = top.value;
        Node<T> n = top;
        n = null;
        top = top.link;
        return item;
    }
    public void display() {
        Node<T> n = top;
        System.out.print("(top)");
        while (n != null) {
            System.out.print(" ->" + n.value);
            n = n.link;
        }
        System.out.println();
    }
}

// Queue---------------------------
class Queue<T> {
    Node<T> front, rear;
    Stack<T> s1 = new Stack<T>();
    Stack<T> s2 = new Stack<T>();
    public Queue() {
    }
    public void add(T item) {
        while (s2.top != null)
            s1.push(s2.pop());
        s1.push(item);
        rear = s1.top;
        while (s1.top != null)
            s2.push(s1.pop());
        front = s2.top;
    }
    public T remove() {
        T item = s2.pop();
        front = s2.top;
        return item;
    }
    public void display() {
        Node<T> n = s2.top;
        System.out.print("(front)");
        while (n != null) {
            System.out.print(" <-" + n.value);
            n = n.link;
        }
        System.out.println(" <-(rear)");
    }
}

// Josephus Problem-------------------
public class Josephus {
    public static void main(String[] args) throws IOException {
        Queue<Integer> q = new Queue<Integer>();
        Queue<Integer> q1 = new Queue<Integer>();
        int n, m, i;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("Enter no. of members (n) : ");
        n = Integer.parseInt(br.readLine());
        System.out.println("Enter the elimination number (m) : ");
        m = Integer.parseInt(br.readLine());
        for (i = 1; i <= n; i++)
            q.add(i);
        Node<Integer> node = q.front;
        int l, k = 0;
        while (k != n - 1) {
            for (i = 1; i < m; i++)
                q.add(q.remove());
            l = q.remove();
            q1.add(l);
            k++;
        }
        System.out.println("Order of elimination is : ");
        while (q1.front != null)
            System.out.print(q1.remove() + ",");
        System.out.println("nWinner is : " + q.remove());
    }
}
import java.io.*;
//Node---------------
class Node<T> {
    T value;
    Node<T> link;
}

// Stack---------------
class Stack<T> {
    Node<T> top;
    public Stack() {
        top = null;
    }
    public void push(T item) {
        Node<T> n = new Node<T>();
        n.value = item;
        n.link = top;
        top = n;
    }
    public T pop() {
        T item;
        item = top.value;
        Node<T> n = top;
        n = null;
        top = top.link;
        return item;
    }
    public void display() {
        Node<T> n = top;
        System.out.print("(top)");
        while (n != null) {
            System.out.print(" ->" + n.value);
            n = n.link;
        }
        System.out.println();
    }
}

// Queue---------------------------
class Queue<T> {
    Node<T> front, rear;
    Stack<T> s1 = new Stack<T>();
    Stack<T> s2 = new Stack<T>();
    public Queue() {
    }
    public void add(T item) {
        while (s2.top != null)
            s1.push(s2.pop());
        s1.push(item);
        rear = s1.top;
        while (s1.top != null)
            s2.push(s1.pop());
        front = s2.top;
    }
    public T remove() {
        T item = s2.pop();
        front = s2.top;
        return item;
    }
    public void display() {
        Node<T> n = s2.top;
        System.out.print("(front)");
        while (n != null) {
            System.out.print(" <-" + n.value);
            n = n.link;
        }
        System.out.println(" <-(rear)");
    }
}

import java.io.*;

class Node<T> {
    T value;
    Node<T> link;
}

class Stack<T> {
    Node<T> top;

    public Stack() {
        top = null;
    }

    public void push(T item) {
        Node<T> n = new Node<T>();
        n.value = item;
        n.link = top;
        top = n;
    }

    public T pop() {
        T item;
        item = top.value;
        Node<T> n = top;
        n = null;
        top = top.link;
        return item;
    }

    public void display() {
        Node<T> n = top;
        System.out.print("(top)");
        while (n != null) {
            System.out.print(" ->" + n.value);
            n = n.link;
        }
        System.out.println();
    }
}

Popular Labels

Featured Post (TOP)

Flickr Images

Follow Me on Facebook.com

Follow on Google+

Recent Posts

AD (728x60)

Pages

Powered by Blogger.

Labels

Followers

Popular Posts

Popular Posts

Subscribe Via Email

Sign up for our newsletter, and well send you news and tutorials on web design, coding, business, and more! You'll also receive these great gifts: