implementation

How to improve the builder pattern?

Motivation Recently I searched for a way to initialize a complex object without passing a lot of parameter to the constructor. I tried it with the builder pattern, but I don't like the fact, that I'm not able to check at compile time if I really set all needed values. Traditional builder pattern When I use the builder pattern to creat...

Where is the signing for signed integral types stored? (In Java)

The Java data type byte for example holds data from -128 to 127 in a single byte on storage. To enable to distingush between - 1 to -128 from 0 to 127 would require extra data which would take the datatype obver its allocated storage. Admittedly it would only take 1 extra bit but it still goes over. How does java do this? ...

Struggling on implementation idea

Hello, What I mean is that when I want to implement something and I have an idea how to do it, I always try to think for other implementation solutions and if I haven't get any I start to struggle about my first though/idea of implementation.Is it really good? Or will other developers think that I did wrong? So these thoughts consumes m...

How can I do a MouseOver of exact image shape?

Hello all, The question below is not really a programming question, but more of "how can I do this" question, implementation advice. I have an image of the world map. I can make each continent a separate image. What I want to do is create a hover over feature for each continent. When the users mouse is over the continent - the EXACT s...

Implementing a default constructor

I am trying to implement a DateTime class in C++: class DateTime { public: DateTime(); DateTime(time_t ticks); DateTime(int day, int month, int year); DateTime(int day, int month, int year, int hour, int minute, int second); //... private: time_t ticks; int day; int month; //... } then in applicati...

Java interface: method signature declared as throws Exception; implemented as throws a subclass of Exception [CLOSED]

Hi all, I have the following interface declaration: public interface SomeInterface { void someMethod() throws Exception; } I use a third party to generate an implementation of this class (JavaCC - for the curious) The generated class looks naively like this: public class SomeClass implements SomeInterface { public void so...

Which Erlang implementation of OpenId should I use, if any?

I'd need an Erlang implementation of the OpenId protocol. I found the following, but it seems to be a project on its early stage. http://code.google.com/p/erlopenid/ Any hint or suggestion on what should I use? ...

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 actual requirements. The original project was written ("Frankensteined together", as the orig...

strlen() implementation in gcc

Can anyone point me to the definition of strlen() in GCC? I've been grepping release 4.4.2 for about a half hour now (while Googling like crazy) and I can't seem to find where strlen() is actually implemented. ...

Has anyone seen a 2-Sat implementation

I have been looking for a while, but I just can't seem to find any implementation of the 2-Sat algorithm. I am working in c++ with the boost library (which has a strongly connected component module) and need some guidance to either create an efficient 2-Sat program or find an existing library for me to utilise through c++. ...

compiler optimization implementation

Actually I am making a major project in implementing compiler optimization techniques. I already know about the existing techniques, but I am confused what technique to choose and how to implement it. ...

Latent Semantic Indexing in Java

Is there any open source implementation of LSI in Java? I want to use that library for my project. I have seen jLSI but it implements some other model of LSI. I want a standard model. ...

Algorithm Implementation to Improve

I believe that out there we have algorithms implementations (e.g. a c++ implementation of a particular sorting algorithm) which might not be as efficient as they could be. I would like to write a research paper discussing how such an implementation might be improved. This could be in any programming language, however C, C++, Python, Jav...

What are some authoritative/respected "best known implementation" websites/resources?

EDIT: Wow, the initial response to this question was quite negative. I think I might have triggered some pretty strong emotions by using the word "best"; it seems like a few people latched onto that word and decided to dismiss my question right away. Obviously, there are many, many situations in which no single approach is "best", or a...

Why? Redeclare things to implement interfaces?! in VB.NET

Hello, experts. I work in VB.NET v2 I have an interface IMyInterface and this interface implements a method MyMethod. I have an object MyObjectBase. This object contains a(the same) method MyMethod. 1) If now I do MyObject Inherits MyObjectBase Implements IMyInterface need I to redefine? (shadow, override) MyMethod in the MyObject cl...

why MD5 collision failed?

The two data blocks are from this site,but failed to produce the collision : var_dump(md5('d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396f9652...

Rolling my own "Version Control"

I'm a hobby developer and i want to put my projects in some sort of version control. I've tried several version control systems (git i think, SVN, mercurial, bazaar) and they were a pain in the neck for one or more of the following reasons: There was no GUI interface The gui interface it DID have was clunky it plastered decals all over...

Javascript CPS (continuation passing style) implementation

Because of an article in IBM Developer Works about CPS (continuation passing style), I'm trying to not use "return". without CPS function getter() { * calculate a* return a; } function test() { *part 1* if(*condition*) { a = getter(); } *use a* *part 2* } transition the rest of the function ...

C++ : implications of making a method virtual

Hi all, Should be a newbie question... I have existing code in an existing class, A, that I want to extend in order to override an existing method, A::f(). So now I want to create class B to override f(), since I don't want to just change A::f() because other code depends on it. To do this, I need to change A::f() to a virtual method...

How to develop a MVC framework from scratch?

View is easy to be separated from MC, but how to separate M and C?The difference seems a little vague to me. I'm using PHP. ...