Questions tagged [implementation]

Deals with various issues of implementation.

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

2196 questions
8
votes
1 answer

What are the principles involved for an Hierarchical State Machine, and how to implement a basic model?

So I'm attempting to make a game using C++, and I've read a ton of articles on Finite State Machines (FSM), and Hierarchical State Machines (HSM). However I will admit most of the stuff I've read is a bit dense and hard to understand, so I was…
Rivasa
  • 6,510
  • 3
  • 35
  • 64
8
votes
5 answers

Javascript: Need a decent red black tree implementation

Where can I find one ready for use? Or for that matter, a good collection of "standard" data structures, if you know of any?
Hamster
  • 2,962
  • 7
  • 27
  • 38
8
votes
2 answers

Hadoop MR source: HDFS vs HBase. Benefits of each?

If I understand the Hadoop ecosystem correctly, I can run my MapReduce jobs sourcing data from either HDFS or HBase. Assuming the previous assumption is correct, why would I choose one over the other? Is there a benefit of performance, reliability,…
Andre
  • 1,601
  • 3
  • 15
  • 15
8
votes
4 answers

What would be a sensible way to implement a Trie in .NET?

I get the concept behind a trie. But I get a little confused when it comes to implementation. The most obvious way I could think to structure a Trie type would be to have a Trie maintain an internal Dictionary. I have in fact written one…
Dan Tao
  • 125,917
  • 54
  • 300
  • 447
8
votes
4 answers

Where can I find the implementation for std::string

I am looking for the code for the c++ string class. What header is it implemented in?
Alan
  • 2,109
  • 5
  • 25
  • 28
8
votes
2 answers

How to implement temporal data in MySQL

I currently have a non-temporal MySQL DB and need to change it to a temporal MySQL DB. In other words, I need to be able to retain a history of changes that have been made to a record over time for reporting purposes. My first thought for…
HartleySan
  • 7,404
  • 14
  • 66
  • 119
8
votes
1 answer

(C) Implementation tactics for heap allocators?

Where are some good resources for looking at the pros/cons of different ways of implementing heap allocators? Resources touching on efficiency (fragmentation, throughput, etc) are preferred. I am NOT looking for simple code repositories. edit: I'm…
Tony Stark
  • 24,588
  • 41
  • 96
  • 113
8
votes
3 answers

C++ header and implementation files: what to include?

There is a .h file and a .cpp file with the same name but different extension. If I want to use what's in the .cpp file, do I include the .h file or the .cpp file?
neuromancer
  • 53,769
  • 78
  • 166
  • 223
8
votes
1 answer

How to control the chunk size of `std::deque` when allocating a new chunk?

When we insert a new element into a std::deque, it may allocate a new chunk to contain the element if the existing chunks are all full. However, how does the implementation control the chunk size? Is it possible for the user to control the chunk…
xmllmx
  • 39,765
  • 26
  • 162
  • 323
8
votes
3 answers

How would I implement something similar to the Objective-C @encode() compiler directive in ANSI C?

The @encode directive returns a const char * which is a coded type descriptor of the various elements of the datatype that was passed in. Example follows: struct test { int ti ; char tc ; } ; printf( "%s", @encode(struct test) ) ; // returns…
Anderson
  • 327
  • 3
  • 10
8
votes
2 answers

LL(1) parser implemented with stack: how to build AST?

I am currently building a parser by hand. It is a LL(1) parser. At the moment, it is a great recognizer: its function parse(List tokens) decides whether or not tokens is a member of the language or not. Now, I want to build the corresponding AST for…
8
votes
2 answers

Bug in glibc `div()` code?

As quoted in "Integer division rounding with negatives in C++", in C before C99 (i.e. in C89) and in C++ before C++11 (i.e. in C++98 and C++03), for an integer division computation where either operand is negative the sign of the remainder (or…
gx_
  • 4,690
  • 24
  • 31
8
votes
2 answers

How do I bridge the gap between my database design and the user interface design?

I know how that question looks, but I'm quite serious. I am trying to create an application that will help me in learning databases (sql, queries, proper database design, etc). I'm using a pet project at work so I have something to focus on with…
romandas
  • 4,086
  • 7
  • 29
  • 33
8
votes
1 answer

Why heap is better than binary tree to represent a priority queue?

In a (max) heap it is easy to find the biggest item in O(1) time, but to actually remove it you need complexity of O(log(n)). So if the insertion and deletion from a heap is both O(log(n)), what are the advantages of a heap over binary tree for…
8
votes
1 answer

Implementing Iota in Haskell

Iota is a ridiculously small "programming language" using only one combinator. I'm interested in understanding how it works, but it would be helpful to see the implementation in a language I'm familiar with. I found an implementation of the Iota…
Josh Voigts
  • 4,114
  • 1
  • 18
  • 43