Array of hashtable

Hi,
Following is my code :
-----------------Code starts here------------------------------------------------------------
import java.util.Hashtable;
public class Test{
public static void main(String arg[]){
          Hashtable ht=new Hashtable();
          Hashtable[] hta=new Hashtable[3];
          ht.put("Country","Japan");
          ht.put("City","Tokyo");
          hta[0]=ht;
          ht.put("Country","India");
          ht.put("City","Delhi");
          hta[1]=ht;
          System.out.println(hta[0].get("Country"));
          System.out.println(hta[1].get("Country"));
----------------Code ends here-------------------------------------------------------------------
And the result is....
-----Output-----------------------
India
India
-----Output ends here---------
While I was expecting....
Japan
India
Why hashtable in hta[0] is over-written ? How can I achieve the result (Japan, India) ?
Thanks,

ht.put("Country","Japan");
ht.put("City","Tokyo");
hta[0]=ht;After this, both hta[0] and ht are references to the same hashtable object
ht.put("Country","India");
ht.put("City","Delhi");Here, you are modifying the same object referenced by ht and hta[0]
hta[1]=ht;Here ht, hta[0],hta[1] all reference the modified object and
hence your result

Similar Messages

  • Hashtable Array

    How can i initialize an Array of Hashtables with a certain type <String, Object> without warning.
    Example:
    private Hashtable<String, Object> items[];
    items = new Hashtable[5];but the warning:
    "Type safety: The expression of type Hashtable[] needs unchecked conversion to conform to Hashtable<String,Object>[]"
    always appears, then i rewrote it with:
    items = new Hashtable<String, Object>[5];At this time the code is wrong in java syntax.
    Message was edited by:
    qizhi

    Java does not seem to allow generic array creation, i.e.
    Hashtable<String,Object>[] items = new Hashtable<String,Object>[5];results in a compiler error. Try using a List, e.g. ArrayList instead.

  • Error in printing hashtable

    Hi,
    I would like to ask some advice about the error I have in my code.
    The thing I'm trying to do is to store the values of two ArrayLists into the hash table (this values are the name and the score). But when I'm trying to print the values from the hashtable I have a null pointer exception. Can't find what is the reason could be. I'm not very good in hashtables, do it first time. The code is:
    import java.util.*;
    public class Scores()
    private ArrayList<Integer> topScores;
    private ArrayList<String> names;
    private Hashtable hash;
    public Scores()
    topScores = new ArrayList<Integer>();
    names = new ArrayList<String>();
    * Method to add scores
    public void addScore(int score, String name)
    if(topScores.size()<5 && names.size()<5)
    topScores.add(score);
    names.add(name);
    * Method to transfer both arrays into hashtable
    public void transferToHashtable()
    Hashtable hash = new Hashtable();
    hash.put(names.get(0), topScores.get(0));
    hash.put(names.get(1), topScores.get(1));
    hash.put(names.get(2), topScores.get(2));
    hash.put(names.get(3), topScores.get(3));
    hash.put(names.get(4), topScores.get(4));
    * Method to print the hashtable
    public void printHashtable()
    Iterator it = hash.keySet().iterator();
    while(it.hasNext())
    String element = (String)it.next();
    System.out.println(element + " " + (String)hash.get(element));
    System.out.println("===============");
    So, while compiling there is no errors. but after adding values to the both arrayLists, calling method to transform them into hashtable and then invoking the method printHashtable() I have this null pointer exception error at the line:
    Iterator it = hash.keySet().iterator();
    What the reason could be?

    * Method to transfer both arrays into hashtable
    public void transferToHashtable()
    Hashtable hash = new Hashtable();
    hash.put(names.get(0), topScores.get(0));
    hash.put(names.get(1), topScores.get(1));
    hash.put(names.get(2), topScores.get(2));
    hash.put(names.get(3), topScores.get(3));
    hash.put(names.get(4), topScores.get(4));
    * Method to print the hashtable
    public void printHashtable()
    Iterator it = hash.keySet().iterator();
    while(it.hasNext())
    String element = (String)it.next();
    System.out.println(element + " " + (String)hash.get(element));
    System.out.println("===============");
    }The problem is that your variable: Hashtable hash = new Hashtable() is visible only inside the public void transferToHashtable() method.
    That's why you reference a null pointer in public void printHashtable() .
    HTH

  • Hashtable on disc

    I've been looking crazy over the internet and in the forums, but haven't found any Hashtable implementation that stores on disc. Anyone know any good library for that?
    Gil

    Thanks all for your efforts.
    As you have pinpointed it's not easy to do a hashtable on disc (why I hoped and prayed there was already something
    out there so I didn't had to do it myself). But it is possible to do it myself I guess.
    As to having multiple persistent hash's sharing a file...
    that may be more difficult then it appears as hashes don't
    have a fixed size so the second hash can't just be appended to the first in the file Not hard. I already have a class "PortionedFile" that gives me instances of "FilePortion". It is virtual files that
    actually resides in only 1 physical file. It has some basic "memory handling". When a hash talbe grows, it requires
    the file to grow (eg double size), and the PortionedFile finds new space (which might be caused be ealrier remove
    portions) for the new file size and copies the old content to the new filespace and connects the virtual FilePortion
    to that new area. Very simple algorithm but efficient and not too spacewasting (and discspace is not that much of a
    problem anyway).
    Probably more like a couple thousand.
    I'm sure you know a file isn't like memory.
    You have to implement all allocation and deallocation mechanisms.
    When you remove an entry that's stored in the middle of the file
    what do you do with the "hole"? Re-use it?
    What will your strategy be to keep the file from becoming too fragmented?
    How will you recover from errors like the app crashing halfway through a write?I have a memory handler for disc, which will be useful when allocating space for data (including variable size keys
    and entries) in a similar way as memory allocation for primary memory is done (alloc in C, new in Java).
    BUT! Does anyone know of a good "allocation and deallocation mechanisms" for disc? Would guess a existing solution
    would not be too bad to use even if mine will "work".
    closed-address hashing where each bin
    (element in the internal array) is null or contains a pointer to a linked
    list. Therefore to save this beasty you need to have a persistant
    linkedlist implementation as well as a persistance mechanism for arrays.The hashtable implementation I was thinking of would use "closed-address hashing", Which includes "pointers" to the
    list for that "hash-bin". I actually don't know if this will cause more disc-reads then "open-adress hashing". The
    advantage as I can see with "closed-address hashing" is that the list for the "hash-bin" can be some kind of structure with all variable length keys and data for that list, so they all can be read in 1 single read. If more data is added to a list, the whole list will be rewritten to disc.
    Trust me, I had to implement an on-disk balanced tree maps (AVL/RedBlack). It was no picnic.I know this sad truth.
    I didn't understand how the ASN1 would be of any help and what matfud meant by "As for the disk format you
    may wish to use somthing similar to ASN1"
    Thanks again
    Gil

  • Is it possible to add a property using variable in variable name?

    I want to query for a list of virtual machines within a folder, then create a menu of the host names using forms.  Since the list of machines is subject to change, I want to build the list each time the script is run, rather than build off a static
    list. 
    For each virtual machine I need to create the list of variables below:
    $hostnameX = New-Object System.Windows.Forms.checkbox
    $hostnameX.Location = New-Object System.Drawing.Size(10,20)
    $hostnameX.Size = New-Object System.Drawing.Size(100,20)
    $hostnameX.Checked = $true
    $hostnameX.Text = "Type"
    $hostnameX.Controls.Add($hostnameX)
    The location and size values need to be incremented but I think I can figure that part out.
    I can use New-Variable to generate the initial variable. But I receive errors using the same method to try to create a new property for the variable.
    $VMS = Get-Cluster MyCLUS | Get-vApp "My vApp" | Get-VM | Select Name,PowerState | Sort Name
    For ($i=0; $i -lt ($VMS.count); $i++)
    $VMS[$i].Name
    $VMGUEST = "$($VMS[$i].Name)" -replace("-","")
    New-Variable "CB$VMGUEST" "New-Object System.Windows.Forms.checkbox"
    New-Variable "CB$VMGUEST.Location" "New-Object System.Drawing.Size(10,20)"
    In the above, $CBVMGUEST1 =  New-Object System.Windows.Forms.checkbox which is what I want,  but $CBVMGUEST1.Location is not set.
    Is there way to add a property using a variable in the variable name?  Or any other suggestions on how to tackle this issue?

    Hi,
    maybe another approach is a bit easier.
    Use a hash-array like
    $CB = @{}
    $CB[$VMGUEST] = New-Object System.Windows.Forms....
    $CB[$VMGUEST].Location = New-Object System.Drawing....
    Mit freundlichen Grüßen Jens Kalski
    That's the correct answer.  Anytime you find yourself wanting to create variables named "Widget1", "Widget2", "Widget3", etc... it's a pretty clear indication that what you really need is a collection object of some sort.  That might be an array,
    a hashtable, or any other data structure for holding other objects, depending on your specific needs.

  • Which is the best practise?

    Hi team,
    I'm trying to insert data to mysql.
    And using a simple jsp to take the data from the user.
    And in my servlet I'm using the following code to store data.
                        String fName = request.getParameter("firstname");
                        String lName = request.getParameter("lastname");
                        String email = request.getParameter("email");
                        Emp emp = new Emp();
                        emp.setFirstName(fName);
                        emp.setLastName(lName);
                        emp.setEmail(email);
                             new DAO().insertData(emp);upto this every this works great.
    But I don't like the above code.... for every time I need to use request.getParameter("XXXXX")
    If I have 20 fields then do I need to fetch these details for every time??
    Or I need to use simple array/hashmap/hashtable+forloop to retrive and store the data.
    So can anyone suggest me the best way to use in this case.
    If anybody provide the simple code that will be a great help to me.
    thanks in advance.
    John

    To do that (easily), you want something that binds your HTTP get/post values to a Java object. Just about every framework that I know of does this for you. There is everything from relatively lightweight: http://wicketwebbeans.sourceforge.net/. To something most developers are familiar with like http://struts.apache.org/2.x/index.html. Or if you want to learn Spring (a good thing, IMO), http://static.springsource.org/spring/docs/2.0.x/reference/mvc.html.
    You can write your own binder (say, by using reflection). Or you can take something that serializes and deserializes (JSON, which is used in Ajax and Javascript extensively). It's really up to you.
    What you are doing right now is the basic or low-level way of interacting with HTTP. The above make the task significantly easier, but there is a bit of a learning curve. There are lots of articles comparing different frameworks, here's one place to start: http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
    - Saish

  • Using XML with Flex - Best Practice Question

    Hi
    I am using an XML file as a dataProvider for my Flex
    application.
    My application is quite large and is being fed a lot of data
    – therefore the XML file that I am using is also quite large.
    I have read some tutorials and looked thorough some online
    examples and am just after a little advice. My application is
    working, but I am not sure if I have gone about setting and using
    my data provider in the best possible (most efficient) way.
    I am basically after some advice as to weather I am going
    about using (accessing) my XML and populating my Flex application
    is the best / most efficient way???
    My application consists of the main application (MXML) file
    and also additional AS files / components.
    I am setting up my connection to my XML file within my main
    application file using HTTPService :
    <mx:HTTPService
    id="myResults"
    url="
    http://localhost/myFlexDataProvider.xml"
    resultFormat="e4x"
    result="myResultHandler(event)" />
    and handling my results with the following function:
    public function myResultHandler(event:ResultEvent):void
    myDataFeed = event.result as XML;
    within my application I am setting my variable values by
    firstly delacring them:
    public var fName:String;
    public var lName:String;
    public var postCode:string;
    public var telNum:int;
    And then, giving them a value by “drilling” into
    the XML, E;g:
    fName = myDataFeed.employeeDetails.contactDetails.firstName;
    lName = myDataFeed.employeeDetails.contactDetails.lastName;
    postCode =
    myDataFeed.employeeDetails.contactDetails.address.postcode;
    telNum = myDataFeed.employeeDetails.contactDetails.postcode;
    etc…
    Therefore, for any of my external (components in a different
    AS file) components, I am therefore referencing there values using
    Application:
    import mx.core.Application;
    And setting the values / variables within the AS components
    as follows:
    public var fName:String;
    public var lName:String;
    fName =
    Application.application.myDataFeed.employeeDetails.contactDetails.firstName;
    lName =
    Application.application.myDataFeed.employeeDetails.contactDetails.lastName;
    As mentioned this method seems to work, however, is it the
    best way to do it??? :
    - Connect to my XML file
    - Set up my application variables
    - Give my variables values from the XML file ……
    Bearing in mind that in this particular application there are
    many variable that need to be set and there for a lot of lines of
    code just setting up and assigning variables values from my XML
    file.
    Could someone Please advise me on this one????
    Thanks a lot,
    Jon.

    I don't see any problem with that.
    Your alternatives are to skip the instance variables and
    query the XML directly. If you use the values in a lot of places,
    then the Variables will be easier to use and maintain.
    Also, instead of instance variables, you colld put the values
    in an "associative array" (object/hashtable), or in a dictionary.
    Tracy

  • Re: (forte-users) Forte and CORBA question

    Hi,
    The discarding the Java variable that references a distributed Forte object
    doesn't cause that the distributed object will be reclaimed. In Forte client
    you can use ReleaseDistReference() of the current partition (task.part) to
    free the remote object. For Java client, you can implement the following
    solution:
    - define a method ReleaseMyObject() in the SO you are using to get the proxy
    to the dist. object. As parameter for it use something that can identify
    your object (attribute).
    - your SO has an array or hashtable with your distributed objects, every new
    object is added to it.
    - in the implementation of ReleaseMyObject() find the object to release in
    the array and call ReleaseDistReference() for it,
    - from the Java client, call the ReleaseMyObject() for the object that is
    not more needed.
    Regards,
    Zenon Adamek
    ----- Original Message -----
    From: Joseph Mirwald <jomirweb.de>
    To: Dave Ortman <dortmanyahoo.com>; 'Forte User Forum'
    <forte-userslists.xpedior.com>
    Sent: Wednesday, March 07, 2001 3:58 PM
    Subject: Re: (forte-users) Forte and CORBA question
    Hello Dave,
    do you use a copy return or copy parameters in this method ?
    If not, then maybe Forte is unable to garbage-collect this object because
    it is forever
    a proxy which only the server-partition may be able to drop it from memory
    (object=NIL).
    Try this and let us know what happens.
    Hope this helps
    Joseph Mirwald
    At 11:49 07.03.01 -0800, Dave Ortman wrote:
    We're attempting to use a Java client to access a
    Forte server. In doing such, we've experienced a
    problem which I hoped somebody could shed some light
    on.
    We've had a Java client calling Forte service objects
    and passing Forte objects back and forth as CORBA
    structs with no problem. However, we have experienced
    some problem obtaining and using remote references to
    distributed objects from the Java client.
    The problem is memory utilization. Each time I obtain
    a reference to a new object, the memory utilization on
    the Forte server jumps up quite a bit (around 100k per
    object on an NT box). Eventually, if I fetch enough
    objects, the server will crash due to lack of memory.
    It seems that Forte never reclaims the memory, even
    though I'm not using (and don't have a handle to) this
    remote objects.
    The objects are very small. In fact, I created a test
    Forte SO with one method, getObject(); which returns a
    distributed object with a single attribute. I then
    have a Java client access the getObject() method
    repeatedly - discarding the reference to the object
    after each iteration. After a short while, the box
    will come down.
    Any thoughts?
    Thanks in advance,
    -Dave Ortman
    --- "Epari, Madhusudhan" <meparioxhp.com> wrote:
    Hi All,
    Following error occurs consistently on a router
    partition for every call to
    the service object but the partition doesn't die or
    crash. I tried bumping
    up the partition memory too. Any thoughts on why
    it's happening?
    Thanks in advance,
    Madhu
    SYSTEM ERROR: Failed to connect or lost connection
    to the
    environment manager
    at FORTE_NS_ADDRESS = <Unknown>. Check that the
    environment
    manager is
    installed at that location. If it is, then check
    to be sure that
    there are
    enough system resources available to support this
    partition.
    Class: qqsp_SystemResourceException
    Error #: [601, 201]
    Detected at: qqdo_NsClient::FindObject at 1
    Error Time: Wed Feb 21 09:30:56
    Exception occurred (locally) on partition
    "CSA_cl0_Part2-router",
    (partitionId =
    C61609A0-8270-11D3-88A9-F4D005D0AA77:0x10c5c:0x1,
    taskId =
    [C61609A0-8270-11D3-88A9-F4D005D0AA77:0x10c5c.8]) in
    application
    "MWRouting_cl1", pid 18937 on node forted1 in
    environment
    frtedev.
    SYSTEM ERROR: Attempt to send from a partition
    (C61609A0-8270-11D3-88A9-F4D005D0AA77:0x10c5c:0x1)
    that no
    longer exists.
    Class: qqsp_DistAccessException
    Error #: [601, 111]
    Detected at: qqdo_PartitionMgr::SendMsg at
    1
    Error Time: Wed Feb 21 09:30:56
    Distributed method called:
    qqdo_NsServerProxy.FindObject
    (object name
    Unnamed) from partition
    "CSA_cl0_Part2-router",
    (partitionId =
    C61609A0-8270-11D3-88A9-F4D005D0AA77:0x10c5c:0x1,
    taskId =
    [C61609A0-8270-11D3-88A9-F4D005D0AA77:0x10c5c.8]) in
    application
    "MWRouting_cl1", pid 18937 on node
    forted1 in environment
    frtedev
    Exception occurred (locally) on partition
    "CSA_cl0_Part2-router",
    (partitionId =
    C61609A0-8270-11D3-88A9-F4D005D0AA77:0x10c5c:0x1,
    taskId =
    [C61609A0-8270-11D3-88A9-F4D005D0AA77:0x10c5c.8])
    in
    application "MWRouting_cl1", pid 18937 on
    node forted1 in
    environment
    frtedev.
    LbRouter::FindMembers - CAUGHT EXCEPTION attaching
    members from
    For the archives, go to:
    http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To
    unsubscribe, send in a new
    email the word: 'Unsubscribe' to:
    forte-users-requestlists.xpedior.com
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com--
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Why not this:
    while myText.moveToString(' ') do
    myText.ReplaceRange('-', myText.Offset, myText.Offset+1);
    end while;
    or if you prefer verbosity:
    while myText.moveToString(source=' ') do
    myText.ReplaceRange(source='-', startOffset=myText.Offset,
    endOffset=myText.Offset+1);
    end while;
    -----Original Message-----
    From: FatchJeBAM.com [mailto:FatchJeBAM.com]
    Sent: Wednesday, January 12, 2000 2:51 PM
    To: Troy.Burnsvacationclub.com; kamranaminyahoo.com
    Subject: RE: (forte-users) search and replace within a TextData
    How about this?? May have to play with start/end on ReplaceRange as I
    didn't really test this
    Anybody got a better way??
    -- replace space with underscore
    For x in 1 to myTextdata.LengthToEnd() do
    If myTextData.IsSpace() then
    MyTextdata.ReplaceRange('_'. Startoffset=myTextdata.offset,
    endoffset=myTextdata.offset+1);
    End if;
    MyTextdata.MoveNext;
    End for;
    Jerry Fatcheric
    -----Original Message-----
    From: Burns, Troy [mailto:Troy.Burnsvacationclub.com]
    Sent: Wednesday, January 12, 2000 9:40 AM
    To: kamranaminyahoo.com
    Subject: (forte-users) search and replace within a
    TextData
    Hello all,
    I need to search within a textdata object, replacing all
    occurrances of a
    space
    with another character. Can you give a quick code example
    of how I would do
    this?
    Thanks in advance,
    Troy
    Troy Burns
    Marriott Vacation Club Intl.
    E-mail: troy.burnsvacationclub.com
    Phone: (941) 688-7700 ext. 4408
    For the archives, go to: http://lists.sageit.com/forte-users
    and use
    the login: forte and the password: archive. To unsubscribe,
    send in a new
    email the word: 'Unsubscribe' to:
    forte-users-requestlists.sageit.com
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.sageit.com

  • Build clisp failed

    Hello Arch community,
    i´m back to Arch. After using it for nearly 3 years, i´ve used Kubuntu nearly a half year, because thats the "standard" Linux Distri used at my chair in university. I´m very happy, that i can use ARCH again. So long so good. Let´s talk about my problem.
    I´ve tried to build clips on my own, using the PKGBUILD from /var/abs/extra/devel.
    It seems to compile to the end. But while installing it gave me an Segmentation fault.
    make[1]: Leaving directory `/var/abs/local/clisp/src/clisp-2.41/src/po'
    make[1]: Entering directory `/var/abs/local/clisp/src/clisp-2.41/src/po'
    installing en.gmo as ../locale/en/LC_MESSAGES/clisp.mo
    installing clisplow_en.gmo as ../locale/en/LC_MESSAGES/clisplow.mo
    installing da.gmo as ../locale/da/LC_MESSAGES/clisp.mo
    installing clisplow_da.gmo as ../locale/da/LC_MESSAGES/clisplow.mo
    installing de.gmo as ../locale/de/LC_MESSAGES/clisp.mo
    installing clisplow_de.gmo as ../locale/de/LC_MESSAGES/clisplow.mo
    installing fr.gmo as ../locale/fr/LC_MESSAGES/clisp.mo
    installing clisplow_fr.gmo as ../locale/fr/LC_MESSAGES/clisplow.mo
    installing es.gmo as ../locale/es/LC_MESSAGES/clisp.mo
    installing clisplow_es.gmo as ../locale/es/LC_MESSAGES/clisplow.mo
    installing nl.gmo as ../locale/nl/LC_MESSAGES/clisp.mo
    installing clisplow_nl.gmo as ../locale/nl/LC_MESSAGES/clisplow.mo
    installing ru.gmo as ../locale/ru/LC_MESSAGES/clisp.mo
    installing clisplow_ru.gmo as ../locale/ru/LC_MESSAGES/clisplow.mo
    make[1]: Leaving directory `/var/abs/local/clisp/src/clisp-2.41/src/po'
    rm -rf data
    mkdir data
    cd data && ln -s ../../utils/unicode/UnicodeDataFull.txt .
    cd data && ln -s ../../doc/Symbol-Table.text .
    gcc -g -O2 -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -Wno-sign-compare -O2 -fexpensive-optimizations -falign-functions=4 -DUNICODE -DDYNAMIC_FFI -I. -x none spvw.o spvwtabf.o spvwtabs.o spvwtabo.o eval.o control.o encoding.o pathname.o stream.o socket.o io.o array.o hashtabl.o list.o package.o record.o weak.o sequence.o charstrg.o debug.o error.o misc.o time.o predtype.o symbol.o lisparit.o i18n.o foreign.o unixaux.o built.o ari80386.o modules.o libcharset.a libavcall.a libcallback.a /usr/lib/libreadline.so -lncurses -ldl -L/usr/lib -lsigsegv -o lisp.run
    cp -p cfgunix.lisp config.lisp
    chmod +w config.lisp
    echo '(setq *clhs-root-default* "http://www.lisp.org/HyperSpec/")' >> config.lisp
    ./lisp.run -B . -N locale -E 1:1 -Efile UTF-8 -Eterminal UTF-8 -norc -m 1800KW -x "(and (load \"init.lisp\") (sys::%saveinitmem) (ext::exit)) (ext::exit t)"
    make: *** [interpreted.mem] Segmentation fault
    ==> ERROR: Build Failed. Aborting...
    Anyone can help me to fix this? Thank
    legout

    /var/abs/extra/devel PKGBUILD:
    build() {
    cd ${startdir}/src/${pkgname}-${pkgver}
    unset CFLAGS CXXFLAGS
    ./configure CFLAGS="-DSAFETY=3" --with-module=clx/new-clx --prefix=/usr --prefix=/usr --with-readline --with-gettext --with-dynamic-ffi src
    cd src
    ./makemake CFLAGS="-DSAFETY=3" --with-module=clx/new-clx --prefix=/usr --prefix=/usr --with-readline --with-gettext --with-dynamic-ffi > Makefile
    Output:
    lispbibl.d:9115: warning: register used for two global register variables
    time.d: In function 'C_default_time_zone':
    time.d:662: warning: integer overflow in expression
    cc -O -O -DUNICODE -DNO_SIGSEGV -I. -c predtype.c
    In file included from predtype.d:8:
    lispbibl.d:9115: warning: register used for two global register variables
    cc -O -O -DUNICODE -DNO_SIGSEGV -I. -c symbol.c
    In file included from symbol.d:4:
    lispbibl.d:9115: warning: register used for two global register variables
    cc -O -O -DUNICODE -DNO_SIGSEGV -I. -c lisparit.c
    In file included from lisparit.d:8:
    lispbibl.d:9115: warning: register used for two global register variables
    In file included from lisparit.d:28:
    arilev1.d:257:28: error: ari80386.c: No such file or directory
    make: *** [lisparit.o] Error 1
    ==> ERROR: Build Failed. Aborting...
    And when I remove the 'CFLAGS="-DSAFETY=3" ' from both of them, I get the same error as posted in the first post
    What am I doing wrong?
    PS! Compiling with ./configure spits out the forementioned error too.
    EDIT: I have done more reading, and found out that some poeple have not found a solution. So, is it maybe possible to add the compiled clx module manually to pacman installed clisp?
    Last edited by kuratkull (2007-10-11 07:51:59)

  • Get-ADGroupMember -recursive Show Groupnames

    I'm new to Powershell and im trying to get a list of the Members of some AD-Groups. Each Group is related to two other Groups for Read and Change permissions. Like FS101_EXAMPLE has two members wich are FS101_EXAMPLE_C and FS101_EXAMPLE_R
    So far I've got the following Code:
    import-module ActiveDirectory
    $GRP = "Groupname"
    Get-ADGroupMember $GRP -recursive | select objectclass,name | export-csv C:\Scripts\Exports\$(get-date -f yyyy-MM-dd-hh-mm-ss)-$GRP.txt –NoTypeInformation -Encoding UTF8
    If i scan on "FS101_EXAMPLE" it works and i get a list of all Members of FS101_EXAMPLE_C and FS101_EXAMPLE_R but i should know how's in wich group.
    How can I get a List with the Groupnames on it?

    If I understand you correctly, it sounds like you're getting the list of members from FS101_EXAMPLE, and recursively returning the members of groups within this first group. Your output lists the users but doesn't distinguish from which group they belong.
    I'm looking at Get-ADGroupMember and I see this behavior as well. I have ADPrincipal objects but there's not way on the surface to see their group membership.
    There are likely a number of ways to reach your goal, here is one way using a recursive function.
    function Get-ADGroupMembers {
    param(
    [string]$GroupName
    $objects = @()
    $members = Get-ADGroupMember -Identity $GroupName
    foreach ($member in $members) {
    if ($member.objectClass -eq "group") {
    $objects += Get-AdGroupMembers -GroupName $member.Name
    $objects += @{
    "objectclass" = $member.objectClass;
    "name" = $member.Name;
    "group" = $GroupName
    } # foreach
    return $objects
    } # Get-AdGroupMembers
    Import-Module ActiveDirectory
    $GRP = "Groupname"
    $AllMembers = Get-ADGroupMembers -GroupName $GRP
    $AllMembers | Foreach-Object {New-Object psobject -Property $_ } | Export-Csv C:\Scripts\Exports\$(get-date -f yyyy-MM-dd-hh-mm-ss)-$GRP.txt –NoTypeInformation -Encoding UTF8
    What I'm doing here is I've created a recursive function Get-ADGroupMembers (maybe not the best name) that calls Get-ADGroupMember against the given group. It then gets the members, collects the properties we want and adds them to an array which the function
    returns. If there is a group in the group, it will call the function again with this subgroup. 
    I'm storing the properties you want, objectClass, and Name, as well as the name of the group in a hashtable. The function returns the array of hashtables which I then convert to an object and export to CSV (HT powershell
    convert array of hastables into csv).
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Dell driver import problem

    MDT 2010
    Trying to package up NIC drivers for the Dell models:  Latitude E4300/E4310/6400/6410 and Precision M4400/4500.  I've downloaded the drivers (R244198 and R267025) and extracted them into separate folders. When I point MDT to those folders
    for importing, I get a bunch of errors. 
    No other drivers have this problem. Can anyone else confirm? Anyone know of a fix (other than wait for Dell to provide updated/fixed drivers)?
    Thanks

    Scanning directories for the count of INFs to import.
    Performing operation "import" on Target "Out-of-box drivers".
    System.Management.Automation.CmdletInvocationException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
       at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
       at System.ThrowHelper.ThrowArgumentOutOfRangeException()
       at System.Collections.Generic.List`1.get_Item(Int32 index)
       at Microsoft.BDD.PSSnapIn.Verifier.AddDriver(String theInfFile)
       at Microsoft.BDD.PSSnapIn.ImportDriver.ImportDrivers(String thePath)
       at Microsoft.BDD.PSSnapIn.ImportDriver.ImportDrivers(String thePath)
       at Microsoft.BDD.PSSnapIn.ImportDriver.ProcessRecord()
       at System.Management.Automation.Cmdlet.DoProcessRecord()
       at System.Management.Automation.CommandProcessor.ProcessRecord()
       --- End of inner exception stack trace ---
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
       at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecute(Array input, Hashtable errorResults)
       at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
       at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()

  • Is this outofmemory error on series 40 phones?

    Hi all,
    I am trying to port my MIDLet application to series 40 phones. My application works fine with 7210MIDP SDK. However, when I play on the phones(6800, 7210, 6100), sometimes I could go through the application, sometimes after I go through a couple of screens then it is freezing. This freezing problem happens randomly, I can't predict when it is going to occure.
    I am thinking it might be running out of memory heap because I have got lot of images. According to some postings in this forum, I have computed the heap size used by my images, it is 2bytes/pixel and total about 50KB for images only, and the official heap size for series 40 phones is 200KB . However, when I set heapsize in java wtk2.1 to be 100K and run my application, I get a "unable to run application" error message which is different from what I get on the phones.
    Could running out of memory cause phone freezing problems?. I really appreciate any advice. Thanks!!!

    Hi forum,
    i would like to aska Q related to the same ISSUE thatis why i intended to put it here not in a new thread
    i have a MIDP application that deal with only one JPEG at a atime but i hav ea obut 4 different jpegs
    - frankly i can setup the MIDLET with only one jpeg -
    that is not the deal
    - the problem is i find the emulator exits when i runt he app.
    - i tried using thememory monitor i found o/t outofmemoryerror
    - i began debugging the source using the java studio mobility and in a specific line it game me that exception
    i admit the program uses alot alot of arrays and hashtable but the gc is working an di get rid of any non-used objects..
    the application works in TWO threads
    to take the whole view.. while im monitoring the object creation - using the memory monitoring -
    be4 the exit i found alot alot of strings objects to be created, but the line i stopped at in debugging was allocating arrays of bytes (of big size ) so i guess the strings is in the other thread
    last i printed out the free VS total memory using
    Runtime.getruntime().freememory() , Runtime.getruntime().totalmemory();
    i found the total memory is only 500000
    i tried changing the IDE file in the bin directory of the studio to use the max availabe memory
    but no difference
    any help PLZ

  • Starting Public Worflows Within An Application

    The documentation for starting a public workflow within an application is ambiguous.
    At the following location: http://e-docs.bea.com/wlintegration/v2_0/collaborate/workflow/start.htm#1331638
    you state that a workflow instance is retrieved using the startWorkflow method.
    Unfortunately, this is a custom method that must be written and there is no suggested
    implementation.
    In terms of creating a workflow instance:
    For the WorkflowInstance class, there is only one documented constructor (although,
    there are 2 constructors). This constructor indicates that a Hashtable Array of
    Party properties is a parameter. The documentation doesn't tell us specifically
    what goes in these Hashtables, though. And as for the second constructor, we have
    no documentation and there is no mention in the API, but I do know that it takes
    3 Strings as its parameters.
    How do I start a public workflow within an application?
    Thanks in advance,
    Mark

    Replace:
    WorkflowInstance wi = startWorkflow();
    with:
    Hashtable[] array = new Hashtable[2];
    Hashtable party1 = new Hashtable();
    Hashtable party2 = new Hashtable();
    party1.put(WorkflowInstance.PARTYNAME_KEY, PARTY_SOURCE);
    party2.put(WorkflowInstance.PARTYNAME_KEY, PARTY_DEST);
    array[0] = party1;
    array[1] = party2;
    WorkflowInstance wi = new WorkflowInstance(BUSINESS_PROCESS_NAME,
    BUSINESS_PROCESS_MAJOR,
    BUSINESS_PROCESS_MINOR,
    BUSINESS_PROCESS_ROLE,
    array);
    "Mark Finlan" <[email protected]> wrote in message
    news:3b686b0f$[email protected]..
    >
    The documentation for starting a public workflow within an application isambiguous.
    At the following location:http://e-docs.bea.com/wlintegration/v2_0/collaborate/workflow/start.htm#1331
    638
    you state that a workflow instance is retrieved using the startWorkflowmethod.
    Unfortunately, this is a custom method that must be written and there isno suggested
    implementation.
    In terms of creating a workflow instance:
    For the WorkflowInstance class, there is only one documented constructor(although,
    there are 2 constructors). This constructor indicates that a HashtableArray of
    Party properties is a parameter. The documentation doesn't tell usspecifically
    what goes in these Hashtables, though. And as for the second constructor,we have
    no documentation and there is no mention in the API, but I do know that ittakes
    3 Strings as its parameters.
    How do I start a public workflow within an application?
    Thanks in advance,
    Mark

  • How should I set up my csv data file and data load structure?

    I'm a little lost on the best way a) format my data for csv and b) what type should it be loaded as. It is for a spaceship battle game.
    InternalItems = some data type that can be from 0 to 20 items like computers, engine boosters, etc.
    ExternalItems = some data type that can be from 0 to 20 items like weapons, sensors, etc.
    Format for InternalItems and ExternalItems "Database ID / Item ID,"
    Multiple items would look like "2/1, 1/2, 2/1"
    // database id 1
    ship.csv
    ID, Name, ExternalItems, InternalItems
    1, "Enterprise","2/1, 2/1", "3/1"
    2, "Galactia", "2/1","3/1"
    // database id 2
    weapon.csv
    ID, Name, Damage
    1, "Phaser", 5
    // database id 3
    engineboost.csv
    ID, Name, Boost
    1, "Super Fuel", 4
    LoadCSV parses External items and loads them into the ship class.
    1) Is there a better way to set up the External/internal lists? "2/1, 2/1, 2/2" etc..
    2) Once parsed, how should these be loaded into a ship class? ArrayList? Array? Hashtable? Basically in battle, the app should loop through weapons to shoot them. For a ship editor, an arraylist seems best, but for optimized combat it seems like an array or hashtable.

    1) Is there a better way to set up the External/internal lists? "2/1, 2/1, 2/2" etc..That's the best way to store an array of an array into a 2D grid.
    2) Once parsed, how should these be loaded into a ship class? ArrayList? Array? Hashtable? Basically in battle, the app should loop through weapons to shoot them. For a ship editor, an arraylist seems best, but for optimized combat it seems like an array or hashtable.If you think the searching is going to slow you down, hash table and array lookup is the way to go. If your indexing range is small, array lookup is the fastest. Hashing requires running hashCode() and does unoptimized searches during collision.

  • WeakHashMap and GC

    Hello:
    I'm trying to track down a memory leak on a Web site that uses ATG Dynamo.
    Currently, I am focusing on classes that use the Singleton pattern to build a persistent cache. In this case, we have a DatabaseCache object that appears to store a Relational View (an R.V. is a Dynamo term, I believe).
    The DatabaseCache object creates an array of HashMaps; the actual size of the array can vary.
    My question/idea is to replace the array of HashMaps with an array of WeakHashMaps with the hope that garbage collection will then be able to clean up stale objects in the cache.
    I have never used WeakHashMap before -- does this idea make sense? Do I have to also implement a null check in all of the code that references the DatabaseCache just in case the GC accidently cleans up objects that are actually needed?
    Thanks!

    One especially suspect singleton class, DatabaseCache,
    frequently builds an array of hashtables to represent
    a Relational View of a database. I consider this
    class especially suspect because it builds a number of
    hashtables of String objects, and there doesn't seem
    to be an explicit process for clearing the objects
    stored in the hashtables after they are no longer
    needed. It is also rather difficult to determine how
    long references to objects in the hashtables endure.
    However, I could be totally wrong.Here's what is vague. What does "HashTables of String objects" mean? HashTables have two components, the keys and the values. Complete this sentence: The keys are ____ and the values are ____.
    So my questions may be summarized as follows:
    1) If my goal is to limit the lifespan of a hashtable,
    how effective is the WeakHashMap at accomplishing
    this.Do you want to collect the HashTable itself, or the keys, or the values?
    2) This is a more open-ended question: Does my
    methodology/idea for solving the memory leak problem
    seem sound? Any suggestions based on previous
    experience?It's still not clear. If you never take anything out of the HashTables, and you never release the HashTables themselves, clearly you have a memory leak. But it sounds like you're unsure of whether this is true or not.

Maybe you are looking for

  • How to change ui element from input field to TextArea?

    Dear colleagues, When I try to add an attribute of type string  in Ui configuration, I found it's by default INPUT_FIELD and can not change to text_area, does any one know how to do this? It will be better if you can tell me how to set text and get t

  • Using new Macbook as a CPU

    I am considering buying the new MacBook 13", to serve a dual purpose -- first to have a laptop to take when traveling, and second, to use to replace my current G4. I would use my current display and separate keyboard and, in essense, use the MacBook

  • Report to view all the Roles and Transactions assinged to a particular user

    Hi, I need to develop a report to view all the Roles and Transactions assinged to a particular user along with the Authorization values. So, if provide the Username, the report should be able to give Roles, Transaction Codes and the fields and thier

  • Support for document and documentwrapped web services

    List, Are "document" and "documentwrapped" style web services supported in WSL 8.1 SP1? The documentation referenced below [1] [2] indicates that these styles are supported, but in the Unsupported Features section of the Web Services overview [3] sta

  • Aftereffects expression BUG. cannot compare the values of 2 sliders???????

    so do this: make a new comp with a new solid. add 2 slider effects to the layer. add an expression to the Opacity of the solid, add this tot he expression: // begin expression if(effect("slider_01")("Slider") == effect("slider_02")("Slider")){ 100 }e