how do i get this kind of effect


Slow shutter speed (1/10s or 1/2s) and an external flash set to rear sync.
 

some time not that slow, that have to depends on the ambient light.

True. But this looks like one of those dark bowling alleys where they use blacklights to get the balls to glow. :D
 

Hmm so just slow shutter will do? Do I need to pan my camera or something? Notice that the background is kind of blur too
 

Depends on the exact effect you want to achieve. In the example, the camera was probably handheld and the movement (can see esp in the lights bottom left) was probably the photographer keeping the subject in frame.
If you want, you can lock the camera position and shoot slow, which will mean no motion effect/streaking of the background objects. Personally I think it's better with the camera movement -- more dynamic.

Hmm so just slow shutter will do? Do I need to pan my camera or something? Notice that the background is kind of blur too
 

You need to mix ambient light with flash, the ambient light plus slow shutter is creating movement, flash is to freeze and create sharp image of your subject.

here is another example I did many years ago.

13771DSC_7090.jpg
 

But what is the ideal f stop and shutter speed for such photos
 

But what is the ideal f stop and shutter speed for such photos

There is none. Stop looking for a magic formula. The ideal f stop and shutter speed depends on you, what the lighting is, what your movement rate is, etc.
 

so essentially i have to set the shutter as a slow speed and pan my camera to follow the subject to achieve the motion feel and also to use flash and set it to rear-sync so that i can freeze the subject. That right?
 

Essentially yes. It's easy enough to experiment -- you can do it at home. Try different shutter speeds, amounts of camera motion till you get a feel of what the result will be.
 

Slow shutter speed (1/10s or 1/2s) and an external flash set to rear sync.

Yep 1/10s external flash on a flash cord in one hand and the camera panning in the other hand, rear sync and about 10 beers or so. Good night all I can say is take your camera out drinkng with you can shoot turn something new each time. I always leave the exif data.

Taken on April 15, 2011 at 10.29pm PDT (edit)
Posted to Flickr April 19, 2011 at 5.30PM PDT (edit)

Exif data

Camera Nikon D300
Exposure 0.1 sec (1/10)
Aperture f/2.8
Focal Length 17 mm
ISO Speed 200
Exposure Bias 0 EV
 

Last edited: