Why does order matter?

Why is it that if say a deriv is dealt with followed by another deriv the second is missed? why is the order of the term important for this code to work?
public void removeIdenticalTerms(String [][] goldStandard, String [][] testModel, int numRows, int goldRows, int columns)
         * Compare all terms in the goldStandard with those in testModel,
         * if any are found remove them and shuffleUp
         * This should also remove any deriv operators
         * Then call the next method
         int difference=0;
         for(int i=0; i<goldRows; i++)
             for(int k=0; k<numRows; k++)
                if(goldStandard[0].equals(testModel[k][0]))
//The predicates match so compare the variables
if((goldStandard[i][0].equals("deriv"))||(goldStandard[i][0].equals("m_plus"))||(goldStandard[i][0].equals("minus")))
if((goldStandard[i][1].equals(testModel[k][1]))&&(goldStandard[i][2].equals(testModel[k][2])))
System.out.println("\nA " + goldStandard[i][0] + " has been removed");
//Remove and shuffle up
for(int h=0; h<columns; h++)
goldStandard[i][h] = null;
testModel[k][h]=null;
shuffleUp(goldStandard, i, goldRows, columns);
goldRows--;
shuffleUp(testModel, k, numRows, columns);
numRows--;
else if(goldStandard[i][0].equals("add"))
if((goldStandard[i][1].equals(testModel[k][1]))&&(goldStandard[i][2].equals(testModel[k][2]))&&(goldStandard[i][3].equals(testModel[k][3])))
System.out.println("\nAn " + goldStandard[i][0] + " has been removed");
//Remove and shuffle up
for(int h=0; h<columns; h++)
goldStandard[i][h] = null;
testModel[k][h]=null;
shuffleUp(goldStandard, i, goldRows, columns);
goldRows--;
shuffleUp(testModel, k, numRows, columns);
numRows--;
System.out.println("\nTest Model\n");
for(int g=0; g<numRows; g++)
for(int m=0; m<columns; m++)
if(!(testModel[g][m]== null))
System.out.println(testModel[g][m]);
System.out.println("\nGold Standard\n");
for(int g=0; g<goldRows; g++)
for(int m=0; m<columns; m++)
if(!(goldStandard[g][m]==null))
System.out.println(goldStandard[g][m]);
countOperators(goldStandard, testModel, numRows, goldRows, columns);

Well, here is another instance where I would use collections
(LinkedList or ArrayList).
But if you have to use arrays...
Well, I guess instead of removing all the ones you want to remove
and shuffling them all up, you could store the indeces that you find
then after collecting them all, run the remove and shuffle up for each
index found.
int[] removeThese = new int[goldRows]; //Maybe need to remove all rows!
int currentPlace = 0;
for (int i = //...) {
  for (int k = //...) {
    if (goldRows[ i ][ 0 ].equals(//...)//...) {
      removeThese[currentPlace++] = i;
      //Dont remove or shuffle yet
for (int r = 0; r <= currenPlace; r++) {
  remove(goldRow, removeThese[r], //...);
  shuffleUp(goldRow, removeThese[r], //...);
}As psuedo code...

Similar Messages

  • Why does ppi matter for web images?

    Hello
    When placing an image in my (web/pixel) project the resolution is dependent from the set ppi.
    When I create a new document for web, then logically only the pixels matter. Nonetheless there's a ppi field, why? And depending what value it has, placed pictures (file > place or drag&drop from Windows' explorer) get resized instead of the wanted 1:1 resolution.
    1 pixel should remain 1 pixel when working with in pixels.
    Try it out:
    Create a new document with Full HD resolution (1920x1080 pixels), set ppi to 10.
    Import a Full HD picture (Blu-Ray screenshot whatever) and it's mini-sized.
    My screen resolution is 59 ppi (I use my 39" TV as monitor) and this is set in the Photoshop preferences (in case I do some print stuff that I get a 1:1 view if wanted). If there was any logic behind the pixel-ppi-placing thing, then this set standard monitor ppi should bring me a 100% sized picture... but it doesn't. Only when the ppi is set to the fantasy value of 72 I get a 100% sized placing.
    This can be disturbing and is very annoying when starting a new project by opening an image that does not come with 72 ppi by default (my Canon camera makes 180 ppi JPEG photos)  and placing new pictures in this project. They get opened in wrong sizes, in my case largely upscaled, with no way to correct it but guess-scaling it down.
    Bug?
    Pls pls fix it.
    Ppi has nothing lost in pixels-only projects.
    The only way that works is to open all single images in Photoshop as tabs, and then drag&drop from within Ps. -.-
    Regards
    Mopsi
    Example screenshot: http://www.m-i-u.de/images-i83580bxvogj.jpg
    The yellow framed layer is a image from my camera, opened in Photoshop CS6 extended. 3264x2448 pixels (180 ppi).
    The green framed layer is a screenshot from a movie, drag&drop from the explorer. 1920x1080 (normally) unwanted upscaled here.
    The red framed layer is a screensot as well, but drag&dropped from a tab within Photoshop. It remains in its original resolution of 1920x1080.

    I'm wrong and your right. I just did some testing and Photoshop does indeed interpolate the lower resolution 600x400 72DPI image is  up size to match the higher resolution document document size during the place process. I just assumed Photoshop would preserve image quality and not interpolate the image.    As you have shown it does interpolate the image which greatly lowers the image quality of re-sized low resolution image.
    This shows you should not use Photoshop to merge images into a composite if they have greatly different resolutions.  I don't have a problem there for I never use "save for web" to save images to be displayed on displays from the web or my machine.  I use Fit Image and save as, or a Image Processor script that uses Fit Image to re-size and uses save as.  The leave all my images files resolution setting unchanged.   For some reason Save for Web changes all jpeg files it saves resolution  setting to 72 DPI even if they are 8MP images for high resolution displays..
    During testing I also tried using Photoshop's script Load Files into Stack instead of using Place.  That script works the way I assumed Photoshop Place would work.  Images layer are not interpolated they remain the correct number of pixels and the image quality is not is not changed.. The image layer are normal layers but can be converted to smart object layers however the object would be normal layer not an image file.
    When you use Place you get
    It also possible to undo Photoshop's Place scaling with a simple calculation.  Divide the image layer's original dpi by the document's dpi here there are three layer that did not start at 300dpi. two started out as 74dpi image file the other a 500dpi image file.  72/300=.24 = 24% the other 500/300=1.66666 = 166.66%
    all you need do is change the associated layer's image transform width and height scale from 100% to the calculated percents
    The only time I set document to 72DPI resolution is in Photoshop Scripts so I can calculate a font size  for a charter sting so it will fit the canvas size.  Photoshop Text Tools seem to be tied to 72DPI resolution.  Once I add the text layer I restore the document DPI resolution back to its original setting.
    So when it comes to Photoshop all files use in a project should have identical DPI resolution for best result when making composites.    My image files are either RAW files which have no DPI for they are not RGB image files. Or RGB Image files that have a high DPI resolution. I process images for print. Image files DPI resolution is meaningless when if comes to Display Screens.  All that matters is the number of pixels a display can display and the number of pixels in the image. Even images I re-size for display screens DPI are high for I do not use "Save for Web". I see no good reason to strip metadata and change resolution to 72DPI.  I tend not to interpolate image except the ones I save to be displayed on a display.  I change Print size by changing the DPI setting without resample.  My Epson 4800 inkjet printer has no problem printing high resolution pixel I see no reason resample my camera 16MP image down in size just to print at 300dpi.  If I want to a single 6"x4" print I see nothing wrong printing it at 816DPI.  My eyes can not resolve down there the printer can.  However when Printing on Roll Paper many 6"x4"  the composite document I create via a script has a 300DPI resolution and the image layers are resized to be 6" x 4".

  • Why does that matter

    That suck y'all should make one for the iPod touch 4g I'm a user of the iPod touch 4g and i can not afford to be buy another iPod just because an other iOS came out it would be expensive and iPod touch 4 is like having a iPhone 4 and it make me disappointed that i can get access to iOS 7  if there anything y'all can do about it is make a iOS that could support our devices  one that does no take that much RAM
    Please think about it

    Expanding on what lllaass said, if Apple were to strip out enough of the features from iOS 7 to get it to work properly on the fourth-gen iPhone, then all you'd basically have is iOS 6 with the new backgrounds and icons. Not worth it, since the look of iOS 7 is what garners the most complaints.
    If you want to run iOS 7, you need a fifth-generation iPod touch. There's no way around that at this time, and it's highly unlikely it will change. If Apple felt they could run iOS 7 on a fourth-gen iPod touch, they'd have released it for that device when they released iOS 7.
    Regards.

  • Why does order of apps and folders change when downloading new apps?

    Since I've downloaded iOS 6 on my iPhone 4s, whenever I download a new app, it goes at the beginning of page 2 on my desktop which of course changes the order of all the apps and folders. It didn't do this with iOS 5. It is a real pain. Is there some way to change it back to the way it used to be on iOS 5?
    Thank you.

    I think that I did that.  I checked the arrow to point up on the numerical listing of the tracks.  When I "burn" the CD, it shows them being written in order, but when the entire thing is completed and I go to the actual CD, they are all out of order.

  • Why does order of playlist changed when burning CD?

    I made a playlist from songs imported from different cd's to burn a mixed cd. i changed the order of the songs in the playlist the way i wanted them on the cd & even changed each songs number in the info box. still once the cd is burned the songs are in a different order. i must have missed something basic but i cant figure out what. help!!

    Are you burning within iTunes? Using Burn Playlist to Disc? That's the only I burn from my library, and my playlists always stay in the order I've placed them in.
    If you're burning through Finder, it may be burning them in alpha order.

  • Why does my ipod list songs in not the right order

    why does my ipod choose to mix the playing order of an album. no matter how many times i remove it from my ipod, when i put the album back on, it is played in a jumbled up order. i have asked itunes but they are ignoring me.

    It's likely that your iPod's headphone jack needs replacing.  You can opt to have Apple fix it for a pretty hefty price or you can look for a 3rd party repair company to do it instead.
    Either way, it might not be a bad idea to bring it into your local Apple store to see if there is anything they can do for you.
    B-rock

  • When I sync my ipod to add new material, sometimes itunes will automatically rearrange the song order of my pre-existing albums by number of plays. Why does it do this? And is there a way to stop it?

    When I add an album to itunes and subsequently to my ipod, everything is arranged by track number of the album. Sometimes when I sync in order to add new material to my ipod, itunes for some reason automatically rearranges some of my pre-existing material by songs with the greatest number of plays to least (though sometimes it seems to be completely random). When I check itunes on my computer, everything still appears to be in order but the way it appears on the device often is in the previously mentioned disorder. Why does it do this? Is there any setting that I can adjust to make it stop because the only way I've found so far is to delete the rearranged material and re-import the cd and then re-sync. It might sound picky, but I prefer that my music be in order by track number as the artists themselves intended for various reasons the foremost being that I often listen to whole albums from start to finish and this glitch makes such problematic. I have found some settings in preferences that focus on how material is arranged but this seemed to be focused on the actual folders where the music is located on my hard drive and not the way it appears on the ipod. If anyone knows the reason it does this or has suggestions on fixing it, I would be greatly appreciative. Thanks.

    Did the original songs that do not appear on the car player play in the Music app on the iPod? Sometimes glitches happen and they do not. Also, If y ohave a 5G iPod/iOS 7, purchase songs  will show with an cloud icon by them if they are not downloaded if Shall All is turned on in Settings>iTunes and App Store

  • WHY does the finder insist on rearranging the files in a folder in alphabetical order even when I have selected "none" in the preferences for file organization?

    WHY does the finder insist on rearranging the files and/or documents in a folder in alphabetical order even when I have selected "none" in the preferences for file organization? Even after I numbered the documents/folders to keep them in my preferred order, it will still displace them occasionally. This is becoming increasingly frustrating!
    Is this a "Pages" issue or "FInder"? The vast majority of documents I use are in Pages, but there are also Numbers, PDFs, jpegs and a few other applications involved. This never happened before I upgraded to Mountain Lion; in Tiger, the documents (mostly Appleworks) and files stayed where I wanted them to be.
    I am visually oriented, and prefer to arrange items in a folder in an order that makes them easier for me to access, which is often NOT alphabetical.
    Can anyone suggest a solution? Please??
    Thank you.
    Sara

    nbar,
    Thank you for your reply.
    However, I do not understand what you mean by "user account." I am the only user, and can find no options for "user" or "guest." The parental controls have always been off, as there are no other people who have access to my computer.
    Frank,
    Thank you for your reply.
    All my documents, files and folders are in icon view, Arranged By: none in both view and view options. This arbitrary rearranging does not happen all the time, only when I make a substantial change to one of the documents in the file or folder. I'm not sure what you mean by "column heading."
    MichaelLAX,
    Thank you for your reply.
    I know, to my sorrow, that Appleworks does not work with Mountain Lion. I spent at least three months converting approximately 2,000 Appleworks documents to Pages, Numbers, Bento (for databases) and Touchdraw (for drawings). So this is not the problem; but as I said, I did not have this rearranging problem with Appleworks - the icons stayed where I wanted them to be. I still miss the ease and reliability of Appleworks, darn it!
    Frank,
    Thank you for your second reply.
    I do have the Sort By: in view options as well as in view set to "none."   The finder still insists on rearranging, but only when I have made a substantial change to a document in that file or folder.
    Any futher thoughts?
    xdab, 
    Thank you for your reply.
    "Are you are using icon view, but for some reason the finder moves files around? is that the problem?"
    YES!! This is exactly the problem.
    "If this operation is successful then erase the original and rename the new one to the name originally chosen by the user."
    This seems like a lot of trouble, especially as I often work on several documents at the same time.
    "By the way, the finder has a "clean up by" menu that rearranges icons in one of the standard orders, there are shortcuts that produce the same effect, for example <option><cmd>1 sorts them by name. Is it possible that this shortcut was typed by mistake without you noticing?"
    I do know about this "clean up by" option, and avoid it like the plague! So I doubt this is the issue, and I infrequently use keyboard shortcuts like this anyway.
    Thanks all who replied. None of the suggestions seem to work, however. Any others out there?
    Regards,
    Sara

  • Why does my screen turn blue and freeze every time i try to plug in my 'mini display to hdmi' cable into my thunderbolt port in order to use an external monitor?

    why does my screen turn blue and freeze every time i try to plug in my 'mini display to hdmi' cable into my thunderbolt port in order to use an external monitor? it only works if i turn the computer on with it already plugged in.

    Do you have gfxCardStatus installed?  Is your monitor set to "Integrated" or "Discrete".  You want it set to Discrete to drive the external HDMI display.
    Try resetting the PRAM and SMC
    <About NVRAM and PRAM>
    <Intel-based Macs: Resetting the System Management Controller (SMC)>
    Are you sure you have a good miniDisplayPort to HDMI cable?
    Do you have another HDMI display you can test against (your neighbor's HDMI capable TV).
    Do you have friend that can test the cable using their Mac and maybe their TV or a monitor that has HDMI input.

  • Capture Sharpening & Lens Corrections- Does the order matter?

    Okay, I think I understand the concept that all of the changes made in Lightroom are metadata edits, and so it does not matter what order you make changes to your image. So using the lightroom controls for sharpening and lens corrections (chromatic aberration, etc.) is just fine.
    But what if you are doing your capture sharpening outside of lightroom, say using photokit sharpener in photoshop?
    Does the use of the lens correction tools in lightroom negatively affect the capture sharpening done later in photoshop? Ideally I'd like to do all of the possible image adjustments in lightroom, without doing any sharpening, and then head over to photoshop for capture sharpening and any further photoshopping that is necessary.
    But if I do lens correction changes in lightroom, will that cause a problem? Do I need to forego doing any lens correcting in lightroom if I am going to be doing capture sharpening in photoshop after the fact?
    Thanks for the help.

    I shoot in Raw. I only recently got Photokit Sharpener, so I am trying to work that in to my workflow, in which case I would turn off Lightroom's default sharpening.
    I think I may be worried about something that isn't really a problem, but I had heard that when you adjust for chromatic aberrations, it adjusts the color channels, for example moving the red channel in relation to the blue channel, in order to eliminate the color fringing. If that is the case, then I was wondering whether sharpening applied outside of Lightroom would have to be applied after the chromatic aberration adjustments had been made or if it could be applied before without causing problems.
    My current plan is to just apply the capture sharpening in Photoshop after all LR adjustments have been made, and hopefully that will work out fine.

  • Why does iPhoto change the sort order of the photos in my album when I attempt to share via Photo Stream?

    Why does iPhoto change the sort order of the photos in my album when I attempt to share via Photo Stream?

    Did anyone find a good way to sort the shared albums better, so that the ones you share with can better find their way around.
    You can arrange them manually in an album, select all and use the Photos ➙ Batch Change ➙ Date to menu option and check the box to add a set interval between photos. That will let the photos be sorted by date and be in the order you want:
    OT

  • HT2470 Why does this not explain how to change the sort order?

    Why does this (i.e. support at Apple.com) not explain how to change the sort order? I can "arrange" by Date Modified for example but it won't let me switch to use most recent dates first. Also, what is Apple-speak for arrange versus sort anyway? It seems I used to be able to click on a column heading in finder and get a drop down arrow allowing me to change the sort sequence.

    Arrange roughly translates to "group the items in the folder." Sort is how each group is ordered. If you have arrange set to none, you can sort by anything. However, there is no way in the Arrange/Sort menu to choose the direction. The only way to do that is in the List View, and you must have Arrangement set to None.
    I've submitted an Enhancement Request to allow choosing sort direction from the Arrange/Sort menu, but I haven't ever gotten a response, which is good and bad. Good because they will often respond that they have considered it and don't plan on implementing. Bad in that they've haven't implemented it.

  • I've had to turn on iPhoto on my iMac in order  for pictures to transfer. Why does'nt iPhoto stay on?

    I've had to turn on iPhoto several times on my iMac in order for my pictures to transfer. Why does'nt it stay on? Is ther something I can do to keep it on?

    What version of iPhoto? Of the OS? How are you trasnsferring? Is it crashing?

  • Why does Image Capture stop recognizing Epson scanner after scanning several images? I have to stop and start the scanner in order for Image Capture to recognize it again.

    Why does Image Capture stop recognizing Epson scanner after scanning several images? I have to stop and start the scanner in order for Image Capture to recognize it again.

    Karen ...
    Might be corrupted preferences (.plist)
    Open the Finder. From the Finder menu bar click Go > Go to Folder
    Type or copy paste the following:
    ~/Library/Preferences/com.apple.image_Capture.plist
    Click Go then move the com.apple.image_Capture.plist file to the Trash.
    Restart your Mac and your scanner and try scanning an image.

  • Why does itunes load cds in the wrong track order

    why does this happen and can it be sorted cheers

    iTunes imports CDs in track order, first to last.  iTunes displays these tracks in your music library based on how you select your library to be viewed.  For example, in list view you can select the "date added" column and see the tracks in the order they were imported (with the most recent on top).  You can select the name colum and see all the tracks in alphabetical order.  You can select the album column and see the tracks in album order.  The album column cycles from album, to album by artist, or album by artist/year as you click on the column title.
    See this for tips on various view options:  http://www.apple.com/itunes/how-to/#tips-viewoptions

Maybe you are looking for

  • New ZEN firmware 1.20

    Filename: ZEN_PCFW_L22__20_02.exe This download contains an improved version of the firmware found on your Creative ZEN? player. It enables you to transfer and view photos from your memory card. For more details, read the rest of this web release not

  • Change Language in LYNC 2013

    Hi, Windows 7 Enterprise Edition is installed in the machine with Office 2010 Professional Plus 32 bit German Language. LYNC 2013 is installed but it is in French language. How to change the language to LYNC 2013 to German. Regards, Boopathi S

  • Can't play video files - max CPU

    I have an out-of the box MacBook with leopard - and I simply had to use Force quit about a thousand times. The problem: When I try to... - import (iPhoto) - play (Quicktime) - Preview - open a folder in which there is... ... a video file shot with my

  • ERP2005 - No Enterprise Services In wsadmin

    Hi all, we have a erp2005 and i have read that in transaction wsadmin should be enterprise services (i. e. ECC....). I can't find this services. Do i have to install this services? regards

  • When i try and download a app or a song it says waiting for about 3 secs then just doesnt download

    When i try and download a app or a song it says waiting for about 3 secs then just doesnt download