Questions tagged [implementation]

Deals with various issues of implementation.

Deals with various issues of implementation of functions, features, languages, etc.

2196 questions
6
votes
1 answer

Is there a way to see decompiled C# code in VS Code?

Is there a way to see decompiled C# code in VS Code? Whenever I go to the decompiled implementation, I see only interfaces of methods, but not the implementation. I heard that some people claim that VS Code can show decompiled implementation as well…
manymanymore
  • 2,251
  • 3
  • 26
  • 48
6
votes
3 answers

How can I implement memoize method on an async function in JavaScript?

I have been trying to write the implementation of the memoize function in JavaScript. I was asked this in an interview question and haven't been able to put it out of my mind since. I would really appreciate some help with this. Given a function in…
Winter
  • 341
  • 1
  • 4
  • 8
6
votes
4 answers

How to force subclass to call an abstract implemented method

Basically, what I want to do is force the subclass to call an abstract superclass method (implemented in the subclass), so I don't have to explicitly write it each time I create a new subclass. I wrote it in the superclass' constructor once, because…
dominicbri7
  • 2,479
  • 4
  • 23
  • 33
6
votes
1 answer

casting a block to a void* for dynamic class method resolution

+(BOOL)resolveClassMethod:(SEL)aSel { NSString *lString = NSStringFromSelector(aSel); if ([self validateLetterAndAccidental:lString]) { id (^noteFactoryBLOCK)(id) = ^(id aSelf) { return [self noteWithString:lString]; …
griotspeak
  • 13,022
  • 13
  • 43
  • 54
6
votes
2 answers

Performance of Dijkstra's algorithm implementation

Below is an implementation of Dijkstra's algorithm I wrote from the pseudocode in the Wikipedia article. For a graph with about 40 000 nodes and 80 000 edges, it takes 3 or 4 minutes to run. Is that anything like the right order of magnitude? If…
zoo
  • 1,901
  • 1
  • 17
  • 25
6
votes
3 answers

implementation of C header files?

I was learning the C language and was peeking through some header files in the Linux directory /usr/include such as stdio.h, stdlib.h etc. What really was bothering me was that I see all functions define with an extern keyword, which means they are…
saad
  • 61
  • 1
  • 2
6
votes
1 answer

R*-Tree C Implementation?

Possible Duplicate: C++ R - tree implementation wanted I've been hunting just about all evening... Anyone know of a R*-Tree implementation that builds on a modern C compiler? Thanks, Chenz
Crazy Chenz
  • 12,650
  • 12
  • 50
  • 62
6
votes
2 answers

Standard container re-allocation multipliers across popular toolchains

Containers like std::basic_string and std::vector perform automatic re-allocations when internal capacity runs out. The standard specifies that, after a re-allocation, .capacity() >= .size(). What are some of the actual multipliers used by…
Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
6
votes
5 answers

c# unit conversion library for food amounts

I want to implement a simple unit conversion library for food measurements, ie cups teaspoons. pinch, milliliters, ounces, liters, grams, pounds etc etc etc. Are there any libraries out there that I can use allready, if not I want to roll my own in…
n4rzul
  • 4,059
  • 7
  • 45
  • 64
6
votes
7 answers

floor()/int() function implementaton

Does anyone have an idea how is the method/function Int() or floor() implemented? What I am looking for a respective implementation as the following is for abs() function. Int Abs (float x){ if x > 0 return x; else return -x } I…
Olga
  • 71
  • 1
  • 1
  • 2
6
votes
5 answers

Java Collection with 2 keys

I want to implement a HashMap with a key with 2 components. Ex. Pseudocode: Key = CollName coll = new CollName; How can I implement this in Java, considering speed and size of the Collection. Thanks :D…
John Bautista
  • 1,480
  • 3
  • 29
  • 60
6
votes
1 answer

Where can I find an implementation of javax.validation.*?

I've just included a new library in my project and it's dependent on some classes in javax.validation - which I can't find an implementation of. Is there a free implementation available that can be licensed for commercial, closed-source use?
Riley Lark
  • 20,660
  • 15
  • 80
  • 128
6
votes
6 answers

Python: the mechanism behind list comprehension

When using list comprehension or the in keyword in a for loop context, i.e: for o in X: do_something_with(o) or l=[o for o in X] How does the mechanism behind in works? Which functions\methods within X does it call? If X can comply to more…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
6
votes
3 answers

Kotlin class implementing Java interface error

I've got a Java interface public interface SampleInterface extends Serializable { Long getId(); void setId(Long id); } and a Kotlin class that is supposed to implement it open class ClazzImpl() : SampleInterface private val id: Unit? =…
hhg
  • 649
  • 1
  • 11
  • 20
6
votes
9 answers

Declaration and Implementation of Functions

According to my teacher, it's bad practice to write user-defined functions like this: int DoubleNumber(int Number) { return Number * 2; } int main() { cout << DoubleNumber(8); } Instead, he says to always use forward declarations, even if…
Maxpm
  • 24,113
  • 33
  • 111
  • 170