pure

In C++ is it possible to have a defined purely virtual function?

Here's the deal. I have a big class hierarchy and I have this one method that is extended all the way through. The method always has to look at one or two more variable at each new level and these variable depend on the actual class in the hierarchy. What I want to do is check those two extra variables then call the superclass's version ...

Pure PHP rrdtool

hello all, does anyone know a pure-php implementation of rrdtool? I googled this question, but only found answers about interfacing PHP & rrd... ...

What is the effect of overriding a (regular) virtual method by a pure virtual method?

Let's say we have class A { public: virtual int foo() { cout << "foo!"; } } class B : public A { public: virtual int foo() =0; } class C : public B { public: virtual int foo() { cout << "moo!"; } } Is this really overriding? I think this is actually overloading. What is the meaning of making something lik...

How to compile the generated AS

Hi guys, hope you can help me with this question. So, I've been working for a while with Flex, and had the crazy idea to create pure AS project. If I compile a Flex app with the -keep flag, the generated actionscript gets generated. Do you guys know of a way to make it compile, without going trough the code and gluing it all together?...

Is this C# extension method impure and if so, bad code?

I'm learning a bit about function programming, and I'm wondering: 1) If my ForEach extension method is pure? The way I'm calling it seems violate the "don't mess with the object getting passed in", right? public static void ForEach<T>(this IEnumerable<T> source, Action<T> action) { foreach ( var item in source ) action(item); }...

Domain Layer access to Persistence stuff

I am trying to keep my domain layer as "pure" as possible without weaving in persistence or other infrastructure concerns. However, there are times when my domain layer needs to use the services of either an RDBMS or other external dependency and I'm not sure how to deal with it. For example, each domain object in my app implements an ...

How to use pure in D 2.0

While playing around with D 2.0 I found the following problem: Example 1: pure string[] run1() { string[] msg; msg ~= "Test"; msg ~= "this."; return msg; } This compiles and works as expected. When I try to wrap the string array in a class I find I can not get this to work: class TestPure { string[] msg; void ad...

Is it possible to write an impure template in C++?

Is it possible to write an impure template in C++? That is, a template that will sometimes give a different resulting type or int for the same template parameters. For example, is it possible to write a template Foo<T> where Foo<int>::type is sometimes char and at other times float? Or a template Foo<T> where Foo<double>::my_static_const...

jQuery: Templating data

I have a unique situation where I'm building a site that will call data via AJAX and load it into "containers" (basically just divs styled and arranged according to elements retrieved from the AJAX callback). I'm not sure how many of these unique container types will be created (styled and rendered) when all is said and done, so I'm lo...

C framework like Qt ?

Hi, is there a full-featured framework for C that is similar to Qt? ...

Is smtplib pure python or implemented in C?

My question is very straight forward: Is smtplib pure python or implemented in C? ...

Pure virtual method called

I understand why calling a virtual function from a constructor is bad, but I'm not sure why defining a destructor would result in a "pure virtual method called" exception. The code uses const values to reduce the use of dynamic allocation - possibly also the culprit. #include <iostream> using namespace std; class ActionBase { public:...

Pragmatism or purity - Should we rely on GUI framework to store program state?

I was once in charged of creating a C# custom user control. It's a control with a bunch of collapsible sections. The control that user could click on it to toggle between collapse/expand state is a label control. There's an image control right beside it that would change state to indicate whether the particular section is collapsed or ex...

Converting PDF to PureEdge and modifing the PureEdge form

I have been looking for a program to convert PDF files (both types) to PureEdge, and be able to modify the PureEdge form (like adding a signature block). I can only find stuff for lotus forms, and was told that files used for PureEdge Viewer were not compatible with lotus forms. Any help would be very appreciated. ...

Difference between a virtual function and a pure virtual function

Possible Duplicate: C++ Virtual/Pure Virtual Explained Hi, Need to know what is the difference between a pure virtual function and a virtual function? I know "Pure Virtual Function is a Virtual function with no body" but what does this mean and what is actually done by the line below virtual void virtualfunctioname() = 0 ...

Question about [Pure] methods

Is the following method Pure? I'd say so, as it doesn't change in anyway the current class, thus, everything we can now currenly "see" in the class, before running this method will still be exactly the same after. Am I correct? class Set { ... public ISet<T> UnionWith(ISet<T> set) { ISet<T> unionSet = ... foreach...

pure/const functions in C++

Hi, I'm thinking of using pure/const functions more heavily in my C++ code. (pure/const attribute in GCC) However, I am curious how strict I should be about it and what could possibly break. The most obvious case are debug outputs (in whatever form, could be on cout, in some file or in some custom debug class). I probably will have a ...

pure/const function attributes in different compilers

pure is a function attribute which says that a function does not modify any global memory. const is a function attribute which says that a function does not read/modify any global memory. Given that information, the compiler can do some additional optimisations. Example for GCC: float sigmoid(float x) __attribute__ ((const)); float c...

JQuery Pure Template

I cant figure out whats wrong. Its working when i tried to refresh only topics but it doesnt works when tried to refresh topics and page-links. ie. topics table's refreshing, and 'pagelinks' disappearing, i thought pure cannot reach - read second template node. By the way, i tested their code, first message box show up all of nodes - in...

How do I code a tree of objects in Haskell with pointers to parent and children?

I've got the following problem: I have a tree of objects of different classes where an action in the child class invalidates the parent. In imperative languages, it is trivial to do. For example, in Java: public class A { private List<B> m_children = new LinkedList<B>(); private boolean m_valid = true; public void invalidat...