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
4
votes
1 answer
calculating ASPECT, SLOPE in python3.x (matlab gradientm function)
gradientm is a matlab function that Calculate gradient, slope, and aspect of data grid
Syntax
[ASPECT, SLOPE, gradN, gradE] = gradientm(Z, R)
Description
[ASPECT, SLOPE, gradN, gradE] = gradientm(Z, R) computes the slope, aspect, and north and east…

pd shah
- 1,346
- 2
- 14
- 26
4
votes
1 answer
c# Substring Equivalent of array
Is there a substring equivalent for an array?
Input new char[] foo = {'a', 'b', 'c', 'd', 'e', 'f'}
If this was a String abcdef I would use .Substring(0, 2) and get ab
Is there a built in method that would give me char[] {'a', 'b'} if the input…

eventseen
- 97
- 1
- 1
- 7
4
votes
3 answers
Data structure to group the elements of equivalence classes
I have to implement a data structure that groups the elements of a equivalence classes.
The API:
interface Grouper{
void same(T l, T r);
Set> equivalenceClasses();
}
interface EquivalenceClass{
Set…

Thomas Jung
- 32,428
- 9
- 84
- 114
4
votes
2 answers
Extension method not equivalent to direct call
I would say the following two code snippets I have are equivalent, but they aren't.
The following is working correctly:
var entry3 = Task.Run(async () => await entry2.GetMemberGroupsAsync(false)).WaitForResult().FirstOrDefault();
The following…

Alexander
- 19,906
- 19
- 75
- 162
4
votes
3 answers
In R, how do I test that two functions have the same definition?
I have two functions, f and g, which have the same definition:
f <- function(x) { x + 1 }
g <- function(x) { x + 1 }
However, the identical function considers them different:
identical(f, g)
FALSE
I presume this is because they occupy different…

sdgfsdh
- 33,689
- 26
- 132
- 245
4
votes
2 answers
jquery 1.4.2 equivalent for setTimeout and clearTimeout
Is there any equivalent for setTimeout and clearTimeout functions in jquery 1.4.2.... I found this ex which uses jquery 1.3.2..
var alerttimer = window.setTimeout(function () {
$alert.trigger('click');
}, 3000);
…

ACP
- 34,682
- 100
- 231
- 371
4
votes
5 answers
What is the Python 3 equivalent of %s in strings?
I've made some basic progress in python before, nothing more than command land algebra calculators to do math homework, using user-defined functions, inputs, and basic stuff. I've since taken the Python 2 course that codeacademy has, and I'm finding…

Gavin
- 143
- 2
- 2
- 10
4
votes
2 answers
SQL Where clause equivalent for Elastic Search
I am trying to create a aggregate results in elastic search but filter option is not working for me.
I can aggregate data without filter e.g.
select name , material ,sum(price)
from products group by name , material
curl -XGET…

Developer
- 817
- 2
- 16
- 28
4
votes
1 answer
C# event += delegate {} equivalent in VB.NET
Well, I was translating a C# into VB.NET using developer fusion, and the API didn't translated me that part...
owner.IsVisibleChanged += delegate
{
if (owner.IsVisible)
{
Owner =…

z3nth10n
- 2,341
- 2
- 25
- 49
4
votes
1 answer
Does .NET have an equivalent of **kwargs in Python?
I haven't been able to find the answer to this question through the typical channels.
In Python I could have the following function definition
def do_the_needful(**kwargs):
# Kwargs is now a dictionary
# i.e. do_the_needful(spam=42,…

Wayne Werner
- 49,299
- 29
- 200
- 290
4
votes
3 answers
Java equivalent to IEnumerator from C#?
Are there interfaces in Java library, which also enumerates some series, but follows slightly another logic than Iterator and Enumeration? Namely they should return boolean on next(), saying whether next element was reached, and should have…

Suzan Cioc
- 29,281
- 63
- 213
- 385
3
votes
2 answers
JavaScript equivalent of SwingUtilities.invokeLater()
Is there any equivalent of Java's invokeLater() method of SwingUtilities in Javascript?
UPDATE 1
So, will setTimeout() with zero delay do exactly the same as invokeLater()?

Dims
- 47,675
- 117
- 331
- 600
3
votes
3 answers
What is the Equivalent code From array_push in java?
Hi guys I need the equivalent java code of this PHP code:
the Output is:
Array
(
[0] => orange
[1] => banana
[2] => apple
…

José Francisco Lara Aguilar
- 297
- 1
- 2
- 5
3
votes
4 answers
How can I convert this c++ template function to a C alternative?
I'm converting parts of a small C++ library to C (gcc). In doing so I'm wanting to convert the following template function to a macro (comments removed for readibility). CpuReadWriteFence() is another function that I've converted to a macro…

hookenz
- 36,432
- 45
- 177
- 286
3
votes
1 answer
Python equivalent of php's virtual()
Do you know if there is a python equivalent of php's virtual() ?
My configuration is python, djanogo, mod_wsgi, apache
Trying to include a script that has only examples for php using the above include and also needs to be included in all website's…

Mecca
- 659
- 1
- 7
- 17