Better way than  if(!rs.next()){...}

Is there any convention to see if a record set is empty. I have been using:
//if(!rs.next()){...}
Steve

If I only wanted to find out if a recordset is empty, I wouldn't produce the recordset in the first place. I would replace the query by one that started out "Select count(*) from ..." and then read the single column from the single row and see if it was zero or not. Although if I knew the recordset would contain either zero or one records, I might still do it the way you describe -- which is perfectly fine.

Similar Messages

  • A better way than a global temp table to reuse a distinct select?

    I get the impression from other threads that global temp tables are frowned upon so I'm wondering if there is a better way to simplify what I need to do. I have some values scattered about a table with a relatively large number of records. I need to distinct them out and delete from 21 other tables where those values also occur. The values have a really low cardinality to the number of rows. Out of 500K+ rows there might be a dozen distinct values.
    I thought that rather than 21 cases of:
    DELETE FROM x1..21 WHERE value IN (SELECT DISTINCT value FROM Y)
    It would be better for performance to populate a global temp table with the distinct first:
    INSERT INTO gtt SELECT DISTINCT value FROM Y
    DELETE FROM x1..21 WHERE value IN (SELECT value FROM GTT)
    People asking questions about GTT's seem to get blasted so is this another case where there's a better way to do this? Should I just have the system bite the bullet on the DISTINCT 21 times? The big table truncates and reloads and needs to do so quickly so I was hoping not to have to index it and meddle with disable/rebuild index but if that's better than a temp table, I'll have to make do.
    As far as I understand WITH ... USING can't be used to delete from multiple tables or can it?

    Almost, but not quite, as efficient as using a temporary table would be to use a PL/SQL collection and FORALL statements and/or referencing the collection in your subsequent statements). Something like
    DECLARE
      TYPE value_nt IS TABLE OF y.value%type;
      l_values value_nt;
    BEGIN
      SELECT distinct value
        BULK COLLECT INTO l_values
        FROM y;
      FORALL i IN 1 .. l_values.count
        DELETE FROM x1
         WHERE value = l_values(i);
      FORALL i IN 1 .. l_values.count
        DELETE FROM x2
         WHERE value = l_values(i);
    END;or
    CREATE TYPE value_nt
      IS TABLE OF varchar2(100); -- Guessing at the type of y.value
    DECLARE
      l_values value_nt;
    BEGIN
      SELECT distinct value
        BULK COLLECT INTO l_values
        FROM y;
      DELETE FROM x1
       WHERE value = (SELECT /*+ cardinality(v 10) */ column_value from table( l_values ) v );
      DELETE FROM x2
       WHERE value = (SELECT /*+ cardinality(v 10) */ column_value from table( l_values ) v );
    END;Justin

  • Express and Extreme - is there a better way than WDS?

    Hi all
    I have a UFO extreme (connected to the modem) and an express set up for WDS to extend the range of the network. The performance is terrible. Is there a better way to extend the network?
    Could I connect the express to the extreme via a CAT5 cable? If so would this provide better performance and - how would I set this up?
    Regards
    Stephen

    Stephen Bennett wrote:
    I have a UFO extreme (connected to the modem) and an express set up for WDS to extend the range of the network. The performance is terrible. Is there a better way to extend the network?
    Ensure that your Airport Express is placed correctly.
    Also check for interference.
    Could I connect the express to the extreme via a CAT5 cable? If so would this provide better performance
    Yes this will provide much better performance. WDS effectively halves the bandwidth and can be more susceptible to interference than a single base station.
    and - how would I set this up?
    You would create a roaming network. The remote Airport Express would be configured as a wireless bridge (not distribute IP addresses), it would (like WDS) use the same network name and wireless security as the main base station, however unlike WDS it needs to be on a different channel.
    iFelix

  • Interview editing question - is there a better way than what I am doing?

    I've got a skype interview I am editing, and I want to cut between a side by side shot (shown below, exhibit A) and a centered full screen shot (shown below, exhibit B).
    I need to keep the audio and images synced across all shots. Additionally, I'll have a motion background that I want to keep synced as well.
    What I am planning to do is just stack all the shots on top of each other, so that all the motion and audio stays in sync.
    Then to change between shots, I was thinking I might just "Blade all" at the spot in time where I want the different angle, and then delete the unwanted portion of footage.
    I wonder if there is an easier way?
    Actually in thinking about it, I wonder if I can take the two side by side shots, make a compound shot, then combine that shot back with the two orignals for a multicam clip?
    If that works, it would be easier for sure!.
    Any other ways this would commonly be achieved?
    Oh and one more question...
    My whole reason for wanting to switch from the side by side view to the individual views, is that I want to put in some lower thirds and I couldn't come up with a good way to do that on the side by side and have it look right - Are there any commonly accepted techniques for dealing with lower thirds with side by side interview footage?
       Exhibit A:
       Exhibit B:

    Thanks Russ H and Ross H!
    I'm finding Multicam, combined with Compound Clips to be extrememly efficient.
    I started with 2 different video clips, along with 2 different audio clips.
    Layed out both clips side by side (visually, they are on top of each other on the timeline),and made that a single compound clip.
    Then I laid out both audio clips on top of each other on the timeline and made those a compound clip.
    So now I have
    2 original individual Video shots
    1 compound video shot of the 2 above side by side.
    2 original audio tracks
    1 compound audio track
    Next I made a multicam track, and added to it all 3 video shots (2 original + 1 compound) And I added the compound audio track. I set that audio track to be "the" track.
    It's just a little bit of setup, but really not that bad, and the ability to use the multicam feature to switch between shots, while keeping everything in sync is fantastic!
    - Jack

  • Upgrading to Lion, There Must be a Better Way Than Migration Assistant!

    I finally got around to updating to Lion and it's turned out to be a little frustrating.
    First Attempt: simply updating over the top of my existing Snow Leopard installation. I had a variety of annoyances mostly surrounding the amazing amount of cruft laying around from years of installing,  then removing apps and just upgrading new versions of Mac OS on top of the existing ones.
    Second Attempt: Partition the drive, did a clean installation, used Migration Assistant and moved my old account to the new installation. This resulted in most of the cruft coming over, many of the annoyances remaining, and some settings and daemons mysteriously disappearing.
    Third Attempt: Deleted the second attempt, did another clean installation, created a new account with the same name as the old account, and then copied only the data I really wanted (Documents, iTunes Library, Mail Data, &tc...). This resulted in dozens of annoyances stemming from permission problems.
    So... how do I jettison all the artifacts from the past while only keeping the data I really want? How do developers deal with having more than one working installation on a Mac? Do they never move stuff between them?

    I pretty much agree with baltwo on this. The only way to weed out the 'cruft' is to reinstall each program manually, copy data from your Pictures, Documents, Music, and Movies folders. Then to be very careful about what you move from the old Library into the new one. Invariably this process leads to missing templates and other issues that take several days - and longer - to resolve. The end result? Your computer doesn't run noticeably faster and you gain perhaps a whopping couple GB or less of drive space.
    I speak from experience. I have performed this painful task twice (and was very thankful to have complete backups that I didn't erase because I didn't realize I was missing some templates for several months). My two work desktops and notebook go all the way back to Jaguar and they are no faster than my home computers of the same vintage.

  • Need a better way than killing connections in SQL Azure - Governor

    I've been pushing the boundaries of  SQL azure (S0 and S1) recently. 
    I'm at a point where normal T-SQL code needs to be optimized for SQL azure, I was surprised that all Microsoft have done was enhance the governor process and kill the connection  rather than slow down the connection, guess this was the easy path to
    use. 
    Simple T-SQL statements like MERGE need to be rewritten to support large data (1 million rows).  Given you need to batch core T-SQL commands you need to answer yourself is this the correct approach.  Also had the same issue using SQL Bulk Copy
    but tweaked a few settings to get around that issue. 
    S0 & S1 still haven't got the same IO as Web/Business edition hence Microsoft need to fix this ASAP.
    Is SQL Azure worth that extra hassle compared with other DB engines?
    Micatio Software Free IIS Azure Web Log App

    Hi Jan,
    Its not the command timeout (for example set as 0 in SQL management studio). 
    I've seen it many times where the last wait type is the LOG GOVERNOR. 
    A few minutes later the status is set as KILLED/ROLLBACK.  I can get around the issue by batching the MERGE statement  and it works fine.  
    I would understand if the MERGE was running for 1-2 hours and I've seen the same thing occur when using a bulk insert command in C# (resolved by limiting the batch size, streaming, etc.).
    The azure version is Microsoft SQL Azure (RTM) - 11.0.9230.176.
    The log governor does kill connections, this is documented on a few sites and MSDN.  LOG GOVERNOR was a SQL Enterprise feature in the standalone product except Microsoft in there wisdom ported it across into SQL Azure to resolve users running bad queries
    on the infrastructure.
    Micatio Software Free IIS Azure Web Log App

  • Importing images into LR: Better way than checking boxes by hand?

    Hi!
    I find it incredibly tedious having to tick every little box in the upper left corner of each photo to import it from my card into LR. Is there a better option?
    My apologies if this has been asked before - I don't come here often, it's late and I'm running out of steam.
    Thanks for any help.

    I do make use of the "Check all" and "Uncheck all" buttons as best as I can, but the problem is that oftentimes, I have photos from multiple shoots and locations on my camera card (it's a 4GB and usually lasts me a couple or more shoots). Let's say I have 370 images on my card, 180 from the latest shoot and the remaining ones from two previous shoots. In that case, I have to hand-check 180 little boxes, all the while scrolling carefully so as to not overlook any images, and then import them into the respective folder. After that, I will have to repeat this tedium with the remaining two shoots.
    I guess I am hoping there might be a keyboard shortcut or a key/mouse click combination that allows you to select a defined set of photos in the import window.

  • Is there a better way to stop a Method than Thread.stop()?

    First my basic problem. In one of my programs I am using constraint solver. I call the constraint solver with a set of constraints and it returns a Map with a satisfying assignment. In most cases this works in acceptable time ( less than 1 second). But in some cases it may take hours. Currently I am running the function in a Thread and using Thread.stop(). This look like that:
         public Map<String, Object> getConcreteModel(
                   Collection<Constraint> constraints) {
              WorkingThread t=new WorkingThread(constraints);
              t.setName("WorkingThread");
              t.start();
              try {
                   t.join(Configuration.MAX_TIME);
              } catch (InterruptedException e) {
              if(t.isAlive()){
                   t.stop();
              return t.getSolution();
         }where t.getSolution(); returns null if the Thread was interrupted.
    Unfortunately this sometimes crashes the JVM with:
    # A fatal error has been detected by the Java Runtime Environment:
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006dbeb527, pid=5788, tid=4188
    # JRE version: 6.0_18-b07
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (16.0-b13 mixed mode windows-amd64 )
    # Problematic frame:
    # V  [jvm.dll+0x3fb527]
    # An error report file with more information is saved as:
    # F:\Eigene Dateien\Masterarbeit\workspace\JPF-Listener-Test\hs_err_pid5788.log
    # If you would like to submit a bug report, please visit:
    #   http://java.sun.com/webapps/bugreport/crash.jsp
    #Does anyone knows a better way to do it?
    Thank you in advance.
    Note 1: the Constraint solver is a Third Party tool and changing it is unfeasible. (I have tried it already)
    Note 2: Using Thread.stop(Throwable t) only chances the error message.

    In case somebody have the same problem here my code which solves the problem. Note it requires to parameters and the result to be serializable.
    The Class which starts to Process:
    public class Solver{
         public Map<String, Object> getConcreteModel(
                   Collection<Constraint> constraints) {
                   try
                        Process p=Runtime.getRuntime().exec(...); //do not forget the classpath
                        new TimeOut(Configuration.MAX_TIME, p).start();
                        ObjectOutputStream out=new ObjectOutputStream(p.getOutputStream());
                        new ErrReader(p.getErrorStream()).start();//not that std.err fills up the pipe
                        out.writeObject(constraints);
                        out.flush();
                        ObjectInputStream in=new ObjectInputStream(p.getInputStream());
                        return (Map<String, Object>) in.readObject();
                   catch(IOException e)
                        return null;
                   } catch (ClassNotFoundException e) {
                        //should not happen
                        return null;
         // For running in a own process
         static private class TimeOut extends Thread
              private int time;
              private Process p;
              public TimeOut(int time, Process p)
                   this.time=time;
                   this.p=p;
              @Override
              public void run() {
                   synchronized (this) {
                        try {
                             this.wait(time);
                        } catch (InterruptedException e) {
                   p.destroy();
         static class ErrReader extends Thread
             InputStream is;
             ErrReader(InputStream is)
                 this.is = is;
                 this.setDaemon(true);
             public void run()
                 try
                     InputStreamReader isr = new InputStreamReader(is);
                     BufferedReader br = new BufferedReader(isr);
                     String line=null;
                     while ( (line = br.readLine()) != null)
                         System.err.println(line);   
                     } catch (IOException ioe)
                         ioe.printStackTrace(); 
    }And the class which executet the Program
    public class SolverProcess {
          * @param args ignored
         public static void main(String[] args){
              try {
                   ObjectInputStream in =new ObjectInputStream(System.in);
                   SolverProcess p=new SolverProcess();
                   p.constraints=(Collection<Constraint>) in.readObject();
                   p.compute();
                   ObjectOutputStream out=new ObjectOutputStream(System.out);
                   out.writeObject(p.solution);
                   out.flush();
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              //System.err.println("solved");
              System.exit(0);
         private Map<String, Object> solution=null;
         private Collection<Constraint> constraints;
           private void compute()
    }

  • Is there any better way for updating table other than this?

    Hi all, I need to update a row in the table that require me to search for it first (the table will have more than hundred thousands of row). Now, I am using a LOV that will return the primary key of the row and put that primary key to DEFAULT_WHERE property in the block and execute query command to fetch the row that need updating. This works fine except that it require 2-query-trip per update (the lov and the execute_query). Is there any better way to doing this? This update is the main objective for my application and I need to use the most effective way to do it since we need to update many records per hour.

    Thanks Rama, I will try your method. Others, how to query row instead of primary key? I thought that querying primary key is faster due to the index?
    BTW, what people do if you need to update a table using Form? I have been using the LOV then execute query since I first developing form. But I am building a bigger database recently that I start worrying about multiple query trip to dbms.
    FYI my table will have up to million rows on it. Each row will be very active (updated) within 1-2 weeks after it creation. After that it will exist for records purposes only (select only). The active rows are probably less than 1% of all the rows.

  • Is there a way that I can see more than just the next slide in Presentation mode (as an old version of PowerPoint used to do)?

    Is there a way that I can see more than just the next slide in Presentation mode (as an old version of PowerPoint used to do)?

    Sorry - should have been more specific. As far as I can see, Keynote will only allow me to see the current slide and the next slide on my laptop when I am presenting a slideshow through a projector. But an old version of PowerPoint allowed me to show the current slide....and (adjustable) many more slides ahead (say 10)....so I could simply jump ahead to a 'future' slide and skip several slides in between. Net result being that I was able to matcgh my slides to group discussions rather than stick to a fixed, predetermined slide show.
    As much as it pains me, without this facility - PowerPoint (old verson, not current one) is more useful for me! :-((

  • Is there a better way to position a flash movie than ap div?

    I'm creating a new website(not yet active) and have a great flash movie for the home page.  I've place it in an ap div and of course it moves to a different position in different browsers. Is there any way I can get it to display correctly, or is there a better way to position the movie? Thanks.

    Of course. The following code is for the home page: 
    "http://www.w3.org/TR/html4/loose.dtd">
    #page-background
    #container
    /* this image stays in internal style sheet*/
    #mainImage{
        background-image: url(images/mainImageBkgrnd.jpg);
        background-position: center top;
        background-repeat: repeat-y;
        width: 875px;
        height: 625px;
        margin: 0 auto;
        padding-left: 0px;
        padding-right: 0px;
        margin-top: 0px;
        position: relative;
    #footer{
        position: absolute;
        top: 700px;
        left: 10px;
    #serviceImage{
        position: absolute;
        top:300px;
        left: 35px;
        z-index: 0;
    #orderImage{
        position: absolute;
        top: 300px;
        right: 20px;
    #flashMovie {
        background-image: url(images/flashPix.png);
        background-position: center top;
        background-repeat: no-repeat;
        width: 700px;
        height: 300px;
        margin: 0 auto;
    .flashText p{
        width: 250px;
        padding-top: 75px;
        font-family: "Arial Narrow";
        font-size: 180%;
        line-height: 1.5em;
        color: #666;
    #vertStripe {
        position: absolute;
        top: 325px;
        left:435px;
    #serviceHeader {
        position: absolute;
        z-index : 50;
    #apDiv1 {
        position:absolute;
        left:607px;
        top:169px;
        width:700px;
        height:298px;
        z-index:2;
    html {overflow-y:hidden;}
    body {overflow-y:auto;}
    #page-background
    #content
    </style>
    <![endif]-->
    <!IE7 and lower stylesheet>
    <!>If this page is not displaying correctly, please update your browser by downloading Internet Explorer 8.<link rel="stylesheet" type="text/css" href="ie7-and-down <link rel="stylesheet" type="text/css" href="ie7-and-down.css" />  <![endif]>
    body
    font-size: 70%;
    text-align: center;
    <!begin flash Movie> 
        <!>>
          <!<![endif]>
            Content on this page requires a newer version of Adobe Flash Player.
    !http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif|height=33|alt=Ge t Adobe Flash player|width=112|src=http://www.adobe.com/images/shared/download_buttons/get_flash_player .gif!</p>
          </div>
          <!>>
        </object>
        <!<![endif]>
      </object>
    </div>
    <!end flash Movie>
    !images/waves2.png|height=100%|alt=Waves|width=100%|src=images/waves2.png!
    !images/banner_nws.gif|height=120|alt=Northwind Safety Corp.|width=875|src=images/banner_nws.gif!
    <!main Navigation menu>
    [About Us | about_us.html]
    [Services | serv_fa.html]
    [Training | train_cpr.html]
    [Products | products.html]
    First Aid
    [AEDs | aed_philips.html]
    <!end main Navigation menu>
    !images/serviceComp.png|height=250|alt=Van Serviceman|width=400|src=images/serviceComp.png!<!end serviceHeader>
    </div><!end serviceImage>
    !images/vertStripe.png|height=150|width=5|src=images/vertStripe.png!
    <!end vertical stripe>
    !images/orderComp.png|height=250|alt=Order Taker|width=380|src=images/orderComp.png!
    <!end orderImage>
    </div><!end mainImage>
    h1. Contact Us
    h1. Careers
    h3. Northwind Safety Corporation
    8425 Rausch Drive
                       Plain City, Ohio 43064
                    phone: 614-873-1000
                    fax: 614-873-1002
    [ [email protected] | mailto:[email protected]]
    <!end footer div>
    </div><!end container div>
    </div><!end body div>
    swfobject.registerObject("FlashID");
    <!end body>
    </html> 
      Thanks  

  • A better way to deal with lost hyperlinks when converting Robohelp to Printed doc?

    I have inherited a 750-page manual that is
    "single-sourced" in RoboHelp X5. When I generate printed
    documentation, all of my hyperlinks and converted to plain text.
    Everytime we release a new version of the manual with any changes,
    we have to re-generate, and then manually go into the MS-Word
    converted document and re-create some 350 hyperlinks and page
    number references. Somebody please tell me that there is a better
    way to do this, or a better tool to manage single-source
    documentation.

    Another post has been raised relating to this problem. See
    http://tinyurl.com/yvpaut
    I am replying here is this is where most of the relevant
    information is.
    You found that using the Style Mapping template solved the
    images problem but the document stopped generating at 450 pages.
    That was sort of what I hoped for. Rather than go to the step I
    will suggest in a moment, I suggested you try something else but
    you never came back to the forum to indicate you had tried it, so
    the assumption is you did and it worked. Patently it did not so
    let's try what I would have suggested next.
    On my website there is a topic on Print Issues and one of the
    them covers Malformed Topics. Try looking for <p
    style="mso-bookmark: as suggested in my earlier reply in this
    thread. You can try RH's Multi file find and replace but FAR from
    http://www.helpware.net/FAR
    may get better results. I think with this error you usually get a
    message. Do you have the Output pane opened and have you read right
    through it for clues? View | Output on the menu. Whether or not the
    Output pane mentions this error, I would search for it anyway.
    Other Points:
    A] It could still be a resource problem. The document is very
    large so, as Harvey mentioned, resources come into it. I know the
    PCs that won't play nicely have good resources but whilst I am no
    expert in this area, don't foget XP is using more of them leaving
    less available to you. It could be an issue but I am inclined
    towards it being something else.
    B] I also suggested a hunt for a rogue topic.
    "What I would try is copying your layout so that you have
    three versions of it. Then delete two thirds from each one. If all
    three work fine, it sort of confirms that size is a problem. If one
    fails, your on the track of the rogue topic."
    Did you try that? Like I said, if all three work fine, then
    we are back with the resource problem but we will have ruled out
    other issues. It should take less than fifteen minutes to set that
    up. Longer to run it but you can be doing something else at that
    point.
    C] On FrameMaker, no real answer but you will soon see
    evidence that Adobe are continuing to better integrate all the
    products we are using. I don't think you will see what you want in
    the upcoming version though.
    NEXT:
    1] Please search for <p style="mso-bookmark:
    2] If that fails, try creating the three layouts.
    3] Then post back how it went. If unsuccessful, tell us if
    the Output pane gave any information about things the process did
    not like.
    Let us know either way as if one succeeds and you post that,
    it helps the next person with the same problem.

  • Must be a better way...

    Hello Flash Community!
    Thanks in advance for any help/advice.
    So, what I'm looking for here is some high level advice as far as a better way to do things. I feel like so often with programming I'm just breaking my neck to get things working when I know there is a better way (presumably based in OOP) to go about things. I just need someone to look at what I've done and point it out to me.
    So, here's what I've done so far: http://www.catherinemix.com
    And it works pretty well as far as I'm concerned! The app dynamically loads as many images as my client (my mom ) puts on the server, resizes them dynamically, adds L/R arrow buttons dynamically based on how many images are involved, etc... But the downside to all that dynamic flexibility is that I haven't found a way to load the thumbnail images (and their respective full size images) one by one. Instead, I have to load them all together and keeping the user waiting that long is unacceptable to my mom. What I would love is for each thumbnail/full size combo to get its own preloader bar in the location it will eventually be embedded, but I haven't found a way to do that and account for an unknown number of images (as it is determined dynamically.)
    Any ideas here? I would specifically like to know which functions y'all use when you need to load multiple files simultaenously (AttachMovie?)
    I have posted the kluge-y code which handles all of the image gallery functions below.
    Thanks! and Be Well
    Graham
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var wait:PleaseWait = new PleaseWait();
    wait.x = 400;
    wait.y = 50;
    addChild(wait);
    var waitFadeIn:Tween = new Tween(wait, "alpha", Regular.easeOut, 0, 1, 1, true);
    var titleText:TextField;
    var textSprite:Sprite;
    //thumbH is the ideal height for our thumbnails, and thumbW the ideal width
    var thumbH = 120;
    var thumbW = 170;
    //loadH is the ideal height for our fullsize images, and loadW the ideal width
    var loadH = 500;
    var loadW = 600;
    //some counter numbers
    var thumbNum = 1;
    var loadNum = 1;
    //some Sprites which need to be accessed by more than one function
    var darkStage:Sprite;
    var loadSprite:Sprite;
    //Let's instantiate some Arrays that we can load the images into.
    //Since Arrays of Loaders can't be copied, we have to go through the process twice.
    var thumbArray:Array = new Array();
    var loadArray:Array = new Array();
    firstLoad();
    firstThumb();
    function firstLoad():void {
        trace("firstLoad");
        var loadski = new Loader();
        loadski.load(new URLRequest("images/fulls/0.png"));
        loadski.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
        loadArray.push(loadski);
    //Starting with the above Loader, this function will execute every time the Loader completes
    function loadComplete(e:Event):void {
        trace("loadComplete");
        var loadski = new Loader();
        loadski.load(new URLRequest("images/fulls/" + loadNum + ".png"));
        loadArray.push(loadski);
        loadski.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
        loadski.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
        loadNum++;
    //Once the Loader goes too far by attempting to load an image that doesn't exist on the computer,
    //it will thorw an IOError Event at which point the following function will execute.
    function loadError(e:IOErrorEvent):void {
        trace("loadError");
        loadArray.pop();
        loadNum = 0;
        loadResize();
        //We use the pop function to remove the most recently added Loader instance, since we know it
        //contains a null reference (beacuse the IOError Event is asynchronous.)
        thumbArray.pop();
        //We reset the counter variable.
        thumbNum = 0;
        //Add the little arrows that allow the user to click to see more thumbnails (if there are more
        //than 8 images on the server.)
        removeChild(wait);
        addArrows();
        //Let's resize the images to thumbnail size and add them to the display list.
        thumbResize();
        addClickOnThumb();
    function loadResize():void {
        trace("loadResize");
        for (var ex = 0; ex < loadArray.length; ex++) {
            //If the width of the image is greater than the ideal width, OR the height is greater than the ideal height...
            if ( loadArray[loadNum].content.width > loadW || loadArray[loadNum].content.height > loadH) {
                //And if the width of the image is greater than the height, apply Scaler 1...
                if ( loadArray[loadNum].content.width > loadArray[loadNum].content.height ) {
                    //Scaler 1 is the ratio of the ideal width to the image width
                    var scaler1 = loadW / loadArray[loadNum].content.width;
                    trace(loadNum + " load scaler 1: " + scaler1);
                    //Apply Scaler 1 to both the width and height of the image
                    loadArray[loadNum].content.scaleX = loadArray[loadNum].content.scaleY = scaler1;
                    //Otherwise, apply Scaler 2
                } else {
                    //Scaler 2 is the ratio of the ideal width to the image height
                    var scaler2 = loadH / loadArray[loadNum].content.height;
                    trace(loadNum + " load scaler 2: " + scaler2);
                    //Apply Scaler 2 to both the width and height of the image
                    loadArray[loadNum].content.scaleX = loadArray[loadNum].content.scaleY = scaler2;
                    trace("loadArray[loadNum].content.height = " + loadArray[loadNum].content.height);
                    trace("loadArray[loadNum].content.width = " + loadArray[loadNum].content.width);
                //Otherwise... (that is, the image width and height are in both cases less than the ideal)
            } else {
                //And if the width of the image is greater than the heigh, apply Scaler 3
                if ( loadArray[loadNum].content.width > loadArray[loadNum].content.height ) {
                    //Scaler 3 is the ratio of the ideal width to the image width
                    var scaler3 = loadW / loadArray[loadNum].content.width;
                    trace(loadNum + " load scaler 3: " + scaler3);
                    //Apply Scaler 3 to both the width and height of the image
                    loadArray[loadNum].content.scaleX = loadArray[loadNum].content.scaleY = scaler3;
                } else {
                    //Scaler 4 is the ratio of the ideal width to the image height
                    var scaler4 = loadH / loadArray[loadNum].content.height;
                    trace(loadNum + " load scaler 4: " + scaler4);
                    //Apply Scaler 4 to both the width and height of the image
                    loadArray[loadNum].content.scaleX = loadArray[loadNum].content.scaleY = scaler4;
            loadArray[loadNum].content.x = - (loadArray[loadNum].content.width / 2);
            loadArray[loadNum].content.y = - (loadArray[loadNum].content.height / 2);
            loadNum++;
    function firstThumb():void {
        trace("firstThumb");
        //Let's populate the first Array with Loaders that load the images Mom has put on the server.
        //We have to do this first Loader object by hand to get the Event.COMPLETE-based-loop going.
        var thumbski = new Loader();
        thumbski.load(new URLRequest("images/thumbs/0.png"));
        thumbski.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbComplete);
        //We add the MouseEvent.CLICK listener to the actual Loader instance so that, later on, in the
        //function enLarge, we can make use of the currentTarget parameter to correlate the Array index of
        //the thumbnail that the user is clicking on with that of the loadArray.
        thumbski.addEventListener(MouseEvent.CLICK, enLarge);
        thumbArray.push(thumbski);
    //Starting with the above Loader, this function will execute every time the Loader completes
    function thumbComplete(event:Event):void {
        trace("thumbComplete");
        var thumbski = new Loader();
        thumbski.load(new URLRequest("images/thumbs/" + thumbNum + ".png"));
        thumbski.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbComplete);
        //We add the IOErrorEvent listener so that as soon as this error is thrown, we will exit this loop
        //and proceed to the next logical step in the program can be taken.
        thumbski.addEventListener(MouseEvent.CLICK, enLarge);
        thumbArray.push(thumbski);
        thumbNum++;
    function addArrows():void {
        //Let's determine how many batches there are. A batch is the minimum amount of thumbnail images
        //mom wants to show up onscreen at a time. In this case, she has decided on 8.
        var batches =  Math.ceil(thumbArray.length / 8);
        //The variable m is part of a kluge fix related to the calculation of startX (explained below.)
        var m = 0;
        //Pseudocode for this loop: If there are at least two batches, then...
        //We do this because less than 2 batches doesn't warrant arrows
        if (batches > 1) {
            for (var k = 1; k < batches; k++) {
                //triW is the desired width of our arrows
                var triW = 20;
                //startX is the x position of the start of our rightward facing triangle(s)
                //The formula says: Our x starting position should be a triangle width shy of the
                //far edge of the stage (multiplying it by k ensures it happens as many times
                //as there are batches, which is why we intialize k = 1.) Every subsequent iteration
                //of the formula has to add a triangle's width worth of distance, except for the
                //very first one, which is why it is multiplied by m, which is initially set to 0.
                var startX = (((stage.stageWidth - triW) * k) + (triW * m));
                //We want the arrows to sit perfectly between the two rows of thumbnails. Since the
                //max height of every thumbnail is thumbW, that would seem to be the natural choice
                //for the starting y position of the arrows. But, we actually have to use thumbW/2
                //because the thumbnails have already been offset by half of thumbW due to being
                //aligned vertically with each other.
                var startY = (thumbW / 2);
                //This is the rightward facing triangle
                var tri:Sprite = new Sprite();
                tri.graphics.beginFill(0xFFFFFF);
                tri.graphics.moveTo(startX, startY);
                tri.graphics.lineTo(startX, (startY + triW));
                tri.graphics.lineTo((startX + triW), (startY + (triW/2)));
                tri.graphics.lineTo(startX, startY);
                tri.graphics.endFill();
                tri.buttonMode = true;
                tri.useHandCursor = true;
                tri.addEventListener(MouseEvent.CLICK, moveLeft);
                addChild(tri);
                //This is the leftward facing triangle
                var tri2:Sprite = new Sprite();
                var startX2 = (startX + (triW * 2));
                tri2.graphics.beginFill(0xFFFFFF);
                tri2.graphics.moveTo(startX2, startY);
                tri2.graphics.lineTo(startX2, (startY + triW));
                tri2.graphics.lineTo((startX2 - triW), (startY + (triW / 2)));
                tri2.graphics.lineTo(startX2, startY);
                tri2.graphics.endFill();
                tri2.buttonMode = true;
                tri2.useHandCursor = true;
                tri2.addEventListener(MouseEvent.CLICK, moveRight);
                addChild(tri2);
                //Increase m (see above)
                m++;
    //This function moves the entire Gallery MovieClip to the left 800 pixels.
    function moveLeft(event:MouseEvent):void {
        var leftTween:Tween = new Tween(this, "x", Regular.easeOut, this.x, (this.x - 800), .5, true);
    //This function moves the entire Gallery MovieClip to the right 800 pixels.
    function moveRight(event:MouseEvent):void {
        var rightTween:Tween = new Tween(this, "x", Regular.easeOut, this.x, (this.x + 800), .5, true);
    //This function resizes the loaded images to the desired thumbnail dimensions and adds them
    //to the display list.
    function thumbResize():void {
        //The highest level of organization of thumbnails is the batch. There are only as many batches
        //as the length of the thumbArray divided by 8 (the max amount of thumbnails in a batch, as determined
        //by mom.)
        for (var batch = 0; batch < Math.ceil(thumbArray.length / 8); batch++) {
            trace("batch " + batch);
            //This Sprite serves as the container that we use to position entire batches
            var batchSprite: Sprite = new Sprite();
            //The logic behind setting the x position of the batchSprite to 800 x batch should be self-evident --
            //we want each new batch to be 800 pixels to the right of the former one -- but the addition of (thumbW
            //divided by 1.5) is a kluge fix for how much space to give the batches on left margin.
            batchSprite.x = (thumbW / 1.5) + (batch * 800);
            addChild(batchSprite);
            //The second highest level of organization for our thumbnails is the row. Our grid of thumbnails is
            //two rows deep.
            for (var row = 0; row < 2; row++) {
                trace("     row " + row);
                //The third highest level of organization for our thumbnails is the column. Our grid of thumbnails is
                //four columns deep.
                for (var col = 0; col < 4; col++) {
                    trace("          col " + col);
                    trace("               thumb " + thumbNum);
                    if (thumbNum < thumbArray.length) {
                        //The following is the logic structure for handling the resizing of images. The goal was to develop
                        //a system robust enough to allow my mom to put whatever size images she wanted on the server and the
                        //app would use them. The logic is explained at each step...
                        //If the width of the image is greater than the ideal width, OR the height is greater than the ideal height...
                        if ( thumbArray[thumbNum].content.width > thumbW || thumbArray[thumbNum].content.height > thumbH) {
                            //And if the width of the image is greater than the height, apply Scaler 1...
                            if ( thumbArray[thumbNum].content.width > thumbArray[thumbNum].content.height ) {
                                //Scaler 1 is the ratio of the ideal width to the image width
                                var scaler1 = thumbW / thumbArray[thumbNum].content.width;
                                trace("               scaler1 = " + scaler1);
                                //Apply Scaler 1 to both the width and height of the image
                                thumbArray[thumbNum].content.scaleX = thumbArray[thumbNum].content.scaleY = scaler1;
                                trace("               image width:" + thumbArray[thumbNum].content.width);
                                trace("               image height:" + thumbArray[thumbNum].content.height);
                                //Otherwise, apply Scaler 2
                            } else {
                                //Scaler 2 is the ratio of the ideal width to the image height
                                var scaler2 = thumbW / thumbArray[thumbNum].content.height;
                                trace("               scaler2 = " + scaler2);
                                //Apply Scaler 2 to both the width and height of the image
                                thumbArray[thumbNum].content.scaleX = thumbArray[thumbNum].content.scaleY = scaler2;
                                trace("               image width:" + thumbArray[thumbNum].content.width);
                                trace("               image height:" + thumbArray[thumbNum].content.height);
                            //Otherwise... (that is, the image width and height are in both cases less than the ideal)
                        } else {
                            //And if the width of the image is greater than the heigh, apply Scaler 3
                            if ( thumbArray[thumbNum].content.width > thumbArray[thumbNum].content.height ) {
                                //Scaler 3 is the ratio of the ideal width to the image width
                                var scaler3 = thumbW / thumbArray[thumbNum].content.width;
                                trace("               scaler3 = " + scaler3);
                                //Apply Scaler 3 to both the width and height of the image
                                thumbArray[thumbNum].content.scaleX = thumbArray[thumbNum].content.scaleY = scaler3;
                                trace("               image width:" + thumbArray[thumbNum].content.width);
                                trace("               image height:" + thumbArray[thumbNum].content.height);
                            } else {
                                //Scaler 4 is the ratio of the ideal width to the image height
                                var scaler4 = thumbW / thumbArray[thumbNum].content.height;
                                trace("               scaler4 = " + scaler4);
                                //Apply Scaler 4 to both the width and height of the image
                                thumbArray[thumbNum].content.scaleX = thumbArray[thumbNum].content.scaleY = scaler4;
                                trace("               image width:" + thumbArray[thumbNum].content.width);
                                trace("               image height:" + thumbArray[thumbNum].content.height);
                        //Here is where we center the images vertically...
                        thumbArray[thumbNum].content.x = - (thumbArray[thumbNum].content.width / 2);
                        //Here is where we center the images horizontally...
                        thumbArray[thumbNum].content.y = - (thumbArray[thumbNum].content.height / 2);
                        //Before placing them in their own container Sprite, so that their relative positions can be
                        //determined accurately (a task that would've been otherwise impossible after the
                        //adjustments to position made above.)
                        var thumby = new MovieClip();
                        thumby.addChild(thumbArray[thumbNum]);
                        //thumbW being the max possible length or width of any one thumbnail (this was done for visual
                        //consistency and codified in the logic tree above), placing two thumbnails thumbW
                        //apart (measuring from center point in either case) will put them edge to edge at best. This is why
                        //we add (thumbW / 8) as additional spacing.
                        thumby.y = (row * (thumbW + (thumbW / 8)));
                        thumby.x = (col * (thumbW + (thumbW / 8)));
                        thumby.buttonMode = true;
                        thumby.useHandCursor = true;
                        var fA:Array = new Array();
                        var dS:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 0.33, 5, 5, 1, 1);
                        fA.push(dS);
                        thumby.filters = fA;
                        trace("thumby.width = " + thumby.width);
                        trace("thumby.height = " + thumby.height);
                        batchSprite.addChild(thumby);
                        thumbNum++;
    function enLarge(event:MouseEvent):void {
        var indexNum:Number = new Number();
        indexNum = thumbArray.indexOf(event.currentTarget);
        trace("indexNum = " + indexNum);
        darkStage = new Sprite();
        darkStage.graphics.beginFill(0x333333, .9);
        darkStage.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
        darkStage.addEventListener(MouseEvent.CLICK, reMove);
        darkStage.buttonMode = true;
        darkStage.useHandCursor = true;
        (parent  as  MovieClip).addChild(darkStage);
        loadSprite = new Sprite();
        loadSprite.addChild(loadArray[indexNum]);
        loadSprite.x = (stage.stageWidth / 2);
        loadSprite.y = (stage.stageHeight / 2);
        loadSprite.addEventListener(MouseEvent.CLICK, reMove);
        loadSprite.buttonMode = true;
        loadSprite.useHandCursor = true;
        loadSprite.mouseEnabled = false;
        (parent  as  MovieClip).addChild(loadSprite);
        var urlRequest:URLRequest = new URLRequest("xmls/" + indexNum + ".xml");
        var titleURL:URLLoader = new URLLoader();
        titleURL.addEventListener(Event.COMPLETE, completeListener);
        titleURL.load(urlRequest);
        function completeListener(event:Event):void {
            titleText = new TextField();
            titleText.autoSize = TextFieldAutoSize.LEFT;
            var myFont:Font = new BOF();
            var ttFormat:TextFormat = new TextFormat();
            ttFormat.color = 0xFFFFFF;
            ttFormat.size = 18;
            ttFormat.font = myFont.fontName;
            textSprite = new Sprite();
            textSprite.addChild(titleText);
            (parent  as  MovieClip).addChild(textSprite);
            var titleXML:XML = new XML(titleURL.data);
            titleText.text = titleXML.toXMLString();
            titleText.setTextFormat(ttFormat);
            titleText.embedFonts = true;
            textSprite.y = 570;
            textSprite.x = ((stage.stageWidth / 2) - (titleText.textWidth / 2));
            textSprite.mouseEnabled = false;
            titleText.mouseEnabled = false;
    function reMove(event:MouseEvent):void {
        (parent  as  MovieClip).removeChild(textSprite);
        (parent  as  MovieClip).removeChild(loadSprite);
        (parent  as  MovieClip).removeChild(darkStage);
    function addClickOnThumb():void {
        var cot:ClickOnThumbnail = new ClickOnThumbnail();
        cot.x = 400;
        cot.y = 583;
        (parent  as  MovieClip).addChild(cot);

    Hey Jim
    Wow, that's great; thanks! Can I ask what settings you used to get the files so small?
    Yes, I am familiar with Photoshop and image optimization issues, but I didn't realize that PNG was so much bigger than JPG and that I had so much file size I could shed before I would notice a degradation in image quality. Your advice will certainly help greatly, and I will certainly apply it to the thumbs as well. I think my mom will be very pleased.  : )
    I look forward to hearing what collection of settings you used.
    Thanks and Be Well
    Graham

  • Is there a better way to deal with Verizon and my DSL issues?

    My family and I have been with Verizon for as long as we've had broadband internet. For the past 5 years or so the internet has been shaky at best. For the most part it works, but a coupe times a year it stops working all together or becomes VERY intermittent (and is usually working by the time I get finished sitting on hold and the test the technician runs shows no problems). Every time I have to wrestle with the "tech support" on the phone and listen to a recording tell me the same things over and over again that never fix my problems.
    Every time my internet gets to this point, it requires a visit from a Verizon technician. Usually they go out into the neighborhood and find a length of cable and replace it. Usually that fixes my issues for a while, but I know it will happen again. It always happens again.  It seems to me that the entire length of line that my internet runs through is old, and needs to be replaced. Instead of fixing the problem before it actually becomes a problem, Verizon continues to leave me and my family without service for periods of time.
    Last week was the most recent time we dealt with this situation, which was fortunately short lived (Only all day Sunday, into Monday when the technician arrived). It's getting VERY tiring dealing with this situation over and over again, and it's getting offensive honestly. To hear the tech support person tell me that I will be charged $91 if the problem is found and is inside my house is ridiculous. I would understand if this was the first time this situation had occurred, or if I frequently reported non-issues. But no, I'm simply reporting the same issue that Verizon has failed to fix MANY times before. 
    Perhaps the most frustrating part of this, is that we've never been compensated for our lost service. Last year we lost service for an entire week. That's an entire week with no internet service at all. After we finally got it back, we spoke with the billing department and they told us that we would be credited for the week we lost service. At this point, we are yet to see any credit for the time we have been without the service we pay for. Perhaps we would have tried dealing with Verizon again to get our weeks credit, but attempting to contact someone in Verizon seems futile. Unless you're calling sales you end up sitting on hold for extended periods of time, only to be bounced from person to person until you get to someone that has no excuse not to pretend to help you. 
    Unless something changes, this is Verizon's last opportunity to keep our service. We have dealt with the loss of service followed by the insult of attempting to deal with Verizon's customer support for the last time. Next time it happens (and I'm sure there will be a next time) unless Verizon shows us that they are actually going to correct the problem, we will cancel our service and give our business to the competitor. This post is being written for a few reasons. I'm hoping that perhaps Verizon can give me a better way to contact someone locally when we have a problem (I would LOVE to speak with a regional manager, or even a local manager of some sort), or at least recognize that there is a problem that will end up costing them money. 
    Thank you,
    A long time customer.

    I've decided to give up the fight and go to another provider.  I have work to do and having to wait at speeds slower than dial up is insane.  At least with dial up I'd have some stability.  I can't even run speedtest because it won't connect.  At hotels, wi-fi, and hanging by blackberry the laptop works fine but to actually use dsl, nope.  Multiple machines and multiple browsers - it's all the same worthless bandwidth.  
    If they won't give you fios then there is no reason to stay.  They've been promising me the service is coming for the last 6 years.  They could have run it here by now for the postage they've spent trying to get me to switch to it even though it isn't available.  Waste, waste, waste ....

  • Is There a Better Way to Work in the Marker List Window?

    Is there a better way to sequentially listen to phrases one-by-one in the Marker List window? What I'm doing is Auto-Marking one single long file to break out 271 bits and save each as their own file. It's WAY faster than copying and pasting bits into new files and "saving as" 217 times.
    BUT, after Auto-Marking, I have 300-400 phrases to listen to, deleting the non-keepers as I go, until I'm left with my "keeper" 271 marked phrases. But it's so tedious to move from phrase-to-phase. I have to double-click each one before I can hear it (you can move the cursor with the down-arrow, but it won't actually select the audio). So I have to use the mouse (unless I'm missing something) and double-click each of the hundreds of phrases. Then whenever I delete one (which I'll have to do about a hundred times or more to get rid of bad takes, alternates, etc.), inexplicably the cursor jumps way up the list so you have to scroll back down dozens of files to get to where you were. It took me 35 minutes to do it this last time.
    Contrast that with Reaper's audition/preview functionality (which, ironically, AA has also, but only for files already saved into a folder). Once I had all the files saved into a folder, I QC'd all 217 files in Reaper and MAN what a difference! All I had to do was use the "down" arrow to advance to the next file AND have it play automatically (Audition can do the same thing with the "Open File" feature). It literally took me 5 minutes to check all 217 files that way. If AA could add that kind of functionality to the Marker List window, or if I'm just completely missing something (very possible) I would REALLY be happy.
    Any ideas?
    Thanks again! Happy New Years again!
    Ken

    Wild Duck,
    That doesn't quite do what I need. My end-product is 271 (used to be 116) separate files created from one large file. That large one is made up of WAY more than 271 (the VO actor records different versions of some commands, makes mistakes, etc.).
    So I need the ability to listen to each marker, and then be able to delete it if need be.
    The Playlist makes this impossible in two ways. It only has 2 options for hearing each marker, and neither option allows me to delete that marker after I've heard it. It either plays them all back-to-back without stopping, or it plays each as you click the "Move Down" button. That last one would be great if showed me which marker was playing! But it doesn't, so there is no way for me to know which marker number I just heard, nor can I delete that marker after I hear it.
    Sigh.
    Thanks for the tip though:).
    Ken

Maybe you are looking for

  • How to fade the Audio in the newest version of Adobe Premiere CC

    Since the newest update I have no Idea how to fade the Audio without keyframes. In Previous Versions i could click the little arrow to set some Points to fade the audio. Can somebody explain me how to do it with the newest version. TY and cheers.

  • How to setup Lotus Traveler on E72?

    Hi everybody,just bought e72 few day ago.i like this phone very much. one question How to setup Lotus Traveler on E72? i want to setup lotus notes on e72 how to go about it.Please advice step by step.thank.

  • 3D Fountain trail to avoid the Cursor

    Hello! I just started doing somethings with 3D,I would like to know how can make the trail of the fountain that can be generated with the code I'm going to show can avoid the cursor. on beginSprite me sprite(me.spriteNum).member.resetWorld() -- creat

  • How can I add a 'Virtual 7354' device?

    We are looking to purchase a PCI-7354 and I noticed that after installing the latest NI-Motion 8.3 that there is no option to add a Virtual 7354 device.  The only options I see are: 7344, 7334, 7358 and 7390.  Can I safely choose the 7358 and integra

  • Iphone stopped working, and Im in the middle of the jungle. Help!

    I'm in the middle of the jungle in Siem Reap, Cambodia and my iphone 3GS 32g just suddenly stopped working. I had been using it all day to take photos, and it suddenly went black and wont turn on. I havent dropped, or damaged it in anyway. It doesn't