Every possible combination - permutation

How can I obtain every possible combination for a dynamic sized set? can it be done without recursion or methods? I've been trying to figure out how to do it with just loops for the past hours and can't seem to come up with a solution.

Quite a few methods can be found on the appropriate wikipedia page.
(note: this answer is overly generic because the OP doesn't go into any deep about what he needs)

Related

Are there ways to store a multidimensional array in a temporary excel or anything else?

I am trying to create an Addin which will copy certain attributes of a chart from First PowerPoint and read it to an Temporary Excel, which then can be used by a second chart in Second PowerPoint. Sounds simple enough, but the problem is, the attributes that I am reading happens to be a multidimensional array, which can't be written to an excel. So I have hit a roadblock as to how to tackle this situation.
On searching through internet, I came across something called localstorage and most of the answer seems to be surrounding javascript which I don't know, so didn't really understand much.
Because this strikes to me like a common problem which others might have also faced at some point in their life, so really hoping to take away some pointers from here.

How do I determine the best loop type to use

What is the method by which a programmer selects the style of loop to use?
I have been looking around but I can't seem to get a straight answer. I understand that you can wrangle most looping styles into working for any particular problem, but when I "guess" a good loop, everything just goes well.
My question is...Is there a formal methodology to determine the best type of loop to at least start with?
I'm currently studying Ruby and sometimes not knowing when to enumerate and when to use a more manual loop i.e. a while loop.
Articles, old posts or good books would all be valid answers.
Thanks!

How to use dapper.fluentmap in Dapper?

Does anyone know or have link in how to use https://github.com/henkmollema/Dapper-FluentMap in my Dapper CRUD?. Right now I am using Dapper.Contrib but we are trying to implement Clean architecture which we remove the Dapper.Contrib in our structure. Now I am trying to use this Dapper-FluentMap to map the properties but there documentation is very poor.
I've wrote an article and a sample that shows how to use Dapper-FluentMap:
https://medium.com/dapper-net/custom-columns-mapping-1cd45dfd51d6
After beating my head against a few brick walls, I have established this much as fact (at least as of late 2018, which is after the date of the OP)...
Answering the question "Is FluentMap supposed to work with Dapper.Contrib extensions?", henkmollema (author of Dapper.FluentMap) responds, "Nope, it does not work with Dapper.Contrib".
So there's your answer, user3928241.
However for me as well as for user3928241 and others desperately searching for answers, he adds, "Shameless plug: it does work together with Dommel using the Dapper.FluentMap.Dommel integration component."
YMMV, but I'm pressing on. Going to try Dommel now.

Rotate a node so it points to a specific position in SceneKit

I have a node and I want it's peak point to a specific position (coordinates). How can I do that? So far, I have tried noting because I have no clue how can I do that. Any suggestions?
What you want to SCNConstraint, and more specifically SCNLookAtConstraint.
There are a few similar questions on StackOverflow and examples in both SceneKit WWDC demos.
Next time you ask a question here, make sure you have a specific problem, and do as much research as you can. Show you did all of that, and you won't get downvoted!
If you encounters problems with the constraints, make sure to check if it has been asked here first. Good luck!

Making a deductive program

I'm thinking about writing a program that asks the user to think of an object(a physical one) and then it asks questions about the object and tries to figure out what the user was thinking. (Similar to http://20q.net)
I tried to do it in Python but figured my approach was naive and would be very inefficient. How would you guys do this?
Doing this efficiently requires a somewhat advanced method in probability called Kullback-Liebler Divergence. Applied to decision trees (which is what you want to do) it is often called Information Gain.
But don't let that stop you! Do some searches for implementation samples of decision trees and start from there. I'd write a much simpler program before you go about solving 20 Questions.
Also, take a look at http://www.20q.net/ . Click "Think in English" then "Classic 20Q". It's scary good, sometimes.
Sounds like you want to make a computerized 21 questions game. I'd do it with a tree of questions and answers.
Here is a nice stackoverflow article about implementing trees in python
How can I implement a tree in Python? Are there any built in data structures in Python like in Java?

Resources