Preheat the oven to 350F (175C).
Combine flour and sugar in a large bowl.
Cut in butter with a pastry blender or two knives until mixture is crumbly.
Set aside 1/2 cup of mixture for topping.
Add baking soda and baking powder to remainder.
Beat together egg, buttermilk, and almond extract (if using), and add to dry ingredients, stirring until just moistened.
Spread two thirds of the batter over the bottom and partway up the side of a greased 8 1/2 inch (21 cm) or 9 inch (23 cm) springform pan.
Spoon pie filling evenly over the batter.
Drop small spoonfuls of the remaining batter over the filling.
Stir almonds (or pine nuts) into the reserved crumbled mixture, and sprinkle over the batter.
Bake 65-75 minutes for the 8 1/2 inch pan, or 50 -60 minutes for the 9 inch pan, or until cake tester inserted into the centre comes out clean.