Search Results

Search found 3844 results on 154 pages for 'detect'.

Page 31/154 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • How to detect Javascript pop-up notifications in WatiN?

    - by Ian P
    I have a, what seems to be, rather common scenario I'm trying to work through. I have a site that accepts input through two different text fields. If the input is malformed or invalid, I receive a Javascript pop-up notification. I will not always receive one, but I should in the event of (like I said earlier) malformed data, or when a search result couldn't be found. How can I detect this in WatiN? A quick Google search produced results that show how to click through them, but I'm curious as to whether or not I can detect when I get one? In case anyone is wondering, I'm using WatiN to do some screen scraping for me, rather than integration testing :) Thanks in advance! Ian

    Read the article

  • Detect Browser Refresh vs. Form Submit in ASP.Net MVC 2

    - by Eric J.
    I have an ASP.Net questionnaire application that resubmits data to the same page, showing a different question each time. There are BACK and NEXT buttons to navigate between questions. I would like to detect when the form is submitted due to a browser refresh vs. one of the buttons being pressed. I came across a WebForms approach but don't know how to apply those principals in an MVC 2 application since page events aren't available (as far as I know... I'm pretty new to Microsoft's MVC model). How would one apply that principle to MVC 2? Is there a better way to detect refresh?

    Read the article

  • How can I detect if the browser has encountered a JavaScript error ... in JavaScript?

    - by RichH
    For automated testing reasons I want to detect if the browser has encountered JavaScript errors for a page. The type of things that would cause the red numbers in the bottom right in Firebug or yellow warning icon in the Internet Explorer status bar. These JS errors could come from any one of a large numbers of scripts. How in JavaScript can I detect these browser errors? Cross browser solutions prefered, but hey, I'll take anything! As a bonus it would also be great to know the script that caused the error.

    Read the article

  • How to detect generation loss of a transcoded audio.

    - by The Rook
    Lets say you have a 96 kbit mp3 and you Transcode the file into a 320 kbit mp3. How could you programmatically detect the original bit rate or quality? Generation loss is created because each time a lossy algorithm is applied new information will be deemed "unnecessary" and is discarded. How could an algorithm use this property to detect the transcoding of audio. 128 kbps LAME mp3 transcoded to 320 kbps LAME mp3 (I Feel You, Depeche Mode) 10.8 MB. This image was taken from the bottom of this site. The 2 tracks above look nearly identical, but the difference is enough to support this argument.

    Read the article

  • How to detect open database connection with Hibernate / JPA?

    - by John K
    I am learning JPA w/Hibernate using a Java SE 6 project. I'd simply like to be able to detect if the connection between Hibernate and my database (MS SQL Server) is open. For example, I'd like to be able to detect this, log it, and try reconnecting again in 60 seconds. This is what I thought would work but isOpen() doesn't appear to be what I want (always is true): EntityManagerFactory emf = Persistence.createEntityManagerFactory("rcc", props); if (emf != null && emf.isOpen()) { EntityManager em = emf.createEntityManager(); if (em == null || !emf.isOpen()) // error connecting to database else ... This seems to me to be a simple problem, but I cannot find an answer!

    Read the article

  • What's the best way to detect web applications attacks ?

    - by paulgreg
    What is the best way to survey and detect bad users behavior or attacks like deny of services or exploits on my web app ? I know server's statistics (like Awstats) are very useful for that kind of purpose, specially to see 3XX, 4XX and 5XX errors (here's an Awstats example page) which are often bots or bad intentioned users that try well-known bad or malformed URLs. Is there others (and betters) ways to analyze and detect that kind of attack tentative ? Note : I'm speaking about URL based attacks, not attacks on server's component (like database or TCP/IP).

    Read the article

  • How can I detect whether an image is a PNG or APNG format?

    - by perlit
    APNG is backwards compatible with PNG. I opened up an apng and png file in a hex editor and the first few bytes look identical. So if a user uploads either of these formats, how do I detect what the format really is? I've seen this done on some sites that block apng. I'm guessing the ImageMagick library makes this easy, but what if I were to do the detect without the use of an image processing library (for learning purposes)? Can I look for specific bytes that tell me if the file is apng? Solutions in any language is welcome.

    Read the article

  • What is proper way to detect all available serial ports on Windows?

    - by Sorin Sbarnea
    There are several ways to list serial ports under Windows but I'm not sure what is the proper way: the way that does detect all serial ports that are available. One good code example is http://www.naughter.com/enumser.html - where there at 9 (nine!) ways of enumerating serial devices. The question is: what is the optimal way of doing it. Requirements: * to not open ports in order to check if they are available. * to be able to detect ports with different names than COMx.

    Read the article

  • how do I detect OS X in my .vimrc file, so certain configurations will only apply to OS X?

    - by Brandon
    I use my .vimrc file on my laptop (OS X) and several servers (Solaris & Linux), and could hypothetically someday use it on a Windows box. I know how to detect unix generally, and windows, but how do I detect OS X? (And for that matter, is there a way to distinguish between Linux and Solaris, etc. And is there a list somewhere of all the strings that 'has' can take? My Google-fu turned up nothing.) For instance, I'd use something like this: if has("mac") " open a file in TextMate from vi: " nmap mate :w<CR>:!mate %<CR> elseif has("unix") " do stuff under linux and " elseif has("win32") " do stuff under windows " endif But clearly "mac" is not the right string, nor are any of the others I tried.

    Read the article

  • Are there any C++ tools that detect misuse of static_cast, dynamic_cast, and reinterpret_cast?

    - by chrisp451
    The answers to the following question describe the recommended usage of static_cast, dynamic_cast, and reinterpret_cast in C++: http://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-and-reinterpret-cast-be-used Do you know of any tools that can be used to detect misuse of these kinds of cast? Would a static analysis tool like PC-Lint or Coverity Static Analysis do this? The particular case that prompted this question was the inappropriate use of static_cast to downcast a pointer, which the compiler does not warn about. I'd like to detect this case using a tool, and not assume that developers will never make this mistake.

    Read the article

  • How can I detect endianness on a system where all primitive integer sizes are the same?

    - by Joe Wreschnig
    (This question came out of explaining the details of CHAR_BIT, sizeof, and endianness to someone yesterday. It's entirely hypothetical.) Let's say I'm on a platform where CHAR_BIT is 32, so sizeof(char) == sizeof(short) == sizeof(int) == sizeof(long). I believe this is still a standards-conformant environment. The usual way to detect endianness at runtime (because there is no reliable way to do it at compile time) is to make a union { int i, char c[sizeof(int)] } x; x.i = 1 and see whether x.c[0] or x.c[sizeof(int)-1] got set. But that doesn't work on this platform, as I end up with a char[1]. Is there a way to detect whether such a platform is big-endian or little-endian, at runtime? Obviously it doesn't matter inside this hypothetical system, but one can imagine it is writing to a file, or some kind of memory-mapped area, which another machine reads and reconstructs it according to its (saner) memory model.

    Read the article

  • Detect what is selected (highlighted) or clicked within an element on a page?

    - by Fog Cook
    How would one go about detecting what has been selected on a page in a browser? Example: Click, hold, select 3 words and 1 image on a page, release. Sub-question: How to detect what letter someone clicked on? Without using: A span injector breaking everything up OR a WYSIWYG plugin I'm hoping this isn't just a type of browser interaction you can't detect. There could be many uses, but my goal is a simple 'live' page editor, or at least a way to know what someone is clicking on/selecting aside from just the id of an element.

    Read the article

  • Using Javascript to detect the bottom of the window and ignoring all events when a request is loading

    - by Aaron Reba
    I have an anonymous function to detect the user has scrolled to the bottom of the window. Inside of the anonymous function, I have a call to a database that takes a while to complete. var allowing_more = 1; $(window).scroll(function() { if (allowing_more == 1){ if ($(window).scrollTop() + $(window).height() == $(document).height()) { allowing_more = 0; //query allowing_more = 1; } } }); In this time, if the user scrolls to the bottom of the window again, it seems a queue is made holding the occurences the user scrolled to the bottom of the window while the query was loading. Upon completing of the query, these occurences are then executed. I have a boolean statement to detect if the anonymous function is accepting more query requests but this seems to be ignored. Is there some sort of way to ignore an anonymous function temporarily and re-enable it?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >