Questions tagged [any]

"Any" means "at least one". Use this tag for questions that deal with testing elements in a collection to see if at least one of them passes a condition.

682 questions
-1
votes
1 answer

Check if words are spelled correctly in list

I've been given a dictionary with the following words: dictionary = ['all', 'an', 'and', 'as', 'closely', 'correct', 'equivocal', 'examine', 'indication', 'is', 'means', 'minutely', 'or', 'scrutinize', 'sign', 'the',…
kinets
  • 65
  • 1
  • 8
-1
votes
1 answer

What is the time complexity of below string matching program?

t= total string and s= test string if its present in t t=input() #main string s=input() #check for substring print(any(s==t[i:i+len(s)] for i in range(len(t)-len(s)))) the give time complexity is O(…
-1
votes
1 answer

What is Class any in kotlin

So I have to make a presentation about class any in Kotlin, I'm a complete beginner so I don't know much, if anybody can link to class any docs or explain in few words what it does or how it works. thanks in advance.
-1
votes
1 answer

List comprehension to get rows from a dataframe that contains matching column values of another dataframe

So I have 2 wildly different dataframes- different column names, different data. Both have a column that contain some matching numbers. Ive attempted to use list comp with any() statements without success, and merge/join is a mess without renaming…
D.M.
  • 1
  • 3
-1
votes
1 answer

Syntax error like what is the problem sql

create table salesman( salesman_id Numeric(5) primary key, name varchar(30), city varchar(15), commission decimal(3,2) ); insert into salesman(salesman_id,name,city,commission) values (5001, "James Hoog", "New York", 0.15), (5002 , "Nail…
-1
votes
2 answers

C# Datatable linq - where any

I have a datatable that populates a list. The datatable has 3 columns, 'unit', 'clientId' and 'incident'. The incident could fx be '1. rate paid' or 'resold'. I'm trying to exclude unit's from the list where any of it's incident is = 'resold',…
Taco2
  • 429
  • 1
  • 6
  • 18
-1
votes
1 answer

How does `NSAttibutedString` equate attribute values of type `Any`?

The enumerateAttribute(_:in:options:using:) method of NSAttributedString appears to equate arbitrary instances of type Any. Of course, Any does not conform to Equatable, so that should not be possible. Question: How does the method compare one…
Matthew Rips
  • 501
  • 4
  • 9
-1
votes
2 answers

Access subscript of array of type any refering to dictionaries

There are a lot of questions on SO about using a subscript on an Array of objects of type ANY that generally recommend casting the Any Object to a variable type that can take a subscript with something like if let addresses = profile["Addresses"]…
user1904273
  • 4,562
  • 11
  • 45
  • 96
-1
votes
1 answer

Type 'Any' has no subscript members error Json

I got this Error Type 'Any' has no subscript members on the lines with 'dayZeroTemperatureMax, dayZeroTemperatureMin' ect and I don't know how to fix it. I searched on the internet but all their fixes won't fix my problem. This is what i…
Dani Kemper
  • 343
  • 2
  • 10
-1
votes
1 answer

%in% suddenly stopped logically responding

I have a list full of generic drugs, and a user makes an input to check if this drug exists in my list (scraped from Medline). The program checks if this drug exists in my list . The thing is that i checked the drug existence with: vast<-user_comp…
Mimic01
  • 107
  • 1
  • 12
-1
votes
2 answers

Checking index of element error

I want to check index of element in array: var arr: [Any] = ["st","er","gh", 2, 5,"jk", 78 ] print(arr.index(of: 2)) but I get an error: error: cannot invoke 'index' with an argument list of type '(of: Any)' note: expected an argument list of type…
whok mok
  • 47
  • 2
  • 5
-1
votes
1 answer

Relationships in Doctrine

I have 2 Entities: Categories and products. How can I build a relationship between these Entities? Category Entity: class Category { private $id; private $name; private $parent; public function getChildren() …
Dialkord
  • 111
  • 1
  • 3
  • 12
-1
votes
1 answer

Yum command is not working in Docker images

[root@8b473cb5f656 sysconfig]# yum update Loaded plugins: fastestmirror, ovl Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was 12: Timeout on…
deepesh
  • 1
  • 2
-1
votes
1 answer

Find any file ending with word, c++

i want the equivalent to the regex '*bla.foo', meaning get me any files ending with bla.foo in c++. What i came up with so far is: #define BOOST_FILESYSTEM_VERSION 3 #define BOOST_FILESYSTEM_NO_DEPRECATED #include #include…
Tuni
  • 129
  • 1
  • 9
-1
votes
3 answers

need to get a class after switch case in swift?

I need to get the class as response after the switch case in swift, I get compilation problems with this function. func getOptClass(signal : String) -> AnyClass{ var result = AnyClass switch(signal){ case "IntRR": result =…
gxmad
  • 1,650
  • 4
  • 23
  • 29