implementation

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<char, Trie>. I have in fact written one this way, and it works, but... this seems like overkill. My impression is that a trie sh...

Implementing a Trie in a non-OO way

Any idea how could I implement a Trie in a non-OO way, i.e. only using arrays? The idea is that it would store some good amount of elements, and the OO approach would be too heavy for my case as it is to be used in a J2ME app, where memory is a concern. Thanks! ...

Convert char to lower case in J2ME without using the Character class

I'd like to convert a char to lower case in a J2ME app. The usual Character.toLowerCase() doesn't work for an arbitrary Unicode character in J2ME, so I need some light API, or, preferably, a piece of code that would do so. Thanks! ...

Unexpected c# interface implementation compiler error

I just came across this weird behavior today: interface IFooBar { void Foo(); void Bar(); } class FooBar : IFooBar { void IFooBar.Foo() { } void IFooBar.Bar() { this.Foo(); } } The line this.Foo(); raises the compiler error 'MyProject.FooBar' does not contain a definition for 'Foo' and ...

Implementation of network protocols

I am going to be implementing a network protocol (specifically, SFTP) and I wondered if there are any general rules-of-thumb to follow? At the moment it seems like a mammoth task and I'm at a loss as where to start. I'm looking for: Tips Best practices Possible design patterns Experiences Try to keep it applicable to network protoc...

Why do search engines ignore symbols?

Searching for symbols is a common in programming, especially when you are new to a language. For example, I had a question about the :: operator in Python, and that is not searchable. People looking for things like this or Object [] (array of Objects), would not find what they want. Why do search engines seem to ignore symbols complete...

Best practices when implementing a scientific simulation methodology from scratch

Hi, in the field of scientific simulations (physics) I am thinking about developing some new simulation package in C/C++. What do you think would be the best practices when starting here from scratch? Can you recommend some bibliography? Thanks ...

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, cost, or ease of use to using HBase as a MR source? The best I've been able to find is th...

Setting Properties Rundown in Objective C

One of the things I've been struggling with whilst breaking into Objective C programming is understanding how to manipulate properties. I'm perhaps out of my comfort zone using a proper coding language as opposed to scripting languages that I'm used to, so the declaring things in header files and implementation files is confusing me some...

Mongo DB Design, embedding vs relationships

I'm building a simple accounting system where a user has many bills. Now I'm trying to decide if bills should be its own collection, or nested within the user. I'm leaning towards the former but I've NEVER done any noSQL stuff so I'm just going by trial and error and what I think makes sense to me. I understand that Mongo has a 4mb ...

passing variables help - total beginer

Ok here is an example of what I'm dealing with at the moment: @implementation ECHOAppDelegate ... @end @interface PtyView (PtyPrivate) -(void)startTask; -(void) didRead: (NSNotification *)fileNoty; @end @implementation PtyView ... -(void)startTask { //starts task } @end Now, if I wanted to "trigger" startTask from the EC...

code problem - beginner

Ok here is my code so far: @implementation PtyView - (id)initWithFrame:(NSRect)frame; { if (self = [super initWithFrame: frame]) { [self setFont:[NSFont fontWithName:@"Courier" size:0.0]]; [self startTask]; } return self; } - (void)keyDown:(NSEvent *)event { const char * typein = [[event characters]...

How does BT magnet links work?

For the first time i used a magnet link. Curious about how it works i looked up the specs and didnt find any answers. From the wiki it says xt means exact topic and is followed by the format (btih in this case) with a SHA1 hash. I saw base32 mentioned, knowing its 5bits per letter and 32 letters i found it holds exactly 160bits which is ...

Simple balls physics implementation not working.

Dear experts, I wanted to implement ball physics and as i m newbie, i adapt the code in tutorial http://adam21.web.officelive.com/Documents/JavaPhysicsTutorial.pdf . i try to follow that as i much as i can, but i m not able to apply all physical phenomenon in code, can somebody please tell me, where i m mistaken or i m still doing some...

What is the best way to break down and follow project progress?

Hi When i wanna start a new project, I have enough details to just start it. And as all programmer needs, I need to analyse that project to understand how to write codes and classes and relations between them... Normally, I do it on so many papers and its really annoying and also I can't consentrate so good (in huge projects). I wanna kn...

Can sizeof(int) ever be 1 on a hosted implementation?

My view is that a C implementation cannot satisfy the specification of certain stdio functions (particularly fputc/fgetc) if sizeof(int)==1, since the int needs to be able to hold any possible value of unsigned char or EOF (-1). Is this reasoning correct? (Obviously sizeof(int) cannot be 1 if CHAR_BIT is 8, due to the minimum required r...

Has this algorithm been implemented properly?

I am currently implementing a BK-Tree to make a spell checker. The dictionary I am working with is very large (millions of words), which is why I cannot afford any inefficiencies at all. However, I know that the lookup function that I wrote (arguably the most important part of the entire program) can be made better. I was hoping to find ...

Implementing a generic interface

I have a generic interface: public interface IUnauthorizedRequestRespondable<out T> where T:class { T GetResponseForUnauthorizedRequest(); } (I'm not sure why Resharper recommended T is "out", but that's not the question). In my scenario, the object returned by GetResponseForUnauthorizedRequest is always of the type that impl...

why interface can not implement another interface in java?

What I mean, interface B; interface A extends B; allowed interface A implements B; not allowed I googled it and I found this -> Implements denotes defining an implementation for the methods of an interface. However interfaces have no implementation so that's not possible. http://www.coderanch.com/t/410331/java/java/interface-imple...

Private interface vs. private method - objective c

Hi, What is the difference between a private method and a private interface? For example, I know that if you define a method in an implementation and its interface does not mention it, it is considered a private method. I have also seen things such as: @interface Collector() @property (readonly) NSMutableDictionary *count; @end Insid...