Daily Archives

Articles indexed Tuesday June 1 2010

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

  • C++ question: boost::bind receive other boost::bind

    - by user355034
    I want to make this code work properly, what should I do? giving this error on the last line. what am I doing wrong? i know boost::bind need a type but i'm not getting. help class A { public: template <class Handle> void bindA(Handle h) { h(1, 2); } }; class B { public: void bindB(int number, int number2) { std::cout << "1 " << number << "2 " << number2 << std::endl; } }; template struct Wrap_ { Wrap_(Han h) : h_(h) {} template<typename Arg1, typename Arg2> void operator()(Arg1 arg1, Arg2 arg2) { h_(arg1, arg2); } Han h_; }; template inline Wrap_<Handler> make(Handler h) { return Wrap_<Handler> (h); } int main() { A a; B b; ((boost::bind)(&B::bindB, b, _1, _2))(1, 2); ((boost::bind)(&A::bindA, a, make(boost::bind(&B::bindB, b, _1, _2))))(); /i want compiled success and execute success this code/ }

    Read the article

  • Magento: Display sub-category list

    - by Neil Bradley
    Hi there, I'm building a Magento store and want to be able to display a list of categories and have each category link to its own page. I have a 'Brands' category with an ID of 42 and I want to display a list of the sub-categories and ensure that each one links to the designated URL key in the CMS. Has anyone had experience of doing this with Magento? Thank you.

    Read the article

  • What would cause my Silverlight .xap to quadruple in size suddenly?

    - by Edward Tanguay
    I've been working on a Silverlight application. I just noticed that the .xap file is now four times as big as it was, what could have caused that? Here's some other info: there seems to now be many more language settings in the bin/Release directory I checked "Reduce size of .xap" in under Properties/Silverlight but that just brought it down from 1300 to 1200. I reference the System.Windows.Controls.Toolkit dll but I was doing that even when it was 325K Screenshot of build directories before and after:

    Read the article

  • How can I programatically test which CSS elements match my XHTML?

    - by Shawn Lauzon
    I have an application which generates XHTML documents which are styled with (mostly) static CSS. I'm currently using XPath and Hamcrest (Java) to verify that the documents are constructed correctly. However, I also need to verify that the correct CSS properties are matched. For example, I would like a test like this: Given XHTML element Foo, verify that the property "text-transform:uppercase" is applied. Ideally, I would like a Java framework that provides this. I've looked a bit at Selenium, but I don't see this type of functionality. Thanks ...

    Read the article

  • NHibernate. Distinct parent child fetching

    - by Andrew Kalashnikov
    Hello. I've got common NH mapping; <class name="Order, SummaryOrder.Core" table='order'> <id name="Id" unsaved-value="0" type="int"> <column name="id" not-null="true"/> <generator class="native"/> </id> <many-to-one name="Client" class="SummaryOrderClient, SummaryOrder.Core" column="summary_order_client_id" cascade="none"/> <many-to-one name="Provider" class="SummaryOrderClient, SummaryOrder.Core" column="summary_order_provider_id" cascade="none"/> <set name="Items" cascade="all"> <key column="order_id"/> <one-to-many class="OrderItem, Clients.Core" /> </set> </class> Want get list by this criteria ICriteria criteria = NHibernateStateLessSession.CreateCriteria(typeof(SummaryOrder.Core.Domains.Order)); ; criteria.Add(Restrictions.Or (Restrictions.Eq(String.Format("{0}.Id", SummaryOrder.Core.Domains.Order.Properties.Client), idClient), Restrictions.Eq(String.Format("{0}.Id", SummaryOrder.Core.Domains.Order.Properties.Provider), idClient))). SetResultTransformer(new DistinctRootEntityResultTransformer()). SetFetchMode(SummaryOrder.Core.Domains.Order.Properties.Items, FetchMode.Join); return criteria.List<SummaryOrder.Core.Domains.Order>() as List<SummaryOrder.Core.Domains.Order> But I've got duplicates.. When I execute One restriction (without OR) I got distinct collection of orders, but Restriction OR brakes my query. I wanna get distinct(at client yet) collection of orders. What's wrong. Please HELP!

    Read the article

  • How do I force or add the content length for ajax type POST requests in Firefox?

    - by Jayson
    I'm trying to POST a http request using ajax, but getting a response from the apache server using modsec_audit that: "POST request must have a Content-Length header." I do not want to disable this in modsec_audit. This occurs only in firefox, and not IE. Further, I switched to using a POST rather than a GET to keep IE from caching my results. This is a simplified version of the code I'm using for the request, I'm not using any javascript framework. function getMyStuff(){ var SearchString = ''; /* build search string */ ... /* now do request */ var xhr = createXMLHttpRequest(); var RequestString = 'someserverscript.cfm' + SearchString; xhr.open("POST", RequestString, true); xhr.onreadystatechange = function(){ processResponse(xhr); } xhr.send(null); } function processResponse(xhr){ var serverResponse = xhr.responseText; var container = document.getElementById('myResultsContainer'); if (xhr.readyState == 4){ container.innerHTML = serverResponse; } } function createXMLHttpRequest(){ try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {} try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} try { return new XMLHttpRequest(); } catch(e) {} return null; } How do I force or add the content length for ajax type POST requests in Firefox?

    Read the article

  • How to know user is dragging something when the cursor is not in my window?

    - by Edwin
    Hi folks, We all know you can implement drag-and-drop feature for your Window so that it accepts drag and drop operation, but my question is, how to detect a drag-and-drop operation that's is in progress in other windows, for example, dragging a file in the Windows Explorer? What I want to do is that when a user is dragging a file then my hidden window shows up. Thank you!

    Read the article

  • iPad issue with a modal view: modal view label null after view controller is created

    - by iPhone Guy
    This is a weird issue. I have created a view controller with a nib file for my modal view. On that view there is a label, number and text view. When I create the view from the source view, I tried to set the label, but it shows that the label is null (0x0). Kinda weird... Any suggestions? Now lets look at the code (I put all of the code here because that shows more than I can just explain): The modal view controller - in IB the label is connected to the UILabel object: @implementation ModalViewController @synthesize delegate; @synthesize goalLabel, goalText, goalNumber; // Done button clicked - (void)dismissView:(id)sender { // Call the delegate to dismiss the modal view if ([delegate respondsToSelector:@selector(didDismissModalView: newText:)]) { NSNumber *tmpNum = goalNumber; NSString *tmpString = [[NSString alloc] initWithString:[goalText text]]; [delegate didDismissModalView:tmpNum newText:tmpString]; [tmpNum release]; [tmpString release]; } } - (void)cancelView:(id)sender { // Call the delegate to dismiss the modal view if ([delegate respondsToSelector:@selector(didCancelModalView)]) [delegate didCancelModalView]; } -(void) setLabelText:(NSString *)text { [goalLabel setText:text]; } /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { // Custom initialization } return self; } */ -(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; // bring up the keyboard.... [goalText becomeFirstResponder]; } // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; // set the current goal number to -1 so we know none was set goalNumber = [NSNumber numberWithInt: -1]; // Override the right button to show a Done button // which is used to dismiss the modal view self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissView:)] autorelease]; // and now for the cancel button self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelView:)] autorelease]; self.navigationItem.title = @"Add/Update Goals"; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Overriden to allow any orientation. return YES; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end And here is where the view controller is created, variables set, and displayed: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // put a checkmark.... UITableViewCell *tmpCell = [tableView cellForRowAtIndexPath:indexPath]; [tmpCell setAccessoryType:UITableViewCellAccessoryCheckmark]; // this is where the popup is gonna popup! // ===> HEre We Go! // Create the modal view controller ModalViewController *mdvc = [[ModalViewController alloc] initWithNibName:@"ModalDetailView" bundle:nil]; // We are the delegate responsible for dismissing the modal view [mdvc setDelegate:self]; // Create a Navigation controller UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:mdvc]; // set the modal view type navController.modalPresentationStyle = UIModalPresentationFormSheet; // set the label for all of the goals.... if (indexPath.section == 0 && indexPath.row == 0) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Long Term Goal 1:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:1]]; } if (indexPath.section == 0 && indexPath.row == 1) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Long Term Goal 2:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:2]]; } if (indexPath.section == 0 && indexPath.row == 2) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Long Term Goal 3:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:3]]; } if (indexPath.section == 0 && indexPath.row == 3) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Long Term Goal 4:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:4]]; } if (indexPath.section == 1 && indexPath.row == 0) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Short Term Goal 1:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:5]]; } if (indexPath.section == 1 && indexPath.row == 1) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Short Term Goal 2:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:6]]; } if (indexPath.section == 1 && indexPath.row == 2) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Short Term Goal 3:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:7]]; } if (indexPath.section == 1 && indexPath.row == 3) { [mdvc setLabelText:[[[NSString alloc] initWithString:@"Short Term Goal 4:"] autorelease]]; [mdvc setGoalNumber:[NSNumber numberWithInt:8]]; } // show the navigation controller modally [self presentModalViewController:navController animated:YES]; // Clean up resources [navController release]; [mdvc release]; // ==> Ah... we are done... }

    Read the article

  • free public databases with non-trivial table structures?

    - by Caffeine Coma
    I'm looking for some sample database data that I can use for testing and demonstrating a DB tool I am working on. I need a DB that has (preferably) many tables, and many foreign key relationships between the tables. Ideally the data would be in SQL dump format, or at least in something that maintains the foreign key references, and could be easily import into an RDBMS (MySQL or H2). The dataset itself doesn't have to be huge (in fact, best if it's not). I thought about using the Stackoverflow Data Dump, but it's only about 5 tables.

    Read the article

  • SQL Server store procedure line number issue

    - by George2
    Hello everyone, I am using SQL Server 2008 Enterprise. I met with issue which says line 9 of store procedure foo is meeting with dead lock issue. My question is how to find exactly the 9th line of the store procedure? My confusion is because of coding format issue, how to locate 9th line correctly. thanks in advance, George

    Read the article

  • (C) which heap policies are most often used?

    - by hatorade
    I have heard that 'better-fit' is pretty commonly used, but I don't seem to read much about it online. What are the most commonly used / thought to be the most efficient policies used by heap allocators. (I admit my vocabulary may be flawed; when I say 'policy' i mean things such as 'best fit,' 'first fit,' 'next fit,' etc)

    Read the article

  • Using special keys for keybidings in Javascript

    - by newhen
    Hi, I was wondering if it was possible to use special keys that the macbook pro has for music control and bind them in javascript? Example keys: PLay/pause,next, back. I am trying to do this to modify a greasemonkey script if that helps. Here is the current code HotKeys.bindings['/'] = HotKeys.activateSearch; HotKeys.bindings['p'] = HotKeys.playPrev; HotKeys.bindings['n'] = HotKeys.playNext; HotKeys.bindings['k'] = HotKeys.selectPrev; HotKeys.bindings['j'] = HotKeys.selectNext; HotKeys.bindings['o'] = HotKeys.playSelected; HotKeys.bindings['v'] = HotKeys.openBlog; HotKeys.bindings['s'] = HotKeys.toggleFavorite; HotKeys.keyBindings[27] /*ESC*/ = HotKeys.deactivateSearch; Script source: http://userscripts.org/scripts/review/23612

    Read the article

  • Undo/Redo Support for Table Changes in WPF RichTextBox

    - by Jeff
    As part of an editor project, I need to add functionality to the WPF RichTextBox control to allow the user to perform operations on a table. One of those operations is to apply a new width value to one or more columns of the table. I have a function that is applying a new Width value to the TableColumn objects in question, and the table is resizing itself nicely. However, I've noticed that the column-width change operation does not seem to be added to the undo stack. In other words, if a user types something, then changes a column width, then selects undo, the RichTextBox control undoes the user's typing. Undo and redo don't seem to be picking up the property change on the TableColumn object. Is there some way to make this operation occur in a way that it actually is undoable/redoable?

    Read the article

  • Technology stack for very frequent gps data collection

    - by gvaswani
    I am working on a project that involves gps data collection from many users (say 1000) every second (while they move). I am planning on using a dedicated database instance on EC2 with the mysql persistent block storage and run a ruby on rails application with nginx frontend. I haven't worked on such data collection application before. Am I missing something here? I will have a another instance which will act as application server and use the data from the same EBS. If anybody has dealt with such a system before, Any advise would be much appreciated?

    Read the article

  • QT4 - MDI model or Dock Windows?

    - by umanga
    Greetings, In the QT application we develop we need to display several 'Viewer windows'(to display data in XY plane ,YX plane,XZ plane and in 3D). We were hoping to use MDI application model ,but later client asked for a requirement to drag and view 'Viewer windows' in multiple desktops.(using multiple monitors). This can not be done using MDI window model ,because we cannot move MDI window outside the Main Application Window. Only possible way is to use Dock windows because they can be undocked from Main Application Window and move into other desktops, but Dock windows primary used for tool-palettes or utility windows. (http://doc.qt.nokia.com/4.6/qdockwidget.html#details) Is it a good practice to use Dock window for our requirement? thanks in advance.

    Read the article

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