Questions tagged [implementation]

Deals with various issues of implementation.

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

2196 questions
19
votes
1 answer

Why is Linux memmove() implemented the way it is?

From the Linux manpage for memmove(3) The memmove() function copies n bytes from memory area src to memory area dest. The memory areas may overlap: copying takes place as though the bytes in src are first copied into a temporary array that does…
MarcDefiant
  • 6,649
  • 6
  • 29
  • 49
18
votes
4 answers

C++ - Separate declaration/definition for template function in template class

I am aware that the syntax for declaring a template class method in a header and defining it in a source file goes as so: myclass.h template class MyClass { public: void method(T input); private: T…
Brandon Miller
  • 2,247
  • 8
  • 36
  • 54
18
votes
2 answers

Implementing a database -- How to get started

I've been trying to learn programming for a while. I've studied Java and Python, and I'm comfortable with their syntax. Recently, I wanted to use what I've learnt with coding a tangible software from ground up. I want to implement a database engine,…
user1621465
17
votes
1 answer

database implementation for apps like instagram

I'm wondering how do apps like snapchat and instagram store pictures and user records in database. Say I have a user table, how would they maintain list of followers for each user? Would they store the list of followers for each entry in user table…
anivader
  • 364
  • 1
  • 4
  • 17
17
votes
5 answers

Can a child class implement the same interface as its parent?

I've never encountered this issue before today and was wondering what convention/best practice for accomplish this kind of behavior would be. Basic setup is this: public interface IDispatch { void Dispatch(); } public class Foo : IDispatch { …
Jesse Carter
  • 20,062
  • 7
  • 64
  • 101
17
votes
3 answers

Is an OutputStream in Java blocking? (Sockets)

I am currently writing naive network code for a project and a mate hinted me at the possibility that when I send a package of information from the server to all clients in an iterative fashion I might get intense lag when one of the clients is not…
salbeira
  • 2,375
  • 5
  • 26
  • 40
16
votes
2 answers

Implementing Java Comparator

I am trying to write an algorithm which utilizes a min-priority queue, so I looked around on google and found the PriorityQueue. It seems that in order to use it, though, I am going to need to tell it how I want it to prioritize, and that the way to…
Jo.P
  • 1,139
  • 4
  • 15
  • 35
15
votes
3 answers

Questions about Paxos implementation

I am implementing Paxos in a cluster simulator application, using the documentation available in Wikipedia. Unfortunately, it leaves several doors open to interpretation and does not provide much information on key implementation issues. It is…
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
15
votes
3 answers

In-memory file system in java

I want to create a simple in-memory file system in Java, which has one root directory and is able to make new sub directory. In the directory we can make new files, write in them, read from them, delete them and also rename them. Can you please give…
alle3x
  • 475
  • 2
  • 6
  • 18
15
votes
4 answers

Constructing a Binary tree in Java

I am constructing a binary tree. Let me know if this is a right way to do it. If not please tell me how to?? I could not find a proper link where constructing a general binary tree has been coded. Everywhere BST is coded. 3 / \ 1 4 / \ 2 …
VIN
  • 195
  • 1
  • 2
  • 9
15
votes
4 answers

Component diagram versus Class diagram?

class and package diagrams model logical design of software component diagram models implementation view Could you please clarify the above difference through a very short example?
user2019510
  • 1,460
  • 5
  • 16
  • 29
15
votes
2 answers

Algorithm for finding minimal cycles in a graph

I'm looking for an algorithm that given a graph it returns all the minimal cycles in it. To make clear what I want, I need the algorithm to return exactly the following cycles from this graph: (1,3,6,1), (1,6,4,1), (1,4,2,1), (6,4,7,6),…
Paris P
  • 335
  • 3
  • 10
14
votes
2 answers

Making class conform to protocol with category for existing methods

I have a protocol named MyProtocol. MyProtocol has an required method: - (NSUInteger)length; And some other methods. Now i want to make the NSString class conform to MyProtocol with a category. Like so: @interface NSString (NSStringWithMyProtocol)…
Mats Stijlaart
  • 5,058
  • 7
  • 42
  • 58
14
votes
5 answers

How is inheritance implemented at the memory level?

Suppose I have class A { public: void print(){cout<<"A"; }}; class B: public A { public: void print(){cout<<"B"; }}; class C: public A { }; How is inheritance implemented at the memory level? Does C copy…
Moeb
  • 10,527
  • 31
  • 84
  • 110
14
votes
9 answers

How can I make a resizable array in Java?

What is the best way to do a resizable array in Java? I tried using Vector, but that shifts all elements over by when when you do an insert, and I need an array that can grow but the elements stay in place. I'm sure there's a simple answer for this,…
Soren Johnson
  • 2,561
  • 4
  • 21
  • 17