Help with generics...

Hi, I'm writing a program, and as specified by my instructor I'm implementing generics.
I get most of generics, but some of it is still blurry to me.
Here is my code:
public class ListSortedArrayBased<ListType extends Comparable<ListType>>
implements ListSortedInterface<ListType>, Iterable<ListType>
     private int size;
     private ListType[] list;
     private int arraySize;
    public ListSortedArrayBased()
         size = 0;
         arraySize = 2;
         list = (ListType[]) new Comparable[arraySize];
     public boolean isEmpty()
          return size == 0;
     public int size()
          return size;
     public void add(ListType item) throws ListException
          int index = locateIndex(item, true);
          if(index == -1)
               throw new ListException("Item already exists in the list.  Add failed.");
          else
               add(item, index);
               if(size == arraySize)     //check for resize after adding (more efficient than checking before so that
                    arrayResize(size*2);  //locateIndex will never go out of bounds of the array in case of a full array.
     private void add(ListType item, int index)
          shift(size - 1, index, true); //shift the items to the right to make room for the new item
          list[index] = item;
          size++;
     public void remove(ListType item) throws ListException
          int index = locateIndex(item, false);
          if(index == -1)
               throw new ListException("Item does not exist in the list.  Remove failed.");
          else
               shift(index, size - 1, false); //shifts the items to the left, writing over the item we removed.
               size--;
               if(size < (arraySize/2))
                    if(size != 0)                //list of size 0 has an array of size 2.
                         arrayResize(arraySize/2);
     public void removeAll()
          size = 0;
          list = (ListType[]) new Comparable[2];
          arraySize = 2;
     public Iterator<ListType> iterator()
          return new ListArrayIterator<ListType>(list);
I'm getting the following compile-time error:
ListSortedArrayBased.java:89: incompaitlbe types
found : ListArrayIterator<ListType>
required: java.util.Iterator<ListType>
return new ListArrayIterator<ListType>(list);
^
Any help would be greatly appreciated...
Thanks in advance!
Andrew

Sorry for not posting it already...here's ListArrayIterator:
import java.util.Iterator;
class ListArrayIterator<ListType extends Comparable<ListType>> implements Iterator<Comparable<ListType>>
    *  Keeps track of current iteration index.
    *  The next object returned will be at this index.
   private int index;
   /** The list to be iterated through. */
   private ListType[] items;
   public ListArrayIterator(ListType[] items)
       index = 0;
       this.items = items;
   public void remove()
      throw new UnsupportedOperationException ("Remove not implemented.");
   public boolean hasNext()
      return (index < items.length) && (items[index] != null);
   public ListType next()
      if (hasNext())  //should be used in conjunction with hasNext(), but just in case...
         return(items[index++]);
      else
         throw new ListException("End of list.");
}

Similar Messages

  • Need help with generics

    I have written a java program using jdk1.5. After completing my program I noticed that the compiler was outputting a warning. It tells me that there were a few unsafe operations in my code. Anyway I found out that my code needed to include generics. I was able to figure out how too include some of the generics. I am having trouble with the following:
    [javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:105: warning: [unchecked] unchecked conversion
    [javac] found : personalInfo.logic.FNComparator
    [javac] required: java.util.Comparator<? super java.lang.Object>
    [javac] Arrays.sort(sort, fn);
    [javac] ^
    [javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:105: warning: [unchecked] unchecked method invocation: <T>sort(T[],java.util.Comparator<? super T>) in java.util.Arrays is applied to (java.lang.Object[],personalInfo.logic.FNComparator)
    [javac] Arrays.sort(sort, fn);
    [javac] ^
    [javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:109: warning: [unchecked] unchecked conversion
    [javac] found : personalInfo.logic.LNComparator
    [javac] required: java.util.Comparator<? super java.lang.Object>
    [javac] Arrays.sort(sort, ln);
    [javac] ^
    [javac] /home/paul/Documents/java/PersonalInfo/src/personalInfo/logic/DB.java:109: warning: [unchecked] unchecked method invocation: <T>sort(T[],java.util.Comparator<? super T>) in java.util.Arrays is applied to (java.lang.Object[],personalInfo.logic.LNComparator)
    [javac] Arrays.sort(sort, ln);
    [javac] ^
    The FN/LNComparator class implements the java.util.Comparator class. I have looked at the generics tutorial on the java.sun.com website. I can't figure out what I replace the <T> with to make the code compile and the warning to go away. I have tried <Comparator> but that just gives me an error that says FNComparator does not take any parameters.
    If anyone knows how to fix these warnings let me know
    -Hockeyfan

    I know how to fix it.
    Step 1. Stop writing subject-lines like "Need help with generics". Everyone who starts a topic needs help, that's why people post here!
    Step 2. Don't just post the error message, post the relevant code. In [code ][code ] tags of course.
    Step 3. Stop watching hockey, it'll stunt your growth
    Step 4. Have the FN/LNComparator implement, not the raw Comparator, but Comparator<Object>

  • Need help with generic class with comparable type

    Hi. I'm at University, and I have some coursework to do on writing a generic class which offers ordered binary trees of items which implement the comparable interface.
    I cant get the code to compile which I have written.
    I get the error: OBTComparable.java uses unchecked or unsafe operations
    this is the more detailed information of the error when I compile with -Xlint:unchecked
    OBTComparable.java:62: warning: [unchecked] unchecked call to insert(OBTType) as
    a member of the raw type OBTComparable
    left.insert(insertValue);
    ^
    OBTComparable.java:64: warning: [unchecked] unchecked call to insert(OBTType) as
    a member of the raw type OBTComparable
    right.insert(insertValue);
    ^
    OBTComparable.java:75: warning: [unchecked] unchecked call to find(OBTType) as a
    member of the raw type OBTComparable
    return left.find(findValue);
    ^
    OBTComparable.java:77: warning: [unchecked] unchecked call to find(OBTType) as a
    member of the raw type OBTComparable
    return right.find(findValue);
    ^
    and here is my code for the class
    public class OBTComparable<OBTType extends Comparable<OBTType>>
      // A tree is either empty or not
      private boolean empty;
      // If the tree is not empty then it has
      // a value, a left and a right.
      // These are not used it empty == true
      private OBTType value;
      private OBTComparable left;
      private OBTComparable right;
      // Create an empty tree.
      public OBTComparable()
        setEmpty();
      } // OBTComparable
      // Make this tree into an empty tree.
      private void setEmpty()
        empty = true;
        value = null; // arbitrary
        left = null;
        right = null;
      } // setEmpty
      // See if this is an empty (Sub)tree.
      public boolean isEmpty()
      { return empty; }
      // Get the value which is here.
      public OBTType getValue()
      { return value; }
      // Get the left sub-tree.
      public OBTComparable getLeft()
      { return left; }
      // Get the right sub-tree.
      public OBTComparable getRight()
      { return right; }
      // Store a value at this position in the tree.
      private void setValue(OBTType requiredValue)
        if (empty)
          empty = false;
          left = new OBTComparable<OBTType>(); // Makes a new empty tree.
          right = new OBTComparable<OBTType>(); // Makes a new empty tree.
        } // if
        value = requiredValue;
      } // setValue
      // Insert a value, allowing multiple instances.
      public void insert(OBTType insertValue)
        if (empty)
          setValue(insertValue);
        else if (insertValue.compareTo(value) < 0)
          left.insert(insertValue);
        else
          right.insert(insertValue);
      } // insert
      // Find a value
      public boolean find(OBTType findValue)
        if (empty)
          return false;
        else if (findValue.equals(value))
          return true;
        else if (findValue.compareTo(value) < 0)
          return left.find(findValue);
        else
          return right.find(findValue);
      } // find
    } // OBTComparableI am unsure how to check the types of OBTType I am comparing, I know this is the error. It is the insert method and the find method that are causing it not to compile, as they require comparing one value to another. How to I put the check in the program to see if these two are of the same type so they can be compared?
    If anyone can help me with my problem that would be great!
    Sorry for the long post, I just wanted to put in all the information I know to make it easier for people to answer.
    Thanks in advance
    David

    I have good news and undecided news.
    First the good news. Your code has compiled. Those are warnings not errors. A warning is the compiler's way of saying "I understand what you are asking but maybe you didn't fully think through the consequences and I just thought I would let you know that...[something] "
    In this case it's warning you that you aren't using generics. But like I said this isn't stopping it from compiling.
    The undecided news is the complier is warning you about not using generics. Are you supposed to use generics for this assignment. My gut says no and if that's true then you have no problem. If you are supposed to use generics well then you have some more work.

  • Help with generics - extending hashmap

    I'm trying to extend the HashMap class to accept multiple values per key. I'd like .put(key,value) to put a single key/value pair. I'd like .get(key) to return a Vector<V> of all the values associated with key, and .get(key, index) to return a single value of type V for that key. I am using Eclipse 3.2 and Java 1.5.
    The problem I am having is my .put(K key,V value) method won't compile, I get the error:
    Name clash: The method put(K,V) of type OneToManyHashMap<K,V> has the same erasure as put(K,V> of type HashMap<K,V> but does not override it
    My code (roughly):
    public class OneToManyHashMap<K,V> extends HashMap<K, Vector<V>> {
        public V get(Object key, int index) { return get(key).get(index); }
        public V put(K key, V value) { ... }
        public V remove(Object key, int index) { return get(key)
    }Yes, I know there is an extra > in the code. It's wasn't there when I typed the message and it's not there when I try and edit the message to remove it :(
    Message was edited by:
    jiggersplat

    This is what was meant by a "has-a" relation:
    public class OneToManyHashMap&#60;K, V extends List&#60;V>> {
        public Map&#60;K, List&#60;V>> map;
        public OneToManyHashMap() { map = new HashMap&#60;K, List&#60;V>>(); }
        public V get(K key, int index) { return map.get(key).get(index); }
        public void put(K key, V value) { map.get(key).add(value); }
        public void remove(K key, int index) { map.get(key).remove(index); }
    }Needless to say, you will have to perform some checks to handle eventual NPE's.

  • Need help with this Generics Warning

    Hi All,
    I could not understand what the following Generics Warning means
    Type safety: The cast from Object to HashMap<String,Object> is actually checking against the erased type HashMap
    Could anyone please help me with this.
    Here is the erring line of Code :
    HashMap<FDTColumInfoKey, ColumnInfo> designMap = (HashMap<FDTColumInfoKey, ColumnInfo>)wdContext.currentContextElement().getColumnInfoMap();
    Thanks !

    SloMoe wrote:
    Hi Malcolm,
    tnx for taking time to answer my query, but doesn't Generics give an exception during compile time as opposed to Run Time ? I mean if the attributes type in the Generic definition does not match with the type of the attributes during Compile time, An exception will be thrown. So why the warning ?Because, in this case, there's no way that the compiler can check the correctness of the generics. You're telling the compiler that the object you retrieve is of the relevant generic types but the compiler can't verify it.
    That's also true with an ordinary cast from Object, of course, but if with an ordinary cast at least the run time will verify that the object is actually of the required type where the cast is made and throw a CastClassException immediately. So it's easy to debug.
    With generics the run time doesn't have access to the generics data. This is what is meant by "erasure". So it can check that the object is a HashMap when casting, but not that it contains the right type of entries. This means that, at some later point in the code, it might retrieve an object from the map and discover that it's of the wrong type, thus causing a ClassCastException in a statement with no explicit cast.

  • Help with HP Laser Printer 1200se

    HP Support Line,
    Really need your assistance.  I have tried both contacting HP by phone (told they no longer support our printer via phone help), the tech told me that I needed to contact HP by e-mail for assistance.   I then sent an e-mail for assistance and got that reply today, the reply is as follows  "Randall, unfortunately, HP does not offer support via e-mail for your product.  However many resources are available on the HP web site that may provide the answer to your inquiry.  Support is also available via telephone.  A list of technical support numbers can be round at the following URL........."  The phone numbers listed are the ones I called and the ones that told me I needed to contact the e-mail support for help.
    So here I am looking for your help with my issue.
    We just bought a new HP Pavillion Slimline Desk Top PC (as our 6 year old HP Pavillion PC died on us).  We have 2 HP printers, one (an all-in-one type printer, used maily for copying and printing color, when needed) is connected and it is working fine with the exception of the scanning option (not supported by Windows 7).  However we use our Laser Printer for all of our regular prining needs.  This is the HP LaserPrinter 1200se, which is about 6 years old but works really well.  For this printer we currently only have a parallel connection type cord and there is not a parallel port on the Slimline HP PC.  The printer also has the option to connedt a USB cable (we do not currently have this type of cable).
    We posed the following two questions:
    1.  Is the Laser Jet 1200se compatible with Windows 7?
    and if this is the case
    2.  Can we purchase either a) a USC connection cord (generic or do we need a printer specific cord)? or b) is there there a printer cable converter adapater to attach to our parallel cable to convert to a USB connection?
    We do not want to purchase the USB cable if Windows 7 will not accept the connection, or if doing this will harm the PC.
    We really would appreciate any assitance that you might give us.
    Thank you,
    Randy and Leslie Gibson

    Sorry, both cannot be enabled by design.  That said, devices on a network do not care how others are connected.  You can print from a wireless connection to a wired (Ethernet) printer and v/v.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Is there a Java utility class to help with data management in a desktop UI?

    Is there a Java utility class to help with data management in a desktop UI?
    I am writing a UI to configure a network device that will be connected to the serial port of the computer while it is being configured. There is no web server or database for my application. The UI has a large number of fields (50+) spread across 16 tabs. I will write the UI in Java FX. It should run inside the browser when launched, and issue commands to the network device through the serial port. A UI has several input fields spread across tabs and one single Submit button. If a field is edited, and the submit button clicked, it issues a command and sends the new datum to the device, retrieves current value and any errors. so if input field has bad data, it is indicated for example, the field has a red border.
    Is there a standard design pattern or Java utility class to accomplish the frequently encountered, 'generic' parts of this scenario? lazy loading, submitting only what fields changed, displaying what fields have errors etc. (I dont want to reinvent the wheel if it is already there). Otherwise I can write such a class and share it back here if it is useful.
    someone recommended JGoodies Bindings for Swing - will this work well and in FX?

    Many thanks for the reply.
    In the servlet create an Arraylist and in th efor
    loop put the insances of the csqabean in this
    ArrayList. Exit the for loop and then add the
    ArrayList as an attribute to the session.I am making the use of Vector and did the same thing as u mentioned.I am using scriplets...
    >
    In the jsp retrieve the array list from the session
    and in a for loop step through the ArrayList
    retrieving each CourseSectionQABean and displaying.
    You can do this in a scriptlet but should also check
    out the jstl tags.I am able to remove this problem.Thanks again for the suggestion.
    AS

  • The best way to get help with logic

    I was posting in a thread on support for logic which appears to have been deleted. anyway, what I was going to say I think is useful info for people, so I'm going to post it anyway. to the mods - it doesn't contain any speculation about policies or anything like that. just an explanation of my views on the best way to deal with issues people have with logic, which I think is a valuable contribution to this forum.
    I think there's a need for perspective. when you buy an apple product you get 90 days of free phone support to get everything working nice and neat. you can call them whenever, and you could actually keep them on the phone all day if you wanted, making them explain to you how to copy a file, install microsoft office, or any number of little questions no matter how simple - what is that red button thingy in my window for?.. on top of that, you've got a 14 day dead on arrival period (or 10 days I can't remember) in which if your machine has any kind of hardware fault whatsoever it's exchanged for a totally new one, no questions asked. a lot of people complain that applecare is overpriced.. and if you think of it just as an extended warranty, then it is a little pricey. but if you are someone that could use a lot of phone support, then it's actually potentially a total bargain. the fact that 2 or more years after you bought a computer, you could still be calling them every single day, asking for any kind of advice on how to use anything on the machine, is quite something. many people on this forum have had problems when they made the mistake of upgrading to 10.4.9 without first creating a system clone or checking first with their 3rd party plug in vendors to make sure it was ok. so, with apple care, you could call them and keep a technician on the phone _all day_ talking you through step-by-step how to back up all of your user data, how to go through and preserve your preferences and any other specific settings you might not want to lose, and then how to rollback to an earlier OS version.. they'll hold your hand through the whole thing if you need them to.
    as for applecare support for pro apps like logic, I'd be the first person to agree that it's not great for anyone except beginners and first time users. if you look at what it takes to get even the highest level of logic certification, it's all pretty basic stuff. and logic doesn't exist in a vacuum, there is an entire universe of 3rd party software and hardware, as well as studio culture and advanced user techniques that are going to be totally invisible to some poor phone support guy at apple that did a logic 101. but it's not hard to see that apple are trying to promote a different kind of support culture, it's up to you to decide whether you want to buy into it or not.
    the idea is that they are able to provide basic setup support for new users, including troubleshooting. because it's a simpler level of support, at least they can do this well. so there's no reason why any new user with say a new imac and logic can't get up and running with the 90 days of phone support they get for free.
    but the thing is, for extremely high end pro users it's a different matter altogether. pro use of logic within the context of say, a studio or a film composition scenario is a very different world. it's almost a nonsense to imagine that apple could even hire people capable of giving useful support for this end of the spectrum, over the phone. there are so many variables, and so many things that require a very experienced studio person or in-work composer to even begin to understand the setup, let alone troubleshoot it. and it's a constantly evolving world, you actually have to be working in it and aware of developments on 3rd party fronts as well as changes in hardware.. not to mention even changes in the culture of studio production and the changed expectations that come from that. there's no way some poor little guy sitting at a help desk at apple can even hope to be privy to that kind of knowledge. it's already good enough that they don't outsource their support staff to india, let alone go out to studios and hire the very people with the skills that should be staying in the studio! not answering phones for apple.
    so, given this reality.. companies have two choices. they can either offer an email based support ticket system, which others do. but in my opinion.. this can just be frustrating and only a half-solution. sure you 'feel' like you are getting a response from the people that make the software and therefore must know it.. but it's not really the case due to what I said above. DAWs don't exist in a vacuum, and so much of what you need to understand to help people requires an intimate knowledge of the music industry in which they are working. you still won't get that from steinberg, even if they sort of answer your emails. the other problem is that this kind of system can mean sporadic answers, a lot of tail-chasing, and quite often you won't get an answer that helps you in the end anyway.
    the other model is to foster a strong user support culture. some people react in the wrong way to this idea.. they just think it's a big brush off from the manufacturer, saying we don't care, go sort it out yourselves.. but this isn't true. apple has a classification for pro resellers called 'apple solutions expert - audio'. what this means is that these dealers are recognised as audio specialists and they can receive extra support and training from apple for this. but more importantly than this.. most of them are music stores, or pro gear dealerships that are also mac and logic dealers. they already employ people that have worked or do work in the music industry, and are constantly on top of all of this stuff. apple encourages these dealers to run workshops, and to provide expert sales advice in the very niche area that logic is in, which they can do far better than some generic apple store ever could. but most importantly, they are encouraged to offer their own expert after-sales support and whatever other value-adding expertise they can, to get sales. because margins in computer gear are so tight nowadays, discounting is not really a viable option for these dealers to guarantee getting musicians to buy computers and logic setups from them. the only companies that can entice people with a lower price a big online wholesalers or big chain stores. so the best idea for these niche expert stores to get sales is to offer you their own experts to help with configuration, ongoing support and to generally make it a better idea that you bought your system from them rather than from some anonymous online store. I can see the wisdom of this.. it puts the support back out there on the ground where it's needed, and also where it can work best. apple could never hope to offer the same level of expertise in helping a film composer work through some issues with a specific interface or some highly specific issue they have with getting a task done. no big software manufacturer could do this anywhere near as well as people out there that have worked in studios or currently do work in studios. so in my opinion it's a far better model to foster this kind of support culture, along with training courses, books and training video support. also user forums like this one are possibly one of the most valuable ports of call anyone could ask for. apple couldn't replicate this with their own staff, even if they tried. and even if they made a system where some of the people close to logic development were able to answer emails, it would still be nowhere near as useful, as rapid or as capable of being up to speed with logic use out in the real world with 3rd pary gear, as any of these other methods are.
    the only thing I think they could do better would be to publish a list of known bugs which are officially recognised. this would help everyone and put an end to a lot of wasted time and speculation on if something is a bug totally to do with logic, or if it's a specific issue raised by a particular configuration.
    but really, in my view, a 3rd party support and training culture through a combination of specialist dealers, consultants that literally run a business setting up computers for pro-users and helping them keep it all working, online user-to-user forums and published materials really are the way forward.

    In all honesty this is currently the 3rd "logicboard" (motherboard)
    in my powerbook due to a design flaw regarding the 2nd memory slot....
    Yep. Mine failed five weeks after I bought it. However, I bought it for work and couldn't afford being without it for four weeks while they fixed it, so I had to live with it. My serial number did not entitle me to a replacement either, post Applecare.
    My firewire ports have burnt out from a third-party defective device (no hot-plugging involved)
    My screen is blotchy (my PW serial number did not entitle me to a replacement).
    My battery serial number did not entitle me to a replacement, and is not that good these days.
    My guaranteed Powerbook-compatible RAM is actually not, causing RAM related problems, most notably these days meaning that as soon as I switch to battery power, the laptop crashes, so I can only use mains power. The company I bought it from stopped taking my calls and wouldn't replace it after they replaced it once, so I'm stuck with it. And of course, only one ram slot is working, so I can't even use my original stick in the first slot, which would shift the dodgy stuff away from the lower system area.
    My power supply failed at the weak spot and caught fire. I managed to break apart the power supply and recable it so I didn't have to buy a new power supply, although the connection at the laptop end is loose (all the more fun that as soon as power is lost, the laptop crashes - see above). The power supply is held together with gaffa tape. Silver gaffer tape though, so it's still kind of 'Appley"...
    My internal hard drive is dying - four or five times now it clicks and won't power up, causing the laptop to die.
    One foot has fallen off (but glued back on).
    The lid is warped.
    The hinge is loosish.
    The S-Video adaptor cable is intermittent.
    But aside from all that, I have looked after it well, and I love it to death. Just as well, because it doesn't look like it will be that long...
    But it still "just works". Apart from the battery power obviously. And the ram slot. And the ram. And the screen. And the hard drive. And the firewire ports. And the feet.
    But everything apart from the main board, the screen, the case, the hard drive and the power supply works fine. So thats... er..
    Hmm.

  • Need help with color management

    I am looking for someone to help me.  Please!
    I am looking for help with Photoshop/printer not printing correct colors.
    I have: Windows 7, Photoshop CS5, Photoshop Elements, HP Pavillion Laptop, new Okidata C530dn color laser printer
    Previously I had a Canon Pixma MP620 and a gentleman from another forum gave me the correct settings for printing on photo paper and colors were perfect.  I now have a OKIdata C530dn color laser and have started a business printing business cards and greeting cards, etc., and I do advertisements on a freelance basis.
    I will be working a lot with cardstock or cover stock 65-110 lbs paper.  I have an old OKIdata 2024e at work, and the colors are much better with that printer than my new personal one.  I have tried matching the settings of that printer to mine to no avail.  I have finally gotten the color close, but not quite.  When I print on my Canon injet the colors match and print perfectly.
    I have tried every setting variation that I can think of to get the color correct with my new OKIdata.  I have to get the colors correct or my new business will go under because I can't match colors for my customers.  I am a self taught Photoshoper and a novice so please bear with me.
    Using Okidata PCL.  Also have PS
    Color settings in Photoshop:
    North America General Purpose 2
    sRGB 2.1
    U.S. Web Coated Swop v2
    Dot gain 20 %
    Dot gain 20 %
    Preserve embeded profile
    Preserve embeded profile
    Preserve embeded profile
    engine: Adobe (ACE)
    Relative Colormetric
    Tried RGB color mode and CMYK color mode, no difference
    Printer settings:
    Photoshop manages colors
    sRGB 2.1 Printer profile
    Relative Colormetric
    Print setup:
    Letter
    Multipurpose tray
    Weight: printer settings-default  (when I used heavy setting for cardstock it printed green instead of the color light blue, so that was a start to the right color)
    Job Options:
    Hight Quality
    Color: No color matching
    Printer preferences in Printer properties:
    Color management
    Device: Display 1 generic PnP monitor AMD M88og with ATI Mobility Radeon HD4200
    ICC Profiles: Generic PnP Monitor (default)
    Advanced:
    Windows Color System Defaults:
    everything under this tab is set at System Default
    I have gotten the color close, but colors are dull. I have tried an adjustment layer and setting the saturation higher, but that doesn't help.  I know my laptop is showing the right colors, (calibrated) because I am still printing to the Canon with cardstock and the colors are perfect using the same settings above.
    Tried printing in PSE and it gave me an error that it was not a post script printer.  Installed ps driver, still getting errors and it wouldn't print.
    I would appreciate any help you could give me before I run out of toner and have to buy the expensive toners, or just slit my wrists j/k  LOL
    Thanks!  JS

    You need an ICC profile for your printer.  Chromix has an excellent service at http://www2.chromix.com/colorvalet/ which will do this calibration for you.  You download some software they provide, then print a test file on the exact same paper you are using for your cards.  Then send the output to them and they will calibrate the colors with their equipment and send you the ICC profile file.  Once you have it, you'll be able to print accurate colors.
    There are other services out there that may cost less, but I do not know how reputable they are.  Chromix is a good business I've worked with many times.
    If you are trying to run a business and you don't understand color management yet, you may be in for a lot of trouble.  Please get the book "Real World Color Management" available at http://www.colorremedies.com/realworldcolor/ and it will save you a ton of money and headaches.

  • Help with Sort function in Terminal

    Hello all... this is my first post on here as I'm having some trouble with some Termianl commands. I'm trying to learn Terminal at the moment as it is but I would appreciate some help with this one....
    I'm trying to sort a rather large txt file into alphabetical order and also delete any duplicates. I've been using the following command in Terminal:
    sort -u words.txt > words1.txt
    but after a while I get the following error
    sort: string comparison failed: Illegal byte sequence
    sort: Set LC_ALL='C' to work around the problem.
    sort: The strings compared were `ariadnetr\345dens\r' and `ariadnetr\345ds\r'.
    What should my initial command be? What is Set LC_ALL='C'?
    Hope you guys can help?

    Various languages distinct sorting - collation - sequences. 
    The characters can and variously do sort differently, depending on what language is involved. 
    Languages here can include the written languages of humans, and a few settings associated with programming languages.  This is all part of what is known as internationalization and localization, and there are are various documents around on that topic.
    The LC_ALL environment variable sets all of the locale-related settings en-mass, including the collation sequence that is established via LC_COLLATE et al, and the sort tool is suggesting selecting the C language collation.
    Here, the tool is suggesting the following syntax:
    LC_ALL=C sort -u words.txt > words1.txt
    This can also be done by exporting the LC_ALL, but it's probably better to just do this locally before invoking the tool.
    Also look at the lines of text in question within the files, and confirm the character encoding of the file.
    Files can have different character encodings, and there's no reliable means to guess the encoding.  For some related information, see the file command:
    file words.txt
    ...and start reading some of the materials on internationalization and localization that are posted around the 'net. Here's Apple's top-level overview.
    In this case, it looks like there's an "odd" character and probably an å character on that line and apparently the Svenska ariadnetrådens. 
    Switching collation can help here, or - if the character is not necessary - removing it via tr or replacing it via sed can be equally effective solutions. 
    Given it appears to be Svenska, it might work better to switch to Svenska collation thanto  the suggested C collation.
    I think that's going to be sv_SE, which would make the command:
    LC_ALL=sv_SE sort -u words.txt > words1.txt
    This is all generic bash shell scripting stuff, and not specific to OS X.  If you haven't already seen them, the folks over at tldp have various guides including a bash guide for beginners, and an advanced bash scripting guide - both can be worth skimming.  They're not exactly the same as bash on OS X and some specific commands and switches can differ, and as bash versions can differ, but bash is quite similar across all the platforms.

  • Error in Extraction with Generic Datasource via Function Module

    Dear Gurus,
    Iam working for BI-HR module.We are extracting data with generic data source via function module. The client some more extra fields in already existing DS. So we made a copy of that Function module and tried to create new generic DS, we got error while extraction like "Error occured during the extraction process". Can you please help in resolving this issue, your valuable suggestion would be highly appreciated.
    Thanks and regards
    Arun S

    Hi,
    Which structure are you using??
    Are you using the same old structure for this function module as well.
    Have you enhanced the structure with new required fields.
    New extrac fields needs to be added to existing structure if you are using the same or create a new one and make sure that you have all the fields in the structure which you are going to use in the data source.
    You need to take care for the append as well and the issue could be in the code as well.
    Make sure you have written the proper code and just for the new fields done an append
    Thanks
    Ajeet

  • Import from database an internal table with generic Type : Web Dynpro ABAP

    Hi everyone,
    i have a requirement in which i'm asked to transfer data flow between two frameworks, from WD Component to another. The problem is that i have to transfer internal tables with generic types. i used the import/ export from database approache but in that way i get an error message saying "Object references and data references not yet supported".
    Here is my code to extract a generic internal table from memory.
        DATA l_table_f4 TYPE TABLE OF REF TO data.
      FIELD-SYMBOLS: <l_table_f4> TYPE STANDARD TABLE.
      DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
      DATA: ls_indx TYPE indx.
      lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
      lo_componentcontroller->fire_vh_search_action_evt( ).
      ASSIGN l_table_f4 TO <l_table_f4>.
    *-- Import table for Help F4
      IMPORT l_table_f4 TO <l_table_f4> FROM DATABASE indx(v1) TO ls_indx ID 'table_help_f4_ID'.
    The error message is desplayed when last instruction is executed " IMPORT l_table_f4...".
    I saw another post facing the same problem but never solved "Generic Type for import Database".
    Please can anyone help ?
    Thanks & Kind regards.

    hi KIan,
    go:
    general type
    TYPE : BEGIN OF ty_itab,
               field1 TYPE ztab-field1,
               field2 TYPE ztab-field2,
    *your own fields here:
               field TYPE i,
               field(30) TYPE c,
               END OF ty_itab.
    work area
    DATA : gw_itab TYPE ty_itab.
    internal table
    DATA : gt_itab TYPE TABLE OF ty_itab.
    hope this helps
    ec

  • Error 500 with generic Apache

    Hi,
    I am trying to user Apex Listener 1.0.2 on OC4J fronted with generic Apache 2.0. I configured mod_oc4j and the combination seems to work.
    When i ran apex/listenerConfigure the configuration page shows up. But when I try to Apply changes I constantly get
    500 Internal Server Error
    Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
    Any idea what would be the cause?
    Janis

    Thank you for the answer. This is the log. I hope it helps
    10/10/27 12:39:04.951 apex: 10.1.3.5.0 Started
    10/10/27 12:56:51.975 apex: Servlet error
    java.lang.NoSuchMethodError: java.lang.String.getBytes(Ljava/nio/charset/Charset;)[B
         at oracle.dbtools.apex.utilities.Text.getBytes(Text.java:31)
         at oracle.dbtools.apex.ModApex.notifyNotConfigured(ModApex.java:257)
         at oracle.dbtools.apex.ModApex.doConfig(ModApex.java:98)
         at oracle.dbtools.apex.ModApex.doGet(ModApex.java:92)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    10/10/27 12:59:11.662 apex: Servlet error
    java.lang.NoSuchMethodError: java.lang.String.isEmpty()Z
         at oracle.dbtools.apex.admin.AdminManager.validConnection(AdminManager.java:337)
         at oracle.dbtools.apex.admin.AdminManager.validateInfo(AdminManager.java:168)
         at oracle.dbtools.apex.admin.AdminManager.processAdministration(AdminManager.java:81)
         at oracle.dbtools.apex.admin.Admin.doPost(Admin.java:87)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.5.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • I have a REAL problem that I need help with

    many thanks to kglad for all his help last week with a problem but it hasn't fully sorted it out. I have a site with 908 buttons. Basically a person clicks a button, makes a donation (through paypal) and then that button gets their name displayed when the mouse hovers over it. Essentially the button becomes the property of the person who makes the donation. The problem I need help with is how to disable each button when someone clicks it. Disabling a button isn't the problem. I need it disabled only when the person has made a valid donation. Each button has a unique instance name (b001 - b908). There must be a way.
    Many thanks in advance.

    I can't get this to work at all. At this stage, I'm considering a complete restructure of the site in dreamweaver.
    I would love to be able to complete it in actionscript though as I would be learning something new.
    When a user clicks a button, and goes through the paypal process, I need the clicked button to be disabled.
    It has to be such that it gets disabled only when a user has made a donation through paypal. For example, plenty
    of people may just click on the buttons as they are checking the site out, without any intention of using the paypal
    facility. This is just human nature. Obviously, I don' t want any buttons disabled under these circumstances.
    I was thinking, do I need a statement such as .......... "on returning from paypal, disable the clicked button"
    Or is it just a case of......... "on returning from paypal, remove the event handler"
    Or is it something completely different, I require, (please don't say a brain would be helpful).
    Is there some generic code out there that could help me out please.

  • Help With Crash Code  In PRE8 Please

    In an interest to turn some of my recent discussions in a more positive direction and in keeping with the primary function of this forum (seeking advice and solutions) and in a further effort to not continually ***** about PRE8, can someone please help with and interpret the following crash codes recently generated by PRE8?
    Thanks in advance for any help.
    Glenn
    Description
    A problem caused this program to stop interacting with Windows.
    Problem signature
    Problem Event Name:                      AppHangXProcB1
    Application Name:                           Adobe Premiere Elements.exe
    Application Version:                         8.0.0.0
    Application Timestamp:                   4aa5c87c
    Hang Signature:                                ba8e
    Hang Type:                                        32
    Waiting on Application Name:       ElementsOrganizerSyncAgent.exe
    Waiting on Application Version:    8.0.0.0
    OS Version:                                        6.0.6001.2.1.0.256.1
    Locale ID:                                           1033
    Additional Hang Signature 1:         cb0b340a390054264815ceb8e3574d53
    Additional Hang Signature 2:         84f3
    Additional Hang Signature 3:         f0a90877ec38c16fd285cc410c83433d
    Additional Hang Signature 4:         ba8e
    Additional Hang Signature 5:         cb0b340a390054264815ceb8e3574d53
    Additional Hang Signature 6:         84f3
    Additional Hang Signature 7:         f0a90877ec38c16fd285cc410c83433d
    Extra information about the problem
    Bucket ID:                                          749899167
    Description
    A problem caused this program to stop interacting with Windows.
    Problem signature
    Problem Event Name:                      AppHangXProcB1
    Application Name:                           Adobe Premiere Elements.exe
    Application Version:                         8.0.0.0
    Application Timestamp:                   4aa5c87c
    Hang Signature:                                ba8e
    Hang Type:                                        32
    Waiting on Application Name:       ElementsOrganizerSyncAgent.exe
    Waiting on Application Version:    8.0.0.0
    OS Version:                                        6.0.6001.2.1.0.256.1
    Locale ID:                                           1033
    Additional Hang Signature 1:         cb0b340a390054264815ceb8e3574d53
    Additional Hang Signature 2:         84f3
    Additional Hang Signature 3:         f0a90877ec38c16fd285cc410c83433d
    Additional Hang Signature 4:         ba8e
    Additional Hang Signature 5:         cb0b340a390054264815ceb8e3574d53
    Additional Hang Signature 6:         84f3
    Additional Hang Signature 7:         f0a90877ec38c16fd285cc410c83433d
    Extra information about the problem
    Bucket ID:                                          749899167
    Description
    A problem caused this program to stop interacting with Windows.
    Problem signature
    Problem Event Name:                      AppHangXProcB1
    Application Name:                           Adobe Premiere Elements.exe
    Application Version:                         8.0.0.0
    Application Timestamp:                   4aa5c87c
    Hang Signature:                                ba8e
    Hang Type:                                        32
    Waiting on Application Name:       ElementsOrganizerSyncAgent.exe
    Waiting on Application Version:    8.0.0.0
    OS Version:                                        6.0.6001.2.1.0.256.1
    Locale ID:                                           1033
    Additional Hang Signature 1:         cb0b340a390054264815ceb8e3574d53
    Additional Hang Signature 2:         84f3
    Additional Hang Signature 3:         f0a90877ec38c16fd285cc410c83433d
    Additional Hang Signature 4:         ba8e
    Additional Hang Signature 5:         cb0b340a390054264815ceb8e3574d53
    Additional Hang Signature 6:         84f3
    Additional Hang Signature 7:         f0a90877ec38c16fd285cc410c83433d
    Extra information about the problem
    Bucket ID:                                          749899167
    Description
    A problem caused this program to stop interacting with Windows.
    Problem signature
    Problem Event Name:                      AppHangB1
    Application Name:                           Adobe Premiere Elements.exe
    Application Version:                         8.0.0.0
    Application Timestamp:                   4aa5c87c
    Hang Signature:                                af71
    Hang Type:                                        0
    OS Version:                                        6.0.6001.2.1.0.256.1
    Locale ID:                                           1033
    Additional Hang Signature 1:         37a5e7ba79ac8a533571e7d8f2e8acd0
    Additional Hang Signature 2:         d900
    Additional Hang Signature 3:         431be4795d1c061aba02734aa57c4950
    Additional Hang Signature 4:         af71
    Additional Hang Signature 5:         37a5e7ba79ac8a533571e7d8f2e8acd0
    Additional Hang Signature 6:         d900
    Additional Hang Signature 7:         431be4795d1c061aba02734aa57c4950
    Extra information about the problem
    Bucket ID:                                          811067413
    Description
    A problem caused this program to stop interacting with Windows.
    Problem signature
    Problem Event Name:                      AppHangB1
    Application Name:                           Adobe Premiere Elements.exe
    Application Version:                         8.0.0.0
    Application Timestamp:                   4aa5c87c
    Hang Signature:                                7008
    Hang Type:                                        0
    OS Version:                                        6.0.6001.2.1.0.256.1
    Locale ID:                                           1033
    Additional Hang Signature 1:         f0af3d01fb74f43241231d4e61778ffa
    Additional Hang Signature 2:         0fb3
    Additional Hang Signature 3:         a5f1d311bc7bfa26f067b42cbdeac6af
    Additional Hang Signature 4:         7008
    Additional Hang Signature 5:         f0af3d01fb74f43241231d4e61778ffa
    Additional Hang Signature 6:         0fb3
    Additional Hang Signature 7:         a5f1d311bc7bfa26f067b42cbdeac6af
    Extra information about the problem
    Bucket ID:                                          781893170

    Here are my system specs.  Let me know if you need anything else.
    Thanks
    Glenn
    Operating System
    MS Windows Vista Ultimate SP2
               Installation Date: 06 March 2009, 02:58
               Intel Mobile Core 2 Duo T9550
                   Cores                       2
                   Threads                     2
                   Name                        Intel Mobile Core 2 Duo T9550
                   Code Name                   Penryn
                   Package                     Socket P (478)
                   Technology                  45nm
                   Specification               Intel Core2 Duo CPU  T9550 @ 2.66GHz
                   Family                      6
                   Extended family             6
                   Model                       7
                   Extended model              17
                   Stepping                    A
                   Revision                    E0
                   Instructions                MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, EM64T
                   Bus speed                   266.0 MHz
                   Rated Bus speed             1064.0 MHz
                   Stock core speed            2666 MHz
                   Stock bus speed             266 MHz
                   Average Temperature         36 °C
                   Cache
                       L1 data cache size              2 x 32 KBytes
                       L1 instructions cache size      2 x 32 KBytes
                       L2 unified cache size           6144 KBytes
                   Core 1
                       Core speed            1596.0 MHz
                       Multiplier            x 6.0
                       Bus speed             266.0 MHz
                       Rated Bus speed       1064.0 MHz
                       Temperature           37 °C
                       Thread 1
                           APIC ID     0
                   Core 2
                       Core speed            2660.0 MHz
                       Multiplier            x 6.0
                       Bus speed             266.0 MHz
                       Rated Bus speed       1064.0 MHz
                       Temperature           36 °C
                       Thread 1
                           APIC ID     1
          Memory
                   Type                                DDR2
                   Size                                4096 MBytes
                   Channels #                          Dual
                   DRAM frequency                      399.0 MHz
                   CAS# Latency (CL)                   6.0 clocks
                  RAS# to CAS# delay (tRCD)           6 clocks
                   RAS# precharge (tRP)                6 clocks
                   Cycle time (tRAS)                   18 clocks
               SPD
                   Number of SPD modules          2
                   Slot #1
                       Type                DDR2
                       Size                2048 MBytes
                       Manufacturer        Hyundai Electronics
                       Max bandwidth       PC2-6400 (400 MHz)
                       Part number         HYMP125S64CP8-S6 
                       Serial number       00007112
                       Week/year           52 / 08
                       SPD Ext.            EPP
                       JEDEC #3
                           Frequency             400.000000 MHz
                           CAS# latency          6.0
                           RAS# to CAS#          6
                           RAS# Precharge        6
                           tRAS                  18
                           tRC                   24
                           Voltage               1.8 V
                       JEDEC #2
                           Frequency             333.333344 MHz
                           CAS# latency          5.0
                           RAS# to CAS#          6
                           RAS# Precharge        6
                           tRAS                  16
                           tRC                   21
                           Voltage               1.8 V
                       JEDEC #1
                           Frequency             266.666656 MHz
                           CAS# latency          4.0
                           RAS# to CAS#          4
                           RAS# Precharge        4
                           tRAS                  12
                           tRC                   16
                           Voltage               1.8 V
                   Slot #2
                       Type                DDR2
                       Size                2048 MBytes
                       Manufacturer        Hyundai Electronics
                       Max bandwidth       PC2-6400 (400 MHz)
                       Part number         HYMP125S64CP8-S6 
                       Serial number       02008065
                       Week/year           52 / 08
                       SPD Ext.            EPP
                       JEDEC #3
                           Frequency             400.000000 MHz
                           CAS# latency          6.0
                           RAS# to CAS#          6
                           RAS# Precharge        6
                           tRAS                  18
                          tRC                   24
                           Voltage               1.8 V
                       JEDEC #2
                           Frequency             333.333344 MHz
                           CAS# latency          5.0
                           RAS# to CAS#          6
                           RAS# Precharge        6
                           tRAS                  16
                           tRC                   21
                           Voltage               1.8 V
                       JEDEC #1
                           Frequency             266.666656 MHz
                           CAS# latency          4.0
                           RAS# to CAS#          4
                           RAS# Precharge        4
                           tRAS                  12
                           tRC                   16
                           Voltage               1.8 V
    Mother Board
    Manufacturer   Dell, Inc.
               Model                      0P786H
               Version                    A04
               Chipset vendor             Intel
               Chipset model              PM45
               Chipset revision           07
               Southbridge vendor         Intel
               Southbridge model          82801IM (ICH9-M)
               Southbridge revision       03
               BIOS
                   Brand       Dell Inc.
                   Version     A04
                   Date        11/26/2008
               Monitor
                   Name                    Generic PnP Monitor on ATI Mobility Radeon HD 3650
                   State                   enable
                   State                   primary
                   Monitor Width           1920
                   Monitor Height          1200
                   Monitor Bit             32
                   Monitor Frequency       60
                   Device:                 \\.\DISPLAY1\Monitor0
                   Name                    Default Monitor on ATI Mobility Radeon HD 3650
                   State                   disabled
                   State                   removable
                   Monitor Width           800
                   Monitor Height          600
                   Monitor Bit             32
                   Monitor Frequency      60
                   Device:                 \\.\DISPLAY2
               ATI Mobility Radeon HD 3650
                   GPU                         M86
                   Device ID                   1002-9591
                   Subvendor                   Dell (1028)
              

Maybe you are looking for

  • My loop statement in smartforms seems not to be working...

    Hello Experts, I am currently practicing smartforms and I am trying to display the records of my internal table. What I did was in my table under MAIN window I have put the statement: it_spfli into wa_spfli and also in my main area of my table I have

  • My iMac

    I've had my iMac G5 since the start of this year. and only lately has my iMac G5 made me a bit worrysome. Ok so the problems are as followed: 1. The fan goes on full blast (you can hear it whirring, but it sounds like it's hitting something i'll try

  • Net price should not be negative

    hello can any one please suggest how can we control the net price in sales order should not be allowed to be negative ,and the sales order should not be saved regards vipin

  • Device personalization

    This is not a flash lite question but still content related. I have been researching about device customization but I am having a hard time trying to distinguish between the content that can be personalized by a device (independently from the carrier

  • Regaring Infortype 0105 subtype 0011

    Hello,    Can any one tell me how this infotype 0105(communication) Subtype 0011(Credit card) working n how it is masking the user data? Thanks and Regards, Dhinesh Kumar.J