Daily Archives

Articles indexed Sunday April 4 2010

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

  • C# Custom EventArgs with no constructor?

    - by Motig
    I have a problem; I'm using an external library where one particular event has its own custom eventargs; with no constructor. If I want to throw my own event using these eventargs, how can I? I'll give more detail if asked, but I'm not sure what exactly I should be giving. :)

    Read the article

  • How can I use Qt to get html code of the redirected page??

    - by Claire Huang
    I'm trying to use Qt to download the html code from the following url: http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=nucleotide&cmd=search&term=AB100362 this url will re-direct to www.ncbi.nlm.nih.gov/nuccore/27884304 I try to do it by following way, but I cannot get anything. it works for some webpage such as www.google.com, but not for this NCBI page. is there any way to get this page?? QNetworkReply::NetworkError downloadURL(const QUrl &url, QByteArray &data) { QNetworkAccessManager manager; QNetworkRequest request(url); QNetworkReply *reply = manager.get(request); QEventLoop loop; QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit())); loop.exec(); if (reply->error() != QNetworkReply::NoError) { return reply->error(); } data = reply->readAll(); delete reply; return QNetworkReply::NoError; } void GetGi() { int pos; QString sGetFromURL = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi"; QUrl url(sGetFromURL); url.addQueryItem("db", "nucleotide"); url.addQueryItem("cmd", "search"); url.addQueryItem("term", "AB100362"); QByteArray InfoNCBI; int errorCode = downloadURL(url, InfoNCBI); if (errorCode != 0 ) { QMessageBox::about(0,tr("Internet Error "), tr("Internet Error %1: Failed to connect to NCBI.\t\nPlease check your internect connection.").arg(errorCode)); return "ERROR"; } }

    Read the article

  • How do you use jQuery .data() to store html?

    - by Al
    Hi all - when I look up the syntax for .data(), it gives examples like this: $('body').data('foo', 52); I am doing AJAX loads and I was wondering if it is possible to store the incoming html using .data() so once the content is loaded, I would not need to do another AJAX load if the same link is clicked again - I would check to see if the .data key is empty. Would something like this work?: To load the contents of a #ajaxdiv into storage: $('body').data('storage', div#ajaxdiv.html()); To test if the data has already been loaded: if $('body').data('storage') != '' { div#ajaxdiv.html($('body').data('storage')); } Thanks in advance!! Al

    Read the article

  • Switch-Case for strings in Javascript not working as expected

    - by Coltin
    So I have this problem with strings and switch-case, and I'll try to keep it as simple as possible. Here event.keyCode has the value "65", and is the result of a keydown event of 'a' (using JQuery). if (event.keyCode == "65") { alert("hmmmm"); } That works, but: switch (event.keyCode) { case '65': alert("Yay!"); break; } That doesn't. However this will work: switch ('65') { case '65': alert("Yay!"); break; } And if I do this: var t = '65'; switch (t) { case '65': alert("Yay!"); break; } It works. And then I tried this: var t = event.keyCode; switch (t) { case '65': alert("Yay!"); break; } But it fails! So why does it match in the if-block at the beginning, but not for the switch-case?

    Read the article

  • Explicit script end tag always converted to self-closing

    - by Jonas
    I'm using xslt to transform xml to an aspx file. In the xslt, I have a script tag to include a jquery.js file. To get it to work with IE, the script tag must have an explicit closing tag. For some reason, this doesn't work with xslt below. <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:asp="remove"> <xsl:output method="html"/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>TEST</title> <script type="text/javascript" src="jquery-1.2.6.js"></script> But if I change the script tag as shown below, it works. <script type="text/javascript" src="jquery-1.2.6.js"> // <![CDATA[ // ]]> </script> I thought that the <xsl:output method="html" /> would do the trick, but it doesn't seem to work? /Jonas

    Read the article

  • OpenGL bitmap text fails after drawing polygon

    - by kaykun
    Hi, I'm using Win32 and OpenGL to to draw text onto a window. I'm using the bitmap font method, with wglUseFontBitmaps. Here is my main rendering function: glClear(GL_COLOR_BUFFER_BIT); glPushMatrix(); glColor3f(1.0f, 0.0f, 1.0f); glBegin(GL_QUADS); glVertex2f(0.0f, 0.0f); glVertex2f(128.0f, 0.0f); glVertex2f(128.0f, 128.0f); glVertex2f(0.0f, 128.0f); glEnd(); glPopMatrix(); glPushMatrix(); glColor3f(1.0f, 1.0f, 1.0f); glRasterPos2i(200, 200); glListBase(fontList); glCallLists(5, GL_UNSIGNED_BYTE, "Test."); glPopMatrix(); SwapBuffers(hDC); As you can see it's very simple and the only thing that it's supposed to do is draw a quadrilateral and draw the text "Test.". But the problem is that drawing a polygon seems to mess up any text operations I try to do after it. If I place the text drawing functions before the polygon, both the text and the polygon draw fine. Is there something I'm missing here? Any help is appreciated.

    Read the article

  • Python -- what is NOT in 2.7 that IS in 3.1? So many things have been back-ported, what is NOT?

    - by StuFuller
    I've been following the saga of Python 3.x and have watched the 3.x features gradually getting back-ported to the 2.x line. Most of the libraries I use haven't been ported and some (e.g. Twisted) seem covertly or overtly hostile to 3.x to varying degrees. At any rate, there has been very little movement towards compatible versions of many of them. Expecially the larger ones. So, my question is, with all the features that have been backported, what is still available in 3.x that's NOT been back-ported? It's pretty easy to find what has been backported, but not what's left. Right now, porting to 3.x just seems like all pain, and I can't see the gain; maybe an "Only in 3.x" list would let me see the light... Thanks, Stu

    Read the article

  • iphone - gesture not working on animated view

    - by Mike
    I have this animated view and a gesture assigned to it... [self.view setUserInteractionEnabled:YES]; UIImageView *sequence = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"frame0.png"]]; [sequence setUserInteractionEnabled:YES]; sequence.center = CGPointMake(centroX, centroY); NSMutableArray *array = [[NSMutableArray alloc] init] ; for (int i=0; i<30; i++) { UIImage *oneImage = [UIImage imageNamed:[NSString stringWithFormat:@"frame%d.png",i]]; [array addObject:oneImage]; } sequence.animationImages = array; sequence.animationDuration = 1.0; sequence.animationRepeatCount = 1; [self.view addSubview:sequence]; [sequence release]; sequence.startAnimating; sequence.image = [UIImage imageNamed:@"frame29.png"]; // doSomething never runs when I tap the image... why? UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doSomething)]; [singleTap setDelegate:self]; [singleTap setCancelsTouchesInView:NO]; [singleTap setDelaysTouchesEnded:NO]; [sequence addGestureRecognizer:singleTap]; [singleTap release]; The gesture is never called... why? I have no other gesture associated anywhere. thanks for any help.

    Read the article

  • HA Proxy and Disaster Recovery - Only access server if others are down?

    - by ben2004uk
    Why I expect this is not the best way to solve the problem, I got thinking tonight. I'm thinking about geo-locating servers. Given we have a load balancer + two servers to handle traffic in NA (North America) and one server in the EU. If the two US servers die, is it possible to get HAProxy to direct traffic automatically to the EU one. However, I don't want to use a roundrobin approach for the EU - just the two US ones. The EU should only be hit when the other two are down. Does anyone know how to configure HAProxy to do this? Thanks Ben

    Read the article

  • Referencing a specific figure in Microsoft Word 2003

    - by stanigator
    Referring to the screenshot below: I want to be able to reference the figure in the body of the text properly without having to change them manually every time I add a figure label before that body of text. However, I don't know how to do it aside from adding caption labels, which won't work for cases where I have more than one reference to the figure (at least I don't know how to do that properly anyway). How would you recommend accomplishing that? Thanks in advance!

    Read the article

  • XCode: Delete line hot-key

    - by Typeoneerror
    I'm looking for a way to map some hot-keys to "delete the line that my cursor is on" in Xcode. I found "delete to end of line" and "delete to beginning of line" in the text key bindings, but I am missing how to completely delete the line no matter what I have selected. TextMate has this functionality mapped to Ctrl+Shift+D and I'd like the same thing if possible. Any ideas?

    Read the article

  • XML serializer filename

    - by Alexander
    I want to serialize an object into an xml and I want the filename of the xml to be random as following 636211ad-ef28-47b9-aa60-207d3fbb9580.xml fc3b491e5-59ac-4f6a-81e5-27e971b903ed.xml I am just curious on how to do such thing?

    Read the article

  • Flash/Flex sending XML to Rails App

    - by bdicasa
    I'm trying to send some XML to a rails app in Flex. I'm using the URLRequest and URLLoader objects. However, I'm having trouble determining how to send the XML and _method parameter to the rails app using these flash objects. Below is how I'm currently trying to achieve this. var request:URLRequest = new URLRequest(); request.method = URLRequestMethod.POST; request.data = new Object(); request.data.xml = Blog.xml.toXMLString(); request.contentType = "text/xml"; var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, saveCompleteHandler); var saveUrl:String = ""; saveUrl = BASE_URL; if (Blog.isNewBlog) { // Set the rails REST method. request.data._method = "POST"; saveUrl += "blogs.xml"; } else { // Set the rails REST method. request.data._method = "PUT"; saveUrl += "blogs/" + Blog.id.toString() + ".xml"; } request.url = saveUrl; //trace(request.data.toString()); loader.load(request); However the only data that is getting sent to the server is [Object object]. If some one could let me know where I'm going wrong I'd greatly appreciate it. Thanks.

    Read the article

  • Custom view in iPhone SDK gets placed incorrectly in realation to statusbar

    - by markqvist
    (ragh, i'm apparently not allowed to post images, so i have included links to the images in this post instead of embedding them) Im writing an iPhone application based on the navigation controller template, but I am not loading the actual navigation controller as the first view in the window. I create a new view controller from a xib, and then add that as a subview, and then only push the navigation view as a modal when i need it. Here's my application: didFinishLaunching ... method in the application deleate RootViewController *rootViewController = (RootViewController *)[navigationController topViewController]; rootViewController.managedObjectContext = self.managedObjectContext; mainViewController = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:[NSBundle mainBundle]]; mainViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [window addSubview:[mainViewController view]]; [[mainViewController view] setNeedsLayout]; [window makeKeyAndVisible]; return YES; It works but the view is not properly aligned with the statusbar: http://img.exdev.dk/1.png When i click "my ambiances" and push the navigation controller view, and then dismiss it again, the layout is fine: same link as above, just replace the 1 with a 2. Sorry for the hassle, apparently I can also only post one link.... Here's the code I use for presenting/dismissing the navigationcontroller: -(void)pushMyAmbiences { [mainViewController presentModalViewController:navigationController animated:TRUE]; } -(void)returnToMainView { [mainViewController dismissModalViewControllerAnimated:TRUE]; } Is there anything I'm missing here? Layout-wise? Something that needs to be set in the xib? In a vain attempt I tried calling setNeedsLayout on the view, no luck. Any help is greatly appreciated!

    Read the article

  • Convert graph in to data points using Mechanical Turk?

    - by user224303
    I looked around but did not see anyone using Mechanical Turk for this. I've heard of the service, but never used it before. I need to take the following graph and digitize it so I get a list of data points for each line (noting that there are two Y-axes, and thus depends on which line we are talking about). This is pretty time consuming for me, and I saw other posts on StackOverflow about digitizing software doing a poor job at this. Would Mechanical Turk be well suited to my task? Here is the graph for reference: http://www.yourpicturehost.com/dyno_hbspeed.jpg

    Read the article

  • UpdateAllViews() from within a worker thread?

    - by Harvey
    I have a worker thread in a class that is owned by a ChildView. (I intend to move this to the Doc eventually.) When the worker thread completes a task I want all the views to be updated. How can I make a call to tell the Doc to issue an UpdateAllViews()? Or is there a better approach? Thank you. Added by OP: I am looking for a simple solution. The App is running on a single user, single CPU computer and does not need network (or Internet) access. There is nothing to cause a deadlock. I think I would like to have the worker thread post (or send) a message to cause the views to update. Everything I read about threading seems way more complicated than what I need - and, yes, I understand that all those precautions are necessary for applications that are running in multiprocessor, multiuser, client-server systems, etc. But none of those apply in my situation. I am just stuck at getting the right combination of getting the window handle, posting the message and responding to the message in the right functions and classes to compile and function at all.

    Read the article

  • SharePoint 2010 is great! Now what do I do?

    - by PeterTweed
    So you have the power of SharePoint 2010 as a platform. What are you going to do now? How about build upon the power of the SharePoint product and implement solutions to business problems that are intuitive, easy to use, integrated, have a rich user experience and delivered over the web? Sounds good doesn’t it! Come to the April East Bay .NET User Group meeting and watch to me show you how easy it is to build Silverlight applications on top of SharePoint 2010 that can be quickly developed, delivered and will wow your stakeholders. See you there!

    Read the article

  • How to force high-dpi scaling?

    - by Ian Boyd
    How can i force an application to be high-dpi scaled? Or alternatively, how can an application that is not manifested as high-dpi aware, and doesn't have dpi-scaling disabled from the Properties-Compatibility tab, not be scaled? Pretend i have an application, who's developers decided to manifest it as high-dpi aware, when it really isn't. How can i force dpi-scaling? Pretend i have an applicaiton that Microsoft has applied the "HighDpiAware" compatiblity shim to, when the application really isn't. How can i force dpi-scaling? Pretend i have an application (i.e. Shareaza) that does not have a dpi-aware manifest, does not disable dpi-scaling from the application's Properties tab, but high-dpi scaling is not being applied? How can i force it? How can i force Windows to apply dpi-scaling to an application? See also

    Read the article

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