theory

Algorithm - generating all combinations from items that must be chosen in sequence

廉价感情. 提交于 2019-12-04 03:41:05
问题 I'm looking to find out if a particular algorithm already exists. I want to use it in an application, but I've also seen this come up in several Project Euler problems too. I'm looking to calculate a specific type of permutation/output set, where the next item chosen must be one from a finite set of options in only the following set. For example, say I've got 3 arrays $a1 = array("a", "b", "c"); $a2 = array("d", "e", "f"); $a3 = array("g", "h", "i"); I'm looking to generate all the

Multi-Sudoku AI approach

末鹿安然 提交于 2019-12-04 03:28:02
问题 I'm conceptualizing a solver for a variant of sudoku called multi-sudoku , where multiple boards overlap like so: If I understand the game correctly, you must solve each grid in such a way that the overlap between any two or more grids is part of the solution for each. I'm unsure as to how I should be thinking about this. Anybody got any hints/conceptual clues? Additionally, if any topics in artificial intelligence come to mind, I'd like to hear those too. 回答1: Constraint programming (CP)

Example of Call by name

戏子无情 提交于 2019-12-04 02:39:04
In my principles of programming class we are talking about different calling methods. Some we discussed were: call by value call by reference call by value/result and call by name I can't find an example of how call by name works. Anyone care to give me an example? I think that when you take an xml file as input this is similar to call by name. Could someone give me a more traditional example? I'll work in a hypothetical programming language. Let's assume we have a function p(x) that prints out x and then returns it. Now let's define a function: function foo(x, y) { return y+1; } Now let's

Halting in non-Turing-complete languages

我的梦境 提交于 2019-12-04 00:17:58
The halting problem cannot be solved for Turing complete languages and it can be solved trivially for some non-TC languages like regexes where it always halts. I was wondering if there are any languages that has both the ability to halt and not halt but admits an algorithm that can determine whether it halts. A. Rex Yes. One important class of this kind are primitive recursive functions . This class includes all of the basic things you expect to be able to do with numbers (addition, multiplication, etc.), as well as some complex classes like @adrian has mentioned (regular expressions/finite

How to attach a DataPoint with a Theory?

心已入冬 提交于 2019-12-04 00:17:18
@DataPoints public static final Integer[] input1={1,2}; @Theory @Test public void test1(int input1){ } @DataPoints public static final Integer[] input2={3,4}; @Theory @Test public void test2(int input2 ){ } I want that test1 runs with data set input1 - {1,2} and test2 runs with input2 - {3,4}. But currently each test runs with both the data sets {1,2,3,4}. How to bind specific @DataPoints to specific @Theorys DataPoints apply to the class. If you have a @Theory method which takes an int, and you have a DataPoint which is an array of ints, then it will be called with the int. @RunWith(Theories

What's a “canonical path”?

纵然是瞬间 提交于 2019-12-03 18:26:30
问题 That's a theory question. I've searched over the internet with no satisfying luck, I just want to understand what's this jargon. I've seen examples of Java, JSON, etc but I couldn't find in Google nor here in StackOverflow a simple explanation, no code needed =P So, an absolute path it's a way to get to a certain file or location describing the full route to it, the full path, and it's OS dependent (the absolute paths for Windows and Linux for example, are different) A relative path it's a

Why can't programs be proven?

我的梦境 提交于 2019-12-03 18:19:52
问题 Why can't a computer program be proven just as a mathematical statement can? A mathematical proof is built up on other proofs, which are built up from yet more proofs and on down to axioms - those truths truths we hold as self evident. Computer programs don't seem to have such a structure. If you write a computer program, how is it that you can take previous proven works and use them to show the truth of your program? You can't since none exist. Further, what are the axioms of programming?

Cell theory|Bulk RNA-seq|Cellar heterogeneity|Micromanipulation|Limiting dilution|LCM|FACS|MACS|Droplet|10X genomics|Human cell atlas|Spatially resolved transcriptomes|ST|Slide-seq|SeqFISH|MERFISH

99封情书 提交于 2019-12-03 17:08:56
生物信息学 Cell theory:7 个要点 All known living things are made up of one or more cells. All living cells arise from pre-existing cells by division. The cell is the fundamental unit of structure and function in all living organisms. The activity of an organism depends on the total activity of independent cells. Energy flow (metabolism and biochemistry) occurs within cells. Cells contain DNA which is found specifically in the chromosome and RNA found in the cell nucleus and cytoplasm. All cells are basically the same in chemical composition in organisms of similar species. Genotype-Transcription-gene

Help with the theory behind a pixelate algorithm?

你离开我真会死。 提交于 2019-12-03 15:34:43
So say I have an image that I want to "pixelate". I want this sharp image represented by a grid of, say, 100 x 100 squares. So if the original photo is 500 px X 500 px, each square is 5 px X 5 px. So each square would have a color corresponding to the 5 px X 5 px group of pixels it swaps in for... How do I figure out what this one color, which is best representative of the stuff it covers, is? Do I just take the R G and B numbers for each of the 25 pixels and average them? Or is there some obscure other way I should know about? What is conventionally used in "pixelation" functions, say like in

A method to calculate the centre of mass from a .stl (stereo lithography) file?

旧巷老猫 提交于 2019-12-03 14:59:09
I am trying to calculate the centre of mass (x,y,z) coordinates of an object defined in an STL file (stereo lithography, not to be confused with the standard template library). The STL file contains a closed object (or objects) defined by a boundary made of triangles. The triangles themselves are not necessarily in any order, the file is simply the coordinates 3 vertices of each triangle floating in 3D space plus a normal vector to the triangle (the normal should be disregarded as it is not always done properly). There is nothing that links each triangle to one another, it is assumed that the