Search Results

Search found 388 results on 16 pages for 'neil bradley'.

Page 12/16 | < Previous Page | 8 9 10 11 12 13 14 15 16  | Next Page >

  • decltype, result_of, or typeof?

    - by Neil G
    I have: class A { public: B toCPD() const; And: template<typename T> class Ev { public: typedef result_of(T::toCPD()) D; After instantiating Ev<A>, the compiler says: meta.h:12: error: 'T::toCPD' is not a type neither decltype nor typeof work either.

    Read the article

  • In CMake, how does CHECK_INCLUDE_FILE_CXX work?

    - by Neil G
    The following code prints nothing CHECK_INCLUDE_FILE_CXX(glog/logging.h GLOG_INCLUDE) IF(GLOG_INCLUDE) MESSAGE("YY") ENDIF(GLOG_INCLUDE) But I have the following environment variable set: export CPLUS_INCLUDE_PATH=/usr/local/include And, "ls /usr/local/include/glog/logging.h" returns the file. I tried using include_directories( "/usr/local/include" ) but it doesn't work either.

    Read the article

  • Ubuntu quickly (python/gtk) - how to monitor stdin?

    - by neil
    I'm starting to work with Ubuntu's "quickly" framework, which is python/gtk based. I want to write a gui wrapper for a textmode C state-machine that uses stdin/stdout. I'm new to gtk. I can see that the python print command will write to the terminal window, so I assume I could redirect that to my C program's stdin. But how can I get my quickly program to monitor stdin (i.e. watch for the C program's stdout responses)? I suppose I need some sort of polling loop, but I don't know if/where that is supported within the "quickly" framework. Or is redirection not the way to go - should I be looking at something like gobject.spawn_async?

    Read the article

  • MySql TABLE data type

    - by Neil Aitken
    MS SQL Server has a TABLE data type which can be used in stored procedures, Does anybody know if MySQL has an equivalent data type? I've had a look over the docs but can't seem to find anything, so I presume it doesn't exist, but perhaps somebody has created a workaround

    Read the article

  • WCF COM+ component

    - by Neil B
    I have a C# WCF client that is wrapped for COM+ Enterprise Services. I install the component on the target machine and use regsvcs to put it into Component services. My question is, where will it look for it's configuration file, as it is running under the dllhost process rather than a regular exe?

    Read the article

  • Initialising structs in C++

    - by Neil Butterworth
    As an addendum to this question, what is going on here: #include <string> using namespace std; struct A { string s; }; int main() { A a = {0}; } Obviously, you can't set a std::string to zero. Can someone provide an explanation (backed with references to the C++ Standard, please) about what is actually supposed to happen here? And then explain for example): int main() { A a = {42}; } Are either of these well-defined? Once again an embarrassing question for me - I always give my structs constructors, so the issue has never arisen before.

    Read the article

  • How often do you implement the big three?

    - by Neil Butterworth
    I was just musing about the number of questions here that either are about the "big three" (copy constructor, assignment operator and destructor) or about problems caused by them not being implemented correctly, when it occurred to me that I could not remember the last time I had implemented them myself. A swift grep on my two most active projects indicate that I implement all three in only one class out of about 150. That's not to say I don't implement/declare one or more of them - obviously base classes need a virtual destructor, and a large number of my classes forbid copying using the private copy ctor & assignment op idiom. But fully implemented, there is this single lonely class, which does some reference counting. So I was wondering am I unusual in this? How often do you implement all three of these functions? Is there any pattern to the classes where you do implement them?

    Read the article

  • Get the affinity of a SQLite column on Android

    - by Neil Traft
    The SQLite C library has a method, sqlite3_column_decltype(). But I cannot find any place where the Android SQLite API makes this method available. Is there any way to get the declared type of a column without running any SQL (i.e. can I avoid using PRAGMA table_info)? I could have used AbstractWindowedCursor.isBlob(), but it says that it will also return true if the field is NULL. I need something that will guarantee me a value equal to the column's declared type.

    Read the article

  • How do you use boost iterators

    - by Neil G
    It worked, and then I added the typedefs so that I could have a const_sparse_iterator as well. Now, when I compile this and try to use sparse_iterator, it says: /Users/neilrg/nn/src/./core/sparse_vector.h:331: error: invalid use of incomplete type 'struct sparse_vector<A>::sparse_iterator' Here's the code. More code here. tempalte<typename T> class sparse_vector { // There is more code at my previous question, but this might be enough...? private: template<typename base_type> class sparse_iterator_private : public boost::iterator_adaptor< sparse_iterator_private<base_type> // Derived , base_type // Base , value_type // Value , boost::random_access_traversal_tag // CategoryOrTraversal > { private: struct enabler {}; // a private type avoids misuse public: sparse_iterator_private() : sparse_iterator_private<base_type>::iterator_adaptor_(0) {} explicit sparse_iterator_private(typename array_type::iterator&& p) : sparse_iterator_private<base_type>::iterator_adaptor_(p) {} private: friend class boost::iterator_core_access; reference dereference() const { return this->base()->value; } }; public: typedef sparse_iterator_private<typename array_type::iterator> sparse_iterator; typedef sparse_iterator_private<typename array_type::const_iterator> const_sparse_iterator; };

    Read the article

  • Factory vs instance constructors

    - by Neil N
    I can't think of any reasons why one is better than the other. Compare these two implementations: public class MyClass { public myClass(string fileName) { // some code... } } as opposed to: public class MyClass { private myClass(){} public static Create(string fileName) { // some code... } } There are some places in the .Net framework that use the static method to create instances. At first I was thinking, it registers it's instances to keep track of them, but regular constructors could do the same thing through the use of private static variables. What is the reasoning behind this style?

    Read the article

  • How do you edit tab labels per tab in GVim?

    - by Neil
    How do you edit a tab label, per tab, in GVim? You can do this: set guitablabel=foo But that will set every tab's label to "foo". The documentation seems to suggest using a t:var, like this: let t:guitablabel="foo" But it doesn't do anything. Is there any way to give each different tab a different name?

    Read the article

  • Is an editable select box the right way?

    - by Neil Middleton
    I have a scenario where a user is emailing another user in an HTML based web app. For the To: field, the user may select one of a pre-defined list of emails OR enter their own ignoring the pre-defined options. What would be the best way of doing this from a UI point of view? I've looked at editable select boxes using jQuery but none seem to let you enter your own option. Is there some other UI mechanism that would work here?

    Read the article

  • Providing *implicit* conversion operator for template specialization

    - by Neil G
    I have a templated sparse_vector<T> class, and I am also using Boost UBLAS. How would I provide implicit conversions between sparse_vector<double> and boost::numeric::ublas::compressed_vector<double>? I would also like to provide similar conversions between std::vector<double> and boost::numeric::ublas::vector<double>. (I am using gcc 4.4 with C++0x enabled.)

    Read the article

  • When is C++ covariance the best solution?

    - by Neil Butterworth
    This question was asked here a few hours ago and made me realise that I have never actually used covariant return types in my own code. For those not sure what covariance is, it's allowing the return type of (typically) virtual functions to differ provided the types are part of the same inheritance hierarchy. For example: struct A { virtual ~A(); virtual A * f(); ... }; struct B : public A { virtual B * f(); ... }; The different return types of the two f() functions are said to be covariant. Older versions of C++ required the return types to be the same, so B would have to look like: struct B : public A { virtual A * f(); ... }; So, my question: Does anyone have a real-world example where covariant return types of virtual functions are required, or produce a superior solution to simply returning a base pointer or reference?

    Read the article

  • Using boost::iterator_adaptor

    - by Neil G
    I wrote a sparse vector class (see #1, #2.) I would like to provide two kinds of iterators: The first set, the regular iterators, can point any element, whether set or unset. If they are read from, they return either the set value or value_type(), if they are written to, they create the element and return the lvalue reference. Thus, they are: Random Access Traversal Iterator and Readable and Writable Iterator The second set, the sparse iterators, iterate over only the set elements. Since they don't need to lazily create elements that are written to, they are: Random Access Traversal Iterator and Readable and Writable and Lvalue Iterator I also need const versions of both, which are not writable. I can fill in the blanks, but not sure how to use boost::iterator_adaptor to start out. Here's what I have so far: class iterator : public boost::iterator_adaptor< iterator // Derived , value_type* // Base , boost::use_default // Value , boost::?????? // CategoryOrTraversal > class sparse_iterator : public boost::iterator_adaptor< iterator // Derived , value_type* // Base , boost::use_default // Value , boost::random_access_traversal_tag? // CategoryOrTraversal >

    Read the article

  • Command Query Separation validating for retries

    - by Neil Barnwell
    So I'm comfortable with the basic concept of CQS, where you might have a command that writes to one database, and that updates the query database that you read from. However, consider the scenario where you are entering data, and want to prevent duplicates. Using new employee data entry an employee register as an example, working through a pile of application forms to key in the new employees' details: Take top sheet. Key in employee name and unique payroll number to UI. Submit. Put paper in "completed pile". Repeat. How would you now prevent the user from keying in the same payroll number again, say for instance if they get distracted and can't remember whether they've keyed one in already and the "message" hasn't got all the way back to the query db for the user to search?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16  | Next Page >