In Chamber of Secrets, page 320, chapter 17:


   A gleaming silver sword had APPEARED inside the hat... 


Also in CoS, page 334, chapter 18:


   "Only a true Gryffindor could have PULLED that out of the hat, Harry" (Dumbledore to Harry)


In Deathly Hallows, page 689, chapter 23:


   "Now, Severus, the sword!  Do not forget that it must be taken under conditions of NEED and VALOR..."


(The emphasis is mine)

The short answer is that the magic of the sword and the hat worked together to provide the sword to Neville.

It appeared to him since Neville fulfilled all the qualities necessary for the sword to appear in the Sorting Hat:


true Gryffindor:  Sorting Hat put Neville in the house
need:  Neville needed to kill Nagini
valor:  definition of valor is "strength of mind or spirit that enables a person to encounter danger with firmness" (Merriam-Webster.com) and I think Neville demonstrated that numerous times


How was the sword of Gryffindor pulled from the hat a second time?
Recently I photographed an event for a friend as a favour using my Canon 750D, my 18-55mm stock and the 50mm f/1.8. The event was indoors, followed briefly by outdoors and then back indoors in a restaurant.

Whilst I did get lots of good photos, I immediately ran into two problems with the 18-55:


It wasn't so good in low light (such as both buildings) to the point I had to crank the ISO up (3200 in many cases) in order to get any kind of decent shutter speed in Av Priority. As a result, many of my photos were very grainy which needed work in Lightroom.
Any kind of wide aperture photography was extremely difficult. The widest setting of f3.5 was hard enough, but throwing in the high ISO to compensate for the low light meant that the shutter speeds were often too slow and capturing blur.


As a result, I switched to the 50mm f/1.8 prime and managed to get some great photos - except that the fixed focal length meant that many photos simply couldn't be taken (or had features clipped) because I couldn't physically get far enough away from the subject.

Given that I enjoyed that kind of indoor photography, what do I need to do to resolve these issues?


Buy a different prime that means I don't have to be in another room to take the photo?
Invest in a decent flash which I can bounce off the ceiling?
Something else?

