Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts

    binary to decimal / Palindromes

    I am reading JAVA:How to program 7th /E , 4th chapter finished just now,

    by the way can you tell me some lines of source, work , if i have a binary number (eg 1110001101) use "%" & "/" to make it decimal(ex.4.31 p.184) by picking off binary numbers one at a time ?

    Palindromes: Also any function in java make a number it's inverse number, eg 12345 make it 54321 ?

    java mob: pdas with large LCD programmed mainly in XHTML Basic ? Or can display and normal XHTML (with scrolls) ?

  • #2
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I have two PCs is needed register Netbeans 6.1 IDE twice ?

  • #3
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PLEASE ANSWER: And questions prior, at start...

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    The binary conversion can be done using the Integer wrapper class:
    Code:
    try
    {
       int converted = Integer.parseInt("1110001101", 2);
    }
    catch (NumberFormatException ex)
    {
    }
    If you mean to make it a float, I think that the double class wrapper also takes a radix. To do this manually, I'd simply loop through it for decString.length in decrementing fashion, and use leftshifting with addition to track the amount. You can also bitmask it. There are a lot of solutions.
    As for reversing, I think you're out of luck on that one. I don't *think* that the String.getChars works in reverse where you give it a starting position of the length - 1, and an ending position of 0. The easiest way would be to convert it to a char array with the string wrapper, and then iterate through it backwards, and finally converting the resulting string back into an integer. Man a char * would really help here...

    I have no idea about the PDA though. I've only done the small handheld devices, so I have no idea what a PDA requires.

    If you plan on installing netbeans on 2 computers, you'll need to register it twice. Not really a problem though, netbeans is free anyway. Otherwise, just remote into the computer with it installed and work from there.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #5
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    in wmlscript how to build my own libraries ? After build , i refer functions as
    myLib.myfunction() or
    myLib#myfunction() ?

  • #6
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    VS2008express is 64bit software ? There's version for mac apple pc ?

  • #7
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Libraries will be . referenced. Visual Studio can likely be found in a 32 bit build, but good luck finding a copy for mac.
    This is unrelated to Java though, sounds like you're programming in C#.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #8
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How I build my own libraries in java ? how then I refer a functionX() in LibraryX ?

  • #9
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Packages are what java usually uses. All you need to do is jar the file and provide an external reference to it. Import it in using the import keyword, and access it properties through period referencing: namespace.class.method.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #10
    Regular Coder
    Join Date
    Dec 2005
    Posts
    702
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How I build my own libraries of classes/methods in java ? how then I refer a functionX() (i mean method) in LibraryX ? can you give a short/brief example of a library with a class with a method and a main method of normal class calling this method (of external's added library's) ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •