Change a int into a char or unhash a string hash

i need to know how to do one of the things in my title thanks :)

alright thank you very much, i wonder why i didnt
think of that.. rofl well ty for the feedback.. i
dont know if im allowed to say this but i gave u 4
duke starts/points :)Nobody really cares. Thanks. Although after reading the other reply I wonder whether that's what you actually want. I just provided what you asked for.

Similar Messages

  • Combine two ints into a long without using chars or strings.

    Hi
    I have two ints and i need to combine (not add) them into a long value. The reason for this is because I need the make keys for a DB containing both values.
    eg.
    int1 = 3567453647
    int2= 6368535795
    long combination = combine(int1, int2);
    and the value of combination should be 35674536476368535795
    I know you can doing it by turning the ints into strings, combining the strings and then using the combined string as intput to a new Long(String) but I really need a faster way using pure maths (maybe bit shift?) as this combination function will be used billions of times.
    Thanks
    Edited by: user8908143 on 29-Sep-2010 19:52

    It's also a good way to get rid of boneheaded comments once one realizes how boneheaded they were. :-)A posteriori editing is another way :o)
    [OT: Forum features and moderators] A posteriori edition ( self- or mod- )
    Edited by: jduprez on Sep 30, 2010 6:21 PM
    That being said (and mocked), the binary shift left solution seems correct (although I'd definitely go for a custom class and double-column key instead).

  • How can I change my JApplet into a JApplication?

    I am working with a JApplet and am finding that some of my code only works in applications.
    So being new to this, I am clueless as to how to change my Applet into an Application. I understand the difference in definition between the two, but when it comes to looking at Applet Code and Application Code, I am not able to see a difference. (Other than an Applet stating "Applet")
    So, that being said how can I change my code so that it runs as an application and not an applet? Here is my current layout code
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import java.text.NumberFormat;
    import java.text.DecimalFormat;
    // Creating the main class
    public class test extends JApplet implements ActionListener
         // Defining of format information
         JLabel heading = new JLabel("McBride Financial Services Mortgage Calculator");
         Font newFontOne = new Font("TimesRoman", Font.BOLD, 20);
         Font newFontTwo = new Font("TimesRoman", Font.ITALIC, 16);
         Font newFontThree = new Font("TimesRoman", Font.BOLD, 16);
         Font newFontFour = new Font("TimesRoman", Font.BOLD, 14);
         JButton calculate = new JButton("Calculate");
         JButton exitButton = new JButton("Quit");
         JButton clearButton = new JButton("Clear");
         JLabel instructions = new JLabel("Please Enter the Principal Amount Below");
         JLabel instructions2 = new JLabel("and Select a Loan Type from the Menu");
         // Declaration of variables
         private double principalAmount;
         private JLabel principalLabel = new JLabel("Principal Amount");
         private NumberFormat principalFormat;
         private JTextField enterPrincipal = new JTextField(10);
         private double finalPayment;
         private JLabel monthlyPaymentLabel = new JLabel("  Monthly Payment    \t         Interest Paid    \t \t            Loan Balance");
         private NumberFormat finalPaymentFormat;
         private JTextField displayMonthlyPayment = new JTextField(10);
         private JTextField displayInterestPaid = new JTextField(10);
         private JTextField displayBalance = new JTextField(10);
         // Creation of the String of arrays for the ComboBox
         String [] list = {"7 Years @ 5.35%", "15 Years @ 5.50%", "30 Years @ 5.75%"};
         JComboBox selections = new JComboBox(list);
         // Creation of the textArea that will display the output
         private TextArea txtArea = new TextArea(5, 10);
         StringBuffer buff = null;
         // Initializing the interface
         public void init()
              // Creation of the panel design and fonts
              JPanel upper = new JPanel(new BorderLayout());
              JPanel middle = new JPanel(new BorderLayout());
              JPanel lower = new JPanel(new BorderLayout());
              JPanel areaOne = new JPanel(new BorderLayout());
              JPanel areaTwo = new JPanel(new BorderLayout());
              JPanel areaThree = new JPanel(new BorderLayout());
              JPanel areaFour = new JPanel(new BorderLayout());
              JPanel areaFive = new JPanel(new BorderLayout());
              JPanel areaSix = new JPanel(new BorderLayout());
              Container con = getContentPane();
              getContentPane().add(upper, BorderLayout.NORTH);
              getContentPane().add(middle, BorderLayout.CENTER);
              getContentPane().add(lower, BorderLayout.SOUTH);
              upper.add(areaOne, BorderLayout.NORTH);
              middle.add(areaTwo, BorderLayout.NORTH);
              middle.add(areaThree, BorderLayout.CENTER);
              middle.add(areaFour, BorderLayout.SOUTH);
              lower.add(areaFive, BorderLayout.NORTH);
              lower.add(areaSix, BorderLayout.SOUTH);
              heading.setFont(newFontOne);
              instructions.setFont(newFontTwo);
              instructions2.setFont(newFontTwo);
              principalLabel.setFont(newFontThree);
              monthlyPaymentLabel.setFont(newFontFour);
              displayInterestPaid.setFont(newFontFour);
              displayBalance.setFont(newFontFour);
              areaOne.add(heading, BorderLayout.NORTH);
              areaOne.add(instructions, BorderLayout.CENTER);
              areaOne.add(instructions2, BorderLayout.SOUTH);
              areaTwo.add(principalLabel, BorderLayout.WEST);
              areaTwo.add(enterPrincipal, BorderLayout.EAST);
              areaThree.add(selections, BorderLayout.NORTH);
              areaFour.add(calculate, BorderLayout.CENTER);
              areaFour.add(exitButton, BorderLayout.EAST);
              areaFour.add(clearButton, BorderLayout.WEST);
              areaFive.add(monthlyPaymentLabel, BorderLayout.CENTER);
              areaSix.add(txtArea, BorderLayout.CENTER);
              // Using the ActionListener to determine when each button is clicked
              calculate.addActionListener(this);
              exitButton.addActionListener(this);
              clearButton.addActionListener(this);
              enterPrincipal.requestFocus();
              selections.addActionListener(this);
         }

    baftos wrote:
    Here is one of the sites that explains the procedure:
    [http://leepoint.net/notes-java/deployment/applications_and_applets/70applets.html].
    But maybe you should try to fix the code that does not work as applet?
    Which one is it?
    >Here is one of the sites that explains the procedure:
    [http://leepoint.net/notes-java/deployment/applications_and_applets/70applets.html].
    But maybe you should try to fix the code that does not work as applet?
    Which one is it?
    The code that doesn't work in my applet is the exit button code
    else if (source == exitButton)
                        System.exit(1);
                   }I also can't get my program to properly validate input. When invalid input is entered and the user presses calculate, an error window should pop up. Unfortunately it isn't. I compile and run my applications/applets through TextPad. So when I try to test the error window by entering in invalid info, the applet itself shows nothing but the command prompt window pops up and lists errors from Java. Anyhow, here is the method I was told to use to fix it.
    private static boolean validate(JTextField in)
              String inText = in.getText();
              char[] charInput = inText.toCharArray();
              for(int i = 0; i < charInput.length; i++)
                   int asciiVal = (int)charInput;
              if((asciiVal >= 48 && asciiVal <= 57) || asciiVal == 46)
              else
                   JOptionPane.showMessageDialog(null, "Invalid Character, Please Use Numeric Values Only");
                   return false;
                   return true;
         }My Instructor told me to try the following, but I still can't get it to work.String content = textField.getText();
    if (content.length() != 0) {       
    try {          Integer.parseInt(content);  
    } catch (NumberFormatException nfe) {}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Change an myArray[] into a String

    Hi all,
    i was just wondering if there is a way to change an int[] array called myArray[] into a String to be printed out in the command prompt? i have been using a for loop to run through each index of myArray[] and print it out, but i thought that there must be a way to convert the int[] array into a string and print all the elements out at once. i want to avoid the loop, is it possible?
    Thanks
    Jay

    Hi all,
    i was just wondering if there is a way to change an
    int[] array called myArray[] into a String to be
    printed out in the command prompt? i have been using
    a for loop to run through each index of myArray[] and
    print it out, but i thought that there must be a way
    to convert the int[] array into a string and print
    all the elements out at once. i want to avoid the
    loop, is it possible?
    Thanks
    JayJay,
    An Array in java is an object, not a primitive, and inherits the toString() method from Object, which prints the object reference. Do you have to use an array? If you use Vector, which implements a growable array, you can take advantage of the fact that Vector has a redefined toString() method which prints the elements of the Vector.
    For example:
    Vector myIntVector = new Vector();
    myIntVector.add( 1 );
    myIntVector.add( 2 );
    myIntVector.add( 3 );
    System.out.println( myIntVector );will print
    [1, 2, 3]

  • Newbie: How to select into a char pointer in Pro*C?

    All Pro*C samples I have seen selects a VARCHAR2 column into a host char array. I want to used a char * instead. However, each time I run the program after successful Pro*C and C compilation, I get a critical error. Can someone share some working code using char * rather than char []? Thanks very much.

    Did you actually allocate space for the data?Funny you mentioned it. Coming from a VB and Java background without C it was not obvious to me that I have to allocate memory after declaring a pointer. But I later found it is necessary. However, even with that I am getting an error. My code (copied from ora-faq and then modified) is like:
    #include <stdio.h>
    #include <sqlca.h>
    void sqlerror();
    EXEC SQL BEGIN DECLARE SECTION;
    char *connstr = "scott/tiger";
    char *db_ename;
    int db_deptno;
    EXEC SQL END DECLARE SECTION;
    int main() {
    db_ename = (char *) malloc(30);
    EXEC SQL WHENEVER SQLERROR DO sqlerror();
         EXEC SQL WHENEVER SQLWARNING CONTINUE;
         EXEC SQL CONNECT :connstr;
         EXEC SQL WHENEVER NOTFOUND GOTO notfound;
         EXEC SQL SELECT ENAME, DEPTNO
              INTO :db_ename, :db_deptno
         FROM EMP
              WHERE EMPNO = 7369;
    found:
         printf("%s is in department %i\n", *db_ename, db_deptno);
         return;
    notfound:
         printf("Employee record not found in database.\n");
         return;
    void sqlerror() {
         printf("Stop Error:\t%25i\n", sqlca.sqlcode);
         return;
    The output is:
    (null) is in department 20
    Did you see anything glaringly wrong?
    Also, in Pro*C, to stored strings, should I use char [], char *, VARCHAR [], or VARCHAR *?
    Thanks,
    Eric

  • Change normal order into expire order

    Hi,
    I am oracle apps developer working in istore 11i module and i new to this forum.My question is i need to change normal order into expire order for this what are all the profile i need change .Please guide me.
    Thanks,
    Bala

    You can get the coordinates of the mouse "drop" relative to the scene in the onDragDropped handler with
    event.getSceneX() and event.getSceneY().
    You can get the location of the top left of a node relative to the scene with
    private Point2D getSceneLocation(Node node) {
         if (node.getScene() == null) {
              return new Point2D(0,0);
         double x = 0 ;
         double y = 0 ;
         for (Node n = node ; n != null; n=n.getParent()) {
              Bounds boundsInParent = n.getBoundsInParent();
              x += boundsInParent.getMinX();
              y += boundsInParent.getMinY();
         return new Point2D(x, y);
    (and you can get the other corners of the node simply by adding the width and/or height from node.getBoundsInLocal() to the result of that if you need.)
    So if you ensure every tab has a graphic, you can iterate through the tabs and do something like
    int dropIndex = 0 ;
    for (Tab tab : tabPane.getTabs()) {
         Point2D tabLocationInScene = getSceneLocation(tab.getGraphic());
         if (tabLocationInScene.getX() > event.getSceneX()) {
              break ;
         } else {
              dropIndex++ ;
    tabPane.getTabs().add(dropIndex, tabToBeAdded);
    Ensuring every tab has a graphic probably just means setting the text to an empty string and setting the graphic to a Label containing the text; or I guess you could just use a zero width and height Rectangle, or some such.

  • C#: How to convert Keyboard.key (Unicode char as number) into correct char?

    Our application uses barcode scanner.
    when scanning a barcode and convert Keyboard.key (as ushort with value 16, it represents char ':') by using
    1)(char)(Keyboard.key)
    2) or Convert.ToChar(Keyboard.key),
    both way convert into symbol '+'.
    How to convert into ':'?
    What is a correct way to convert Keyboard.key as ushort into correct char? Thx!
    JaneC

    Hi Dan Nemec,
    It is normal '+'. It is special '+' symbol.
    We search a little bit and find out Unicode ':' is 3A and value is not 16.
    So during the process barcode scanner, the value has been changed in some way.
    We are trying to find out where the value has been changed.
    JaneC

  • Conversion of NUMC variable into a  CHAR one

    I have come accross an issue wherein i need to change the NUMC value into a CHAR value. Kindly let me know whether there is any function module for this purpose.
    <removed_by_moderator>
    Edited by: Julius Bussche on Dec 31, 2008 10:09 AM

    what is the problem??????????/
    data: var(10) type n.
    data: var1(10) type c.
    var = '0123456789'.
    var1 = var.
    this type of conversions will done , so what is your case???????/
    Regards,
    Arjun.

  • How to replace regex match into a char value (in the middle of a string)

    Hi uncle_alice and other great regex gurus
    One of my friends has a peculiar problem and I cant give him a solution.
    Using String#replaceAll(), i.e. NOT a Matcher loop, how could we convert matched digit string such as "65" into a char of its numeric value. That is, "65" should be converted into letter 'A'.
    Here's the failing code:
    public class GetChar{
      public static void main(String[] args){
        String orig = "this is an LF<#10#> and this is an 'A'<#65#>";
        String regx = "(<#)(\\d+)#>";
        //expected result : "this is an LF\n and this is an 'A'A"
        String result = orig.replaceAll(regx, "\\u00$2");
        // String result = orig.replaceAll(regx, "\\\\u00$2"); //this also doesn't work
        System.out.println(result);

    I don't know that we have lost anything substantial.i think its just that the kind of task this is
    especially useful for is kind of a blind-spot in the
    range of things java is a good-fit for (?)
    for certain tasks (eg process output munging) an
    experienced perl programmer could knock up (in perl)
    using built-in language features a couple of lines
    which in java could takes pages to do. If the cost is
    readability/maintainability/expandability etc.. then
    this might be a problem, but for a number of
    day-to-day tasks it isn't
    i'm trying to learn perl at the moment for this exact
    reason :)Yes. And when a Java source-code processor(a.k.a. compiler) sees the code like:
    line = line.replaceAll(regexp,  new String(new char[] {(char)(Integer.parseInt("$1"))}));or,
    line = line.replaceAll(regexp,  doMyProcessOn("$1")); //doMyProcess returns a Stringa common sense should have told him that "$1" isn't a literal string "$1" in this regular expression context.
    By the way, I abhor Perl code becaus of its incomprehensibleness. They can't be read by an average common sense. Java code can be, sort of ...

  • Changing the heading of free chars  in navigation pane

    Hi,
    Whatever charcterstics are there in free chars column in Query designer will be appearing  in the free chars column in navigation pane .Is it possible to change the heading of free chars to some other caption in navigation pane
    Thanks
    Sany

    Dear Sany,
    Change the DESCRIPTION of the object in the properties of Query Designer. You will get this description where ever u use this object.
    Regards,
    Ram.

  • I need to change a photo into a video file in order to post on youtube. How can I do this with my mac?

    I need to change a photo into a video file in order to post in youtube. How can I do this with my mac mini?

    When I go to import, the choices are :
    movies
    camera archive
    imovie for IOS
    imovie for HD
    It refuses to import a photo with any of these choices, which is located on the desktop or in a folder. It's a regular .jpg
    There are instructions to drag it. I put it there, and it bounces right back. The photo will not stay.
    I just need this one picture to go on so I can post a meditation on youtube.  It doesn't come from a camera.

  • Change a song into a ringtone

    how do i change a song into a ringtone

    I've seen the suggestion to follow ehow iPhone ringtones before, but, as with every other suggestion, I get to one point and what my computer says and what the instructions claim it will say are two different things. For instance, I get to the point on the ehow tutorial (#11) to right-click the ringtone and select "Delete." I do that, and what is SUPPOSED to pop up is a selection box with a (#12) "Keep Files" option. I do not get the "Keep Files" option; rather, a "Remove" or "Cancel" button. If I click "Cancel," of course, it brings me back to square one. If I select "Remove," it removes the files and closes it out with no option to keep the file somewhere. What type of computer is actually in use in the ehow directions?

  • Using PRO XI for educators. Every time I try to change a document into a PDF document the program asks me to sign up for a monthly fee.  What's going on???

    I am using Adobe XI Pro for educators.
    Every time I try to change a document into a PDF document the program asks me to sign up for a monthly fee. What’s going on???

    Hi Peter,
    Are you still facing this issue.
    I am not able to see any product registered under the email id using you are registered here.
    Regards,
    Ajlan Hulda.

  • I want to change normal order into expire order

    Hi,
    I am oracle apps developer working in istore 11i module and i new to this forum.My question is i need to change normal order into expire order for this what are all the profile i need change .Please guide me
    Thanks in advance.
    DV.Balaji

    You no need to add the changes, It can be shown in Environment menu. If u want to see the person who changed the PO in ur Print, ABAP work will be required..
    By the way what is the business requirement for this. B'cas PO is meant for vendor, Why do u want to print, whoever did the changes..This thing you can see from SAP itself at anytime.
    Cheers!
    ***Reward If useful (RIU)

  • How can i change analog waves into digital waves?

    we had labview lab last week.. were doing fine if we have instructions unfortunately the professor will give us an exercise regarding baseband signals spectra.. were trying to download a trial software but we dont have any luck. the question asks for us to change analog waves into digital waves, measure the amplitude of the 5-th harmonic using spectrum analyzer.. i hope you can help me thnx..

    After you are successful getting LabVIEW on your computer, put together something to at least show us you're up for learning.  Then we can guide you to a solution that you've developed (mostly) on your own. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

Maybe you are looking for

  • Awesome 3.4.5-1 video issues (lingering visuals)

    I recently upgraded to awesome 3.4.5-1. I didn't reboot at the time, just restarted x. I rebooted when my house burned down, and at the same time had to change my nvidia settings [back to a single screen]. Since rebooting and changing settings, my aw

  • Bank Account Problem

    I'm sorry I keep asking question but my company just switched to the BlueJ program and I'm not quite fond of it yet. My Issue is that I need to add the change program from this:     Initial balance? 2000     Interest rate? 4     Number of periods? 8

  • Interface-Establishing relation of idoc created and Purchase requisition

    Hi All, I have created a program wherein idocs are generated. Its gives rise to Purchase requisition. Can you please tell me how to show the PR created against the idocs that are generated in the spool list? Please note the function module creating t

  • Cannot connect to YouTube on ipad3

    Cannot connect to YouTube using YouTube app on ipad3 / iPhone 4 works fine

  • ITunes Library Damaged, lost playlists

    Hi, we were running iTunes on my wife's computer. The iTunes Library was damaged. When iTunes came up again, the playlists were lost. I was able to recover the playlists, and wanted to share how. I looked at the Apple help page http://support.apple.c