Problem in framing or understanding the exact approach for the specificatio

Hi , I got a task to create a java program , but actually I am not able to understand what I need to do . I mean , there are some Filie System , flat file scenarios and space given . So please explain me what exactly I need to code and what is the actual requirement. The problem given as-
**I do not need the entire code .
A specification for a very simple file system stored inside a flat file (FS). There is an associated index file (FI) which provides meta-data to the data inside the flat file (FS).
FS:- FS cannot be larger than 1 MB. The entire space in FS is divided into blocks of 128 bytes.
FI:- FI provides meta-data regarding what is stored in FS. Directories, sub-directories and files are supported. Files can be binary or text which is marked in the meta-data. The following is a detailed description of FI -
FI consists of a sequence of entries or records. Each record (R) is 48 bytes long. Each record has an index and is referred by its index. There can be a max 8192 Records if each file is exactly one block long. Therefore FI can be at most 8192 x 48 = ~384KB in size. The structure of each Record is -
*1 2 3 4 5*
*|-----------------|--|--|---|-------|*
*1 - Name (32 bytes)*
*2 - Attribs (2 bytes) Described below*
*3 - Directory Entry (2 bytes) - what is the parent directory of this record*
*4 - Size (4 bytes) - File size, 0 for Directory*
*5 - Blocks list (8 bytes)*
Name - The file/dir name can be at most 32 bytes long. Only ascii alpha-numeric characters are allowed.
The only symbols allowed are - $ and .
A string shorter than 32 characters is terminated with an ascii value of 0.
Attributes - Only the relevant attributes are described here
*1st bit - if set is a File else Dir*
*3rd bit - if set is a Text file else Binary*
Dir Entry - The index of the parent’s Record in FI. The root entry has this value as 0.
Size - The actual size of the file (not the block count), always 0 for directories
Blocks list - Lists which blocks in FS holds the contents of this record. 8 bytes allows for 4 block indices to be specified each of size 2 bytes. If a file is larger than 4 block sizes (i.e. larger than 512 bytes) then a chaining mechanism is used where the last 2 bytes of the block from FD is used to point to the next block in FS.  Suppose if the file is of 8 block size, then the last 2 bytes of 4th block will point to 5th block and last 2 bytes of 5th block points to 6th block and so on.
Directories will not have any block entries.
The root directory always occupies R[0].
Problem
A] Write a class com.progress.test.FSReader which has a static read method and takes as its only argument a file path similar to \files\abc.txt and returns a String of its contents.
If the path provided is not a file or not a text file null must be returned. No exceptions must be thrown.
Signature -> String com.progress.test.FSReader.read(String path)
Edited by: buntha on Mar 26, 2010 5:59 AM

buntha wrote:
Hi , I got a task to create a java program , but actually I am not able to understand what I need to do .[_So, You Need to Write a Program but Don't Know How to Start_|http://home.earthlink.net/~patricia_shanahan/beginner.html]
So please explain me [...] what is the actual requirement. How should we know this? We have at most as much information as you have (probably less) in this case.

Similar Messages

  • I need advise and help with this problem . First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product . At the present time I'm having lots of problems with the router so I was looking in to

    I need advise and help with this problem .
    First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product .
    At the present time I'm having lots of problems with the router so I was looking in to some info , and come across one web site regarding : port forwarding , IP addresses .
    In my frustration , amongst lots of open web pages tutorials and other useless information , I come across innocent looking link and software to installed called Genieo , which suppose to help with any router .
    Software ask for permission to install , and about 30 % in , my instinct was telling me , there is something not right . I stop installation . Delete everything , look for any
    trace in Spotlight , Library . Nothing could be find .
    Now , every time I open Safari , Firefox or Chrome , it will open in my home page , but when I start looking for something in steed of Google page , there is
    ''search.genieo.com'' page acting like a Google . I try again to get raid of this but I can not find solution .
    With more research , again using genieo.com search eng. there is lots of articles and warnings . From that I learn do not use uninstall software , because doing this will install more things where it come from.
    I do have AppleCare support but its to late to phone them , so maybe there some people with knowledge , how to get this of my computer
    Any help is welcome , English is my learned language , you may notice this , so I'm not that quick with the respond

    Genieo definitely doesn't help with your router. It's just adware, and has no benefit to you at all. They scammed you so that they could display their ads on your computer.
    To remove it, see:
    http://www.thesafemac.com/arg-genieo/
    Do not use the Genieo uninstaller!

  • My IPOD menus suddenly appear in Japanese or Chinese and are impossible to understand for me who is european. Has somebody else had this problem? Please help? The song titles are still in the language they were entered though. /Jane

    My IPOD menus suddenly appear in Japanese or Chinese and are impossible to understand for me who is european. Has somebody else had this problem? Please help? The song titles are still in the language they were entered though. /Jane

    Fingers crossed, the following document might be of some assistance:
    iPod: Changing the display language

  • I have a windows 7 operating system on my laptop and it keeps saying I have installed itunes wrong?? i have done this activity three times now and do not understand the error? what di I have to do to fix the problem?

    i have a windows 7 operating system on my laptop and it keeps saying I have installed itunes wrong?? i have done this activity three times now and do not understand the error? what di I have to do to fix the problem?

    What's the precise text of the error message, please? (There's a few different ones I can think of that you might be getting.)

  • Cannot understand the problem

    Hi frnds my name is raj , i am very new to OBIEE , i have been pracitcing it on my own and now i had few problems in understanding the errors .
    I built a physical layer with CHANNELS ,COSTS , COUNTRIES , PRODUCTS , SALES ,TIMES tables and SALES being the fact table ,,, I have physical joined every column except COST to sales .
    And in Bussiness layer i have created a new bussiness model and dragged all the tables from physical layer except COST table..
    In BMM layer , in Sales Table i have dragged a column named UNIT_COST from cost table in physcial layer and renamed it to unitcost , so the sales table in BMM layer has two sources i.e., SALES and COSTS .
    Now i applied aggergation sum rule on UNIT COST and dragged it to presentation layer ...
    When i opened the presentation server , and selected Product name from product table and Amount sold and Unitcost from sales table and when i click the results to view i have encountered with an error
    ODBC DRIVER RETURNED AN ERROR(SQLEXECDirectVV)
    the message says : UNIT_COST : invalid Identifier at OCI call .
    Please help me in understanding this error and kindly give me the solution for it
    thanks ...

    Hi,
    Firstly did you make a "view data" in the physical layer for the COSTS table. I am doubting that this table wasnot created in the db itself. Kindly check it and let us know if you have any issues
    Regards,
    BI Learner

  • HT1390 I downloaded two movies 4 days ago before a school trip. I watched the first on the bus on the way. I am now on the way home and want to watch the other movie and it disappeared. This has happened to me in the past and I dont understand the problem

    I downloaded two movies 4 days ago before a school trip. I watched the first on the bus on the way. I am now on the way home and want to watch the other movie and it disappeared. This has happened to me in the past and I dont understand the problem!!

    Drrhythm2 wrote:
    What's the best solution for this? I
    Copy the entire /Music/iTunes/ folder from her old compouter to /Music/ in her account on this new computer.

  • Problem in understanding the code

    this particular code is given as stadard example in sap unicode conversion
    this particular code is replcement for 'translate code page syntax'
    this code describes  how to use particular cl_abap_conv_in_ce classs
    i cannot understand the   'buffer'  field in this code
    can any one tell me what is the meaning of buffer = '41424320' from where did he get this value?
      DATA:
        text(100) TYPE c,
        int TYPE i,
        buffer(4) TYPE x,
        conv TYPE REF TO cl_abap_conv_in_ce.
      conv = cl_abap_conv_in_ce=>create(
              encoding = 'UTF-8'
              endian = 'L' ).
      buffer = '41424320'.
      conv->convert(
        EXPORTING input = buffer
        IMPORTING data = text ).
      buffer = '02010000'.
      conv->convert(
        EXPORTING input = buffer
        IMPORTING data = int ).

    thank you mahmet i also want to check weather  i am doing the  code correct or not
    i have old syntax in my program like    'TRANSLATE header-id FROM CODE PAGE file_tab-codepage'.
    i am replacing the above syntax with the follwing code and can u correct me if  i am wrong
    data:
    buffer1 type xstring,
    conv type ref to cl_abap_conv_in_ce,
    int type i.
    conv = cl_abap_conv_in_ce=>create(
              encoding = 'file_tab-codepage'
              endian = 'L' ).
      buffer1 = '41424320'.
      conv->convert(
        exporting input = buffer1
        importing data = header-id ).

  • Java tutorial - helps, problem  is i don't understand the API

    I don't understand the JAVA Tutorials or the API

    Take two steps back.
    Buy a book on basic Java Programming. You need to understand the concepts behind programming before you should start reading the API.
    But kudos for at least trying to read the API.
    Now look at the column on the left, and follow the link called [url http://developer.java.sun.com/developer/onlineTraining/] Tutorials 
    and then the link titled [url http://java.sun.com/docs/books/tutorial/index.html]The Java Tutorial (Java Series).
    And finally read through the sections starting with [url http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html]Your First Cup of Java.
    Then once you have been through all of that, come back and ask for clarification
    on any specific points that you have trouble understanding.
    Finally (Because the Finally always gets executed) Try taking a class in java programming.
    regards

  • Problem with trees(Duplication of the parent node in creation of  children)

    Hi guys i am experiencing a slight problem with the creation of trees.Here is a clear explanation of my program.I created a program that generates edges from a set of datapoints then use each and every edge that is generated to create multiple trees with the edge as the rootnode for each and every tree.Everything up to so far everything went well but the problem comes when i want the program to pick every single tree and traverse through the set of generated edges to create the children of a tree.What it does at the moment for each tree is returning the a duplication of the parent node as the child nodes and that is a problem.Can anyone related with this problem help.Your help will be appreciated.
    The code
    TreeNode class
    package SPO;
    import java.util.*;
    public class TreeNode
            Edge edge;
            TreeNode node;
         Vector childrens = new Vector();
            public TreeNode(Edge edge)
                    this.edge = edge;
            public synchronized  void insert(Edge edge)
                    if(edge.fromNode == this.edge.toNode)
                            if(node == null )
                                    node = new TreeNode(edge);
                                    childrens.add(node);
                            else
                        node.insert(edge);
                                    childrens.add(node);
    Tree class
    package SPO;
    import java.util.*;
    public class Tree
            TreeNode rootNode;
         public Tree()
                    rootNode = null;
            public Tree[]  createTrees(Vector initTrees,Vector edges)
                   Tree [] trees =  new Tree[initTrees.size()];
                   for(int c = 0;c < trees.length;c++)
                      trees[c] = (Tree)initTrees.elementAt(c);     
                   for(int i = 0;i < trees.length;i++)
                            for(int x = 0;x < edges.size();x++)
                                    Vector temp = (Vector)edges.elementAt(x);
                                    for(int y = 0;y < temp.size();y++)
                                           trees.insertNode((Edge)temp.elementAt(y));
    return trees;
    public void printTree(Tree tree)
    System.out.print("("+tree.rootNode.edge.fromNode.getObjName()+","+tree.rootNode.edge.toNode.getObjName()+")");
    Vector siblings = tree.rootNode.childrens;
    for(int i = 0; i < siblings.size();i++)
    TreeNode node = (TreeNode)siblings.elementAt(i);
    System.out.print("("+node.edge.fromNode.getObjName()+","+node.edge.toNode.getObjName()+")");
    System.out.println();
    public Vector initializeTrees(Vector edges)
    Vector trees = new Vector();
    for(int i = 0;i < edges.size();i++)
    Vector temp = (Vector)edges.elementAt(i);
    for(int j = 0;j < temp.size();j++)
    Tree tree = new Tree();
    tree.insertNode((Edge)temp.elementAt(j));
    trees.add(tree);
    return trees;
    public synchronized void insertNode(Edge edge)
    if(rootNode == null)
    rootNode = new TreeNode(edge);
    else
    rootNode.insert(edge);
    EdgeGenerator class
    package SPO;
    import java.util.*;
    import k_means.*;
    public class EdgeGenerator
         public EdgeGenerator()
    public Vector createEdges(Vector dataPoints)
    //OrderPair orderPair = new OrderPair();
    Vector edges = new Vector();
    for(int i = 0;i < dataPoints.size()-1 ;i++)
    Vector temp = new Vector();
    for(int j = i+1;j < dataPoints.size();j++)
    //Create an order of edges
    Edge edge = new Edge((DataPoint)dataPoints.elementAt(i),(DataPoint)dataPoints.elementAt(j));
    temp.add(edge);
    edges.add(temp);
    return edges;
    Edge class
    package SPO;
    import k_means.*;
    public class Edge
    public DataPoint toNode;
    public DataPoint fromNode;
    public Edge(DataPoint x,DataPoint y)
    if (x.getX() > y.getX())
    this.fromNode = x;
    this.toNode = y;
    else
    this.fromNode=y;
    this.toNode = x;
    Entry Point
    package SPO;
    import java.util.*;
    import k_means.*;
    public class Tester {
         public static void main(String[] args)
              Vector dataPoints = new Vector();
              dataPoints.add(new DataPoint(140, "Orange"));
              dataPoints.add(new DataPoint(114.2, "Lemmon"));
              dataPoints.add(new DataPoint(111.5, "Coke"));
              dataPoints.add(new DataPoint(104.6, "Pine apple"));
              dataPoints.add(new DataPoint(94.1, "W grape"));
              dataPoints.add(new DataPoint(85.2, "Appletizer"));
              dataPoints.add(new DataPoint(84.8, "R Grape"));
              dataPoints.add(new DataPoint(74.2, "Sprite"));
              dataPoints.add(new DataPoint(69.2, "Granadilla"));
              dataPoints.add(new DataPoint(59, "Strawbery"));
              dataPoints.add(new DataPoint(45.5, "Stone"));
              dataPoints.add(new DataPoint(36.3, "Yam"));
              dataPoints.add(new DataPoint(27, "Cocoa"));
              dataPoints.add(new DataPoint(13.8, "Pawpaw"));
    EdgeGenerator eg = new EdgeGenerator();
    Vector edges = eg.createEdges(dataPoints);
    Tree treeMaker = new Tree();
    Vector partialTrees = treeMaker.initializeTrees(edges);
    Tree [] trees = treeMaker.createTrees(partialTrees,edges);
    for(int i = 0;i < trees.length;i++)
    treeMaker.printTree(trees[i]);
    The program output
    Each and every "@" symbol represents the start of a tree
    @(Orange,Lemmon)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)(Lemmon,Coke)
    @(Orange,Coke)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)
    @(Orange,Pine apple)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)
    @(Orange,W grape)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)
    @(Orange,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
    @(Orange,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
    @(Orange,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
    @(Orange,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
    @(Orange,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
    @(Orange,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(Orange,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(Orange,Cocoa)(Cocoa,Pawpaw)
    @(Orange,Pawpaw)
    @(Lemmon,Coke)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)(Coke,Pine apple)
    @(Lemmon,Pine apple)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)
    @(Lemmon,W grape)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)
    @(Lemmon,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
    @(Lemmon,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
    @(Lemmon,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
    @(Lemmon,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
    @(Lemmon,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
    @(Lemmon,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(Lemmon,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(Lemmon,Cocoa)(Cocoa,Pawpaw)
    @(Lemmon,Pawpaw)
    @(Coke,Pine apple)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)(Pine apple,W grape)
    @(Coke,W grape)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)
    @(Coke,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
    @(Coke,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
    @(Coke,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
    @(Coke,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
    @(Coke,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
    @(Coke,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(Coke,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(Coke,Cocoa)(Cocoa,Pawpaw)
    @(Coke,Pawpaw)
    @(Pine apple,W grape)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)(W grape,Appletizer)
    @(Pine apple,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
    @(Pine apple,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
    @(Pine apple,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
    @(Pine apple,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
    @(Pine apple,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
    @(Pine apple,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(Pine apple,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(Pine apple,Cocoa)(Cocoa,Pawpaw)
    @(Pine apple,Pawpaw)
    @(W grape,Appletizer)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)(Appletizer,R Grape)
    @(W grape,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
    @(W grape,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
    @(W grape,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
    @(W grape,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
    @(W grape,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(W grape,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(W grape,Cocoa)(Cocoa,Pawpaw)
    @(W grape,Pawpaw)
    @(Appletizer,R Grape)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)(R Grape,Sprite)
    @(Appletizer,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
    @(Appletizer,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
    @(Appletizer,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
    @(Appletizer,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(Appletizer,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(Appletizer,Cocoa)(Cocoa,Pawpaw)
    @(Appletizer,Pawpaw)
    @(R Grape,Sprite)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)(Sprite,Granadilla)
    @(R Grape,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
    @(R Grape,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
    @(R Grape,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(R Grape,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(R Grape,Cocoa)(Cocoa,Pawpaw)
    @(R Grape,Pawpaw)
    @(Sprite,Granadilla)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)(Granadilla,Strawbery)
    @(Sprite,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
    @(Sprite,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(Sprite,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(Sprite,Cocoa)(Cocoa,Pawpaw)
    @(Sprite,Pawpaw)
    @(Granadilla,Strawbery)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)(Strawbery,Stone)
    @(Granadilla,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(Granadilla,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(Granadilla,Cocoa)(Cocoa,Pawpaw)
    @(Granadilla,Pawpaw)
    @(Strawbery,Stone)(Stone,Yam)(Stone,Yam)(Stone,Yam)
    @(Strawbery,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(Strawbery,Cocoa)(Cocoa,Pawpaw)
    @(Strawbery,Pawpaw)
    @(Stone,Yam)(Yam,Cocoa)(Yam,Cocoa)
    @(Stone,Cocoa)(Cocoa,Pawpaw)
    @(Stone,Pawpaw)
    @(Yam,Cocoa)(Cocoa,Pawpaw)
    @(Yam,Pawpaw)
    @(Cocoa,Pawpaw)

    Your program description makes no sense. What exactly is it supposed to do?
    Your errors make no sense. What is it doing wrong?
    Your program output makes no sense. Look up pre-order, in-order, and post-order notation for representing trees. Pick one of those that you think would be best. I would go with pre-order. Because what you are doing isn't understandable.
    By the way, I think your concept of a tree is flawed. A node in a tree has 3 things. it has a reference to its parent, it has references to any of its children, and it has some key value that represents the node (if each node were represented by numbers, the value would be an integer or something). In the case of the root, its reference to its parent is null. I don't know what you are doing with your tree, but it is highly confusing.

  • Could you please help me understand the logic behind certain things in OSX?

    Ok, so I try to be an open-minded guy, and I bear no particular allegiance to either OS. I own a Sony TZ and a Mac mini, and my wife has a MacBook Pro. I use both Oses.
    There are certain things I have trouble understanding in th Mac OS, so what I'd really like to understand the logic behind certain design decisions in the OS, and why these might be better ways of accomplishing things. I know how to get around all of the things I mention, so I'm not looking for instructions; rather I'm looking for well-thought out explanations for why these features are the way they are.
    *1. Programs don't quit when you close the window.*
    - This totally puzzles me. Why design it so that program windows are independent are from the running program itself? There must be a reason, cold someone explain how this is more efficient? To me, it's simpler to click an X on the window you are working on to completely shut down a program, rather than to either mouse through menus to select quit, or be obligated to using Command Q keyboard shortcut.
    *2. Menu bars are on the desktop.*
    - Related to the first point, why make the main thing framing your desktop be something which is always changing depending on the program? Why have file menus outside the main window of the program. Having the menu bar on the desktop then necessitates an additional area, the dock, which has to be used as a launch bar and to tell you what programs are currently running. That obligates you to having 3 different areas of screen: 1 for program menus, 1 for running programs, and the program window itself. This seems very inefficient to me. Not to mention all the messy-looking floating palettes all over the place, again because everything is separated and not nicely contained in a single program window.
    - Really, having a changing menu bar that frames the desktop isn't even consistent wth the whole desktop metaphor, which is that you place things on a desktop, like programs, files, etc. Are you changing the whole desk everytime you load a new program, yet the wallpaper stays the same? Doesn't seem to be logically consistent to me.
    *3. No delete key.*
    - This one really gets me. Why make such a commonly used key be a function key (Fn + Backspace)? Why make the user press a secondary key for a major function?
    *4. No Cut command.*
    - I read something about how Cut doesn't actually make sense when moving files around, but I obviously didn't fully understand it. Why make the user command drag, when you can just do Ctrl X??.
    *5. Launching Apps from the Finder.*
    - This seems weird to me, that you find and launch applications from the same thing you use to view files. Program icons in the finder are placeholders for the entire program, not files, yet they are found in the file viewer. Again, to me this seems logically mixed. I really dislike scrolling through Finder to look for apps. I know there is Spotlight and the dock (used as a quicklauncher), but these are really just workarounds for a setup which seems inherently illogical. To me at least, a menu of applications make more sense, ie, the start menu.
    Anyway, those are all I can think of now, although there are other things aout OSX that don't make sense to me.
    Thanks in advance! If I can understand Apple's reasoning and it is convincingly better, that will go a long way towards making me more comfortable with this OS.

    1. Programs don't quit when you close the window.
    That's really more a matter of what you're used to. It comes down to a programming decision as to what Apple and Microsoft considered to make sense. MS thinks that if there are no open windows, you're done using the app. Apple thinks you aren't necessarily done yet, as others have mentioned. I certainly wouldn't want Photoshop to quit every time I closed the last open image I was working on. Would be nice though if Safari would quit when I close the last open browser window. It's quick to relaunch if you really weren't done with it, so wouldn't be much of a bother to have it shut down with the last window.
    2. Menu bars are on the desktop.
    Makes way more sense the Microsoft's approach of repeating the same file menu on every open document in a program. How many places do you need to see File, Options and other common menu headings?
    2. Menu bars are on the desktop.
    Related to number two. The forward app is the only one you can directly work in, so why not have the menu bar change to reflect the choices for that application? When you go back to the previous app you were in, the menu bar changes back. So what loss of functionality is there? It comes back to not having menu bars on every single open window. There's no need or purpose for it.
    3. No delete key.
    Backspace does the same thing.
    4. No Cut command.
    Command+X, not Ctrl+X. This is Mac, not Windows. There's also very little need to ever do this from the keyboard. If you're moving files that are on the same drive/partition, then just drag and drop from the target folder window to the source. It's automatically a move. If going from one physical drive or partition to another, it's automatically a copy. Press and hold the Command key during the drag to make it a move.
    Besides, you don't really think Windows cuts the entire folder or file contents into RAM, do you? If your computer has 4 GB of RAM, and you cut 12 GB of data, it of course can't possibly fit in the clipboard. All Windows does when you do a cut is visually remove the files and folders from the screen. If the items are going to a location on the same drive/partition, it does the same thing as if you did a drag and drop move. The file table is simply updated to reflect the new file or folder locations. If it's to a different drive/partition, it then performs a copy then delete action, same as OS X.
    5. Launching Apps from the Finder.
    A program is just as much a file as any other file. It takes up space on the drive. The OS of course knows what to do with it when you double click an app. Same as it knows what to do when you double click a document related to an app. Windows is no different. An .exe file is also just as much a file as a .doc file. The .exe extension tells Windows to try and treat it as a program to load into RAM. It's not just a simple placeholder. The program has to be made up of something.

  • Need help for understanding the behaviour of these 2 queries....

    Hi,
    I need your help for understanding the behaviour of following two queries.
    The requirement is to repeat the values of the column in a table random no of times.
    Eg. A table xyz is like -
    create table xyz as
    select 'A' || rownum my_col
    from all_objects
    where rownum < 6;
    my_col
    A1
    A2
    A3
    A4
    A5
    I want to repeat each of these values (A1, A2,...A5) multiple times - randomly decide. I have written the following query..
    with x as (select my_col, trunc(dbms_random.value(1,6)) repeat from xyz),
    y as (select level lvl from dual connect by level < 6)
    select my_col, lvl
    from x, y
    where lvl <= repeat
    order by my_col, lvl
    It gives output like
    my_col lvl
    A1     1
    A1     3
    A1     5
    A2     1
    A2     3
    A2     5
    A3     1
    A3     3
    A3     5
    A4     1
    A4     3
    A4     5
    A5     1
    A5     3
    A5     5
    Here in the output, I am not getting rows like
    A1     2
    A1     4
    A2     2
    A2     4
    Also, it has generated the same set of records for all the values (A1, A2,...,A5).
    Now, if I store the randomly-decided value in the table like ---
    create table xyz as
    select 'A' || rownum my_col, trunc(dbms_random.value(1,6)) repeat
    from all_objects
    where rownum < 6;
    my_col repeat
    A1     4
    A2     1
    A3     5
    A4     2
    A5     2
    And then run the query,
    with x as (select my_col, repeat from xyz),
    y as (select level lvl from dual connect by level < 6)
    select my_col, lvl
    from x, y
    where lvl <= repeat
    order by my_col, lvl
    I will get the output, exactly what I want ---
    my_col ....lvl
    A1     1
    A1     2
    A1     3
    A1     4
    A2     1
    A3     1
    A3     2
    A3     3
    A3     4
    A3     5
    A4     1
    A4     2
    A5     1
    A5     2
    Why the first approach do not generate such output?
    How can I get such a result without storing the repeat values?

    If I've understood your requirement, the below will achieve it:
    SQL> create table test(test varchar2(10));
    Table created.
    SQL> insert into test values('&test');
    Enter value for test: bob
    old   1: insert into test values('&test')
    new   1: insert into test values('bob')
    1 row created.
    SQL> insert into test values('&test');
    Enter value for test: terry
    old   1: insert into test values('&test')
    new   1: insert into test values('terry')
    1 row created.
    SQL> insert into test values('&test');
    Enter value for test: steve
    old   1: insert into test values('&test')
    new   1: insert into test values('steve')
    1 row created.
    SQL> insert into test values('&test');
    Enter value for test: roger
    old   1: insert into test values('&test')
    new   1: insert into test values('roger')
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select lpad(test,(ceil(dbms_random.value*10))*length(test),test) from test;
    LPAD(TEST,(CEIL(DBMS_RANDOM.VALUE*10))*LENGTH(TEST),TEST)
    bobbobbobbobbobbobbobbobbobbob
    terryterry
    stevestevesteve
    rogerrogerrogerrogerrogerrogerrogerrogerrogerYou can alter the value of 10 in the SQL if you want the potential for a higher number of names.
    Andy

  • Trying to Understand the PostSyncCleanup parameter

    I've got a problem with running my application on the Australian version of Windows. We have a "test" application built around SQL Server Compact Merge Replication Library (thanks ErikEJ) and that works but our application doesn't.
    One of the main differences with our application code is that we do not set the PostSyncCleanup value to anything and the library sets it to 2 per this link:
    http blogs.msdn.com/b/sqlblog/archive/2009/04/15/sql-compact-performance-postsynccleanup-to-turn-off-updatestatistics-during-initial-download-of-sql-compact-replication.aspx (put the :// back to get the link)
     I'm trying to understand the impact of making that our "production" configuration since we haven't been using it.  The description looks harmless enough but I don't really understand what statistics I'm turning off and what the impact
    would be and what even the default setting is.  Anything that could enlighten me would be appreciated along with a guess as to why that might be causing a problem on the Australian version of Windows would be appreciated.

    So we've been running with the default value (0) and have not really had any "problems".  I haven't done any testing but I'm ok with faster, like everyone would be, but am also a bit risk averse so want to know what exactly I'm turning off.
    I also saw this advice from Rob Tiffany:
    Use the appropriate x64, x86 or ARM version of SQL Server Compact 3.5 SP2 to take advantage of the
    PostSyncCleanup property of the SqlCeReplication object that can reduce the time it takes to perform an initial synchronization. Set the
    PostSyncCleanup property equal to 3 where neither
    UpdateStats nor CleanByRetention are performed.
    Here: http  robtiffany.com/microsoft-sql-server-compact-3-5-sp2-has-arrived/
    So, is the best advice to use that parameter and set the value to 3 or 2
    I don't really know what I'm losing to "not performing" UpdateStats or CleanByRetention and does making that change need I need to do something else on the server or client to "clear out" or "clean up" something that this is
    doing.

  • Hello, okay? On September 13 I bought an iPad and in October bought a game on the app store problem is that when informed the card number dropped normally, but then went on to ask for a new form of payment because one had given any errors, and so not lowe

    Hello, how are you? On September 13 I bought an iPad and in October bought a game on the app store problem is that when informed the card number dropped normally, but then went on to ask for a new form of payment because one had given any errors, and so not lowered any other game and not upgraded the already downloaded. I do not know what exactly I have to do, because if informed a new payment method continues with the same problem, checked the card bill and really had given an error, because there was no billed the game. I ask you to verify what happened and explain to me what I need to do, because my single card is Visa's and do not intend to return others to use the services of the App Store.
    Thank you for understanding.

    I think you need the app store support. http://www.apple.com/support/mac/app-store/contact/ Go there and use one of the methods to contact them about your issue and they should be able to help you out.
    This forum isn't checked by Apple employees but is for users to help each other out.
    Phil

  • Performance of the LOD approach for network analisys

    Hi to all,
    I open new thread for speak about performance of LOD approach for Network analysis using Java API as continuing from this thread:
    Partitioning of the Network for using LOD API
    I remember you that:
    - I'm using Oracle 11g R2;
    - my network consist of 7.817.372 of links and 6.662.079 of nodes (big network);
    - LINK_LEVEL of links table is setted as NULL;
    - I have partitioned the network with these procedure:
    partition:
    EXEC sdo_net.spatial_partition('ITALIA', 'ITALIA_PART$', 10000, 'WORK_DIR_ITALIA', 'ITALIA_PART.log', 'a', 1);
    and for partition blob:
    EXEC sdo_net.generate_partition_blobs('ITALIA', 1, 'ITALIA_PBLOB$', true, true, 'WORK_DIR_ITALIA', 'ITALIA_PBLOB.log', 'a');
    - I'm using LOD Java API for network analysis with Netbeans IDE; I took the code from NDM_tutorial of Hillsborough network.
    My first analysis is the compute of the shortest path between two extreme nodes (about 1.500 km of distance) and between two near nodes (about 80 km of distance) using Dijkstra and AStar algorithm.
    I did the following tests on execution times of the compute of the shortest path:
    1) with partition of maximum 10000 nodes for partition (from log file I read that were been generated 1024 partitions with 1 link level):
    - between two extreme nodes, about 1 minute and 50 seconds.
    - between two near nodes, about 20 seconds.
    then I have re-executed the two previous procedures where I changed the value of maximum nodes for partition and I did other tests:
    2) with partition of maximum 15000 nodes for partition (from log file I read that were been generated 512 partitions with 1 link level):
    - between two extreme nodes, about 1 minute and 50 seconds and sometimes it goes out of memory
    - between two near nodes, about 20 seconds.
    3) with partition of maximum 5000 nodes for partition (from log file I read that were been generated 2048 partitions with 1 link level):
    - between two extreme nodes, about 1 minute and 50 seconds and sometimes it goes out of memory
    - between two near nodes, about 20 seconds.
    4) with partition of maximum 2000 nodes for partition (from log file I read that were been generated 4096 partitions with 1 link level):
    - between two extreme nodes, about 1 minute and 50 seconds and sometimes it goes out of memory
    - between two near nodes, about 15 seconds.
    I think that there is any problem because I expect execution times more lower (maximum 5-6 seconds for extreme nodes).
    Even changing the maximum number of nodes to partition the execution times do not change much.
    I remember you that with in-memory approach on Oracle 10gR2 the execution times for every computation between two nodes was of about 4 minutes and sometimes it goes out of memory. With LOD on Oracle 11gR2 the execution times are reduced but are too long for me.
    Now, my questions are:
    - @Jack Wang: (if you're reading me) do you know what are the execution times for the compute of shortest path between two nodes for USA network (about 1500 km of distance)? I remember that you have used LOD for USA (56 Millions of link and 20 Millions of nodes).
    - Do you think that I wrong anything? How can I do for reduce the execution times of network analysis?
    If you need any more information just ask.
    Thank you to all in advance very much.

    Jack Wang wrote:
    Are the 12/13 seconds computation times for the near node pair?Yes.
    You can look at an example for computing hierarchical shortest path with a 2-level network(NAVTEQ_SF) under ndm_tutorial
    ~ \ndm_tutorial\examples\java\src\lod\SpWithMultiLinkLevels.java.But I think that yesterday I had not yet used the LINK_LEVEL = 2 in network analysis. Infact, I used the code into ShortestPathAnalysis.java where linkLevel is always setted = 1.
    Now, I'm using the example SpWithMultiLinkLevels.java and I'm seeing that linkLevel is setted = 2 before the execution of Dijkstra and AStar algorithm. This code works with Hillsborough_network. Instead with my network (note that I'm using a region of Italy with 700.000 link and 600.000 nodes called ITAI11_METERS for to test a network with 2 LINK_LEVEL), I have a problem during readPartitionFromBlob.
    This is the code:
    package calcolopercorsolod;
    import java.io.*;
    import java.sql.*;
    import java.text.*;
    import java.util.*;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.pool.OracleDataSource;
    import oracle.spatial.util.Logger;
    import oracle.spatial.network.UserDataMetadata;
    import oracle.spatial.network.lod.*;
    import oracle.spatial.network.lod.config.*;
    import oracle.spatial.network.lod.util.PrintUtility;
    public class SpWithMultiLinkLevels
      private static NetworkAnalyst analyst;
      private static NetworkIO networkIO;
      private static void setLogLevel(String logLevel)
        if("FATAL".equalsIgnoreCase(logLevel))
            Logger.setGlobalLevel(Logger.LEVEL_FATAL);
        else if("ERROR".equalsIgnoreCase(logLevel))
            Logger.setGlobalLevel(Logger.LEVEL_ERROR);
        else if("WARN".equalsIgnoreCase(logLevel))
            Logger.setGlobalLevel(Logger.LEVEL_WARN);
        else if("INFO".equalsIgnoreCase(logLevel))
            Logger.setGlobalLevel(Logger.LEVEL_INFO);
        else if("DEBUG".equalsIgnoreCase(logLevel))
            Logger.setGlobalLevel(Logger.LEVEL_DEBUG);
        else if("FINEST".equalsIgnoreCase(logLevel))
            Logger.setGlobalLevel(Logger.LEVEL_FINEST);
        else  //default: set to ERROR
            Logger.setGlobalLevel(Logger.LEVEL_ERROR);
      public static void main(String[] args) throws Exception
            String configXmlFile = "LODConfigs.xml";
            String logLevel    =    "DEBUG";
            String dbUrl       = "jdbc:oracle:thin:@oracle:1521:mySID";
            String dbUser      = "myUser";
            String dbPassword  = "myPass";
            String networkName = "ITAI11_METERS";
            long startNodeId = 15323;
            long endNodeId   = 431593;
        int linkLevel      = 1;
        double costThreshold = 1550;
        int numHighLevelNeighbors = 8;
        double costMultiplier = 1.5;
        Connection conn    = null;
        //get input parameters
        for(int i=0; i<args.length; i++)
            if(args.equalsIgnoreCase("-dbUrl"))
    dbUrl = args[i+1];
    else if(args[i].equalsIgnoreCase("-dbUser"))
    dbUser = args[i+1];
    else if(args[i].equalsIgnoreCase("-dbPassword"))
    dbPassword = args[i+1];
    else if(args[i].equalsIgnoreCase("-networkName") && args[i+1]!=null)
    networkName = args[i+1].toUpperCase();
    else if(args[i].equalsIgnoreCase("-linkLevel"))
    linkLevel = Integer.parseInt(args[i+1]);
    else if(args[i].equalsIgnoreCase("-configXmlFile"))
    configXmlFile = args[i+1];
    else if(args[i].equalsIgnoreCase("-logLevel"))
    logLevel = args[i+1];
    // opening connection
    conn = LODNetworkManager.getConnection(dbUrl, dbUser, dbPassword);
    System.out.println("Network analysis for "+networkName);
    setLogLevel(logLevel);
    //load user specified LOD configuration (optional),
    //otherwise default configuration will be used
    InputStream config = ClassLoader.getSystemResourceAsStream(configXmlFile);
    LODNetworkManager.getConfigManager().loadConfig(config);
    //LODConfig c = LODNetworkManager.getConfigManager().getConfig(networkName);
    //get network input/output object
    networkIO = LODNetworkManager.getCachedNetworkIO(
    conn, networkName, networkName, null);
    //get network analyst
    analyst = LODNetworkManager.getNetworkAnalyst(networkIO);
    double[] costThresholds = {costThreshold};
    try
    System.out.println("*****Begin: Shortest Path with Multiple Link Levels");
    System.out.println("*****Shortest Path Using Dijkstra");
    String algorithm = "DIJKSTRA";
    linkLevel = 2;
    costThreshold = 5000;
    LogicalSubPath subPath = analyst.shortestPathDijkstra(new PointOnNet(startNodeId),
    new PointOnNet(endNodeId),linkLevel, null);
    PrintUtility.print(System.out, subPath, true, 10000, 0);
    System.out.println("*****End: Shortest path using Dijkstra");
    System.out.println("*****Shortest Path using Astar");
    HeuristicCostFunction costFunction = new GeodeticCostFunction(0,-1, 0, -2);
    LinkLevelSelector lls = new DynamicLinkLevelSelector(
    analyst, 2, costFunction, costThresholds,
    numHighLevelNeighbors, costMultiplier, null);
    subPath = analyst.shortestPathAStar(
    new PointOnNet(startNodeId), new PointOnNet(endNodeId), null, costFunction, lls);
    PrintUtility.print(System.out, subPath, true, 10000, 0);
    System.out.println("*****End: Shortest Path Using Astar");
    System.out.println("*****End: Shortest Path with Multiple Link Levels");
    catch (Exception e)
    e.printStackTrace();
    if(conn!=null)
    try{conn.close();} catch(Exception ignore){}
    and this is the output with the error:...
    [LODNetworkAdaptorSDO::isNetworkPartitioned, DEBUG] Query String: SELECT p.PARTITION_ID FROM PROVA.ITAI11_PART$ p WHERE p.LINK_LEVEL = ? AND ROWNUM = 1 [2]
    [QueryUtility::prepareIDListStatement, DEBUG] Query String: SELECT NODE_ID, PARTITION_ID FROM PROVA.ITAI11_PART$ p WHERE p.NODE_ID IN ( SELECT column_value FROM table(:varray) ) AND LINK_LEVEL = ?
    [LODNetworkAdaptorSDO::readNodePartitionIds, DEBUG] Query linkLevel = 2
    [NetworkIOImpl::readLogicalPartition, DEBUG] Read partition from blob table: partition 4, level 2
    [LODNetworkAdaptorSDO::readPartitionBlobEntry, DEBUG] Query String: SELECT BLOB, NUM_INODES, NUM_ENODES, NUM_ILINKS, NUM_ELINKS, NUM_INLINKS, NUM_OUTLINKS, USER_DATA_INCLUDED FROM PROVA.ITAI11_PBLOB$ WHERE PARTITION_ID = ? AND LINK_LEVEL = ? [4,2]
    [QueryUtility::prepareIDListStatement, DEBUG] Query String: SELECT NODE_ID, PARTITION_ID FROM PROVA.ITAI11_PART$ p WHERE p.NODE_ID IN ( SELECT column_value FROM table(:varray) ) AND LINK_LEVEL = ?
    [LODNetworkAdaptorSDO::readNodePartitionIds, DEBUG] Query linkLevel = 1
    [NetworkIOImpl::readLogicalPartition, DEBUG] Read partition from blob table: partition 91, level 1
    [LODNetworkAdaptorSDO::readPartitionBlobEntry, DEBUG] Query String: SELECT BLOB, NUM_INODES, NUM_ENODES, NUM_ILINKS, NUM_ELINKS, NUM_INLINKS, NUM_OUTLINKS, USER_DATA_INCLUDED FROM PROVA.ITAI11_PBLOB$ WHERE PARTITION_ID = ? AND LINK_LEVEL = ? [91,1]
    [NetworkIOImpl::readLogicalPartition, DEBUG] Read partition from blob table: partition 91, level 2
    [LODNetworkAdaptorSDO::readPartitionBlobEntry, DEBUG] Query String: SELECT BLOB, NUM_INODES, NUM_ENODES, NUM_ILINKS, NUM_ELINKS, NUM_INLINKS, NUM_OUTLINKS, USER_DATA_INCLUDED FROM PROVA.ITAI11_PBLOB$ WHERE PARTITION_ID = ? AND LINK_LEVEL = ? [91,2]
    oracle.spatial.network.lod.LODNetworkException: java.lang.NullPointerException
    at oracle.spatial.network.lod.NetworkIOImpl.readPartitionFromBlob(NetworkIOImpl.java:549)
    at oracle.spatial.network.lod.NetworkIOImpl.readLogicalPartition(NetworkIOImpl.java:436)
    at oracle.spatial.network.lod.CachedNetworkIOImpl.readLogicalPartition(CachedNetworkIOImpl.java:114)
    at oracle.spatial.network.lod.CachedNetworkIOImpl.readLogicalPartition(CachedNetworkIOImpl.java:105)
    at oracle.spatial.network.lod.NetworkExplorer.getPartition(NetworkExplorer.java:335)
    at oracle.spatial.network.lod.LabelSettingAlgorithm.getElementPartition(LabelSettingAlgorithm.java:520)
    at oracle.spatial.network.lod.LabelSettingAlgorithm.expand(LabelSettingAlgorithm.java:561)
    at oracle.spatial.network.lod.LabelSettingAlgorithm.shortestPath(LabelSettingAlgorithm.java:1362)
    at oracle.spatial.network.lod.NetworkAnalyst.shortestPathHierarchical(NetworkAnalyst.java:2523)
    at oracle.spatial.network.lod.NetworkAnalyst.shortestPathDijkstra(NetworkAnalyst.java:2291)
    at oracle.spatial.network.lod.NetworkAnalyst.shortestPathDijkstra(NetworkAnalyst.java:2268)
    at oracle.spatial.network.lod.NetworkAnalyst.shortestPathDijkstra(NetworkAnalyst.java:2249)
    at calcolopercorsolod.SpWithMultiLinkLevels.main(SpWithMultiLinkLevels.java:135)
    Caused by: java.lang.NullPointerException
    at oracle.spatial.network.lod.NetworkIOImpl.readPartitionFromBlob(NetworkIOImpl.java:542)
    ... 12 more
    I don't understand why the analysis does a query with PARTITION_ID=91 and LINK_LEVEL=2:
    Query String: SELECT BLOB, NUM_INODES, NUM_ENODES, NUM_ILINKS, NUM_ELINKS, NUM_INLINKS, NUM_OUTLINKS, USER_DATA_INCLUDED  FROM PROVA.ITAI11_PBLOB$ WHERE PARTITION_ID = ? AND LINK_LEVEL = ? [91,2]
    Infact I have 512 PARTITION_ID  associated to LINK_LEVEL=1 and only 16 PARTITION_ID associated to LINK_LEVEL=2. Why it search PARTITION_ID=91 with LINK_LEVEL=2? This correspondance doesn't exist.
    Where I wrong?
    Note that if I set LINK_LEVEL=1 it works.
    Thank you very much                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • ServerSocket problems accepting 2 client at the same time

    hi all,
    i wrote a simple client-server pair, to synchronize databases, and works fine.
    but i found a problem: all ok when 2 clients try to connect to the server whit a little gap (ie 1 second), the problem is when they try to connect EXACTLY at the same time
    while (true)
                enter();
    synchronized void enter()
            try
                    client=server.accept();
                    thread_name++;
                    s_newport np=new s_newport(client,
                    ((new Integer(thread_name)).toString()));               
                catch (IOException io)
                catch (NullPointerException np)
        }when a request is accepted, an instance of the class s_newport (a thread) starts to open another socket.
    the problem is when 2 requests arrive in the same moment, and the server doesn't accept anything.
    i declared the enter() method synchronized, but this doesn't seem to work!
    anyone could help me please?
    thanks
    sandro

    excuse me, i didn't understand...
    thanks for your reply
    sandro

Maybe you are looking for