Avoid Evaluate in this case?

I am invoking a webservice that returns Java entry arrays for
ldap user information.
To display the name from each entry i have this code:
<cfloop index="intIndex" from="0"
to="#arraylen(topOfOrg.getEntryArray().getEntry())-1#">
<cfoutput>#directReports.getEntryArray().getEntry(evaluate(intIndex)).getName()#</cfoutpu t>
</cfloop>
Should i avoid using evaluate in this case? And how could I
if it is an option?
Thanks for any thoughts/ideas.

Thanks all for the feedback/discussion.
I'm not an expert yet... just graduated with a bachelors in
business adminstation with a CIS focus in december. That means i
had about 3 programming classes and one web design class that had
about 4 weeks on coldfusion. But ever since i was exposed to
coldfusion i have enjoyed it. Landed a job after graduation as a
web master of a site with coldfusion 5.0 applications.
I recommened a new server and upgrade to coldfusion mx 7. And
started redesigning our site and applications. Its been fun and
challenging.
This week i had the idea to make a dynamic org chart. Our
corporation has a active directoy lookup web service, so I set out
to consume it in coldfusion. Took some trial and error but i got
consumption to work....
I don't know java well, but the web service documentation
said returns java entry array objects. Took some trial and error
again to get the data out of the objects once they were returned.
But got that working, then i expanded my querie to return multiple
arrays within the object so i had to loop over it (i assume this is
a resonably efficient way to get at each array).
My original logical line of code was to use:
<cfloop index="intIndex" from="0"
to="#arraylen(directReports.getEntryArray().getEntry())-1#">
<cfoutput>#directReports.getEntryArray().getEntry(intIndex).getName()#</cfoutput>
</cfloop>
This code returns this error: "The selected method getEntry
was not found."
coldfusion.runtime.java.MethodSelectionException: The
selected method getEntry was not found.
In response to that i set evaluate around the intIndex and it
worked, but i had read evaulate was a costly operation, so i asked
for help here. And got the excellent javacast alternative.
The webservice return variable is directreports, a java
object i believe, and it has a method to get to the result set of
EntryArray and then each array in the result set has methods to
reveal my data. Like name, work phone, job title, etc.
Its a simple application, but everyone loves it so far.
Thanks all!

Similar Messages

  • Can I avoid fraud in this case...

    This may be a lesson learned...
    I sold my iPod Nano (6th generation) on eBay. I placed hi resolution images on my page and decribed it as having no scratchs or dings. It didn't. When the buyer recieved the product they said it has obvious scratches and dings, and proceeded to use vulgar language to describe my intentions.
    Being a nice guy I let them ship at back, at no cost to them.
    My concern now is that they will send me a different iPod. It will look the same in all ways, but have some scratches and dings, I assume. And worse it may be defective in some ways not easily detected until it has been used for a while (hence their need for a new one).
    I know I registered the iPod when I first pruchased it, but I have read here that Apple no longer keep records of registered products. My hope was that I could find the seriel number and match it to the one I am getting in return.
    Is there anything I can do to match iPods. Before I sent it to them, I naturally reset the OS, so they had a clean slate to work with.
    I purchased this from a retialer, not Apple.
    Any ideas?
    thanks - Otto.

    if you registered the serial number with your Apple ID, you can go to http://supportprofile.apple.com and the serial should appear there.

  • What is the best practice in this case?

    I want to create a vending machine simulation program.
    The design will be something like this :
    GUI----use----VendingMachine----has----ProductStorage
    Previously, i want everything inside VendingMachine will be transparent from the GUI.
    The GUI just use VendingMachine, and it has no knowledge about ProductStorage.
    But then i realize that in order for the GUI to display the products, it has to use ProductStorage.
    So i came up with adding this getter to VendingMachine class :
    public ProductStorage getStorage()
         return storage;
    }I'm breaking the rules of encapsulation.
    Is it okay to do this? What is the practice in this case?
    Thanks,
    Ang.

    GUI----use----VendingMachine----has----ProductStorage
    Previously, i want everything inside VendingMachine will be transparent from the GUI.
    The GUI just use VendingMachine, and it has no knowledge about ProductStorage.
    But then i realize that in order for the GUI to display the products, it has to use ProductStorage.Not necessarily. You can expose the ProductStorage interface (did I get this right: methods such as getProductList(), getProductQuantity(String productId) ?), in VendingMachineImpl. That latter can simply delegates to its ProductStorage collaborator. The GUI code doesn't need to know this latter is a separate instance.
    I'm breaking the rules of encapsulation.
    Is it okay to do this? What is the practice in this case?Technically you're violating the so-called Law of Demeter, which as you mention means you reveal implementation details to the client - and makes it less flexible, if you ever want to move ProductStorage API in another class. For example it would exhibit transaction logic to the client code.
    OK we're talking about a far-fetched exemple, part of an exercise, but in general you should avoid this.

  • What's wrong with a "regular" global in this case? AND WIl ActiveX objects stored in functional globals remain valid (when used in an executable)?

    I've written a plugin layer for a LV executable.  When this layer makes a call to the plugins' initialization functions, I want each plugin library to be able to initialize and maintain its own global memory (where things like VISA resource names or ActiveX objects are stored).  However, I've found that I can't manage to keep my global VIs "alive."  I'm inclined to switch to functional globals, but I suspect that this will be a problem for things like ActiveX objects (that in this particular case reference a CAN interface).  I believe that the functional global will indeed store the object from run to run, it's just that I'm somehow disinclined to think that the object will remain valid.  I think you'll have to re-initialize it.  Can anyone speak for or against this hunch?  (If you can't tell, I'm trying to avoid building a whole little test executable just to debug this problem.)
    I suppose the more profound question is "Why don't the globals stay in memory?"  I'm attaching an image of what the application layer that calls the plugins' intializations looks like.  Next I'm attaching an example of an actual initialization routine.  You'll notice that I've even gone so far as to explicitly open the ref to the global VI that I want to keep in memory.  Then I just leave it there dangling - but it still gets dropped!  In my mind I shouldn't even have to do this, since the dynamically-called subVI "MC_CMO Init.vi" actually initializes the globals and runs with AutoDisposeRef = False. 
    Lastly, this is my first-ever attempt at writting plugin software.  So if you look at my code and have any criticisms/pointers, I'll greatly appreciate them.
    Thanks in advance,
    Nick
    "You keep using that word. I do not think it means what you think it means." - Inigo Montoya
    Attachments:
    AppLayer.JPG ‏60 KB
    InitPlugin.JPG ‏103 KB

    I am not sure if I follow you completely on your work-around.
    Everything I have to say on this topic is based on obesrvations and threads I have read on Info-LabVIEW. Therefore it is subject to corecttion by those who know better.
    LV is smart enough to know when "something" that had been opened, can be closed. It is not perfect.
    If for instance you open a VISA refnum and pass the refnum  to a LV2 AS A REFNUM the refnum in the LV2 stay alive as long as the VI's are running.
    If you start another VI that uses the LV2 to fetch the refnum, it should get a valid ref as long as it starts before the first goes idle.
    You then be able to work with refnum usign the VI launched second as long as stays active.
    I often create action engine that can be invoked where required throughout an application. If the action engines get a ref in one state (like init) and use it another, I will generally write a "tester" that calls the action engine action to test the engine. In this case, my "tester" stays live and it keeps the ref's fresh.
    I suspect if you tried to trick LV you could. If you type cast the ref nums to I32 and stored those in a LV2, I could see how LV could loose track of the resource sharing, but that is something I would avoid.
    So I encourage you to do some experimenting with keeping track of who's running when to see if your work-around will work.
    If you think you understand it better than I explained it, please post.
    Trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • ICloud ruined my life- how can I escalate this case further!!!

    The unthinkable has been hande to me by Apple.
    iCloud corrupted 40% of my documents. Then 'reset' the remaining 60%
    100% of my documents erased by Apple. This has taken 8 months of my life away, the apple care process has been woeful. So many Senior Advisors said they would 'take ownership of the case' and 'call me back'. Nothing, no call back- I am forced to call up again- explain the case again- be promised again by another Senior Advisor that they would 'take ownership of the case' and 'call me back'...
    I am left shattered.
    This was a few months ago- i have lost huge amounts of irreplaceable research generated from over 2000 hours of my own personal work.
    It was not backed up to my mac book as it was rendered inoperable when i 'upgraded' to OSX Lion.
    I did all my work for 8 months on my ipad. All documents were created and stored locally on my ipad. I had no access to my LaCie external because my macbook was inoperable.
    It was recommended by Apple Genius that I turn on icloud for Documents. iCloud then corrupted the documents and synced that corruption back to my documents locally stored on my ipad.
    I could then see all the images in pages documents view. But could not open them- that was for about 40%of my documents. I could still access the other 60%
    My account was then referred to the iCloud engineers. After a few weeks with no contact from apple I called up to chase up this loss of my documents- it had been going on for 7 weeks at this point.
    The senior advisor told me that my account had been 'reset' and should be working fine now..
    WHAT!!!! Reset!!!?????? so what about the 60% of docs that i had access to?
    Gone. Deleted from the icloud account, synced back to my ipad.
    All Gone.\
    If i had been contacted by the engineers. 'We cannot fix your corrupted documents. We propose to reset your account. That will erase all data and documents in your account. Is this ok? Please backup any documents you have on your ipad.'
    This would have saved 60% of my 8 months research- which is a lot.
    but no- no contact, just reset my account and erased my documents.
    its unbelieveable and unthinkable.
    I am a MASSIVE apple fan- i have 22 Apple devices and tell everyone in my network that all my dreams have come true with Apple- ridiculing them for using other devices. It has now turned into a nightmare.
    I WENT TO THE APPLE STORE IN SYDNEY IN DESPARATION- TO FIND OUT IF THERE WAS AN IMAGE OF THE DOCUMENTS SOMEWHERE/ANYWHERE!!! I KNOW THEY CAN ONLY CONTACT ICLOUD IN THE SAME WAY AS ME- BUT WHAT OPTIONS DID I HAVE- I COULDN'T ESCALATE THROUGH APPLE ANY HIGHER- THEY TOLD ME THAT THE SENIOR ADVISORS AND ENGINEERS WERE AS HIGH AS I COULD ESCALATE. SO I WENT TO THE APPLE STORE AND TOLD THEM THAT I WOULD NOT LEAVE THE STORE UNTIL IT WAS RESOLVED- THEY TOLD ME THEY COULDN'T HELP ME- I STAYED FOR 8 HOURS- AFTER 1.5 HOURS WE FOUDN OUT THAT THE ENGINEERS LIKENED TRYING TO RESTORE MY DOCUMENTS TO TRYING TO REBUILD A BURNT DOWN HOUSE.
    We were about to release our energy saving App globally. I had a meltdown and just went away on holiday to New Zealand and Thailand with my kids- I couldn't face the reality of what i had to do to recover.
    I came back to try and get back on track recently. My only way forward was to forget about it and start again.
    AND THEN!!!
    I stupidly used pages on my ipad to edit a document from our development partner the other day. I opened my pages today, the document was there- then in front of my eyes all the documents shuffled around. Guess what- the doc I had edited disappeared.. In shock i called Apple Support. He asked me to check on icloud. com. 15 documents, not the one i want, advisor can see my doc- i cannot. I feel naseous.
    THIS CASE HAD ALREADY GONE TOO FAR. BUT NOW I HAVE HAD ENOUGH!!!!!!
    How can i escalate further? There must be a way. This is not acceptable! Apple are messing with my life!!!!! I'm losing too much time and money- it's just not fair at all. Something MUST be done by way of compensatiing for this series of errors!!!!

    There's nothing anyone here can do for you, and I'm afraid I have little sympathy.
    2000 hours of "irreplaceable work" and at no point during those 8 months did you think "Gee, I really should back up all these hugely important files just in case my iPad gets stolen, lost, breaks or some other disaster occurs"?
    As soon as you noticed something was amiss, or even at the point when you still had access to 60% of your documents, why did you not take the opportunity to download a copy of them via iCloud.com (on any computer) and save them safely on a memory stick or other backup device?
    Having just one copy of any file is asking for trouble. Backing up regularly is the No.1 rule of computing. Apple is not responsible for your lack of any backup routine. Apple advise you to backup regularly. Being able to backup your iPad should've been your motivation for spending an hour or two of those 2000 getting the MacBook up and running.

  • I've moved my Aperture library to another computer, and masters are referencing an old path name.  How can I update these references?  Reloctating masters does not work in this case :(

    I've moved my Aperture library from one computer to another using Finder.
    I merged the library with one which was already on the computer.
    Now, the photos I imported have reference to the old path name on my old computer.
    How can I update these references as "Relocate Masters" does not work in this case?

    Just one suggestion to be able to reconnect all at once:
    Create a smart album containing the images with missing masters:
    File -> New ->  Smart Album,     and add a rule: File Status is "Missing"     (or File Status is "offline")
    Then select the images in this album and go to the File menu:
    and select:   File -> Locate referenced File
    If you are lucky, Aperture will reconnect all at once, if you point the first image version to its counterpart.

  • My authorization is to buy in an itunes USA store, but how can i buy an album from an itunes store of another country (this case Brazil)?

    my authorization is to buy in an itunes USA store (per the message that pops up on my iPhone 4), but how can i buy an album (using either my iPhone 4 or MacBook Pro) from an itunes store of another country (this case Brazil)?

    You cannot use other countries itunes stores.
    Sorry

  • I have a domain with 2 DCs (both virtual machines) in different Hyper-V Hosts. Dose this case make any influence on the time sync?

    As title,
    I have a domain with 2 DCs (both virtual machines) in 2 different Hyper-V Hosts, and one of the perform as a PDC Emulator.
    Dose this case make any influence on the time sync?
    i.e. Both of the VMs sync with Hyper-V host, instead the other host should sync with the PDC Emulator?
    I run w32tm command and get the following result:
    C:\Users\Administrator.DOMAIN8>w32tm /query /computer:dc8.domain8.local /source
    VM IC Time Synchronization Provider
    C:\Users\Administrator.DOMAIN8>w32tm /query /computer:hpvzh05.domain8.local /source
    VM IC Time Synchronization Provider
    HPVZH05.domain8.local works as PDC server.
    How can I make DC8 sync with HPVZH05?

    Awesome!
    It looks like your PDC is successfully pulling time from an external source.  DC8 is not longer pulling from Hyper-V so that is good.
    When you set a client to pull from a source ( and in this case DC8 is pulling from NT5DS, which tells it to pull from the PDC), and it CAN'T pull from that source, it will default to Local CMOS Clock.  This is likely an easy fix.
    First, check connectivity:
    - Method one- Download Portqry and run this command: portqry -n HPVZH05 -p both -e 123 and see if the results say listening, or
    - Method two- Run this command from DC8: w32tm /stripchart /computer:HPVZH05
    If you get any kind of error using method two, it's a connectivity issue.  (Maybe you have a firewall that's blocking access?)
    The other cause of this, and probably more likely in your case, is that your PDC isn't properly advertising as a reliable time source, so DC8 isn't 'allowed' to pull from it.
    Try running this command on your PDC: w32tm /config /reliable:yes
    Then go restart time on your PDC, THEN DC8 again.  (net stop w32time & net start w32time)
    Here's an article you can reference: http://technet.microsoft.com/en-us/library/cc794937(v=WS.10).aspx
    - As always, if you find my posts to be helpful, please mark it appropriately.  Thank you :)
    Chris Ream

  • Can I replace my current iPhone 5s with a new one in this case?

    I just got my iPhone 5s two days ago, but it already has problems when I was trying to text with it while charging. The phone was doing all these random things like mis-sensed my typing really badly, jumping out to the main screen and even called the person I was texting. I even tried typing messages in Whatsapp, it constantly hides the keyboard from time to time and that's really irritating. While it's on lock screen, I could not slide to unlock it, I had to use my finger scan to access my phone in the end. The phone went normal again once I got the charge unplugged, but it went crazy again once I got it plugged in. I truely believe it's something wrong with the phone rather than the charger. Can I replace my current phone with a new one in this case?

    Take it back. This is a warranty/purchase issue. We are just users here.

  • Cheque printing. How to avoid last page in case of check printing in F110?

    F-68 prints only one page whereas F110 prints 2 pages.
    How to avoid last page in case of check printing using F110? Is there any other option than changing the Script.

    Hi,
    Im also facing the same issue. Generates 1 page with F-58 but 2 pages with f110. Kindly let me know how to resolve.

  • Do I need to declare a transaction in this case?

    I am struggling to understand when it is necessary to declare my own transaction to ensure the data is properly updated.
    For example, in the following code, which is part of a java bean in the EJB project, KeyFacade is a stateless session bean tied to the entity "Key". it is a standard EJB created with the netBeans 5.5 wizard. I have changed no defaults.
    Do I need to declare a transaction, commit the transaction and close it when I use the "KeyFacade.edit(key);" in order to ensure the database is updated? Or is it automatically done because the .edit() method uses the entityManager and the persistence is container managed?
    Would it make a difference if this bean was part of a WAR project?
        public BigInteger getNextKey(String tableName){
            KeyFacadeLocal KeyFacade = this.lookupKeyFacade();
            Key key = KeyFacade.findByTablename(tableName);
            long nextKey = key.getKeyvalue();
            BigInteger BINextKey =BigInteger.valueOf((int)nextKey);
            //  now update the table by incrementing the key value by 1
            long incrementKey = nextKey + 1;
            key.setKeyvalue(incrementKey);
            KeyFacade.edit(key);
            return BINextKey;
        }

    808239 wrote:
    I have a Map<Integer, List<T>> data, and all the lists are initialized using Collections.synchronizedList().Seems like overkill to me. Your Map also looks like a Multimap, of which there are several existing implementations.
    When I do the traversal, I want to traverse ALL lists in the map at the same timeI suspect not. What you want to do is to traverse each one in sequence.
    so I have to sync all lists as shown in the API doc as follows: ...Seems like overkill to me, and will probably result in a very slow Map (not that there's any problem with that if it's the right thing to do; in this case, I suspect it isn't).
    Is this approach ok?What are you trying to achieve? If you need full consistency for your iterators (ie, a snapshot of the entire Map at the time the iterator is created), you have a two choices (assuming you don't want to deal with update journals):
    1. Lock the Map.
    2. Clone the Map (and your clone() method should be synchronized).
    Of the two, the second seems best to me, but neither is all that wonderful.
    However, if all you need is weak consistency - that is to say, what you return reflects the state of the Map when Iterator.next() is called - all you really need to do is make sure that your Lists are synchronized when you do the read.
    Since the List updates are the responsibility of your Map (I'm still presuming this is some sort of Multimap implementation), there's no real need to synchronize them; just synchronize the Map's own update methods.
    I'd also suggest that you make sure your getValue() method hands back an [url http://download.oracle.com/javase/6/docs/api/java/util/Collections.html#unmodifiableList%28java.util.List%29]unmodifiable List to clients; otherwise they could start adding or removing values themselves.
    HIH
    Winston

  • HT5639 After installing the windows 7 64 bit, it will restart automatically with error in blue screen. in this case what should i do?  i have using bootcamp 5

    After installing the windows 7 64 bit, it will restart automatically with error in blue screen. in this case what should i do?  i have using bootcamp 5

    if it's restarting directly into an error, you can try troubleshooting (might be painful) or re-install windows with boot camp

  • IPod touch 1st generation could not be restore on iTunes, an unknown error occurred (1). how can i fixed this case?

    My iPod touch 1st generation could not be restore on iTunes, the message was "The iPod "iPod" could not be restore. an unknown error occurred (1)".
    my serial number is AB1905714N
    how can i fixed this case?
    thank you

    ERROR (1)
    - Place the iPod in DFU mode and then restore
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - Try on another computer
    - Try another cable           
    - Also, confirm your security software and settings are allowing communication between your device and update servers.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar     

  • What is the cost of replacing a battery for an Ipad 2 in India? On asking the service centre, I was informed the entire Ipad would be replaced for 20K which is exorbitant. Is it advisable to buy the Apple protection program in this case?

    What is the cost of replacing a battery for an Ipad 2 in India? On asking the service centre, I was informed the entire Ipad would be replaced for 20K which is exorbitant. The same is done in US for a paltry (comparably) 100 dollars. Is it advisable to buy the Apple protection program in this case?

    Battery Replacement
    http://www.apple.com/batteries/replacements.html

  • 'Unable to connect' the number of free accounts can be enabled on this case has been reached

    hello ! please someone help me
    when i sign in icould ...'Unable to connect' the number of free accounts can be enabled on this case has been reached' heelp please

    hello ! please someone help me
    when i sign in icould ...'Unable to connect' the number of free accounts can be enabled on this case has been reached' heelp please
    iPhone 5s, iOS 7.1.1 

Maybe you are looking for

  • Reg.payment terms

    Hi [1].    Customer credit period =30 days Payment should be made by 2 installments 1st installment at the time of delivery i.e 30% (10 days from posting period) 2nd installment after 20 days i.e  remaining amount.(70%) i entered values in installmen

  • We used to be able to watch rented movies from Apple TV right away.  Now it takes hours.  Is there a setting to change?

    We used to be able to watch rented movies from Apple TV right away.  Now it takes hours.  Is there a setting to change?  They used to start playing after a few minutes of starting the download but not now.  What's up?

  • Where does iTunes save iPad backups on a PC

    I'm looking for my backup since it took up a majority of the space left on my laptops HD. I've already checked for User\AppData\Roaming\Apple Computer\MobileSync\Backup\ and I seem to not have the appdata file. I don't know if this matters but its a

  • Java time stamp

    Hello All, I want to create a TimeStamp Object. I was using the constructor TimeStamp s = new TimeStamp(2001, 07, 07, 0, 0, 0, 0); Problem is that this constructor is now deprecated. The new constructor takes a value of type 'long'. But I don't know

  • How to clear cache in weblogic server 10.3

    Hi, I am using web logic to handle cache ? How can i clear cache using web logic Mbeans?