Search Results

Search found 335 results on 14 pages for 'neil hoff'.

Page 10/14 | < Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >

  • How do I make a class whose interface matches double, but upon which templates can be specialized?

    - by Neil G
    How do I make a class whose interface matches double, but whose templated types do not dynamic cast to double? The reason is that I have a run-time type system, and I want to be able to have a type that works just like double: template<int min_value, int max_value> class BoundedDouble: public double {}; And then inherit use template specialization to get run-time information about that type: template<typename T> class Type { etc. } template<int min_value, int max_value> class Type<BoundedDouble<min_value, max_value>> { int min() const { return min_value; } etc. } But, you can't inherit from double...

    Read the article

  • asp:Button is not calling server-side function

    - by Richard Neil Ilagan
    Hi guys, I know that there has been much discussion here about this topic, but none of the threads I got across helped me solve this problem. I'm hoping that mine is somewhat unique, and may actually merit a different solution. I'm instantiating an asp:Button inside a data-bound asp:GridView through template fields. Some of the buttons are supposed to call a server-side function, but for some weird reason, it doesn't. All the buttons do when you click them is fire a postback to the current page, doing nothing, effectively just reloading the page. Below is a fragment of the code: <asp:GridView ID="gv" runat="server" AutoGenerateColumns="false" CssClass="l2 submissions" ShowHeader="false"> <Columns> <asp:TemplateField> <ItemTemplate><asp:Panel ID="swatchpanel" CssClass='<%# Bind("status") %>' runat="server"></asp:Panel></ItemTemplate> <ItemStyle Width="50px" CssClass="sw" /> </asp:TemplateField> <asp:BoundField DataField="description" ReadOnly="true"> </asp:BoundField> <asp:BoundField DataField="owner" ReadOnly="true"> <ItemStyle Font-Italic="true" /> </asp:BoundField> <asp:BoundField DataField="last-modified" ReadOnly="true"> <ItemStyle Width="100px" /> </asp:BoundField> <asp:TemplateField> <ItemTemplate> <asp:Button ID="viewBtn" cssclass='<%# Bind("sid") %>' runat="server" Text="View" OnClick="viewBtnClick" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> The viewBtn above should call the viewBtnClick() function on server-side. I do have that function defined, along with a proper signature (object,EventArgs). One thing that may be of note is that this code is actually inside an ASCX, which is loaded in another ASCX, finally loaded into an ASPX. Any help or insight into the matter will be SO appreciated. Thanks! (oh, and please don't mind my trashy HTML/CSS semantics - this is still in a very,very early stage :p)

    Read the article

  • What is the difference between causal models and directed graphical models?

    - by Neil G
    What is the difference between causal models and directed graphical models? or: What is the difference between causal relationships and directed probabilistic relationships? or, even better: What would you put in the interface of a DirectedProbabilisticModel class, and what in a CausalModel class? Would one inherit from the other? Collaborative solution: interface DirectedModel { map<Node, double> InferredProbabilities(map<Node, double> observed_probabilities, set<Node> nodes_of_interest) } interface CausalModel: DirectedModel { bool NodesDependent(set<Node> nodes, map<Node, double> context) map<Node, double> InferredProbabilities(map<Node, double> observed_probabilities, map<Node, double> externally_forced_probabilities, set<Node> nodes_of_interest) }

    Read the article

  • Extract multiple values from one column in MySql

    - by Neil
    I've noticed that MySql has an extensive search capacity, allowing both wildcards and regular expressions. However, I'm in somewhat in a bind since I'm trying to extract multiple values from a single string in my select query. For example, if I had the text "<span>Test</span> this <span>query</span>", perhaps using regular expressions I could find and extract values "Test" or "query", but in my case, I have potentially n such strings to extract. And since I can't define n columns in my select statement, that means I'm stuck. Is there anyway I could have a list of values (ideally separated by commas) of any text contained with span tags? In other words, if I ran this query, I would get "Test,query" as the value of spanlist: select <insert logic here> as spanlist from HtmlPages ...

    Read the article

  • 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

< Previous Page | 6 7 8 9 10 11 12 13 14  | Next Page >