Little problem with Strings.

          I have an little problem with Strings, i make one comparision like this.
          String nombre="Javier";
          if( nombre.equalsIgnoreCase(output.getStringValue("CN_NOMBRESf",null)) )
          Wich output.getStringValue("CN_NOMBRESf",null) is "Javier" too, because I display
          this before and are equals.
          What I do wrong?.
          

You are actually making your users key in things like
"\026"? Not very user-friendly, I would say. But
assuming that is the best way for you to get your
input, or if it's just you doing the input, the way to
change that 4-character string into the single
character that Java represents by '\026', you would
use a bit of code like this:char encoded =
(char)Integer.parseInt(substring(inputString, 1),
16);
DrClap has the right idea, except '\026' is octal, not hex. So change the radix from 16 to 8. Unicode is usually represented like '\u002A'. So it looks like you want:String s = "\\077";
System.out.println((char)Integer.parseInt(s.substring(1), 8));Now all you have to do is parse through the String and replace them, which I think shouldn't be too hard for you now :)

Similar Messages

  • Problem with String variable

    I am new to Java Programming.
    I have a line of code that works and does what is supposed to.
    faceData.getProfile("Lisa").removeFriend("Curtis");
    If I assign the strings to variables such as-
    String name = "Lisa";
    String fName = "Curtis";
    and then plug those into the same line of code, it does not work
    faceData.getProfile(name).removeFriend(fName);
    What could be causing the problem?
    I even added some lines to print out what is stored in the variables to verify that they are what they should be, but for some reason the variables do not work while putting the strings in quotes does. Any ideas?

    I guarantee that something about your assertions are incorrect. Those variables are either not equal to the values you claim, or something else is going on. But it's not a problem with string variables versus string constants.
    Edit: My best guess in lack of a real example from you, is that the strings in question have non-printable characters in them, such as trailing spaces or line feeds.

  • Little problem with Photoshop ....

    Hi. I have a little problem with photoshop CS 4. I use a color replacement tool to change a color in some details... but when i set new color, on pictures entries only or grey or black colors and nothing other... i dont known why.... please help . Thanks. Sorry for bad english

    Usually the Color mode is the one you want for the color replacement tool, you
    might have it set to luminosity or your trying replace black or white colors.
    MTSTUNER

  • Problem with String to Int conversion

    Dear Friends,
    Problem with String to Int conversion
    I am having a column where most of the values are numeric. Only 4 values are non numeric.
    I have replaces those non numeric values to numeric in order to maintain the data type.
    CASE Grade.Grade  WHEN 'E4' THEN '24'  WHEN 'E3' THEN '23'  WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade  END
    This comes the result as down
    Grade
    _0_
    _1_
    _10_
    _11_
    _12_
    _13_
    _14_
    _15_
    _16_
    _17_
    _18_
    _19_
    _2_
    _20_
    _21_
    _22_
    _23_
    _24_
    _3_
    _4_
    _5_
    _6_
    _7_
    _8_
    _9_
    Refresh
    Now I want to convert this value to numeric and do some calculation
    So I changed the formula as below
    cast (CASE Grade.Grade  WHEN 'E4' THEN '24'  WHEN 'E3' THEN '23'  WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade  END as INT)
    Now I get the following error
    View Display Error
    _     Odbc driver returned an error (SQLExecDirectW)._
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    _State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1722, message: ORA-01722: invalid number at OCI call OCIStmtFetch. [nQSError: 17012] Bulk fetch failed. (HY000)_
    SQL Issued: SELECT cast ( CASE Grade.Grade WHEN 'E4' THEN '24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' ELSE Grade.Grade END as Int) saw0 FROM "Human Capital - Manpower Costing" WHERE LENGTH(CASE Grade.Grade WHEN 'E1' THEN '20' WHEN 'E2' THEN '21' WHEN 'E3' THEN '22' WHEN 'E4' THEN '23' ELSE Grade.Grade END) > 0 ORDER BY saw_0_
    Refresh
    Could anybody help me
    Regards
    Mustafa
    Edited by: Musnet on Jun 29, 2010 5:42 AM
    Edited by: Musnet on Jun 29, 2010 6:48 AM

    Dear Kart,
    This give me another hint, Yes you are right. There was one row which returns neither blank nor any value.
    I have done the code like following and it works fine
    Thanks again for your support
    Regards
    Code: cast (CASE (CASE WHEN Length(Grade.Grade)=0 THEN '--' ELSE Grade.Grade END) WHEN 'E4' THEN '24' WHEN 'E3' THEN '23' WHEN 'E2' THEN '22' WHEN 'E1' THEN '21' when '--' then '-1' ELSE Grade.Grade END as Int)

  • Little Problem with Photoshop CS3

    Hi, I have a little problem with Photoshop CS3, I'm not sure if this's because a Windows option that I messed up, but the thing is that I didn't touch any options, or some kind of preferences.
    I'm talking about the "little windows" (I don't know the correct name) that come from, in this case, the Filter and Analysis options, they're coming down from their right side, and usually, the come down from their left side. This is really annoying.
    Not big deal, but I can't really work properly. I hope you guys can help me, and this's my first post, I hope I didn't break any rule.

    Thanks Mylenium, that was the problem, I don't even have a tablet, but that fixed my problem =)
    Thanks again.

  • Hello, I have a little problem with my ipod (3rd generation): I restored my iPod because of problems of wi-fi, then synced my music on itunes and then on my ipod. The problem is that I still do not have wi-fi and my ipod says I have no music. Help me!

    Hello, I have a little problem with my ipod (3rd generation): I restored my iPod because of problems of wi-fi, then synced my music on itunes and then on my ipod. The problem is that I still do not have wi-fi and my ipod says I have no music. Help me!

    No. In fact, my ipod detects the livebox and the network but I can not connect to the internet.

  • A little problem with color profiles

    I am trying LR and so far I love it, it has successfully replaced RSP for me, and also beat Bibble which I briefly considered but didn't like due to the weird UI.
    However, I have a little problem with colours, which has never happened so far with other converters, and I am hoping you can help me to solve it.
    My monitor is calibrated with the Spyder and the appropriate profile loaded in the video card.
    When I work on a RAW image in LR, and then export a sRGB JPG, and then open it with a browser, or the Win viewer, I see it redder. If I open the image in Faststone, I see it almost sepia.
    If I export a TIFF and open it in PS, I see it as in LR, but when I export a JPG from PS (this is my typical workflow), the resulting image has the same problem.
    Considering that my entire workflow is in sRGB, can anybody coach me as to the correct settings I must use in order to obtain a final sRGB image with the same colors as in LR? I think that I must be doing something wrong, as the program behaves consistently with PS.
    Thank you in advance for any help you will be able to provide.
    Andrea,
    from Italy

    Funny how it's only Windows users that have this 'problem'.
    This is not a 'problem' at all. The only 'problem' here is that you've been used to using non-color-managed applications. Suddenly, Lightroom comes in as a mature, color-managed, program... and you're all going bonkers.
    Mac users aren't going bonkers because we're used to using color-managed applications (Preview, Safari, etc. are all color-managed on a Mac).
    Let me clarify for you that by 'color-managed', I mean that the software is *not only* reading the embedded profile in your image, but is *also* converting, on-the-fly, the RGB values of that image to a new set of RGB values that compensates for the native response of your monitor. Say, for example, your monitor only displays a narrow gamut of reds. Chances are, then, that LR or PS will intelligently compensate for this by saturating reds before sending to your monitor. This is how color management works. You can now imagine the disastrous effects that a bad/inaccurate monitor profile might have...
    Your Windows applications, such as 'Viewer', use the Microsoft ICM 2.0 API. This *will* read the embedded profile in an image, but instead of converting to your monitor profile for output, will simply convert to sRGB. That's basically like half-a$$ color-management. Read more about it here:
    http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/prork/prdn_img_vkev.ms px?mfr=true
    Firefox & IE don't even use the ICM 2.9 API, making them entirely non-color-managed. Whatever the raw RGB values are in your image, these applications spit out at your monitor.
    It's very important you understand these simple concepts before proceeding any further.
    OK, ready?
    The original monitor profile that came with my MacBook Pro (profiled by someone over at Apple generically for all MacBook Pro LCDs, I guess) really seems to have underestimated the gamut of my monitor. Hence, color-managed applications compensated for this be resaturating my images (especially in the oranges/reds) before outputting to monitor. Therefore, images looked really nice and saturated in color-managed applications; however, when I exported them to sRGB JPEGs and then uploaded to the web, they looked desaturated (in Firefox, NOT in Safari, since Safari is color managed). They even looked desaturated on other people's monitors (these 'other people' were your average Joes...).
    I then profiled my monitor using an i1 colorimeter. A 3-D plot of my monitor profile now showed that it actually had a much larger gamut than what Apple had predicted in their profile (but this gamut was still much smaller than sRGB, or the gamut of my Dell LCD or Sony CRT, etc.). Therefore, now, LR and PS, using this new profile, showed images much less saturated. Now when I made my edits, and then exported to sRGB JPEGs, images looked slightly *more* saturated in non-color-managed applications and on other people's computers.
    So, you see, your monitor profile affects how you make adjustments/edits in color-managed programs. If your hardware profiler profiled your monitor incorrectly (which I assume is the problem here), then you may be over-saturating certain colors within LR, skewing those RGB values so that a non-color-managed program, which will not re-correct these values as LR is doing, will display the image with too much, say, red.
    Bad monitor profiling also explains why you see this problem only on certain images/colors... if it were a LR problem, you'd most likely see it on every export. The color variance is more than likely due to a bad monitor profile that is not accurately describing your monitor's native response... hence LR/PS are incorrectly adjusting your images before sending to the monitor.
    And at this point, please don't resort to saying "but the colors in the web browser look 'right' and LR looks 'wrong'". This statement has no meaning, as what looks 'right' to you in your web browser might look horrible to someone else with a different monitor. The point of color-management is to minimize these differences. For example, I was very unhappy by how desaturated my images looked on the web compared to in PS before I calibrated my monitor. Now, images look slightly *more* saturated on the web than in LR/PS, which I'm OK with. *Should* they look the same? Heck no. Similar? Yes. Is it better if they do look the same after hardware profiling? Yes, if your main goal is web export, but, keep in mind, the only way they *would* look the same after PROPER hardware profiling would be if your monitor happened to have a very sRGB-like response (to explain this would take another few paragraphs... but you should be able to figure it out if you ponder a bit).
    I hope this is making sense. Let me ask you a couple questions now:
    1.) For your headshot image, IMG_8860, which colors look 'right' to you -- the colors in LR, or the colors upon export (i.e. the headshot on the left or the right in your link above)?
    2.) How exactly did your profile your monitor? Was it in the dark? I had quite a bit of variance in my monitor profile depending on whether or not the Mac OS X dock was visible at the bottom of the screen -- the light from the dock leaked into the colorimeter which then led to profiles that generated yellow/green color casts.
    -Rishi

  • Problem with String in a Vector

    I'm making a small hangman game. And I got a problem with putting words in a Vector... This is the code... Can someone tell me what I'm doing wrong?
    // First I define it.
    Vector Words;
    //  Then add the words
    Vector Words = new Vector();
    Words.add(new String("HELLO"));
    Words.add(new String("GOOD BYE"));
    // When I try to get a string from the Vector I use this.
    // The program compiles but when I try to run it I get NullPointerExeption here
    W = (String) Words.elementAt(0);

    Not sure since I cant see all of your code but looks like this might be your problem:
    // First I define it.
    Vector Words; //<-- here you define a Vector named Words that is null
    // Then add the words
    Vector Words = new Vector(); //<-- here you define another vector named Words that holds a reference to a new Vector. This is a different reference than the one created above so you should probably remove the "Vector" part from the beginning of this line. Is this a local variable to a method and the one before is a global variable?
    //Here you probably access the locally created Words vector which is initialized
    Words.add(new String("HELLO"));
    // When I try to get a string from the Vector I use this.
    // The program compiles but when I try to run it I get NullPointerExeption here
    W = (String) Words.elementAt(0); //<--and here my guess is that this statement is inside another method than the one with the local Words vector defined. Thus this one accesses the global Words Vector that is never initalized and is Null. And that gives you the NullPointerException.
    So try changing the statement
    Vector Words = new Vector();
    to
    Words = new Vector();
    or just remove it totally and move the Vector creation to the place where you introduce the global variable.
    Of course I might be totally wrong since I cant see all of your code but that is my guess.
    Hope it helps,
    -teka

  • I have a little problem with input in my program...(System.in, BufferedRead

    I'm coding a program that takes a input like this :
    Sample Input
    1 11 5
    2 6 7
    3 13 9
    12 7 16
    14 3 25
    19 18 22
    23 13 29
    24 4 28
    So I wrote a code like this :
    public static void main(String[] args) throws Exception{
              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              String input = null;
                   while((input = br.readLine()) != null) {
                   StringTokenizer st = new StringTokenizer(input);
                   int leftX = Integer.parseInt(st.nextToken());
                   int height = Integer.parseInt(st .nextToken());
                   int rightX = Integer.parseInt(st.nextToken());
    .... rest of the code....
    But unlike I expected, the program did not pass the while loop.
    When I observed in debugging mode, when "br.readLine()" has no more strings to read,
    the whole program just becomes idle doing nothing, and it does not proceed further.
    Is there any problem with my code there? I've been trying to figure it out for hours... Please help!!!

    myunghajang wrote:
    Why doesn't it work in a way I intended? BufferedReader returns null if there is no more string to read, and what's the problem?
    It's so frustrating...The computer doesn't have a mind reading input, how is your program supposed to know you have finished typing the input?
    If you put the data in a file and redirect it into your program on the command line it will work (because the file knows where its end is)
    Your program could instead assume that a blank line is you end of input.

  • StringTokenizer class problem with strings in double quotes

    Hello Technocrats,
    I have a problem with tokenizing following string enclosed in (). (abc," India, Asia", computer engineer). My separator is ",", thus StringTokenizer class gives me 4 tokens namely abc, "India, Asia" and computer engineer. But I require that String in double quotes should be a single token. How to achieve this using StringTokenizer class? Or is there any other way?
    Thanks in advance.

    Try
    String[] str="abc,\" India, Asia\",computer engineer".split(",",1);
              for(String s: str)
                   System.out.println(s);
              }Thanks.

  • Urgent Little Problem with JApplet

    Hi, i have a little problem, i have an applet that loads on a webpage
    it contains two textFields and a command button , i want when i click
    on the button i should open a new page with the values in the two TextFields.
    Thanks.

    Use getAppletContext().showDocument(URL url).
    ================================
    Sincerely,
    Melnikov V
    AlarIT programmer
    http://www.AlarIT.com
    ================================

  • A stupid little problem with FORTE

    Hi to everyone,
    I'm using FORTE on windows 2000 but I've a little problem: I can't put the characters {} in the source editor.
    I've tried with the ASCII code (ALT + 123) and with ALTGR+7 but they don't work. How ca I do?
    Thanks

    You can copy the them from where you are able to type them, and then paste them in the editor with ctrl+v. To copy, you can use ctrl+c.

  • Little probleme with UIScrollBar

    Hi,
    Im having a problem with my UIScrollBar.,
    I have a dynamic text field "My_text" in the scene.  the text is aplied to it  dynamicly    like this: My_text=String(theVarText). The text appear but the scroll dont scroll. but if i set the text in the textfield in the actual FLA and export the movie, the scroll works, Can someone tel me WHY ??

    When you write to a textfield that has a scrollbar assigned to it, you need to refresh the scrollbar if you change/add text after the file is playing.  I don't have the help documents available at the moment, but if you should be able to look thru the UIScrollbar methods and find the method that is used for this... possibly reset() or refresh() or update().  So once you write to the textfield, use that command to make the scrollbar readjust to the new next situation.

  • Having a little problem with iPhone 3G.

    Hi!
    I have problem with Iphone 3G 16 GB. I was trying to reset all the settings in the iphone but something went to wrong side and now probably operating system is damaged and only icon for connection to the iTunes is showing up. ITunes is not recognizing the phone. Please can you help me!
    Thanks in advance.

    Hey gonche,
    The iPhone is in Recovery Mode, generally the iPhone will have to be restored to get it out of recovery mode.
    This article: http://docs.info.apple.com/article.html?artnum=305744 will walk you through restoring the iPhone.
    -Jason

  • Little problem with rename view

    Hej, I've been having a problem an small problem with this... so far i'm changing the position of the tree of and Active Directory account... the major problem is that if i move this account 3 times the accountId fot that resurce is still the original one.
    <set name='newViews.newAccountId'>
                    <ref>myIdentity</ref>
                  </set> 
                  <set name='newViews.accounts[AD].newAccountId'>
                    <ref>myIdentity</ref>
                  </set>
                  <set name='newViews.resourceAccounts.selectAll'>
                    <s>false</s>
                  </set>
                  <set name='newViews.accounts[AD].identity'>
                    <ref>myIdentity</ref>
                  </set>
                  <set name='newViews.accounts[AD].newAccountId'>
                    <ref>myIdentity</ref>
                  </set>
                  <set name='newViews.resourceAccounts.currentResourceAccounts[AD].identity'>
                    <ref>myIdentity</ref>
                  </set>
                  <set name='newViews.resourceAccounts.currentResourceAccounts[AD].selected'>
                    <s>true</s>
                  </set>
                  <set name='newViews.resourceAccounts.currentResourceAccounts[Lighthouse].selected'>
                    <s>false</s>
                  </set>myIdentity is the new value for the account basically cn=..,ou=.. etc.. and all works fine but the first given accountId when the account is created always remains and is never changed during the rename action....

    Hi,
    I had the same problem. The move operation in AD functioned perfectly but the displayed account information kept showing the old DN. The problem was, I had the move activity inserted in the update user workflow BEFORE the Provision activity. I moved my custom rename activity to AFTER Provision (and right before notification) and now the new DN is showing on the account information screen. It appears that if you do the rename before provision, the old information will overwrite the new stuff. But if you do it after provision the new stuff will overwrite the old stuff.
    I hope this helps :-)

Maybe you are looking for

  • Where are the print drivers found?

    I have a Brother HL 2040 laser printer. THe Brother website has a version 2.2 driver for this printer. I downloaded and installed. When I add the printer I keep getting version 1.4 driver. Can someone tell me where are the drivers found on my iMac? A

  • To know the name of the job

    Hi all,    Could u say me how to get the name of the job that is being used in the program if if the name of the report is known?

  • Problem with Tabs Palette

    Perhaps someone can help me. I hope this isn't a problem that only I have run across. There's no consistency to this but every so often, my Tabs Palette stops working. Where I had been able to set tabs within a document, suddenly I can't add, move, o

  • Slideshows to iTunes

    I create slideshows in Elements 7 and they have to be saved as wmv. files.   How can I download/export thes videos to iTunes for synching to my iPod Touch?    iTunes say that only videos purchased from Apple can be downloaded to iTunes, but I am sure

  • Status of new account? Can human be reached?

    I am so very frustrated and can't find a way to communicate with a human! We started our application a few months ago, finally got it signed and submitted online and the screen said we were awaiting an account review before activation. That was weeks