SwiftStriker00's Profile User Rating: *****

Reputation: 433 Architect
Group:
Expert w/DIC++
Active Posts:
1,599 (0.75 per day)
Joined:
25-December 08
Profile Views:
29,268
Last Active:
User is offline Oct 03 2014 11:04 AM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Jeep
Dream Kudos:
275

Latest Visitors

Icon   SwiftStriker00 has set their status

Posts I've Made

  1. In Topic: <img> not displaying properly, and background-color not being

    Posted 3 Oct 2014

    Solved, this worked:
    //thumbnail.style = "background-color: " + opponentColor +";";
    
    thumbnail.style.backgroundColor = opponentColor;
    


    I'll get someone better at making graphics to fix the png
  2. In Topic: <img> not displaying properly, and background-color not being

    Posted 3 Oct 2014

    I'm not using any shadows or gradients behind the png image. My code basically outputs this:
    Firefox
    <img alt="Field 1" src="images/shirt_field1.png" style="background-color: rgb(90, 142, 190);">
    

    I.E:
    <img alt="Field 3" src="images/shirt_field3.png">
    


    I'm wondering if jQuery mobile is changing something, or IE/Chrome don't support the line:
    thumbnail.style = "background-color: " + opponentColor +";";

    I'm not 100% worried about the border color, I'm going to get a friend to make a better graphic for me, but those imgs are 80x80, and that is what jquery mobile scales the images to.
  3. In Topic: How do I get rid of a null pointer exception?

    Posted 16 May 2013

    --
    Bit of further explanation of locality. The reason we can use the same variable name in different methods is because of the scope of a variable. in Java it is pretty simple to tell in the basic case because a variable will stay in scope until the code block is complete (e.g.
    { }
    
    ). Take the following code. It will break because I try and access the variable out of scope
    if( true ) {
       int a = 5;
    }
    System.out.println( a );
    


    Now when dealing with class variables and constructors we usually want to keep our terminology the same to make things easier. So if we create a new Person( "Sam" ). we would probably write a class like this:
    public class Person{
      private String name;
    
      public Person( String name )
      {
        //what do we put here?
      }
    }
    

    So how do we know which 'name' to use? Well if you don't explicitly tell Java, it will always use the most local one. Another way of saying is the more recently created one inside that block (in the class above, it would be the parameter to the constructor). So in order to maintain the similar terminology and state which to save we need the keyword this.
    public class Person{
      private String name;
    
      public Person( String name )
      {
        this.name = name;
      }
    }
    

    this, is talking about "this class" essentially, and will distinguish that we want to save the parameter 'name' to the class 'name'.
  4. In Topic: How do I get rid of a null pointer exception?

    Posted 16 May 2013

    You are getting a null pointer exception because you your constructor has the line int[][] board = .... Because you put the int[][] java thought you were creating a new local variable for that method. So you are not actually saving the new to the class variable board.

    Just delete the int[][] in your constructor
  5. In Topic: Can anyone explain what is wrong with this code ?

    Posted 13 May 2013

    Syntactically speaking your code is fine. But as GregBrannon said, you need to tell us what you are expecting versus what you are actually getting.

My Information

Member Title:
No idea why my code works
Age:
26 years old
Birthday:
May 7, 1988
Gender:
Location:
Rochester, NY
Interests:
Programming, Snowboarding, Videogames, Football, Camping, Watching movies
Full Name:
Ryan Bucinell
Years Programming:
6
Programming Languages:
C#, Java, C++, Actionscript 3.0, Scheme, Perl, Batch, Powershell, Javascript

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://cs.rit.edu/~rmb1201/
Skype:
Skype  SwiftStriker00
LinkedIn:
http://www.linkedin.com/in/ryanbucinell
Facebook:
http://www.facebook.com/ryanbucinell
Twitter:
https://twitter.com/SwiftStriker00

Comments

Page 1 of 1
  1. Photo

    SwiftStriker00 Icon

    07 Sep 2013 - 09:27
    Monu, welcome to d.I.c, if you need help please post your problem in the Java forum along with the code you have already written. We can help you there
  2. Photo

    monu63 Icon

    07 Sep 2013 - 06:50
    hi sir i am a begineer in java.while doing my Thread problem i geting and error of illegal staticdeclaration error. i need know when it usally occur..
  3. Photo

    SwiftStriker00 Icon

    03 Nov 2012 - 12:08
    hi pagelarry, welcome to </d.i.c>
  4. Photo

    pagelarry Icon

    03 Nov 2012 - 06:38
    Hi SwiftStriker..
Page 1 of 1