Search Results

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

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

  • Ruby Detect method

    - by JZ
    Select makes sense. But can someone explain .detect to me? I don't understand these data. >> [1,2,3,4,5,6,7].detect { |x| x.between?(3,4) } => 3 >> [1,2,3,4,5,6,7].detect { |x| x.between?(3,6) } => 3 >> [1,2,3,4,5,6,7].detect { |x| x.between?(3,7) } => 3 >> [1,2,3,4,5,6,7].detect { |x| x.between?(2,7) } => 2 >> [1,2,3,4,5,6,7].detect { |x| x.between?(1,7) } => 1 >> [1,2,3,4,5,6,7].detect { |x| x.between?(6,7) } => 6 >> [1,2,3,4,5,6,7].select { |x| x.between?(6,7) } => [6, 7] >> [1,2,3,4,5,6,7].select { |x| x.between?(1,7) } => [1, 2, 3, 4, 5, 6, 7]

    Read the article

  • mac os x - detect file system read

    - by quano
    I want to know what files a specific application is trying to access on my disc. I know that you can use fs_usage, but this outputs events from all applications. I know that you can target a single application, but only one that is already running. I want to detect all readfile-events an application is trying to do, ever since it is started. I don't want to miss out on any event. How do you achieve this?

    Read the article

  • Flash hit detect area

    - by Quandary
    With Flash, is it possible to detect whether an object is fully ontop of another ? E.g. I have a rectangle (floor surface) and a circle (furniture). Now I want to detect whether the circle is fully in (=over) the rectangle, and not just whether it hits the rectangle somewhere. Is that possible ? How ?

    Read the article

  • How to detect page redirect with PHP?

    - by blabus
    I'm trying to detect whether an image exists on a remote server. However, I've tried several methods and can't get any of them to work. Right now I'm trying to use this: if (!CheckImageExists("http://img2.netcarshow.com/ABT-Audi_R8_2008_1024x768_wallpaper_01.jpg")) { print_r("DOES NOT EXIST"); } else { print_r("DOES EXIST"); }; function CheckImageExists($imgUrl) { if (fopen($imgUrl, "r")) { return true; } else { return false; }; }; But it returns 'true' whether the image actually exists or not (the above image should, but change it to gibberish and it still will return 'true'). I have a feeling it could be because if the URL does not exist, it redirects to the homepage of the site. But I don't know how to detect that. Thanks for any help!

    Read the article

  • How to Detect a Right Click on Taskbar in WPF

    - by Zay
    I've got a WPF application in C# that starts off with a loading dialog. As expected, a button for the app shows up in the Windows taskbar. I would like to detect right-clicks that might be done to that button. Ultimately, I hope to disable the right-click or simply have the loading dialog regain focus. I've seen that some people use custom libraries and packages (interop, for example) to achieve some Win32 functionality, but I'd personally like to avoid this. Furthermore, these libraries/packages appear to be specific to Windows Forms; I've not seen anything for WPF. Is it impossible to manipulate the taskbar's right-click in WPF?

    Read the article

  • Detect and record a sound with python

    - by Jean-Pierre
    I'm using this program to record a sound in python: import pyaudio import wave import sys chunk = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() stream = p.open(format = FORMAT, channels = CHANNELS, rate = RATE, input = True, frames_per_buffer = chunk) print "* recording" all = [] for i in range(0, RATE / chunk * RECORD_SECONDS): data = stream.read(chunk) all.append(data) print "* done recording" stream.close() p.terminate() write data to WAVE file data = ''.join(all) wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb') wf.setnchannels(CHANNELS) wf.setsampwidth(p.get_sample_size(FORMAT)) wf.setframerate(RATE) wf.writeframes(data) wf.close() I want to change the program to start recording when sound is detected by the sound card input. Probably should compare the input sound level in Chunk, but how do this?

    Read the article

  • Detect if any USB drive is detected or if not using WinForm Application in Visual C#

    - by Pavan Kumar
    I want to do the following things in my application 1) I want to display whether any USB drive is inserted or not in my application to prompt the user to insert a USB drive. I just want to notify the user if any USB dirve is inserted else prompt him to insert one using a label or something (i want to avoid messagebox as it will keep appearing whenever a device is inserted or removed. It will be irritating for the end user) in my Visual C# WinForm Application. If any USB drive is present display "USB drive detected" in the label. The user may add one or more USB sticks but the status will remain same. When there is none then the status of the label will change to "No USB drives found.Please insert a USB drive". 2) When one or more USB drive is added the volume name with the drive letter for example "James(F:)" is added to the Combobox list. The combobox list also needs to remove the entry for the USB drive added in the list automatically when it is removed . So when there is no USB the list should be empty and the label will again prompt user to insert a USB stick or drive.

    Read the article

  • Detect if any USB drive is detected or not using WinForm Application in Visual C#

    - by Pavan Kumar
    I want to do the following things in my application 1) I want to display whether any USB drive is inserted or not in my application to prompt the user to insert a USB drive. I just want to notify the user if any USB dirve is inserted else prompt him to insert one using a label or something (i want to avoid messagebox as it will keep appearing whenever a device is inserted or removed. It will be irritating for the end user) in my Visual C# WinForm Application. If any USB drive is present display "USB drive detected" in the label. The user may add one or more USB sticks but the status will remain same. When there is none then the status of the label will change to "No USB drives found.Please insert a USB drive". 2) When one or more USB drive is added the volume name with the drive letter for example "James(F:)" is added to the Combobox list. The combobox list also needs to remove the entry for the USB drive added in the list automatically when it is removed . So when there is no USB the list should be empty and the label will again prompt user to insert a USB stick or drive.

    Read the article

  • jquery image hover popup cant detect browser edge and change its direction

    - by Salman
    hi guys i am trying to implement jquery image hover popup but facing a problem when the popup is closer to browser edge it goes beyond its edge i want it to change its direction when it finds that space is not enough to show that popup, i have see this effect in many plugins where popups, tooltips and drop down menus change their direction if they are close to browser window edge can any one guide me in right direction here is the screen shot for reference http://img512.imageshack.us/img512/4990/browseredge.png here is the jquery hover code function imagePreview(){ /* CONFIG */ xOffset = 10; yOffset = 30; // these 2 variable determine popup's distance from the cursor // you might want to adjust to get the right result /* END CONFIG */ $("a.preview").hover(function(e){ this.t = this.title; this.title = ""; var c = (this.t != "") ? "<br>" + this.t : ""; var newName = this.name; //console.log(this.name); newName=newName.replace("/l/","/o/"); //console.log(newName); $("body").append("<p id='preview'><img src='"+ this.name +"' alt='Image preview' style='margin-bottom:5px;'>"+ c +"</p>"); $("#preview img").error(function () { $("#preview img").attr("src" ,newName).css({'width': '400px', 'height': 'auto'}); }); $("#preview") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX + yOffset) + "px") .fadeIn("fast"); }, function(){ this.title = this.t; $("#preview").remove(); }); $("a.preview").mousemove(function(e){ $("#preview") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX + yOffset) + "px"); }); }; any help will be appriciated Thanks Salman

    Read the article

  • Detect if images have loaded in a UIWebView?

    - by Josh Gare
    Hey, I have a UIWebview that is loading an image. However I am trying to call a method when the image has completed loaded / rendered. I tried using UIWebViewDelgate and used, -(void)webViewDidFinishLoad:(UIWebView *)webView {} However this method is called before the image has loaded / rendered. How can I fix this. Any help would be greatly appreciated. Josh

    Read the article

  • How to feature-detect/test for specific jQuery (and Javascript) methods/functions used

    - by Zildjoms
    good day everyone, hope yer all doin awesome am very new to javascript and jquery, and i (think) i have come up with a simple fade-in/out implementation on a site am workin on (check out http://www.s5ent.com/expandjs.html - if you have the time to check it for inefficiency or what that'd be real sweet). i use the following functions/methods/collections and i would like to do a feature test before using them. uhm.. how? or is there a better way to go about this? jQuery $ .fadeIn([duration]) .fadeOut([duration]) .attr(attributeName,value) .append(content) .each(function(index,Element)) .css(propertyName,value) .hover(handlerIn(eventObject),handlerOut(eventObject)) .stop([clearQueue],[jumpToEnd]) .parent() .eq(index) JavaScript setInterval(expression,timeout) clearInterval(timeoutId) setTimeout(expression,timeout) clearTimeout(timeoutId) i tried looking into jquery.support for the jquery ones, but i find myself running into conceptual problems with it, i.e. for fadein/fadeout, i (think i) should test for $.support.opacity, but that would be false in ie whereas ie6+ could still fairly render the fades. also am using jquery 1.2.6 coz that's enough for what i need. the support object is in 1.3. so i'm hoping to avoid dragging-in more unnecessary code if i can. i also worked with browser sniffing, no matter how frowned-upon. but that's also a bigger problem for me because of non-standard ua strings and spoofing and everything else am not aware of. so how do you guys think i should go about this? or should i even? is there a better way to go about making sure that i don't run code that'll eventually break the page? i've set it up to degrade into a css hover when javascript ain't there.. expertise needed. much appreciated, thanks guyz!

    Read the article

  • Javascript: How to detect if a word is highlighted

    - by fterh
    I'm writing a Firefox addon that is triggered whenever a word is highlighted. However I need a script that detects when a word is highlighted, and I'm stuck. An example would be nytimes.com (when you're reading an article and you highlight a word, the reference icon pops up). However the nytimes.com script is super complex. I'm 16 and not much of a programmer, so that is definitely way out of my league.

    Read the article

  • Second monitor not detected

    - by configurator
    Note: I've seen this question quite a lot, but in all the cases I could find with answers, the answer was either "I don't know" or "use nvidia-settings (which is irrelevant to me)." I'm using Intel Sandybridge Desktop graphics, with a P8H61-M LE motherboard. How do I get Ubuntu to detect my second monitor? Clicking "Detect Displays" here doesn't do anything. Here's some system info: $ lspci | grep VGA 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) $ uname -a Linux clyde 3.5.0-13-generic #13-Ubuntu SMP Tue Aug 28 08:31:47 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux $ hardinfo [copied from the UI] -Display- Resolution : 1920x1080 pixels Vendor : The X.Org Foundation Version : 1.12.3 -Monitors- Monitor 0 : 1920x1080 pixels -Extensions- BIG-REQUESTS Composite DAMAGE DOUBLE-BUFFER DPMS DRI2 GLX Generic Event Extension MIT-SCREEN-SAVER MIT-SHM RANDR RECORD RENDER SECURITY SGI-GLX SHAPE SYNC X-Resource XC-MISC XFIXES XFree86-DGA XFree86-VidModeExtension XINERAMA XInputExtension XKEYBOARD XTEST XVideo -OpenGL- Vendor : Intel Open Source Technology Center Renderer : Mesa DRI Intel(R) Sandybridge Desktop Version : 3.0 Mesa 8.1-devel Direct Rendering : Yes I've tried upgrading everything from ppa:xorg-edgers/ppa and ppa:glasen/intel-driver. I've also installed various tools I've found in other threads (e.g. hardinfo) but they weren't really helpful to me as I don't know what to make of the data. How do I get Ubuntu to detect my second monitor?

    Read the article

  • How to detect when a device is heading towards a certain location?

    - by Tiger
    Hi, How can I detect when a device is heading towards a certain location? Lets say I have 2 locations- the devices current location, and a location of some restaurant for example- I would like to detect when the device is heading towards that restaurant. (I asked this before with no answers- I thought maybe if I'll rephrase the question...) Thanks.

    Read the article

  • How can I detect if an iPhone is rotating while being face up in a table?

    - by OscarMk
    Hello, Is there a way to detect if an iphone lying down in a table face up is rotating?. I do realize that this kind of movement is not reported by the accelerometer and neither is it reported to the - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation method. Is there a way to detect angle variations for the phone rotating this way?. Thank you.

    Read the article

  • How can I detect 'any' ajax request being completed using jQuery?

    - by Brian Scott
    I have a page where I can insert some javascript / jquery to manipulate the output. I don't have any other control over the page markup etc. I need to add an extra element via jquery after each present on the page. The issue is that the elements are generated via an asynchronous call on the existing page which occurs after $(document).ready is complete. Essentially, I need a way of calling my jquery after the page has loaded and the subsequent ajax calls have completed. Is there a way to detect the completion of any ajax call on the page and then call my own custom function to insert the additional elements after the newly created s ?

    Read the article

  • Dualboot Asus n56v (ubuntu / win 7 x64) - ubuntu doesn't detect partition table made by windows

    - by user76439
    I have an Asus n56v and I've got troubles installing Ubuntu 12.04 x64. I already have installed Windows 7 x64! The hard drive is: Hitachi HTS547575A9E384 My problem: The installation program doesn't recognize the already existing partitions and is offering only options where there are partitions. Can someone help me out? Is this an ACPI/IDE conflict, missing driver or conflict with Windows 7? (I'm not an expert on Linux, only working sometimes with it.) I now tried out some options concerning EFI with a GTP-table. Everything worked but I wasn't able to fix a dual boot (Windows boot loader) nor with GRUB2. The laptop is still having a BIOS, but is able to boot DVDs/CDs in EFI-mode. Now I try to avoid EFI and GTP using the old windows MBR style. I reinstalled Windows, so far no problem. When I want to try to install Ubuntu, it doesn't detect the already existing partition table. It is just showing me an empty space for the whole disk. Other threads like Ubuntu 12.04 does not see windows already install on my computer (dual installation) don't help me out. os-prober shows me a correct result. I don't know how to deal with gdisk as shown in Installer doesn't detect existing partition table/windows 7 partition. I have 750GB for the whole disk. I'm using: 90GB for Windows reserved partition + system partition, 500GB for data and the rest should be for SWAP and linux-system. How can I make Ubuntu detect the partition table?

    Read the article

  • Detect collision from a particular side

    - by Fabián
    I'm making a platform sidescrolling game. All I want to do is to detect if my character is on the floor: function OnCollisionStay (col : Collision){ if(col.gameObject.tag == "Floor"){ onFloor = true; } else {onFloor = false;} } function OnCollisionExit (col : Collision){ onFloor = false; } But I know this isn't the accurate way. If I hit a cube with a "floor" tag, in the air (no matter if with the character's feet or head) I would be able to jump. Is there a way to use the same box collision to detect if I'm touching something from a specific side?

    Read the article

  • Detect duplicate in a subset from a set of elements

    - by Abhinav Shrivastava
    I have a set of numbers say : 1 1 2 8 5 6 6 7 8 8 4 2... I want to detect the duplicate element in subsets(of given size say k) of the above numbers... For example : Consider the increasing subsets(for example consider k=3) Subset 1 :{1,1,2} Subset 2 :{1,2,8} Subset 3 :{2,8,5} Subset 4 :{8,5,6} Subset 5 :{5,6,6} Subset 6 :{6,6,7} .... .... So my algorithm should detect that subset 1,5,6 contains duplicates.. My approach : 1)Copy the 1st k elements to a temporary array(vector) 2) using #include file in C++ STL...using unique() I would determine if there's any change in size of vector.. Any other clue how to approach this problem..

    Read the article

  • Detect Driver

    This article is the continue of the previously posted article Hide Driver. Some methods to detect hidden files and processes are described in it

    Read the article

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