huzi8t9's Profile User Rating: -----

Reputation: 23 Tradesman
Author w/DIC++
Active Posts:
345 (0.12 per day)
11-July 07
Profile Views:
Last Active:
User is offline Jan 08 2015 02:45 PM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Favorite Gaming Platform:
Your Car:
Dream Kudos:

Latest Visitors

Icon   huzi8t9 Enjoying LEGO Batman way too much for the 360....

Posts I've Made

  1. In Topic: Mathematical Error - index out of bounds

    Posted 8 Oct 2014

    View Postmodi123_1, on 08 October 2014 - 08:01 PM, said:

    To be clear - you understand what the out of bounds means, right? Say you have an array with 5 items. If you try and access index 6 that is out of bounds. Like asking a person to read page 90 of a 10 page book.

    I fully understand what out of bounds means. However, I have tried checking to see if the requested "char" was available, if not, set "x" to '\0'. That doesn't seem to cut it.

    Thanks for your reply though, I now have a better understanding of what out of bounds means.

  2. In Topic: Mathematical Error - index out of bounds

    Posted 8 Oct 2014

    After lots debugging and a bit of tweaking, I've only come to learn what I knew already - which is quite annoying.

    I've amended my code a little and wrote a basic function called ln which just basically does System.out.println.

    Here's a segment of my amended code:

    int y = (int)0xFFFFFFFF;
            char x = salt.charAt(0);
            for (int i = 0; i < 4; i++)
                x = (char)(x ^ y);
                ln("X1 = " + x);
                x = (char)(x & 255);
                ln("X2 = " + x);
                y = table[x] ^ (y >>> 6);
                ln("Y1 = " + y);
                x = (char)(salt.charAt(1 + i * 2) ^ y);
                ln("X3 = " + x);
                x = (char)(x & 255);
                ln("X4 = " + x);
                y = table[x] ^ (y >>> 6);
                ln("Y2 = " + y);
                //PROBLEM START
                x = salt.charAt(2 + i * 2);
                ln("X5 = " + x);
                ln("Loop " + (i+1) + " of 4 complete.");
            ln("Array populated.");

    Image: Posted Image

    And here's the important parts of the stack trace

    10-08 19:40:55.031  12208-12208/mhp.parentaltool I/System.out﹕ Loop 3 of 3 complete.
    10-08 19:40:55.031  12208-12208/mhp.parentaltool I/System.out﹕ X1 = 뚖
    10-08 19:40:55.031  12208-12208/mhp.parentaltool I/System.out﹕ X2 = 
    10-08 19:40:55.031  12208-12208/mhp.parentaltool I/System.out﹕ Y1 = 445592619
    10-08 19:40:55.031  12208-12208/mhp.parentaltool I/System.out﹕ X3 = 㐓
    10-08 19:40:55.031  12208-12208/mhp.parentaltool I/System.out﹕ X4 =
    10-08 19:40:55.031  12208-12208/mhp.parentaltool I/System.out﹕ Y2 = -2066235570
    10-08 19:40:55.031  12208-12208/mhp.parentaltool D/AndroidRuntime﹕ Shutting down VM
    10-08 19:40:55.031  12208-12208/mhp.parentaltool W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x40d192a0)
    10-08 19:40:55.046  12208-12208/mhp.parentaltool E/AndroidRuntime﹕ FATAL EXCEPTION: main
        java.lang.StringIndexOutOfBoundsException: length=8; index=8
                at mhp.parentaltool.ParentalTool.genKey(
                at mhp.parentaltool.ParentalTool.access$100(
                at mhp.parentaltool.ParentalTool$1.onclick(
                at android.view.View.performClick(
                at android.view.View$
                at android.os.Handler.handleCallback(
                at android.os.Handler.dispatchMessage(
                at android.os.Looper.loop(
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(
                at dalvik.system.NativeStart.main(Native Method)

    If you'll noticed, X5 is never printed in the stack trace before the error is thrown.

    The "salt" is based on an 8-digit code, generated by user input.

    Why is this error happening? I've tried working around it but there's nothing I can do :(/>/>

    Any help appreciated


  3. In Topic: Mathematical Error - index out of bounds

    Posted 8 Oct 2014

    View Postmodi123_1, on 08 October 2014 - 05:57 PM, said:

    I am not sure what row 119 is in your code, but the exception is being kicked around there.

    Line 119 is the line where that (y = table[x] ^ (y >>> 8);) happens. Tried debugging, now the 'logcat' won't work. It's not my day, think I need a break :)

    Thanks for the quick response, will post further if needs be.

    Thanks again

  4. In Topic: [SOLVED] MySQL Syntax - unable to correctly populate

    Posted 8 Apr 2014

    View PostArtificialSoldier, on 08 April 2014 - 06:52 PM, said:

    You need parentheses in the WHERE clause. If any of those conditions surrounded by OR match then the record will be returned regardless of whether or not the AND conditions match. Use parentheses to tell it exactly what you mean.

    Nailed it - thank you! The query ended up being SELECT * FROM posts, users WHERE (users.user_id=posts.post_id AND posts.post_replyto='0' AND posts.post_removed='0' AND posts.post_privacy='World') OR (posts.post_replyto='0' AND posts.post_removed='0' AND posts.post_user='2' AND users.user_id=posts.post_user) OR (posts.post_replyto='0' AND posts.post_removed='0' AND posts.post_user='3' AND users.user_id=posts.post_user) ORDER BY posts.post_date DESC;. The parentheses did the trick.

    Thank you again.

  5. In Topic: Not able to pass $_Session variables

    Posted 28 Jan 2014

       // get the product id
       $DVDID = isset($_GET['DVDID']) ? $_GET['DVDID'] : "NOT_SET";
       $name = isset($_GET['NameOfTheDVD']) ? $_GET['NameOfTheDVD'] : "NOT_SET";
       $Quantity = isset($_GET['Quantity']) ? $_GET['Quantity'] : "NOT_SET";
       require "connect.php";
       $query = "SELECT `DVDID`, `NameOfTheDVD`, `Quantity` FROM `DVD`";
       $stmt = $dbhandle->prepare($query);
        * check if the 'cart' session array was created
        * if it is NOT, create the 'cart' session array
     . */
         $_SESSION['cart'] = array();
        array_push($_SESSION['cart'][], $DVDID);
        // !!- The above line WAS aray_push($_SESSION['cart'][] = $DVDID); - it should be coma separated. In the first parameter, you're telling the function WHICH array you're pushing to, the SECOND parameter is the value you want adding to the array(the FIRST parameter).
        // redirect to product list and tell the user it was added to cart
        header('Location: shop.php?$action=add&DVDID=' . $DVDID . '&NameOfTheDVD=' . $name);

    Try setting the values where you're initially assigning them to a variable. It appears they're coming from $_GET on your first section of code. I've changed some of it to work, see the comments.

    Secondly, I see you're querying the database but doing nothing with the result?

    Hope this helps


    edit changed a typo

My Information

Member Title:
D.I.C Regular
25 years old
August 30, 1989
Nottinghamshire, England
Programming, Rock Climbing, Programming.
Full Name:
Mark Hughes
Years Programming:
Programming Languages:
HTML, JavaScript, jQuery, Visual Basic, C++, PHP, ASP, ActionScript 2/3

Contact Information

AIM  Glitcher 04
Website URL:
Website URL
Yahoo  gOoDnPlEnTy83
Skype  huzi8t9



Page 1 of 1
  1. Photo

    jesicalbaby Icon

    16 Sep 2013 - 14:34
    My name is Miss jesical,
    i saw your profile today
    and,i fill more interest to contact you ,
    i will like you to please send me
    an email via (
    for me to send you my picture
  2. Photo

    ahmed12345 Icon

    19 Feb 2012 - 12:09
    i am having problem in under standing with this assignment, can any one out there help me to better under stand

    1. Demonstrate knowledge of abstract classes and interfaces,
    2. Show how to handle exceptions.


    This is an assignment about Assignments and Grades. Some Assignments in this class are Gradab...
Page 1 of 1