This tag is used for questions about similarities between any of various programming constructs. Comparisons include correspondences between API, functionality, syntax, features, methodologies and the like.
Questions tagged [equivalent]
369 questions
9
votes
4 answers
What is the C++ equivalent of python collections.Counter?
The python collections.Counter object keeps track of the counts of objects.
>> from collections import Counter
>> myC = Counter()
>> myC.update("cat")
>> myC.update("cat")
>> myC["dogs"] = 8
>> myC["lizards"] = 0
>> print(myC)
{"cat": 2, "dogs": 8,…

conchoecia
- 491
- 1
- 8
- 25
9
votes
7 answers
Working equivalent for method .some() in javascript or jquery?
Was looking for "equivalent for some method in javascript" and "return just one value if is in array", but saw only the answers to the way in which to determine the type of variables or too many unnecessary.
I bypass all inputs in html and i want…

trogwar
- 216
- 1
- 11
- 26
8
votes
3 answers
MySQL DB selects records with and without umlauts. e.g: '.. where something = FÖÖ'
My Table collation is "utf8_general_ci". If i run a query like:
SELECT * FROM mytable WHERE myfield = "FÖÖ"
i get results where:
... myfield = "FÖÖ"
... myfield = "FOO"
is this the default for "utf8_general_ci"?
What collation should i use to…

Benjamin Grieshaber
- 81
- 1
- 2
8
votes
3 answers
Is there an equivalent C# syntax for C's inline anonymous struct definition?
Greetings Overflowers,
I know in C we can define a struct inline with the variable declaration so that the struct type is specific to this variable. This is instead of defining the type alone then declaring the variable to be of that struct type. Is…

geeko
- 2,649
- 4
- 32
- 59
8
votes
1 answer
Ruby get maximum integer size value
What is the Ruby equivalent for Java's Integer.MAX_VALUE?. Hopefully native.
Runner Up: If no equivalent, I need to set this for a Time object, so instead of hardcoding the maximum date for an integer 2116-02-20, is there a system constant that…

user8897013
- 443
- 4
- 15
8
votes
1 answer
What is the C# equivalent of CType in VB.NET?
I am trying to convert the example provided in MSDN article Creating Dynamic Data Entry User Interfaces to C#, but am stuck at the following code:
CType(dq, IUIBuildingBlock).QuestionText = reader("QuestionText")
How do I convert the above VB.NET…

Girish
- 758
- 2
- 8
- 18
8
votes
5 answers
Loop Java HashMap like Python Dictionary?
In Python, you can have key,value pairs in a dictionary where you can loop through them, as shown below:
for k,v in d.iteritems():
print k,v
Is there a way to do this with Java HashMaps?

Federer
- 33,677
- 39
- 93
- 121
8
votes
2 answers
Equivalent of Python's list sort with key / Schwartzian transform
In Python, given a list, I can sort it by a key function, e.g.:
>>> def get_value(k):
... print "heavy computation for", k
... return {"a": 100, "b": 30, "c": 50, "d": 0}[k]
...
>>> items = ['a', 'b', 'c', 'd']
>>>…

Claudiu
- 224,032
- 165
- 485
- 680
8
votes
8 answers
Python equivalent of IDL's stop and .reset
I'm relatively new to python but have a bit of experience using IDL. I was wondering if anyone knows if there are equivalent commands in python for IDL's stop and .reset commands.
If I'm running some IDL script I wrote that I put a stop command in,…

Jamie
- 579
- 1
- 9
- 15
7
votes
3 answers
Proving equivalence of sequence definitions from Applicative and Monad
How can I properly prove that
sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
sequenceA [] = pure []
sequenceA (x:xs) = pure (:) <*> x <*> sequenceA xs
is essentially the same to monad inputs as
sequenceA' :: Monad m => [m a]…

developer_hatch
- 15,898
- 3
- 42
- 75
7
votes
8 answers
What is the equivalent syntax in C#, if any?
Does C# have any equivalent for VB6
With
End With

abhi
- 3,082
- 6
- 47
- 73
7
votes
5 answers
What is the jQuery equivalent to document.forms[0].elements[i].value;?
What is the jquery equivalent to: document.forms[0].elements[i].value;?
I don't know how to travel through a form and its elements in jQuery and would like to know how to do it.

Ian
- 3,266
- 4
- 29
- 37
7
votes
1 answer
7
votes
1 answer
.NET code execution at normal process exit?
In C there is the atexit function, which
The atexit() function registers the given function to be called at normal process termination, either via exit(3) or via return from the program's main().
Python has a similar capability.
Does .NET provide…

Wayne Werner
- 49,299
- 29
- 200
- 290
7
votes
1 answer
jQuery equivalents to ExtJS functions extend(), apply() and namespace()?
ExtJS provides some great helper functions like:
Ext.extend()
Ext.apply()
Ext.namespace()
Are there any equivalents in jQuery? I know I could port all three to jQuery since I like them so much, but maybe I'm missing something that's already there.…

Robert Koritnik
- 103,639
- 52
- 277
- 404