It would be worth your time to read the 'Switch Stacking Guide' for the version of the firmware you are using; it has very detailed descriptions of the possible configurations, including diagrams showing how the ports can be connected.
One thing to note: according to the guide for 09.x firmware, the 4x10GF module can only be used for stacking if it is in the module 2 (front) slot. If it is installed in either of the rear slots it can only be used for data ports. The reverse is true for the 1x40GF modules; they can only be used for stacking in the rear slots, not the front slot.
It is also possible to use all four 10Gb ports to connect two switches, with 20Gb bandwidth in each direction in a ring topology. This would require four fiber pairs though (unless you use BiDi transceivers), so that's probably more than you want to do.
One thing to note: according to the guide for 09.x firmware, the 4x10GF module can only be used for stacking if it is in the module 2 (front) slot. If it is installed in either of the rear slots it can only be used for data ports. The reverse is true for the 1x40GF modules; they can only be used for stacking in the rear slots, not the front slot.
It is also possible to use all four 10Gb ports to connect two switches, with 20Gb bandwidth in each direction in a ring topology. This would require four fiber pairs though (unless you use BiDi transceivers), so that's probably more than you want to do.