Search Results

Search found 324 results on 13 pages for 'robin v g'.

Page 6/13 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Operator== in derived class never gets called.

    - by Robin Welch
    Can someone please put me out of my misery with this? I'm trying to figure out why a derived operator== never gets called in a loop. To simplify the example, here's my Base and Derived class: class Base { // ... snipped bool operator==( const Base& other ) const { return name_ == other.name_; } }; class Derived : public Base { // ... snipped bool operator==( const Derived& other ) const { return ( static_cast<const Base&>( *this ) == static_cast<const Base&>( other ) ? age_ == other.age_ : false ); }; Now when I instantiate and compare like this ... Derived p1("Sarah", 42); Derived p2("Sarah", 42); bool z = ( p1 == p2 ); ... all is fine. Here the operator== from Derived gets called, but when I loop over a list, comparing items in a list of pointers to Base objects ... list<Base*> coll; coll.push_back( new Base("fred") ); coll.push_back( new Derived("sarah", 42) ); // ... snipped // Get two items from the list. Base& obj1 = **itr; Base& obj2 = **itr2; cout << obj1.asString() << " " << ( ( obj1 == obj2 ) ? "==" : "!=" ) << " " << obj2.asString() << endl; Here asString() (which is virtual and not shown here for brevity) works fine, but obj1 == obj2 always calls the Base operator== even if the two objects are Derived. I know I'm going to kick myself when I find out what's wrong, but if someone could let me down gently it would be much appreciated.

    Read the article

  • Alternative databases to use when putting IIS Logs into a database using LogParser

    - by Robin Day
    We have run some scripts that use LogParser to dump our IIS logs into a SQL Server database. We can then query this to get simple stats on hits, usage etc. It's also good when linking it to error log databases and performance counter database to compare usage with errors, etc. Having implemented this for just one system and for the last 2-3 weeks we already have a 5GB database with around 10 million records. This is making any queries to this database quite slow and will no doubt cause storage issues if we continue to log as we are. Can anyone suggest any alternative databases that we could use for this data that would be more efficient for such logs? I'd be particularly interested in any experience of Google's BigTable or Amazon's SimbleDB. Are either of these suitable for reporting queries? COUNTs, GROUP BYs, PIVOTs?

    Read the article

  • Using a map with set_intersection

    - by Robin Welch
    Not used set_intersection before, but I believe it will work with maps. I wrote the following example code but it doesn't give me what I'd expect: #include <map> #include <string> #include <iostream> #include <algorithm> using namespace std; struct Money { double amount; string currency; bool operator< ( const Money& rhs ) const { if ( amount != rhs.amount ) return ( amount < rhs.amount ); return ( currency < rhs.currency ); } }; int main( int argc, char* argv[] ) { Money mn[] = { { 2.32, "USD" }, { 2.76, "USD" }, { 4.30, "GBP" }, { 1.21, "GBP" }, { 1.37, "GBP" }, { 6.74, "GBP" }, { 2.55, "EUR" } }; typedef pair< int, Money > MoneyPair; typedef map< int, Money > MoneyMap; MoneyMap map1; map1.insert( MoneyPair( 1, mn[1] ) ); map1.insert( MoneyPair( 2, mn[2] ) ); map1.insert( MoneyPair( 3, mn[3] ) ); // (3) map1.insert( MoneyPair( 4, mn[4] ) ); // (4) MoneyMap map2; map1.insert( MoneyPair( 3, mn[3] ) ); // (3) map1.insert( MoneyPair( 4, mn[4] ) ); // (4) map1.insert( MoneyPair( 5, mn[5] ) ); map1.insert( MoneyPair( 6, mn[6] ) ); map1.insert( MoneyPair( 7, mn[7] ) ); MoneyMap out; MoneyMap::iterator out_itr( out.begin() ); set_intersection( map1.begin(), map1.end(), map2.begin(), map2.end(), inserter( out, out_itr ) ); cout << "intersection has " << out.size() << " elements." << endl; return 0; } Since the pair labelled (3) and (4) appear in both maps, I was expecting that I'd get 2 elements in the intersection, but no, I get: intersection has 0 elements. I'm sure this is something to do with the comparitor on the map / pair but can't figure it out.

    Read the article

  • [grails] setting cookies when render type is "contentType: text/json"

    - by Robin Jamieson
    Is it possible to set cookies on response when the return render type is set as json? I can set cookies on the response object when returning with a standard render type and later on, I'm able to get it back on the subsequent request. However, if I were to set the cookies while rendering the return values as json, I can't seem to get back the cookie on the next request object. What's happening here? These two actions work as expected with 'basicForm' performing a regular form post to the action, 'withRegularSubmit', when the user clicks submit. // first action set the cookie and second action yields the originally set cookie def regularAction = { // using cookie plugin response.setCookie("username-regular", "regularCookieUser123",604800); return render(view: "basicForm"); } // called by form post def withRegularSubmit = { def myCookie = request.getCookie("username-regular"); // returns the value 'regularCookieUser123' return render(view: "resultView"); } When I switch to setting the cookie just before returning from the response with json, I don't get the cookie back with the post. The request starts by getting an html document that contains a form and when doc load event is fired, the following request is invoked via javascript with jQuery like this: var someUrl = "http://localhost/jsonAction"; $.get(someUrl, function(jsonData) { // do some work with javascript} The controller work: // this action is called initially and returns an html doc with a form. def loadJsonForm = { return render(view: "jsonForm"); } // called via javascript when the document load event is fired def jsonAction = { response.setCookie("username-json", "jsonCookieUser456",604800); // using cookie plugin return render(contentType:'text/json') { 'pair'('myKey': "someValue") }; } // called by form post def withJsonSubmit = { def myCookie = request.getCookie("username-json"); // got null value, expecting: jsonCookieUser456 return render(view: "resultView"); } The data is returned to the server as a result of the user pressing the 'submit' button and not through a script. Prior to the submit of both 'withRegularSubmit' and 'withJsonSubmit', I see the cookies stored in the browser (Firefox) so I know they reached the client.

    Read the article

  • Magento images not showing on front end

    - by Robin Williams
    I'm using Magento 1.4. I have two website set up. If I upload images to Website A, they appear fine on both front and back end. If I upload or import images to Website B, they do not appear on the front end, only the backend. I'm completely stuck. I'm happy to provide any additional details that may be helpful, but am so frustrated I'm not sure what is necessary info to fix the problem. Thanks!

    Read the article

  • How to Deserialize this Xml file?

    - by Robin-Hood
    Hello experts, I have this Xml file, and I need to Deserialize it back to a class. The problem is: what is the right structure/design of this class considering that the count of the Xml element (RowInfo) is not constant? The Xml File: <?xml version="1.0"?> <SomeObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <Layers> <Layer Id="0"> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1</RowInfo> <RowInfo>1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</RowInfo> <RowInfo>1,1,1,0,0,1,1,1,1,1,1,1,1,1,0,0,1,0,0,1</RowInfo> <RowInfo>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1</RowInfo> </Layer> </Layers> </SomeObject> Appreciate your help. Thanks. Edit1:also considering that (Layers) may contains more than one layer.

    Read the article

  • sed replacement does not work

    - by Robin Hood
    Hello, I have trouble using sed. I need to replace some lines in very deprecated HTML sites which consist of many files. My script does not work and I do not why. When I tried to find exact pattern with Netbeas it worked. find . -type f -name "*.htm?" -exec sed -i -r 's/ing\. Šuhajda Dušan\, Mírová 767\, 518 01 Dobruška\, \+420 737 980 333\,/REPLACEMENT/g' {} \; Where is the mistake? Is there an alternative to replace text without searching regular expression but plain text? Thanks for any respond.

    Read the article

  • Is there simple way to play an rtp video/audio stream in WPF?

    - by Robin
    I need to create a WPF control that will play an rtp stream with the requirement that the latency needs to be as low as possible. I've looked at the following two projects: http://vlcdotnet.codeplex.com/ http://wpfmediakit.codeplex.com/ As far as I know, I can't use VLC because we're shipping a commercial application with a more restrictive license than GPL (i.e. we can't ship our source). Wpf media kit is nice, but I can't seem to find a good/free rtp directshow source filter and I wanted to ask if there is a simpler solution out there that I'm missing before I jump into writing my own. Any ideas?

    Read the article

  • Jquery UI Tabs, control variable lenght spent on each tab?

    - by Robin
    I'm trying the following to control the speed of rotation of the tabs but with no luck, any ideas? $('#featured').tabs({ onShow: function(event, ui) { if(ui.index == 0)> { $('#featured').tabs("rotate", 2000, true); } else if(ui.index == 1){ $('#featured').tabs("rotate", 5000, true); } else if(ui.index == 2){ $('#featured').tabs("rotate", 10000, true); } } });

    Read the article

  • How do I configure WinCE to use wildcard SSL certificates?

    - by Robin M
    Our Windows CE 5.0 application has a problem with our wildcard SSL certificate (*.domain.com) - it won't accept it as valid. I understand that Windows Mobile 6.0 has support for wildcard certificates (earlier versions don't) and that is built on WinCE 5 which suggests it should be possible to change WinCE 5 to accept wildcard certificates (EDIT - apparently this shows my limited understanding of the environment and isn't a valid presumption!). Can anyone suggest how we go about this? The change needs to be programmatic so that we can roll it out to hundreds of existing clients. Help!

    Read the article

  • DB Design Pattern - Many to many classification / categorised tagging.

    - by Robin Day
    I have an existing database design that stores Job Vacancies. The "Vacancy" table has a number of fixed fields across all clients, such as "Title", "Description", "Salary range". There is an EAV design for "Custom" fields that the Clients can setup themselves, such as, "Manager Name", "Working Hours". The field names are stored in a "ClientText" table and the data stored in a "VacancyClientText" table with VacancyId, ClientTextId and Value. Lastly there is a many to many EAV design for custom tagging / categorising the vacancies with things such as Locations/Offices the vacancy is in, a list of skills required. This is stored as a "ClientCategory" table listing the types of tag, "Locations, Skills", a "ClientCategoryItem" table listing the valid values for each Category, e.g., "London,Paris,New York,Rome", "C#,VB,PHP,Python". Finally there is a "VacancyClientCategoryItem" table with VacancyId and ClientCategoryItemId for each of the selected items for the vacancy. There are no limits to the number of custom fields or custom categories that the client can add. I am now designing a new system that is very similar to the existing system, however, I have the ability to restrict the number of custom fields a Client can have and it's being built from scratch so I have no legacy issues to deal with. For the Custom Fields my solution is simple, I have 5 additional columns on the Vacancy Table called CustomField1-5. This removes one of the EAV designs. It is with the tagging / categorising design that I am struggling. If I limit a client to having 5 categories / types of tag. Should I create 5 tables listing the possible values "CustomCategoryItems1-5" and then an additional 5 many to many tables "VacancyCustomCategoryItem1-5" This would result in 10 tables performing the same storage as the three tables in the existing system. Also, should (heaven forbid) the requirements change in that I need 6 custom categories rather than 5 then this will result in a lot of code change. Therefore, can anyone suggest any DB Design Patterns that would be more suitable to storing such data. I'm happy to stick with the EAV approach, however, the existing system has come across all the usual performance issues and complex queries associated with such a design. Any advice / suggestions are much appreciated. The DBMS system used is SQL Server 2005, however, 2008 is an option if required for any particular pattern.

    Read the article

  • How to get a unique WindowRef in a dockable Qt application on Mac

    - by Robin
    How do I get a unique WindowRef from a Qt application that includes docked windows on the Mac? My code boils down to: int main(int argc, char* argv[]) { QApplication* qtApp = new QApplication(argc, argv); MyQMainWindow mainwin; mainwin.show(); } class MyQMainWindow : public QMainWindow { //... QDockWidget* mDock; MyQWidget* mDrawArea; QStackedWidget* mCentralStack; }; MyQMainWindow::MyQMainWindow() { mDock = new QDockWidget(tr("Docked Widget"), this); mDock->setMaximumWidth(180); //... addDockWidget(Qt::RightDockWidgetArea, mDock); mDrawArea = new MyQWidget(this); mCentralStack = new QStackedWidget(); mCentralStack->addWidget(mDrawArea); // Other widgets added to stack in production code. setCentralWidget(mCentralStack); //... } (Apologies if the above isn't syntactically correct, it's just easier to illustrate than to describe.) I added the following temporary code at the end of the above constructor: HIViewRef view1 = (HIViewRef) mDrawArea->winId(); HIViewRef view2 = (HIViewRef) mDock->winId(); WindowRef win1 = HIViewGetWindow(view1); WindowRef win2 = HIViewGetWindow(view2); My problem is that view1 and view2 are different, but win1 and win2 are the same! I tried the following equivalent on Windows: HWND win1 = (HWND)(mCentralDrawArea->winId()); HWND win2 = (HWND)(mDock1->winId()); This time win1 and win2 are different. I need the window handle to pass on to a 3rd party SDK so that it can draw into the central area only. BTW, I appreciate that the winId() method comes with lots of portability warnings, but a substantial refactor is out of the question for me. The same goes for using Carbon instead of Cocoa. Thanks.

    Read the article

  • Loading dynamic external content into the Div of another on click

    - by Robin I Knight
    Trying to load an external php file into another onClick. Iframes will not work as the size of the content changes with collapsible panels. That leaves AJAX. I was given a piece of code HTML <a href="#" id="getData">Get data</a> <div id="myContainer"></div> JS $('#getData').click(function(){ $.get('data.php', { section: 'mySection' }, function(data){ $('#myContainer').html(data); }); }); PHP: <?php if($_GET['section'] === 'mySection') echo '<span style="font-weigth:bold;">Hello World</span>'; ?> I have tested it here http://www.divethegap.com/scuba-diving-programmes-dive-the-gap/programme-pages/dahab-divemaster/divemaster-trainingA.php and get the most unexpected results. It certainly loads the right amount of items as it says in the lower bar on safari but I see three small calendars and that is it. Can anyone see where I have made a mistake?

    Read the article

  • How do I splice a python string programmatically?

    - by Robin Welch
    Very simple question, hopefully. So, in Python you can split up strings using indices as follows: >>> a="abcdefg" >>> print a[2:4] cd but how do you do this if the indices are based on variables? E.g. >>> j=2 >>> h=4 >>> print a[j,h] Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: string indices must be integers

    Read the article

  • PageableListView Not rendering my data as required

    - by Robin
    i am working on wicket, where i am supposed to show my data's under <tr> <td>Name</td> <td>Single Player Score</td> <td>Double Player Score</td> <td>Total Score</td> </tr> <tr wicket:id="data"> <td wicket:id="name"></td> <td wicket:id="singlePlayerScore"></td> <td wicket:id="doublePlayerScore"></td> <td wicket:id="totalScore"></td> </tr> My Player model class is as: Player class with attributes singlePlayerScore, doublePlayerScore(), name with getter and setter and also a list data obtained from database. Data from SQLQuery is as; name score gamemode A 200 singlePlayerMode A 100 doublePLayerMode B 400 singlePlayerMode B 300 doublePLayerMode dataList == player.getScoreList(); My PageableListView is as: final PageableListView listView = new PageableListView("data",dataList,10){ @Override protected void populateItem(Item item){ player = (Player)item.getModelObject(); item.add(Label("name",player.getName())); item.add(Label("singlePlayerScore",player.getName())); item.add(Label("doublePlayerScore",player.getName())); item.add(Label("totalScore",String.valueOf(player.getSinglePlayerScore()+player.getDoublePlayerScore()))); } } My Problem is as: What view i get is as: Name single Player Score Double Player Score Total Score A 0 100 100 A 200 0 200 B 0 300 300 B 400 0 400 How do i achieve below view on my webpage? Name single Player Score Double Player Score Total Score A 200 100 300 B 400 300 700 Please help me as to why is this happening? I guess my list has size four that's one reason why as to it is rendering the view? So what can i do to get as require rendering view?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >