Questions tagged [inclusion]

89 questions
176
votes
8 answers

How to check if all of the following items are in a list?

I found, that there is related question, about how to find if at least one item exists in a list: How to check if one of the following items is in a list? But what is the best and pythonic way to find whether all items exists in a list? Searching…
sirex
  • 4,593
  • 2
  • 32
  • 21
56
votes
5 answers

rails validation: :allow_nil and :inclusion both needed at the same time

Usually the field 'kind' should be allowed blank. but if it is not blank, the value should included in ['a', 'b'] validates_inclusion_of :kind, :in => ['a', 'b'], :allow_nil => true The code does not work?
Daniel
  • 861
  • 1
  • 8
  • 12
13
votes
5 answers

Test if python Counter is contained in another Counter

How to test if a python Counter is contained in another one using the following definition: A Counter a is contained in a Counter b if, and only if, for every key k in a, the value a[k] is less or equal to the value b[k]. The Counter({'a': 1, 'b':…
enrico.bacis
  • 30,497
  • 10
  • 86
  • 115
11
votes
1 answer

Double inclusion and headers only library stbi_image

I have a main.cpp including a.h (that has its own a.cpp) a.h includes the header only library "stbi_image.h" as such: #ifndef STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION #include…
cppbeginner
  • 111
  • 1
  • 1
  • 3
10
votes
1 answer

rails validate specific value

I have this code I have these options and if the user select anything except 'British Columbia' to give him error message that the province have to 'British Columbia' I believe it will solve by using the model validation <%= f.label :province…
nourza
  • 2,215
  • 2
  • 16
  • 42
9
votes
3 answers

what are Parametric and Inclusion polymorphism in C++

I am reading some C++ text at the address https://cs.senecac.on.ca/~chris.szalwinski/archives/btp200.082/content/adhoc.html. In the section UNIVERSAL POLYMORPHISM, the author mentioned about Parametric and Inclusion polymorphisms. I am not quite…
ipkiss
  • 13,311
  • 33
  • 88
  • 123
8
votes
2 answers

Including xml files when deploying WPF application

I have a WPF application with 3 projects to represent a 3-layer architecture. One project is set as the main project. I have some XML files in one of the non-main project. These XML files are accessed by functions defined in classes of that project.…
naveen
  • 219
  • 4
  • 12
6
votes
2 answers

Problem with include guard

When I add an include guard to my header file for a Visual C++ project, it gives me the following warning and error: warning C4603: '_MAPTEST_H' : macro is not defined or definition is different after precompiled header use Add macro to…
Izza
  • 2,389
  • 8
  • 38
  • 60
5
votes
1 answer

Inclusion tag error ..... Invalid template library specified. ImportError raised when trying to load

index.html has a block containing the context from a view called init in the crudapp app.Index.html also has a block called sidebar_files which I trying to populate using an inclusion tag. I have created an inclusion tag in…
Shane G
  • 3,129
  • 10
  • 43
  • 85
5
votes
7 answers

How to find if a range is included in another range using VBA?

I have a problem comparing two ranges. For simplicity I will take two simple ranges M6:M10 and M6:M8, I want to know if the second one is included into the first one and the first thing I though is to write Sub example() Dim range1, range2,…
Bmb58
  • 155
  • 2
  • 9
5
votes
2 answers

Rails validation inclusion error 'not included in list'

Hi all I have seen several issues similar to mine but none of the solutions seem to solve my issue so after a day and a half of trying everything I've decided to try my luck posting my problem. I have a table which in a MySQL db with this…
Surep
  • 179
  • 4
  • 19
5
votes
2 answers

Rails inclusion validation

I'm struggling with the following inclusion validation, class User < ActiveRecord::Base attr_accessible :language validates :language, :presence => true, :inclusion => { :in => I18n.available_locales.join(' ')} end If I run this in the…
richard
  • 1,565
  • 2
  • 18
  • 35
4
votes
2 answers

Dynamic inclusion of piwik code by means of server side filtering inside apache server

After a few hours of fruitless attempts I would like to ask you all for a little assistance with a simple setup: For a bunch of web applications and sites I run using the apache2 http server I use Piwik for a simple statistical overview. That works…
arkascha
  • 41,620
  • 7
  • 58
  • 90
4
votes
1 answer

Multiple inclusion error, can't find a solution

I've recently been struggling with multiple file inclusion errors. I'm working on a space arcade game and have divided my classes/objects into different .cpp files and to make sure everything still works fine together I have build the following…
Joey Dewd
  • 1,804
  • 3
  • 20
  • 43
3
votes
1 answer

RAILS 3 model validation inclusion in does not work

# ==Schema Information # Schema version: # Table name: terms # id :integer not null, primary key ... # user_id :integer # term_type :string(255)` term.rb: class Term < ActiveRecord::Base validates …
user623012
  • 31
  • 1
  • 2
1
2 3 4 5 6