74HC595N Shift Register

So, recently I've been working on a quite big 7segment display. I am having problems with choosing the right segments.
The circuit which I am using is: http://arduino.cc/en/tutorial/ShiftOut without the capacitor.

And the code:

int latchPin = 7;
int clockPin = 8;
int dataPin = 9;
int digit0 = 5;

byte b[10] = {B01111110,B00110000,B01101101,B01111001,B00110011,B01011011,B01011111,B01110000,B01111111,B01111011};
 
void setup() 
{
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
  pinMode(digit0, OUTPUT);
  
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, B00000000);
  digitalWrite(latchPin, HIGH);
}
 
void loop() 
{
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, b[1]);
  digitalWrite(latchPin, HIGH);
  digitalWrite(digit0, HIGH);
  delay(1);
  digitalWrite(digit0, LOW);
  delay(1);
}

What I see when using this, is that if the selected byte ends with a 0, then all the outputs are low, and if the end is 1, then all of them are high.

What displayś do you use??
Common Anode or
Common Cathode??
Otherwise the high and low even to run???

I am using a common anode display, the shift register is connected to a ULN2003AN transistor-array in order to switch the segments.
The digit0, Pin 5 is for switching the digit on/off, it is done with an NPN, and a PNP transistor combo and I am sure that's working properly.
I am only having trouble with the code, since it's not turning the right segments on.

You have likely have noise on the clock line so that the last bit is be shifted repeatedly
into all the positions. Either that or a lack of decoupling.

Its important not to have long cable runs for these high speed logic signals, and that
signal wires should run alongside a ground wire all the way. The shift register will respond
to nanosecond timescale impulses so the signals have to be clean.

I wish they would fix that stupid tutorial its just embarassing to have that 1uF cap on the
clock signal and no decoupling on the shift register.

Around a year ago I was able to somehow get this circuit working with a code like this.

With other codes I've found on the internet I am able to turn on separate outputs. But I'd like something that allows me to turn on combinations of outputs.

Also:

//g,e,d,c,b,a,f
int numbers[11][8]={{1,1,1,1,1,1,0,0},
                    {0,0,0,1,1,0,0,0},
                    {0,1,1,0,1,1,0,1},
                    {0,0,1,1,1,1,0,1},
                    {1,0,0,1,1,0,0,1},
                    {1,0,1,1,0,1,0,1},
                    {1,1,1,1,0,1,0,1},
                    {0,0,0,1,1,1,0,0},
                    {1,1,1,1,1,1,0,1},
                    {1,0,1,1,1,1,0,1},
                    {0,0,0,0,0,0,0,0}};
  
long l = 0;
int i = 0;

void setup() {
 pinMode(8, OUTPUT);
 pinMode(9, OUTPUT);
 pinMode(7, OUTPUT);
 pinMode(5, OUTPUT);
 pinMode(6, OUTPUT);
 
 digitalWrite(13, LOW);
 digitalWrite(7, HIGH);
 selectNumber(10);
 shift(0);
}
void loop() {
  if(millis()-1000>l) {
    if(i<99) {
      i++;
    }
    else {
       i = 0; 
    }
    l = millis();
  }
  selectNumber(i%10);
  digitalWrite(6,HIGH);
  delay(1);
  digitalWrite(6,LOW);
  delay(1);
  selectNumber((i-i%10)/10);
  digitalWrite(5,HIGH);
  delay(1);
  digitalWrite(5,LOW);
  delay(1);
}
void selectNumber(int n) {
  digitalWrite(7, LOW);
  for(int i=0;i<8;i++) {
    shift(numbers[n][i]);
  }
  
  digitalWrite(7, HIGH);
}
void shift(int value) {
  digitalWrite(7, LOW);
  shiftOut(9,8,MSBFIRST,value);
  digitalWrite(7, HIGH);
}

With this code I am able to turn a combination on well, showing the right number, but when it comes to multiplexing this crap, the shift registers outputs aren't good for every number.

If anyone has a code which can shift out anything well(bool array, int, byte, etc.) I would appreciate it.

I think it might be some code misunderstand, or the arduino library being crap.

This makes a pattern 101001 to shift through the output pins, however this isn't what it supposed to do.

int latchPin = 7;
int dataPin = 9;
int clockPin = 8;

byte dec_digits[] = {0b11000000,0b11111001,0b10100100,0b10110000,0b10011001,0b10010010,0b10000011,0b11111000,0b10000000,0b10011000 };


void setup() {
  Serial.begin(9600);
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}
void loop() {
 for (int numberToDisplay = 0; numberToDisplay < 10; numberToDisplay++) {
    // take the latchPin low so 
    // the LEDs don't change while you're sending in bits:
    Serial.println(dec_digits[numberToDisplay]);
    digitalWrite(latchPin, LOW);
    // shift out the bits:
    shiftOut(dataPin, clockPin, MSBFIRST, dec_digits[numberToDisplay]); 
    //take the latch pin high so the LEDs will light up:
    digitalWrite(latchPin, HIGH);
    // pause before next value:
    delay(2000);
  } 
}

SOLVED: Clock pin and Latch pin were shorted to together, that's why it shifted always one bit.