implementation

Python implementation question

Hey. I have a problem I'm trying to solve in Python and I can't think of a clever implementation. The input is a string of letters. Some of them represent variables, others represent operators, and I want to iterate over a large amount of values for the variables (different configurations). I think an equivalent question would be that y...

Book on translating particular business problems into software implementations?

I would be interested in finding a book that deals with some common business issues and how they are translated into software implementations. For example: a trading system - how requirements are gathered and an appropriate technology and architecture are chosen to translate this into a web application an integration project - an exam...

Where can I find source of unhook function used in STL implementation provided with g++.

It is used in /usr/include/c++/4.3/stl_list.h on my system (current Ubuntu). ...

Was Algol ever used for "mainstream" programming?

I know that Algol language is super-uber-extremely important as a theoretical language, and it also had a variety of implementations as per Wikipedia. However, what's unclear is, was Algol (pure Algol, not any of its derivatives like Simula) ever actually used for any "real" programming in any way? By "real", I mean used for several ...

C#: How do I prepend text to each line in a string?

What would an implementation of 'MagicFunction' look like to make the following (nunit) test pass? public MagicFunction_Should_Prepend_Given_String_To_Each_Line() { var str = @"line1 line2 line3"; var result = MagicFunction(str, "-- "); var expected = @"-- line1 -- line2 -- line3"; Assert.AreEqual(expected, result); }...

J2EE Question: How can I do this ?

Firstly, it was hard to include the question inside the title, so don't bash me. I have a web framework created by someone and I need to learn to use it. Let's say I have this HTML form: <form action="servletX" method="get"> <input name="action" value="search" type="submit"> </form> When the search button is submitted, inside of...

Enumerable.Range implementation

What is the precise implementation of Enumerable.Range in .Net; preferable .Net 4? Is it a yielded for-loop? A custom implementation (IEnumerable, IEnumerator) or? ...

In a header file for other programm to use, can I only declare the templates?

I was wondering about using or not templates, in other thread I found out that templates must be implement in the header file because of some reasons. Thats ok, my question is if the source will be need if other programm use it? from the logic of the other thread's answer, it seems that even other programm would need the full implementat...

Saving the State of a System

A very flowery title indeed. I have a PHP web application that is in the form of a web based wizard. A user can run through the wizard and select options, run process (DB queries) etc. They can go backwards and forwards and run process again and again. I am trying to work out how to best save the state of what users do/did, what proces...

How is reference to java object is implemented?

Is pointer is just used for implementing java reference variable or how it is really implemented? Below are the lines from Java language specification 4.3.1 Objects An object is a class instance or an array. The reference values (often just references) are pointers to these objects, and a special null reference, which refers ...

Open Id implementation in php?

I am considering implementing OpenID on my website and I am having a hard time finding good resources for OpenID implementation in php. So far I have only found RPX but I don't want to depend on third party vendors. I want something similar to SO , can anyone point me in the right direction and can you also tell approximately how much ti...

MSDN: How can I see what inherits/implements a class/interface?

One thing I really, really miss from Javadoc is the ability to see which classes inherit the class you're looking at. So if you are looking at an abstract class (such as List) then you would be able to see all classes that inherit/implement the class/interface you're looking at. Is this available in the MSDN and I'm just missing it or is...

Open id and facebook implementation in php?

I am using Open ID on my website using Dope Openid library but I would like to add facebook as an open id provider to the list since facebook also supports OpenID...Can anyone help me out with an explanation or link me to a tutorial (staga.net is using it flawlessly on their site) *if someone can also explain to me how Staga is using but...

malloc code in C

I have a code block that seems to be the code behind malloc. But as I go through the code, I get the feeling that parts of the code are missing. Does anyone know if there is a part of the function that's missing? Does malloc always combine adjacent chunks together? int heap[10000]; void* malloc(int size) { int sz = (size + 3) / 4; int ...

Java coding best-practices for reusing part of a query to count

The implementing-result-paging-in-hibernate-getting-total-number-of-rows question trigger another question for me, about some implementation concern: Now you know you have to reuse part of the HQL query to do the count, how to reuse efficiently? The differences between the two HQL queries are: the selection is count(?), instead of th...

How to implement restitution coefficient into a simple physics engine?

I am writing a simple 2d physics engine that supports circle-circle collision and i can't figure out how to retrofit my collision resolution method to add restitution. How is a restitution coefficient property implemented in physics engines? ...

Why don't the mainstream DBMSs have graph functionality?

Relational databases are frequently used to store graphs in all their many flavors (trees, directed graphs, undirected graphs, ...). Why then do none of the major DBMSs (Microsoft, MySql, Oracle, PostgreSQL, SqlLite, just to name a few in alphabetical order) include library support for treating relations as graphs? Some desirable featu...

How do you implement Software Transactional Memory?

In terms of actual low level atomic instructions and memory fences (I assume they're used), how do you implement STM? The part that's mysterious to me is that given some arbitrary chunk of code, you need a way to go back afterward and determine if the values used in each step were valid. How do you do that, and how do you do it efficient...

.NET 3.5 - Object not implementing IComparable?

When converting a project (in which a template method of IComparable was used a few times) from VS 2005 to VS 2008 I've got some errors: Error 12 Type argument 'Object' does not inherit from or implement the constraint type 'System.IComparable'. Is this an actual fact that System.Object no longer implements that interface, or somethi...

Can I make an existing (fixed) class implement a new interface?

I have a feeling I already know the answer people are going to give, but here goes anyway: Say I'm writing a new class, let's call it PooledQueue<T>, in the constructor of which I want to accept an argument that implements the interface IResourcePool<T>. The idea here is that I'm fine with using any underlying pool object, as long as it...