Questions tagged [non-repetitive]

57 questions
0
votes
0 answers

How to deal with frequently used strings in a project?

Working on MVC applications has made me realize that A LOT of some strings are repeated in every single form class. For instance take Symfony Forms, it is common to see stuff like this:
Me.
  • 1
  • 4
0
votes
4 answers

Trying to generate & display non-repeating random values for a BINGO game

I am working on making a bingo game. I've gotten as far as being able to get a random number generated and displayed at the click of a button. My only issue is that some values will end up being generated more than once. THAT IS THE PART I'M POSTING…
p4yner56
  • 17
  • 1
  • 1
  • 7
0
votes
1 answer

Making a BINGO game. How do I generate a random number to be displayed from one set without repeating which number is generated and displayed?

I'm making a bingo game for a course I'm taking, and the assignment is to generate a random pick/element from a pre-setup Set();, display that random value (it's going to be a letter and number e.g. G78, so not an integer), and then make sure that…
p4yner56
  • 17
  • 1
  • 1
  • 7
0
votes
2 answers

Combinations without repetitions with must included in the combos

I have 2 list of ints and I need a list of all possible combinations without repetitions of 5 numbers. But it also needs to include all the ints from another list. Example: var takeFrom = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; var…
Quoter
  • 4,236
  • 13
  • 47
  • 69
0
votes
0 answers

How GAM regression (mgcv) deals with repeated values?

I am trying to explore regressions between abundances and 3 variables. My data (test.gam)looks like this: # A tibble: 6 x 5 Site Abundance SPM isotherm SiOH4 1 cycle1 0.769 5960367. 102. …
Rhiz
  • 23
  • 6
0
votes
2 answers

Search for repeated consecutive characters in strings and replace each string with 1 or 0

I am having an array $array = array("ab","aab","abb","abab","abaab","abbb"); I want to search the elements that contain duplicate consecutive characters like aab, abb, abbb and replace them with 1. Conversely, if an element does not contain any…
user8788514
0
votes
4 answers

Making 6 different random Numbers

I'm not that good at coding right now, i am trying to improve and learn. ATM i was trying to write a code that randomly picks 6 non-repeating numbers, but i fail at it. what should i do? import random a = random.randint(1, 100) b =…
CelSer
  • 3
  • 2
0
votes
2 answers

Generation of 4 non repeating random numbers using arrays in java

I have this array int [] marc = new int[4]; i need to insert a set of non repeating random numbers in the range of 1-10 to it i'm using this for loop to set random numbers for (he = 0; he < 4; he++) { marc[he] = rn.nextInt(10 - 1 + 1) + 1; …
0
votes
2 answers

Flexibility of scenarios in Gherkin.

I looking for mechanism that will allow to build more flexible scenarios. For example for these two very similar scenarios that test existence of records in database: Scenario Outline: Testing query with 1 attribute with these 2 record in and…
Daniel
  • 7,684
  • 7
  • 52
  • 76
0
votes
1 answer

Can the repetition in this line be avoided?

'=' not in access and name + '.' not in access I hope to avoid the multiplicity of not in accesss in a line of Python code. I've used expression evaluation loops for cases of higher numbers of repetitions for convenience but it just seems odd at…
user6428287
0
votes
5 answers

How to pass fields from a class to function in c++?

In some words: how can I pass various fields from a custom class to a single function? Now in details: I have a std::vector containing a class, for example CustomClass from which I have to extract a result from a field from this class by some…
winsett
  • 71
  • 7
0
votes
2 answers

Selecting Non-Repeating Random Elements of 2 Dimensional Array in C

I'm pretty new to programming, so the solution needs to be simple. What I need to do is generate an 8x8 matrix, and, because of what I'll be doing with it later, I need to set all the elements equal to 0. Then, I need to select 20 of the elements…
rgolden
  • 149
  • 1
  • 6
0
votes
2 answers

In Prolog how can I cut redundant answers

I am working on a dictionary-like program with prolog, and my code goes like…
Meric Usta
  • 15
  • 3
0
votes
3 answers

Make a bunch of C++ classes comparable while avoiding repetitiveness in code

I need to create a bunch of classes so that the instances of a particular type can be mutually compared. I thought about writing a compare method, unique to each class, and then adding the following code to each class definition, replacing T with…
Petr Skocik
  • 58,047
  • 6
  • 95
  • 142
0
votes
2 answers

Is there any shorter way to do function calls with Ajax in it?

I am pasting the whole function in here, and by the way I used the mustache templating library in this script, but that is not necessary in the question: tmplReplaceContent : function(json, tmpl, target){ var regex = new…
Joey Hipolito
  • 3,108
  • 11
  • 44
  • 83