Search Results

Search found 18596 results on 744 pages for 'c how to detect all ip addresses from a lan'.

Page 130/744 | < Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >

  • Algorithm to detect how many words typed, also multi sentence support (Java)

    - by Alex Cheng
    Hello all. Problem: I have to design an algorithm, which does the following for me: Say that I have a line (e.g.) alert tcp 192.168.1.1 (caret is currently here) The algorithm should process this line, and return a value of 4. I coded something for it, I know it's sloppy, but it works, partly. private int counter = 0; public void determineRuleActionRegion(String str, int index) { if (str.length() == 0 || str.indexOf(" ") == -1) { triggerSuggestionList(1); return; } //remove duplicate space, spaces in front and back before searching int num = str.trim().replaceAll(" +", " ").indexOf(" ", index); //Check for occurances of spaces, recursively if (num == -1) { //if there is no space //no need to check if it's 0 times it will assign to 1 triggerSuggestionList(counter + 1); counter = 0; return; //set to rule action } else { //there is a space counter++; determineRuleActionRegion(str, num + 1); } } //end of determineactionRegion() So basically I find for the space and determine the region (number of words typed). However, I want it to change upon the user pressing space bar <space character>. How may I go around with the current code? Or better yet, how would one suggest me to do it the correct way? I'm figuring out on BreakIterator for this case... To add to that, I believe my algorithm won't work for multi sentences. How should I address this problem as well. -- The source of String str is acquired from textPane.getText(0, pos + 1);, the JTextPane. Thanks in advance. Do let me know if my question is still not specific enough.

    Read the article

  • How to detect a Triangle gesture with kinect?

    - by Akhilesh Mishra
    I am trying to implement a gesture recognition system which interprets the geometric gestures user makes and draws it on screen, I have some idea of how circle can be recognized, however i have no clue how to get started with triangle recognition. the data I have is X and Y coordinates of all points the gesture passed through. I get this data by tracking right hand. I found something online called Hough Transform , which is used for detecting lines but i am not sure whether it will work for discrete collection of points, Any ideas folks?

    Read the article

  • How to detect a click outside an element?

    - by Sergio del Amo
    I have some html menus, which i show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus area. Is something like this possible with jquery? $("#menuscontainer").clickOutsideThisElement(function() { // hide the menus });

    Read the article

  • How to detect if a script is being sourced

    - by brianegge
    I have a script where I do not want it to call 'exit' if it's being sourced. Initially I though checking if $0 == bash but this has problems if the script is sourced from another script, or if the user sources it from ksh. Is there a reliable way of detecting if a script is being sourced?

    Read the article

  • Detect URL and Download content from it

    - by Veejay
    I have a page 'PageA' that has around 20 links on it. Each link leads to a different page. How can I access all the links on PageA programmatically and then download each of the pages(20) as .mht? Also is there any existing app that does that?

    Read the article

  • Where to find great proxy servers for testing GeoIP services?

    - by Andreas
    We would like to test a GeoIP-Service. Therefore we need to go to the site with an IP from another country. There are a lot of free proxy lists like http://nntime.com/proxy-country/ The problem with them is, that only the CoDeen-Proxies are working. But with CoDeen you can't select your country of origin (the same as with TOR). You get redirected to a random proxy in the network. Where to find good proxy server for testing the GeoIP Services? Free proxy servers would be great, but if they cost something small that doesn't matter.

    Read the article

  • Correct way to detect sequence parameter?

    - by noamtm
    I want to write a function that accepts a parameter which can be either a sequence or a single value. The type of value is str, int, etc., but I don't want it to be restricted to a hardcoded list. In other words, I want to know if the parameter X is a sequence or something I have to convert to a sequence to avoid special-casing later. I could do type(X) in (list, tuple) but there may be other sequence types I'm not aware of, and no common base class. -N. Edit: See my "answer" below for why most of these answers don't help me. Maybe you have something better to suggest.

    Read the article

  • Detect IE version in Javascript

    - by Chad Decker
    I want to bounce users of our web site to an error page if they're using a version of Internet Explorer prior to v9. It's just not worth our time and money to support IE pre-v9. Users of all other non-IE browsers are fine and shouldn't be bounced. Here's the proposed code: if(navigator.appName.indexOf("Internet Explorer")!=-1){ //yeah, he's using IE var badBrowser=( navigator.appVersion.indexOf("MSIE 9")==-1 && //v9 is ok navigator.appVersion.indexOf("MSIE 1")==-1 //v10, 11, 12, etc. is fine too ); if(badBrowser){ // navigate to error page } } Will this code do the trick? To head off a few comments that will probably be coming my way: [1] Yes, I know that users can forge their useragent string. I'm not concerned. [2] Yes, I know that programming pros prefer sniffing out feature-support instead of browser-type but I don't feel this approach makes sense in this case. I already know that all (relevant) non-IE browsers support the features that I need and that all pre-v9 IE browsers don't. Checking feature by feature throughout the site would be a waste. [3] Yes, I know that someone trying to access the site using IE v1 (or = 20) wouldn't get 'badBrowser' set to true and the warning page wouldn't be displayed properly. That's a risk we're willing to take. [4] Yes, I know that Microsoft has "conditional comments" that can be used for precise browser version detection. IE no longer supports conditional comments as of IE 10, rendering this approach absolutely useless. Any other obvious issues to be aware of? Thanks.

    Read the article

  • snmp, how to retrieve ip connected to the router with MIB-II

    - by dany
    Hi all, I want to create a program that acts as manager and that queries the router (or sets a trap) to obtain the list of ip connected to it. My router has these functionalities: SNMP v1, v2c, built-in MIB-I, MIB-II agent. Is it possible to retrieve these informations quering the MIB-II agent of the router in a standard way (not vendor dependent)? Bye

    Read the article

  • Detect NetStream events with AS3 Video Object (not component)

    - by JFOX
    I have created a FLV video player using the AS3 flash.media.Video object (not the FLV playback component) and I am trying to listen for meta events and Cue Points embedded in the FLV video but I am not receiving any when I trace the movie. The cue points are not being created dynamically, they are in the FLV video. Video embed code: // Initialize net stream nc = new NetConnection(); nc.connect (null); // Not using a media server. ns = new NetStream(nc); // Add video to stage vid = new Video(456,675); addChild (vid); // Add callback method for listening on // NetStream meta data client = new Object(); ns.client = client; client.onMetaData = this.nsMetaDataCallback; client.onCuePoint = this.onCuePoint; // Play video vid.attachNetStream ( ns ); ns.play ("flv/00_010.flv"); callback handlers in the same class as the above code: public function onCuePoint(info:Object):void { trace("cuePoint: time = " + info.time + " name = " + info.name + " type = " + info.type); if (ns) ns.pause(); } public function nsMetaDataCallback (mdata:Object):void { trace (mdata.duration); } Is there anything I am missing have wrong to capture events from my net stream?

    Read the article

  • how to detect an IMAPMessage is not an email but a Task or Calendar item

    - by raticulin
    I am accessing Lotus and Groupwise using javamail via IMAP, recursively accessing all folders and processing email I find. But in folders like Tasklist and Calendar (those are from Groupwise but I think I remember Lotus had similar things), I get the items in there as instances of IMAPMessage, and so they are processed as if they were mail. I understand those items get exposed as mail through the IMAP protocol (either by design or by mistake), but I only want to process proper mail. Is there a way to do this? I have dismissed following approaches so far: Make sure the message has a message-id, at least in Groupwise Calendar items have it. Ignore folders by name (such as Calendar and Tasklist): is not totally correct as a user can move mail inside those folders. What I am looking is some IMAP api call I have missed so far or something in those lines...

    Read the article

  • how to detect sql server timeout from .NET application without using catch Exception

    - by haditeo
    Hi, In my current application, i am performing an update by invoking T-SQL Update command. The problem is when the same record is locked by other users at that time. At .NET application, the application will wait until SQL Server timeout, then it will throw the SqlException timeout. Is it possible to perform a check first whether a particular record is locked by other process rather than catching the exception ? Thanks, hadi teo Update : The SQL Server version used are 2000 and 2008

    Read the article

  • Best way to detect that HTML5 <canvas> is not supported

    - by brainjam
    The standard way to deal with situations where the browser does not support the HTML5 <canvas> tag is to embed some fallback content, usually a polite version (and sometimes a less polite version) of <canvas>Your browser sucks</canvas> But the rest of the page remains the same, which may be inappropriate or misleading. I'd like some way of detecting canvas non-support so that I can present the rest of my page accordingly. What would you recommend?

    Read the article

  • Detect aborted connection during ASIO request

    - by Tim Sylvester
    Is there an established way to determine whether the other end of a TCP connection is closed in the asio framework without sending any data? Using Boost.asio for a server process, if the client times out or otherwise disconnects before the server has responded to a request, the server doesn't find this out until it has finished the request and generated a response to send, when the send immediately generates a connection-aborted error. For some long-running requests, this can lead to clients canceling and retrying over and over, piling up many instances of the same request running in parallel, making them take even longer and "snowballing" into an avalanche that makes the server unusable. Essentially hitting F5 over and over is a denial-of-service attack. Unfortunately I can't start sending a response until the request is complete, so "streaming" the result out is not an option, I need to be able to check at key points during the request processing and stop that processing if the client has given up.

    Read the article

  • Cakephp - detect if unable to connect to database and recover gracefully

    - by Phantz
    I have a few sites built with Cakephp. If any of these sites lose their connection to the database for whatever reason it does not handle it well. Basically it renders itself inside itself trying to display an error over and over until the browser crashes. The rendering itself inside itself is caused by the use of requestAction from elements. What I want to know is how can I check if the database connection exists I tried this in the app_controller before filter: if(!ConnectionManager::getDataSource('default')) { die(); //this will be a message instead } but it does not seem to work. Thanks

    Read the article

< Previous Page | 126 127 128 129 130 131 132 133 134 135 136 137  | Next Page >