Violet_82 89 Posting Whiz in Training

Thanks for that. The code posted is obviously a small example and part of a bigger program.

If those values represent something persistent about the MyTest instance that is relevant to a number of methods

That is correct they will be used in a number of methods and (I haven't included this in the example for brevity) their value comes from a user input, so the idea is that users type in the value and then I do whatever check is needed, which actually involves several methods testing those values. The values of the variables stay the same for quite awhile, surely till after all the checks have been made and then (everything will be in a loop) users are asked to input another 2 values for the same variables and it all starts again till the condition used in the loop become false or something like that.
So based on what you said, I think that it will be best to use setter and getters rather than passing parameters. Somehow it felt more right to pass the values as parameters, I don't know why just a feeling, but I will go with the suggestion

Violet_82 89 Posting Whiz in Training

Hi, when I started to look into programming, one of the things I remember many programmers are quite keen on are setters and getters. I totally understand the importance of them but there is one thing that isn't really clear to me. If I have a class with some private members declared in it and setters and getters like:

public class MyTest{
    private int variable1;
    private int variable2;
    ...
    //setter1
    public void setVar1( int theFirst){
        variable1 = theFirst;        
    }
    //setter2
    public void setVar2( int theSecond){        
        variable2 = theSecond;
    }
    //getter1
    public int getVar1(){
        return variable1;
    }
    //getter2
    public int getVar2(){
        return variable2;
    }

    public void doSomething( int theFirst, int theSecond){
        ...
    }
}

and a test class like
public class TheTest{
    int firstVar = 34;
    int secondVar = 20;

    MyTest probe = new MyTest();

    setVar1(firstVar);
    setVar2(secondVar);

    doSomething( firstVar, secondVar);

}

Now my question is this: in the above code I call the setter once to set the value of
the instance variables. I need to use these variables (variable1 and variable2) in my doSomething function but
I am thinking, because I have the setters, this type of call doSomething( firstVar, secondVar); - in which I
pass the local variables to the function - is needless: I might as well do instead doSomething(); , passing no parameters at all and then inside doSomething edit directly variable1 and variable2.
So what's the best way? using setters or passing variables to the function?
thanks

Violet_82 89 Posting Whiz in Training

thanks for your replies,
@Schol-R-LEA:

when what you presumably wanted was for it to return true if no cases proved to equal myEnumeration.FRIDAY

That is correct, it's exactly what I want to do, I didn't realize that in the way I construct the function it would exit at the first pass, so I will change it as you suggested.

@bguild:

The problem comes from the fact that it is possible for myarray to have zero-length,

I appreciate that my snippet was only a function so it doesn't say much about the rest of the program, but I would have thought that the array always has a lenght > 0 because I initialize it, so I think it will never be empty
thanks

Violet_82 89 Posting Whiz in Training

Chaps, I am having some problems with a return statement in a function.
I have this situation:

    public boolean isFine(){
        for( int i = 0; i < myarray.length; i++ ){
            for(int j = 0; j < myarray[i].length; j++ ){
                if( myarray[i][j] == myEnumeration.FRIDAY ){
                    return false;
                }
                else{
                    return true;
                }
            }//end of column array
        }//end of row array     
    }//end of isFine()

I am returning values to the caller using if statements. Now, the compiler is telling me that a return statement is missing, but in fact I have 2. Does it say that because it wants me to have a return statement further down, before the last set of brackets? If so how can I possibly do it?!
thanks

Violet_82 89 Posting Whiz in Training

brilliant, yep crystal clear! no wonder i was getting all sort of errors
thanks

Violet_82 89 Posting Whiz in Training

Chaps, sorry I have a silly question. I am not quite sure if this is right, but what is the differenct between the two below:

public class myclass{

    public static void main( String args[] ){
    boolean variable1 = false;
    boolean variable2 = false;
    ...
    System.out.print(variable1 + " and " + variable2)
    }

and

public class myclass{
    boolean variable1 = false;
    boolean variable2 = false;
    public static void main( String args[] ){   
    ...
    System.out.print(variable1 + " and " + variable2)
    }

Does it mean that in the second snippet the variables are static? Also will I be able to print both of the variables in both snippets without compilation errors?
thanks

Violet_82 89 Posting Whiz in Training

yes that's it, could you show me the source code please?
thanks

Violet_82 89 Posting Whiz in Training

thanks I came across that too, but using that metatag means that I will force the browser to display only the feature that the broswer specified in the header supports, and I don't want that, I want the page to be displayed with all the features. This method could be I think useful for debugging only I presume.
But what I am asking is whether the compatibility buttons essentially means that some work needs to be done or I can leave it like that, and whether the browser can actually force a website to display in compatibility mode
thanks

Violet_82 89 Posting Whiz in Training

Hi all, I have a few questions about compatibility mode. I am using IE9 at the moment.
First and foremost, I have noticed that the compatibility icon tends to appear quite often when browsing the internet: it appears when I look at the bbc site http://www.bbc.co.uk/ and w3c schools just to name a few http://www.w3schools.com/. Does it mean that those sites are somehow broken?

Then, is it possible that when viewing a website IE9 will force it in and therefore display it in compatibility mode? This assuming you haven't clicked the compatibility mode icon.
My understanding is that, if and when that icon appears, if you don't click it the site still works. If you do click it, then - as microsoft says http://windows.microsoft.com/en-us/internet-explorer/use-compatibility-view#ie=ie-10 - that site sits within the compatibility sites list and will therefore be displayed in compatibility mode all the time unless you clear that list.

I have done quite a bit of reading about it, but I am not clear whether just the mere fact that the compatibility icon appears means "your site has problems" or not.

Violet_82 89 Posting Whiz in Training

No I am not expecting a member to resolve all the issues, I was just answering your question about "what all this has to do with javascript" and therefore I listed the issues that I thought could be resolved with js.
I haven't added anything to the code, I appreciate that it will work fine with @media only screen and (min-device-width : 320px) and (max-device-width : 480px) - I haven't tried but if it worked for you I don't see why it shouldn't work for me - but the main issue with theis approach as said is that the reading order changes: a list is meant to be read from top to bottom and not I have to read it from left to right, so that, for example, product1 and product2 are next to each other and not one above the other as it should be, see screenshot

Violet_82 89 Posting Whiz in Training

try and see first what are distinctive and repeating code, and write those as methods first, it'll spare you a lot of work.

I did that stultuske and I came up with this code which has the class and a few methods (some of them you will find them in my original post):

/*TicTacToe.java*/
public class TicTacToe{
    private string board[];//ticTactToe board
    private boolean isFull = false;//if true all the squares have been assigned.
    private boolean isDraw;//to check if the game is draw
    private boolean squareStatus;//returns the status of a square, if false the square is full if true the square is empty
    private boolean victory;//if returns true one of the players has won
    private int playerCounter = 1;//if it is odd it's player1's turn if even it's player2's turn
    private int row;//row of the 3-by-3 array
    private int column;//column of the 3-by-3 array

    function boolean checkSquare(int number1, int number2){
        if(array[number1][number2] == EMPTY){
            return false;
        }
        else{
            return true;
        }       
    }
    function void assignSymbol(int number1, int number2, int counter){
        if(counter is odd){//it's player1
            array[number1][number2] = X;        
        }
        else{//it's player2
            array[number1][number2] = O;        
        }
    }
    function boolean checkDraw(){
        if (all the squares are full){
            return true;
        }
        else{
            return false;
        }
    }
    function boolean checkVictory(){
        //check if anybody has won; 
        if(there are 3 X or O in horizontal, vertical, or diagonal row){
            return true;
        }
        else{
            return false;
        }       
    }
}//end of class

-checkSquare() checks that the selected box is empty (passing the 2 parameters inserted by the …

Violet_82 89 Posting Whiz in Training

That's right. Not only that: sometimes - unfortunately I can't replicate that all the time - when the list is broken, if you hover on the text, it resets itself...

Violet_82 89 Posting Whiz in Training

Chaps, I have come across something really really odd. I won't bother you with too many details, what happened on the website I am working on, but I have managed to recreate the issue in a very simple page. Basically, it seems to me that chrome doesn't handle list-style-position very well. Let's look at an example.

<!DOCTYPE html>
<html>
    <head>
        <style>
            .wrapper ul{
                border:1px solid red;
                list-style: inside disc none;
                color: blue;
                float:left;
                margin-right:11.189%;
                margin-left:8px;
            }
            .wrapper{
                margin:0 auto;
                border:1px solid blue;
            }
            .clear{clear:both;}
        </style>
    </head>
    <body>
                <div class="wrapper">
                        <ul>
                            <li><a href="#">Product1</a></li>
                            <li><a href="#">Product2</a></li>
                            <li><a href="#">Product3</a></li>
                            <li><a href="#">Product4</a></li>
                            <li><a href="#">Product5</a></li>                           
                        </ul>

                        <ul>
                            <li><a href="#">Product1</a></li>
                            <li><a href="#">Product2</a></li>
                            <li><a href="#">Product3</a></li>
                            <li><a href="#">Product4</a></li>
                            <li><a href="#">Product5</a></li>                           
                        </ul>

                        <ul>
                            <li><a href="#">Product1</a></li>
                            <li><a href="#">Product2</a></li>
                            <li><a href="#">Product3</a></li>
                            <li><a href="#">Product4</a></li>
                            <li><a href="#">Product5</a></li>                           
                        </ul>
                        <div class="clear"></div>
                </div>

    </body>
</html>

Right. if you save this and open it in chrome, bring up the development tool with f12, let's find the ul and disable float:left. As you expect the lists don't float anymore, but now enable the floating property again, and see what happens: you will see that the list is now broken, the bullet points are actually above the text. Repeat this making sure you first disable list-style: inside disc none; in the console: you will see that when you toggle the float property the list doestn' break anymore. And it's not just the float property, it is everything - even toggling the color when list-style: inside disc none; is enabled will break the list.

Now if in …

Violet_82 89 Posting Whiz in Training

hi LastMitch,
thanks for that. Well the reason why I said I might need js is because I have attempted - before posting - something similar to what you've done and it works fine as long as you view the site on a desktop machine. If you resize your browser, say you go down to a resolution of 350px, then the list breaks and I need a solution that works across mobile devices too. That said I haven't tested your code as yet, so I will do it right now to check the list doestn' break.
As for having "longer" css selectors, unfortunately that is necessary for several reasons:
1) I have many uls and lis in my page, and I want to target only the ones inside the wrapper container;
2) I am not the only one who updates the css (which is pretty big by the way), but there are other people that will do that. So I am happy to have a "slower" selector to make sure that the style of that list doesn't get overridden by something else declared somewhere else in the css
thanks

Sorry I forgot a very very important point. WIth your solution above the "reading order" changes: list items ina list are meant to be read from top to bottom, whereas with the percentage solution above, I end up having to read the list from left to right, so effectively the list loses its meaning I believe

Violet_82 89 Posting Whiz in Training

Hi all, I wonder if you can help me at all. I need to display one ul list into separate (3-4) columns one next to the other one, only if the number of items is bigger than 6.
Let's look at the following code.
Html is:

<div class="wrapper">
    <h2 id="first">First</h2>                     
        <ul id="items">                      
            <li><a href="#">Product1</a></li>
            <li><a href="#">Product2</a></li>
            <li><a href="#">Product3</a></li>
            <li><a href="#">Product4</a></li>
            <li><a href="#">Product5</a></li>                           
            <li><a href="#">Product6</a></li>
            <li><a href="#">Product7</a></li>
            <li><a href="#">Product8</a></li>
            <li><a href="#">Product9</a></li>
            <li><a href="#">Product10</a></li>
            <li><a href="#">Product11</a></li>
            <li><a href="#">Product12</a></li>
            <li><a href="#">Product13</a></li>
            <li><a href="#">Product14</a></li>
            <li><a href="#">Product15</a></li>                          
            <li><a href="#">Product16</a></li>
            <li><a href="#">Product17</a></li>
            <li><a href="#">Product18</a></li>
            <li><a href="#">Product19</a></li>
            <li><a href="#">Product20</a></li>                          
        </ul>
    <div class="clear"></div>
   </div>

CSS:

.wrapper ul{
    list-style: inside disc none;
    color: #AC2973;
    /* float:left; */
    margin-right:11.189%;
    margin-left:8px;    
}
.wrapper ul#items li{
    /*width:33%;
    float:left; */
} 

.wrapper ul li a{
    font-size:0.875em;
    line-height:1.428571428571429em; /*14/20*/
}

Now, I appreciate that there will be people saying "oh why don't you use multiple lists etc etc", the thing is, it's a bit complicated to explain, but the cms doestn' like multiple lists etc etc, so in essence I have to have 1 ul which display like multiple ones, one next to the other.

I have tried with css only, following this approach http://csswizardry.com/2010/02/mutiple-column-lists-using-one-ul/ but I will have problems displaying the list correctly on mobile devices so I need to do it via script.

I presume a script should look at the ul, determine whether there are more than 6 items, if so display the 7th item up to the 13th in a separate column …

Violet_82 89 Posting Whiz in Training

Oh one thing I wanted to ask and I forgot. In this program I will have to use a class and an enumeration. Usually I have 2 java files, one for the class and one for the program to test the class: should I have 3 files this time (the 2 above plus the enumeration) or can an enumeration be inside a class?
thanks

Violet_82 89 Posting Whiz in Training

ok I see, so in other words what you stultuske were saying is that I need to refine the code a bit more before I start coding, correct?

Violet_82 89 Posting Whiz in Training

thanks stultuske,
I must admit writing pseudocode isn't really something I am terribly good at : - ). So, just so I understand it correctly, are you suggesting to turn the pseudocode slowly into proper code? But then wouldn't I end up with what I posted first, a mixture of pseudocode and normal code?

Violet_82 89 Posting Whiz in Training

ok, fair enough, maybe I have been too descriptive. How about this?

create TicTacToe class  

create enumeration
    constant X
    constant O
    constant EMPTY

while boolean variable is not true
    if 1st player's turn
        print"Player 1's turn, enter the coordinates of the square";        
    else
        print"Player 1's turn, enter the coordinates of the square";

    check the status of the square
    while the square is not empty
        choose another square 
        check the status of the square

    if the square is empty 
        if it is player n1
            then assign X to the square
        else
            assign O to the square

    print the board (array)
    check if the game is draw
        if it is draw
            print "the game is draw"
            print the board (array)
            break;
    check if any player has won
        if player1 has won
            print "player1 has won"
            print array
            break;
        else
            print "player2 has won"
            print array
            break;
    change the player's turn

thanks

Violet_82 89 Posting Whiz in Training

spot on LastMitch : - ), thanks for your help!

Violet_82 89 Posting Whiz in Training

Hi all it's that time again, java exercise! Mindful of what happened last time http://www.daniweb.com/software-development/java/threads/449525/building-a-simple-airline-reservation-system-exercise/ , this time I have decided that I want to have all the pseudocode done before I even start thinking about how to code the whole thing.
This is what the exercise requires:

Create a TicTacToe that will enable you to write a program to play Tic-Tac-Toe. The class contains a private 3-by-3 2 dimensional arrays. Use an enumeration to represent the values in each square of the array. The enumeration's constants should be named X, 0 and EMPTY (for a position that doesn't contain an X or 0).
The constructor should initialize the board elements to EMPTY. Allow 2 human players. Wherever the first player moves place an X in the specified square amd place an 0 wherever the second player moves. Each move must be to an empty square. After each move, determine whether the game has been won and whether it's a draw.

If anybody is interested this exercise is taken from the Deitel and deitel book "Java How to program" p393.
Ok, this is my pseudocode:
There are plenty of comments so it should be clear what's going on:

/*PSEUDOCODE*/
create TicTacToe class
    private 3-by-3 two_dimensional_arrays;//holds the board
    private boolean isFull = false//if true all the squares have been assigned.     
    private boolean isDraw;//to check if the game is draw
    private boolean squareStatus;//returns the status of a square, if false the square is …
Violet_82 89 Posting Whiz in Training

sort of LastMitch, except that even with overflow visible the image won't extend, because it's a background image. What I am saying is essentially that if I have a div and this div has a background image, it's imposible to get the background image to overflow its container: this because we are talking about a background image.
If instead I have a div and inside a div there is a html image so something like:

<div>
    <img src="myImage.jpg">
</div>

and I try to get that image to overflow its container, then this is possible with some css (positioning the image absolutely in its div container)

Violet_82 89 Posting Whiz in Training

LastMitch, I believe I can't do what I wanted, because a background image can't extend outside its container. So I ended up having an html image, that gave me the flexibility I wanted

Violet_82 89 Posting Whiz in Training

Will give it a go

Violet_82 89 Posting Whiz in Training

Hi chaps, I wonder whether this is possible or not. Basically, I have an absolutely positioned div with a width and height and a background image (it's a little arrow) that I want to overflow its container so that it sticks out and point at something. Is it possible with background images, or do I have to use a html image?
An example is this:

<div class="me">
    <div class="myDiv">

    </div>
</div>





.me{width:900px; 
height:800px;
position:relative;
/*background:url(ajax-loader.gif) 100px 40px no-repeat;*/
border:1px solid red;}

.myDiv{
    background:url('overlayArrow_03.png') no-repeat -20px 0;
    border:1px solid blue;
    height:150px;
    width:300px;
    position:absolute;
    top:217px;
    left:35px;
}

So here the background image is positioned -20px so it should stick out but it doestn's it looks like there is an overflow:hidden applied as a default. Is there anyway I can get that image to stick out?
thanks

Violet_82 89 Posting Whiz in Training

ok thanks for that!

Violet_82 89 Posting Whiz in Training

ok got it, thanks!

Violet_82 89 Posting Whiz in Training

oh yes sorry of course, that's the object and not the class. Even so , so far I have only come across variables to be passed to printf(). SO if you pass an object as a string representation what happens?I understand the toString() gets called automatically when something - in this case an object - is passed to printf() I just never came across that...so if the whole object is passed to it, even its variables (number and string) are passed to printf() and because of that toString() can safely do ( "number: %d; string: %s", number, string );

@stultuske, no worries, I tend to follow good coding habits, I didn't write the above example, I took it as it is from a book. The reason why it has been written like that is because it was only meant ot explain package access

Violet_82 89 Posting Whiz in Training

Hi I wonder if somebody can help me to understand a few things in the following example:

// Fig. 8.17: PackageDataTest.java
// Package-access members of a class are accessible by other classes 
// in the same package.

public class PackageDataTest 
{
   public static void main( String[] args )
   {
      PackageData packageData = new PackageData();

      // output String representation of packageData 
      System.out.printf( "After instantiation:\n%s\n", packageData );

      // change package access data in packageData object
      packageData.number = 77;     
      packageData.string = "Goodbye";

      // output String representation of packageData
      System.out.printf( "\nAfter changing values:\n%s\n", packageData );
   } // end main
} // end class PackageDataTest

// class with package access instance variables
class PackageData 
{
   int number; // package-access instance variable
   String string; // package-access instance variable

   // constructor
   public PackageData() 
   { 
      number = 0; 
      string = "Hello";
   } // end PackageData constructor

   // return PackageData object String representation
   public String toString() 
   {
      return String.format( "number: %d; string: %s", number, string );
   } // end method toString
} // end class PackageData

In this line System.out.printf( "After instantiation:\n%s\n", packageData ); packageData is the name of the class, I didn't know that it could be used as a parameter. I assume it's calling the toString method? But can you actually do that, use the class name to call a method like that?! never seen that before!

Violet_82 89 Posting Whiz in Training
boolean isLeapYear(year)
   if year divisible by 400 return true
   if year divisible by 100 return false
   if year divisible by 4 return true
   return false

Ok, why is it returning false at the very end?

Violet_82 89 Posting Whiz in Training

Ok I see, but am I right to suspect that each browser might implement it in a different way, as in some might not parse that js on time to assign the metatag before the page is load, in other words, is this guaranteed to work on every browser (including mobile ones?) as long as js is enabled?

Violet_82 89 Posting Whiz in Training

ah ok, sorry this is getting more confusing. Wikipedia above said that if a year is divisible by 100 then it's not a leap year hence the year % 100 != 0 condition, so if ((the year is divisible by 4) and (not by 100) or (it is divisible by 400)) then it's a leap year.

Violet_82 89 Posting Whiz in Training

Hi all, I was reading a few things on the net about how to calculate a leap year in java (and not only for that matter). So something like ...if( year % 400 == 0 || ( year % 4 == 0 && year % 100 != 0 ) )...

So on wikipedia I have found that:

if year is divisible by 400 then
   is_leap_year
else if year is divisible by 100 then
   not_leap_year
else if year is divisible by 4 then
   is_leap_year
else
   not_leap_year

so what's that year % 4 == 0 about? the above if should only say if( year % 400 == 0 && year % 100 != 0 ) ) because if these 2 conditions are satisfied then the year is leap year
Or am I getting it wrong?
thanks

Violet_82 89 Posting Whiz in Training

thanks, unfortunately I need the meta tag to be added before the page loads - if it is possible at all.
Yes I am using media queries already, the reason why I wanted to add the meta tag on the fly is because I need a way for the browser to follow these content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1 once the widt has been determined, and I don't know if I can do that with media queries

Violet_82 89 Posting Whiz in Training

thanks, but doesn't the above happen when the page has arleady loaded ? I am not entirely sure how the page evaluates meta tag, I assume it does it before the page load. So what I want ideally is to have the browser to determine the resolution or page width (say I am browsing the site from a mobile device) and if so loads the meta tag and therefore adapt the page to the device
thanks

Violet_82 89 Posting Whiz in Training

HI chaps, I was wondering if it is possible to add a meta tag using jquery to an html page before the page loads.
The reason why I ask, is because I have a page with no viewport meta tag on and it should have it only when the resolution drops below 700px - <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1"/>
Any idea?
thanks

Violet_82 89 Posting Whiz in Training

ok thanks guys, much clearer now!

Violet_82 89 Posting Whiz in Training

I thought the term client was quite widespread (they use it often in the book I am reading http://www.deitel.com/Books/Java/JavaHowtoProgram9e/tabid/3622/Default.aspx).
What you say makes sense, but i have alse heard "client of an object" as in a class that calls the object methods, so I assume in this case it will be EmployeeClass because it uses the methods of the Employee class

Violet_82 89 Posting Whiz in Training

Hi chaps, what do we define as a client of a class please? I keep reading about "clients of a class" but I don't understand what that means. Maybe it is better to have some examples: take the following 2 files:

//Employee.java
public class Employee{
    public static void main(String[] args){
        EmployeeClass employee1 = new EmployeeClass("your name 1", "your surname 1", 0.0);
        System.out.println("Printing values '1' initialized by the constructor.");
        System.out.printf("Name:%s ", employee1.getName());
        System.out.printf("\nSurnname:%s ", employee1.getLastName());
        System.out.printf("\nSalary:" + employee1.getSalary());

        EmployeeClass employee2 = new EmployeeClass("your name 2", "your surname 2", 0.0);
        System.out.println("\n\nPrinting values '2' initialized by the constructor.");
        System.out.printf("Name:%s ", employee2.getName());
        System.out.printf("\nSurnname:%s ", employee2.getLastName());
        System.out.printf("\nSalary: " + employee2.getSalary());

        //setting the values of the instance variables of first employee
        employee1.setName("John");
        employee1.setLastName("Smith");
        employee1.setSalary(19000.50);

        //getting the values of the instance variables of first employee
        System.out.println("\n\nPrinting the values of first employee's details after having set them");
        System.out.printf("Name:%s ", employee1.getName());
        System.out.printf("\nSurnname:%s ", employee1.getLastName());
        System.out.println("\nSalary: \u00A3" + employee1.getSalary());
        //increase 10% salary
        System.out.print("\na 10% rise will give a new salary of \u00A3" + employee1.salaryIncrease()); 

        //setting the values of the instance variables of second employee
        employee2.setName("Michael");
        employee2.setLastName("McWry");
        employee2.setSalary(23000.50);

        //getting the values of the instance variables of second employee
        System.out.println("\n\nPrinting the values of second employee's details after having set them");
        System.out.printf("Name:%s ", employee2.getName());
        System.out.printf("\nSurnname:%s ", employee2.getLastName());
        System.out.println("\nSalary: \u00A3" + employee2.getSalary());
        //increase 10% salary
        System.out.print("\na 10% rise will give a new salary of \u00A3" + employee2.salaryIncrease() + "\n");  
    }
}

SO which one is the client of which class please?
thanks

and this

//EmployeeClass.java
public class EmployeeClass{ 
    private String …
Violet_82 89 Posting Whiz in Training

Oh I see! thanks, if I want to get back to the start when the sprite ends, do I just reset the background position?
thanks

Violet_82 89 Posting Whiz in Training

Hi chaps, I am having a little problem. Given the following snippet:
html

<div id="carousel">  
</div>

css

#carousel{
    border:1px solid magenta;
    width:600px;
    height:258px;
    background: url('sprite.png') no-repeat 0 0;
    position:absolute;
    left:0;
    top:28%;
}

jquery

$(document).ready(function(){
function scroll(){
            $("#carousel").animate({
                backgroundPosition:'-600px'}, 500);
        }
    setInterval(function(){scroll()},2000);     
});

I am trying to run scroll() forever to show different areas of the sprite in the css, but the function runs only once, how is that? I thought that calling setInterval on scroll() meant that it would run forever. Any idea?
thanks

Violet_82 89 Posting Whiz in Training

@LastMitch, sorry I left out the a closing tag, typo.
@IIM, it is mainly safari, although I had problems with chrome too

Violet_82 89 Posting Whiz in Training

have a look at the dell site http://www.dell.com/uk/p?~ck=mn. I usually buy dell, they are pretty good and not too expensive. What kind of programming are you planning to do? I guess a i5 should suffice, but that said I don't do programming (other than basic java) but web development and I got myself a i7 processor and it is pretty fast

Violet_82 89 Posting Whiz in Training

I have an old galaxy gti-9000. It came shipped with Android 2.1. Unfortunately samsung support goes up to Android 2.2 and I had to get a custom ROM (Cyanogen 9 equivalent of Android 4.1.0) and isntall it myself, but the phone works fine. So my suggestion is, if you don't have that much cash, check out http://forum.xda-developers.com/ and http://forum.cyanogenmod.org/ and then buy an old one and install a custom ROM. It is perfectly legal and not too involved.

Violet_82 89 Posting Whiz in Training

eh eh, the thing is this lappy is quite expensive so I don't want to mess it up...but that's probably the only option! : -)

Violet_82 89 Posting Whiz in Training

uhm, sounds a bit suspicious...I can only assume (sorry oalee and CimmerianX) that you don't have a genuine copy of windows. You should buy a genuine copy of windows and the serial number will come with it. If you're trying to install the same genuine copy of windows onto another machine you should be able to transfer the licence to it.

Violet_82 89 Posting Whiz in Training

ahahahaahahha!!! sorry, too funny caperjack, couldn't help to say sth!
@olowokere if you want to download linux (and not linus) have a look at ubuntu here http://www.ubuntu.com/download/desktop

Violet_82 89 Posting Whiz in Training

LastMitch, thanks for your reply. I haven't included any html simply because it is a general question, in that I can replicate the problem - or bug if you prefer - all the time. A normal list containing links will suffice

<div id="myDiv">
    <ul>
        <li><a href="#" class="myLink">ABC</li>
        <li><a href="#" class="myLink">DEF</li>
        <li><a href="#" class="myLink">GHI</li>
        <li><a href="#" class="myLink">JKL</li>
    </ul>
</div>

I have had a look at your links, but I have found quite a bit about this problem (other than the W3C explanation above):
http://apple.stackexchange.com/questions/40835/how-to-force-coloured-display-of-visited-links-in-safari-5
http://www.evotech.net/blog/2010/06/safari-5-link-selector-bug/
http://support.apple.com/kb/HT4196
So I concluded that it is a sort of bug...
thanks

Violet_82 89 Posting Whiz in Training

thanks guys, I kind of suspected the voltage might have been different...it's that I really don't want to take the whole machine apart, but I will probably have to
thanks

Violet_82 89 Posting Whiz in Training

IIM, I looked at all those already tahnks : - ) it's just that I mis interpreted it
thanks