Search Results

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

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

  • Javascript Detect Control Key Held on Mouseup

    - by Michael Mikowski
    I've searched a good deal, and can't seem to find a satisfactory solution. I hope someone can help. While I am using jQuery, I am also writing many thousands of lines of Javascript. So a "pure" javascript solution is just fine. I'm trying to determine if the control key is physically held down on a mouseup event. That's it; there are no other preconditions. Does anyone know how to do this reliably, cross-browser? I've tried storing this in a state variable by noting when the key is pressed and released: // BEGIN store control key status in hash_state $().bind('keydown','ctrl',function( arg_obj_e ){ hash_state.sw_ctrldn = true; console.debug( hash_state.sw_ctrldn ); }); $().bind('keyup','ctrl',function( arg_obj_e ){ hash_state.sw_ctrldn = false; console.debug( hash_state.sw_ctrldn ); }); // END store control key status in hash_state However, this really doesn't work. If you test this using firebug and watch the console, you will see that auto-repeat seems to happen, and the value toggles. I inspected the mouseup event to see if there is anything useful there, but to no avail: var debugEvent = function( arg_obj_e ){ var str = ''; for ( var attr in arg_obj_e ){ str += attr + ': ' + arg_obj_e[attr] + '\n'; } console.debug(str); } Any help would be appreciated.

    Read the article

  • PHP session starter detect for visitor counting

    - by zapping
    Is there a way to find out on session being started. Like for instance the session start event in the global.ascx file of .net. The requirement is to find the no. of visits the user has done on the site. Instead of checking each time during posts or gets to the server. Is there something in php to find out if the session is a new one. Zen framework is also used for the app.

    Read the article

  • How to detect when window is closed when using Show() in WinForms C#

    - by MadBoy
    I've been using ShowDialog() in following way for all my new Windows. SomeGui test = new SomeGui(); test.ShowDialog(); refreshSomeListView(); However recently I've started to use Show() instead of ShowDialog() and it's working much better. The only drawback of this is that refreshSomeListView(); cannot be used like in example above since if i leave it there it's executed instantly when new Window shows up. What's the best way to know that the user has closed test window and that now refreshSomeListView(); should be executed? What's suggested approach for this? Should it involve setting events in test GUI on Close/Closing or there's other / better method?

    Read the article

  • UITabBarController detect tab clicks

    - by satyam
    I'm creating an app using tab bar controller. It has 2 tabs. In first tab, it will have a text field and a submit button. user will enter some value in text field and clicks submit. Now my problem: on click of submit button, some result "X" is computed depending on value entered in text field and it will open second tab. here result "X" has to be shown in label. without entering some value in text field, if user clicks on second tab, it must show an alert that "enter some value in text field" How can i achieve this. please help me.

    Read the article

  • How to detect if Asp.Net form is valid

    - by Hasan Gürsoy
    Hi, I have a form which is in an updatePanel and I have a span with hidden loading image, which I want to show when user clicks to submit button but I first need to check if page is valid on client side. Also I'm making loading span visible with jQuery. Here is my code: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> function showLoading() { $('#loader').show(); } </script> </head> <body> <asp:ScriptManager ID="smMain" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="upForm" runat="server"> <ContentTemplate> <asp:MultiView ID="mvContact" runat="server" ActiveViewIndex="0"> <asp:View ID="vDefault" runat="server"> <asp:TextBox ID="tEMail" runat="server" CssClass="input" /> <asp:RequiredFieldValidator ID="rfvEMail" runat="server" ControlToValidate="tEMail" ErrorMessage="* required" Display="Dynamic" /> <asp:RegularExpressionValidator ID="revEMail" runat="server" ControlToValidate="tEMail" ErrorMessage="* invalid" Display="Dynamic" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" /> <asp:ImageButton ID="btnSubmit" runat="server" ImageUrl="~/Assets/Images/btnSubmit.png" ToolTip="Submit Form" style="margin:5px 5px 0 -5px" onclick="btnSubmit_Click" OnClientClick="showLoading();" /> <span id="loader"><img src="Assets/Images/loader.gif" title="Sending..." /></span> </asp:View> <asp:View ID="vResult" runat="server"> <div class="result"> <span id="lResult" runat="server">Your message is sent</span> </div> </asp:View> </asp:MultiView> </ContentTemplate> </asp:UpdatePanel> </body></html>

    Read the article

  • Detect block size for quota in Linux

    - by Chen Levy
    The limit placed on disk quota in Linux is counted in blocks. However, I found no reliable way to determine the block size. Tutorials I found refer to block size as 512 bytes, and sometimes as 1024 bytes. I got confused reading a post on LinuxForum.org for what a block size really means. So I tried to find that meaning in the context of quota. I found a "Determine the block size on hard disk filesystem for disk quota" tip on NixCraft, that suggested the command: dumpe2fs /dev/sdXN | grep -i 'Block size' or blockdev --getbsz /dev/sdXN But on my system those commands returned 4096, and when I checked the real quota block size on the same system, I got a block size of 1024 bytes. Is there a scriptable way to determine the quota block size on a device, short of creating a known sized file, and checking it's quota usage?

    Read the article

  • Detect if the user has used the back button

    - by Tom
    My webpage runs a javascript function when the page is loaded. However, I don't want the function to run if the user comes back to this page using the back button. How can I prevent this using javascript? $(document).ready(function(){ // Do not run this function if the user has arrived here using the back button RefreshThePage(); });

    Read the article

  • Detect start of a new band

    - by Dave Jarvis
    Using iReport, how do you set a variable (could be a parameter, or a value in the REPORT_PARAMETERS_MAP) to Boolean.TRUE at the start of a new band? There are some fields in the header that should only be displayed after a specific band has started being filled. Thank you!

    Read the article

  • Returning a 404 page when a folder is accessed from one domain, but allowing access from other domains and IP addresses

    - by okw
    Situation: I want to return a 404 page ("404.php") when a folder ("hidden") is accessed from the example.com domain. I want the same folder to be accessible from a subdomain ("hidden.example.com") or from a different domain ("hidden.com") which are both configured in a single VirtualHost entry. The server has multiple IP addresses that it listens on. Each IP address serves identical content from the example.com domain (sharing a VirtualHost entry.) I want the folder to be accessible from the IP address. The server is configured to use SSL/TLS/HTTPS. HTTPS is optional on example.com, but HTTPS is enforced in the .htaccess file for the hidden folder using a rewrite rule shown below. /www/hidden/.htaccess RewriteCond %{HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] I know that {SERVER_ADDR} gives the server's IP address, but does it return the one that the client is requesting from? I'm also starting to think that something in the VirtualHosts file would be more appropriate. Any thoughts on this? What should be allowed: http://87.65.43.21/hidden/ https://87.65.43.21/hidden/ http://12.34.56.78/hidden/ https://12.34.56.78/hidden/ http://hidden.example.com/ https://hidden.example.com/ http://hidden.com/ https://hidden.com/ http://www.hidden.com/ https://www.hidden.com/ What should be 404-ed with 404.php http://example.com/hidden/ https://example.com/hidden/ http://www.example.com/hidden/ https://www.example.com/hidden/ http://example.com/hidden/hiddenfile.php https://example.com/hidden/hiddenfile.php etc. Thanks.

    Read the article

  • Geocoding Chinese addresses using Google Maps API in Python?

    - by Jack Low
    I have looked into Geopy and googlemaps (http://py-googlemaps.sourceforge.net/) and they both do not work for Chinese addresses. My app is stored on the Google App Engine. What I want to do is to parse a file containing addresses of restaurants in Hong Kong, and then Geocode the addresses and store the Lat and Lng in the datastore. How do I do this?

    Read the article

  • Algorithm to compare people names to detect identicalness

    - by Pentium10
    I am working on address book synchronization algorithm. I would like to reuse some code if there exists, but couldn't find one yet. Does someone know about an algorithm that will tell me in numbers/float/procent how much two names are identical. Levenstein distance is not good in this approach, as names and our adddress books are matching the begining of each of the name sections. John Smith should match Smith Jon, Jonathan Smith, Johnny Smith

    Read the article

  • IP Blocking on error logs PHP

    - by Lee
    Is there a way to block error logging from a specific set of IP's ? Basically macafee carry out a range of testing on the server nightly and we don't want to record these in our error logs. Is there a good way to avoid this from happening ? Hope you can advice!

    Read the article

  • Detect same image names {iPhone SDK}

    - by Momeks
    hi , i want create image animation , i have 50 images with png format now i want set images name ... something like this but doesnt work ! my images name are : iamge_0000 to image_0050 NSArray *myImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"image_%d.png"], //image named doesnt work ??!?!?!?

    Read the article

  • Memory Profiling: How to detect which application/package is consuming too much memory

    - by malvim
    Hi, I have a situation here at work where we run a JEE server with several applications deployed on it. Lately, we've been having frequent OutOfMemoryException's. We suspect some of the apps might be behaving badly, maybe leaking, or something. The problem is, we can't really tell which one. We have run some memory profilers (like YourKit), and they're pretty good at telling what classes use the most memory. But they don't show relationships between classes, so that leaves us with a situation like this: We see that there are, say, lots of Strings and int arrays and HashMap entries, but we can't really tell which application or package they come from. Is there a way of knowing where these objects come from, so we can try to pinpoint the packages (or apps) that are allocating the most memory? Thank you in advance.

    Read the article

  • Smart auto detect and replace URLs with anchor tags

    - by Robert Koritnik
    I've written a regular expression that automatically detects URLs in free text that users enter. This is not such a simple task as it may seem at first. Jeff Atwood writes about it in his post. His regular expression works, but needs extra code after detection is done. I've managed to write a regular expression that does everything in a single go. This is how it looks like (I've broken it down into separate lines to make it more understandable what it does): 1 (?<outer>\()? 2 (?<scheme>http(?<secure>s)?://)? 3 (?<url> 4 (?(scheme) 5 (?:www\.)? 6 | 7 www\. 8 ) 9 [a-z0-9] 10 (?(outer) 11 [-a-z0-9/+&@#/%?=~_()|!:,.;cšžcd]+(?=\)) 12 | 13 [-a-z0-9/+&@#/%?=~_()|!:,.;cšžcd]+ 14 ) 15 ) 16 (?<ending>(?(outer)\))) As you may see, I'm using named capture groups (used later in Regex.Replace()) and I've also included some local characters (cšžcd), that allow our localised URL to be parsed as well. You can easily omit them if you'd like. Anyway. Here's what it does (referring to line numbers): 1 - detects if URL starts with open braces (is contained inside braces) and stores it in "outer" named capture group 2 - checks if it starts with URL scheme also detecting whether scheme is SSL or not 3 - starts parsing URL itself (will store it in "url" named capture group) 4-8 - if statement that says: if "sheme" was present then www. part is optional, otherwise mandatory for a string to be a link (so this regular expression detects all strings that start with either http or www) 9 - first character after http:// or www. should be either a letter or a number (this can be extended if you would like to cover even more links, but I've decided to omit other characters because I can't remember a link that would start with some other character 10-14 - if statement that says: if "outer" (braces) was present capture everything up to the last closing braces otherwise capture all 15 - closes the named capture group for URL 16 - if open braces was present, capture closing braces as well and store it in "ending" named capture group First and last line used to have \s* in them as well, so user could also write open braces and put a space inside before pasting link. Anyway. My code that does link replacement with actual anchor HTML elements looks exactly like this: value = Regex.Replace( value, @"(?<outer>\()?(?<scheme>http(?<secure>s)?://)?(?<url>(?(scheme)(?:www\.)?|www\.)[a-z0-9](?(outer)[-a-z0-9/+&@#/%?=~_()|!:,.;cšžcd]+(?=\))|[-a-z0-9/+&@#/%?=~_()|!:,.;cšžcd]+))(?<ending>(?(outer)\)))", "${outer}<a href=\"http${secure}://${url}\">http${secure}://${url}</a>${ending}", RegexOptions.Compiled | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); As you can see I'm using named capture groups to replace link with an Anchor tag: ${outer}<a href=\"http${secure}://${url}\">http${secure}://${url}</a>${ending} I could as well omit the http(s) part in anchor display to make links look friendlier, but for now I decided not to. Question I would like for my links to be replaced with shortenings as well. So when user copies a very long links (for instance if they would copy a link from google maps that usually generates long links I would like to shorten the visible part of the anchor tag. Link would work, but visible part of an anchor tag would be shortened to some number of characters. Does the replace string support notations like that so I can stil use a singe Regex.Replace() call?

    Read the article

  • Detect the URI encoding automatically in Tomcat

    - by Roland Illig
    I have an instance of Apache Tomcat 6.x running, and I want it to interpret the character set of incoming URLs a little more intelligent than the default behavior. In particular, I want to achieve the following mapping: So%DFe => Soße So%C3%9Fe => Soße So%DF%C3%9F => (error) The bevavior I want could be described as "try to decode the byte stream as UTF-8, and if it doesn't work assume ISO-8859-1". Simply using the URIEncoding configuration doesn't work in that case. So how can I configure Tomcat to encode the request the way I want? I might have to write a Filter that takes the request (especially the query string) and re-encodes it into the parameters. Would that be the natural way?

    Read the article

  • How to detect filesystem has changed in java

    - by Alfred
    Hi all, I would like to know how to efficiently implement filesystem changes in java? Say I got a file in a folder and modify that file. I would like to be notified by java about this change as soon as possible(no frequently polling if possible.). Because I think I could call java.io.file.lastModified every few seconds but I don't like the sound of that solution at all. alfred@alfred-laptop:~/testje$ java -version java version "1.6.0_18" Java(TM) SE Runtime Environment (build 1.6.0_18-b07) Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode) Many thanks, Alfred

    Read the article

  • Efficiently detect corrupted jpeg file?

    - by Jacco
    Is there an efficient way of detecting if a jpeg file is corrupted? Background info:   solutions needs to work from within a php script   the jpeg files are on disk   manual checking is no option (user uploaded data) I know that imagecreatefromjpeg(string $filename); can do it. But it is quite slow at doing so. Does anybody know a faster/more efficient solutions?

    Read the article

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