Search Results

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

Page 117/744 | < Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >

  • efficient way to detect if an image is empty

    - by Jos
    Hi, I need a very fast method to detect if an image is empty. Im my case then all pixels are white and transparant. The images are png's. My current method is to load them in a memory bitmap and check each pixel value, but this is way to slow. Is there a more efficient way? This is my current code: 'Lock the bitmap bits. Dim bmpData As System.Drawing.Imaging.BitmapData = bmp.LockBits(rectBmp, _ Drawing.Imaging.ImageLockMode.ReadOnly, bmp.PixelFormat) Try Dim x As Integer Dim y As Integer For y = 0 To bmpData.Height - 1 For x = 0 To bmpData.Width - 1 If System.Runtime.InteropServices.Marshal.ReadByte(bmpData.Scan0, (bmpData.Stride * y) + (4 * x) + 3) <> 0 Then Return True Exit For End If Next Next Finally bmp.UnlockBits(bmpData) End Try

    Read the article

  • How to detect Out Of Memory condition?

    - by Jaromir Hamala
    I have an application running on Websphere Application Server 6.0 and it crashes nearly every day because of Out-Of-Memory. From verbose GC is certain there are the memory leaks(many of them) Unfortunately the application is provided by external vendor and getting things fixed is slow & painful process. As part of the process I need to gather the logs and heapdumps each time the OOM occurs. Now I'm looking for some way how to automate it. Fundamental problem is how to detect OOM condition. One way would be to create shell script which will periodically search for new heapdumps. This approach seems me a kinda dirty. Another approach might be to leverage the JMX somehow. But I have little or no experience in this area and don't have much idea how to do it. Or is in WAS some kind of trigger/hooks for this? Thank you very much for every advice!

    Read the article

  • Outlook 2007 VSTO Add-in deployed by click-once doesn't detect published updates

    - by Matt
    I have created an outlook 2007 add-in project in vs2008, targeting .net 3.5, then migrated the project to vs2010. I have then published the project from vs2010 to a web site, and installed the add-in using click-once to a virtual machine running xp, .net 3.5 sp1, and outlook 2007. This all works great and I can see my add-in within outlook. Publish update settings are set to update the add-in at startup rather than every 7 days. However when I then make a simple change to the add-in, update the AssemblyVersion and AssemblyFileVersion of the add-in project, and then publish the updates, when I run outlook it doesn't detect that there is a new version, and just runs the current one that is installed. I can see that the publish has generated a new setup.exe and added a new folder to the 'Application Files' folder with the current (autogenerated) publish version. Can anyone suggest anything how I can get the update to be deployed to the client?

    Read the article

  • Detect file system changes on Samba share with Java on Windows

    - by GHad
    Hi, for a recent project I need to detect file system changes on a mapped Samba share from java on windows: Creates, updates and removes. At the moment I am using a folder poll that maintains a list of files and their modified timestamp to look for events. But my problem is that this folder poll only peeks into the folder at certain times (every 10 seconds for example), so an updated file can be updated twice between two polls without recognizing. Is there any way to get events from windows inside Java whenever a file event occours on that mappep Samba share? Thanks!

    Read the article

  • Reliably detect caller domain over cURL request?

    - by Utkanos
    OK so server-side security is not my forte. Basically, I'm building a service which users may use (via an SDK) only on the domain they stipulated when they signed up. The SDK calls my web service over cURL in PHP. Would I be right in thinking I cannot reliably detect the caller domain, i.e. enforce that it is the same domain they stipulated when signing up? cURL of course sends this over headers, but headers can always (?) be faked. Is there a better course of action to enforce domain for this sort of thing? (NB I'm already using an API key, too - it's just I wanted to restrict domain, too) Thanks in advance

    Read the article

  • Detect if Java Swing component has been hidden

    - by kayahr
    Assume we have the following Swing application: final JFrame frame = new JFrame(); final JPanel outer = new JPanel(); frame.add(outer); JComponent inner = new SomeSpecialComponent(); outer.add(inner); So in this example we simply have an outer panel in the frame and a special component in the panel. This special component must do something when it is hidden and shown. But the problem is that setVisible() is called on the outer panel and not on the special component. So I can't override the setVisible method in the special component and I also can't use a component listener on it. I could register the listener on the parent component but what if the outer panel is also in another panel and this outer outer panel is hidden? Is there an easier solution than recursively adding componentlisteners to all parent components to detect a visibility change in SomeSpecialComponent?

    Read the article

  • (Wordpress) Global variable to detect pagination?

    - by Gnee
    I am showing 6 posts on one page. On the 7th post, pagination occurs on so on. goal: If there is more than one page (page 1, 2, 3, etc..), JavaScript is to add a specific div element. If there are only 6 posts or less, no pagination occurs, no div element is added. The number of posts to show: $showposts = get_query_var('showposts'); The current post number I can keep track of: $post_count++; Problem is I can keep track of posts 1-6 but how to tell if if it goes over to 7 and starts pagination? I thought there was a global variable that returns if pagination occurs, but I can't seem to find it. (I know there is global to detect pagination via <!--nextpage--> but so far I can't find it's equivalent for index.php).

    Read the article

  • Can't detect MIME type when using Zend Zend_File_Transfer_Adapter_Http !

    - by mrblue
    Hi all, I am writing a small script to upload and detect MIME type, using Zend Framework. For the design purpose, I can't use Zend_Form but normal instead. And I simply apply from the manual : $adapter = new Zend_File_Transfer_Adapter_Http(); $files = $adapter-getFileInfo(); $mime = $files-getMimeType(); But the system inform that the funcion getMimeType() does not existed. Then, I tried: $adapter = new Zend_File_Transfer(); $files = $adapter-getFileInfo(); $mime = $files-getMimeType(); This time, it didn't work either. So, how can I get the MIME type ? Thank you so much for your help

    Read the article

  • How to detect tab key pressing in C#?

    - by user342325
    I want to detect when tab key is pressed in a textBox and focus the next textbox in the panel. I have tried out keyPressed method and keyDown method. But when I run the program and debug those methods are not calling when the tab key is pressed. Here is my code. private void textBoxName_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Tab) { textBoxUsername.Focus(); } } private void textBoxName_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar==(char)Keys.Tab) { textBoxUsername.Focus(); } } Please correct me.Thank you.

    Read the article

  • Bash init.d script detect that mysqld has started and is running

    - by Ricket
    I'm working on my dedicated server running CentOS. I found out that one of my applications which starts up via a script in /etc/init.d/ requires MySQL to be running, or else it throws an error, so essentially I currently have to start it by hand. How can I detect, in a bash script (#!/bin/sh), whether the MySQL service has started yet? Is there some way to poll port 3306 until it is open to accept connections, and only then continue with the script? Or maybe set an order so that the script doesn't run until the mysqld script runs?

    Read the article

  • Asterisk: Originate API - Which card to use to detect busy/ringing/answer event for FXO

    - by spkhaira
    I want to use Originate API of Asterisk to place an outbound call on a FXO channel, for testing purpose I am using X100P card and, as expected, card is not able to detect if the number is busy/ringing or when it is answered. I want to know which card should I use so that I can get such basic events ... I am not really interested in detailed call progress analysis for answering machine or live voice. I just need basic busy/ringing and answer events and maybe a dis-connect event. Thanks.

    Read the article

  • detect where a redirect wants to go with jQuery

    - by Markus
    Hi there, I have a page with a flash plugin. If I'm on that page, I don't want to post a message if the user wont to leaf it without saving it...: if(/containers/.test(document.location.href)){ window.onbeforeunload = function(){ return exit_text; }; } This works fine, except that I if i save the content in the flash plugin. In that case I don't want to show up that message. How can I detect the url within the onbeforeunload method? That way I can descide when to post the method! Thanks Markus

    Read the article

  • Detect touch Cocos2d-x

    - by James Dunay
    I'm using Cocos2d-x and trying to detect touches in my HelloWorld project. Though I'm having no luck. .h class HelloWorld : public CCLayer{ private: CCSpriteBatchNode * _batchNode; CCSprite *_turkey; virtual void ccTouchesBegan(cocos2d::CCSet* touches, cocos2d::CCEvent* event); .ccp void HelloWorld::ccTouchesBegan(cocos2d::CCSet* touches, cocos2d::CCEvent* event){ CCLog("this"); } but the thing is that when I click the screen 'this' never shows up in the log. What am i missing here? thanks!

    Read the article

  • Detect if an app was uninstalled

    - by mobilekid
    Is there a way to get a system notification when an app has been uninstalled? I would like to maintain a table of all clients' info currently using my app. However, that seems impossible if there is no way to detect this event. The first solution I can think of is to have an always running service in the background listening for android.intent.action.PACKAGE_REMOVED. But then would that service be killed once the uninstallation process has ended, or would it be stopped just before the process has kicked off? Also even if this is a solution it's has the potential to put off a lot of people when they realise that part of the app is running in the background. Any suggestions? Thanks!

    Read the article

  • C/C++ enums: Detect when multiple items map to same value

    - by Dan
    Is there a compile-time way to detect / prevent duplicate values within a C/C++ enumeration? The catch is that there are multiple items which are initialized to explicit values. Background: I've inherited some C code such as the following: #define BASE1_VAL (5) #define BASE2_VAL (7) typedef enum { MsgFoo1A = BASE1_VAL, // 5 MsgFoo1B, // 6 MsgFoo1C, // 7 MsgFoo1D, // 8 MsgFoo1E, // 9 MsgFoo2A = BASE2_VAL, // Uh oh! 7 again... MsgFoo2B // Uh oh! 8 again... } FOO; The problem is that as the code grows & as developers add more messages to the MsgFoo1x group, eventually it overruns BASE2_VAL. This code will eventually be migrated to C++, so if there is a C++-only solution (template magic?), that's OK -- but a solution that works with C and C++ is better.

    Read the article

  • Is System.Windows.Media.RenderCapability the wrong source to detect the current render-mode

    - by happyclicker
    I use System.Windows.Media.RenderCapability.Tier to show the current render mode within a diagnostics panel of my app. If I force the app to change the render-mode through the following code HwndSource hwndSource = PresentationSource.FromVisual(visual) as System.Windows.Interop.HwndSource; HwndTarget hwndTarget = hwndSource.CompositionTarget; hwndTarget.RenderMode = renderMode; neither System.Windows.Media.RenderCapability.TierChanged fires, nor has the System.Windows.Media.RenderCapability.Tier property changed. However the changes are applied to the app. If I look with Perforator, the render mode has been changed to the desired mode. Although I’ve found at many locations that System.Windows.Media.RenderCapability.Tier can be used to detect the current render state (also msdn, see this), it seems, System.Windows.Media.RenderCapability only gives information about the capabilities and not about the current mode. That makes also sense if I look at the name of the class. Is there another source to know how an actual wpf-content is rendered or am I doing something wrong?

    Read the article

  • Detect NativeDragDrop to Trash or RecycleBin

    - by colder
    I will let user remove item from List with a cool method. Drag an item in adobe air List control and then drop it to Trash(OSX) or Recycle Bin(Win). The trash accept move drag action only. So I think I must set dragMoveEnable=true. When I drag an item to Recycle Bin on Windows. It show accept effect(alpha mask) and Air remove that object from List's dataProvider. So I can find which one is disappear. But when I drag to Trash on MacOSX. It show effect too. But Air do nothing for List. Maybe this is a bug. How can I avoid it? Are there any way to detect where dropped by user?

    Read the article

  • Detect when home button is pressed iOS

    - by nick
    I have several iOS apps that all use the same port to listen for a network beacon. On the main view I use viewWillDisappear to close the port when another view is opened, which was working great. Then I noticed if I pressed the home button from the main view controller without opening another view to close the port, then the port stays open and non of my other apps can listen on that port any more. I then tried using viewWillUnload, but that doesn't seem to get called when I press the home button. -(void)viewWillUnload { //[super viewWillUnload]; NSLog(@"View will unload"); [udpSocket close]; udpSocket = nil; } View will unload is never displayed in the console, which leads me to believe that the method is never getting called. Is there a way to detect when the home button is pressed so I can close my port?

    Read the article

  • func_get_args detect context

    - by Steve
    I have a script where it accepts a varying number of arguments. I want to use func_get_args to perform operations on said arguments. If I have one function like this: function Something() { foreach(func_get_args($this) as $functions) { // Do something } // Return.. } I want to be able to call this function in, for example, another function to add/save entries. The add/save function would have arguments 'title', 'description' etc.. I basically want to know if there is a way to detect the context of a function call. Can I pass something to func_get_args that will let it know that its called in a certain function? So if I do: function Save($title, $desc) { $vars = $this->Something(); } I want $vars to contain $title and $desc after modifying them.

    Read the article

  • Automatically detect a new computer connected to the network

    - by Ian
    Hi All, Is there an elegant way to make a program detect a new computer that is connected to the network? I would like my program to "auto-sense" a new computer being connected on the network (they're on the same network). Like a USB device being connected to the computer. What I'm doing now is to save a list of all computers in the network from time to time. Another approach is to PING all available IPs on the subnet. Are there any other elegant approaches? Thanks!

    Read the article

  • Detect if the iframe content has loaded successfully.

    - by skinssay
    Hi, I have a widget that contains an iframe. The user can configure the url of this iframe, but if the url could not be loaded (it does not exists or the user does not have access to internet) then the iframe should failover to a default offline page. The question is, how can I detect if the iframe could be loaded or not? I tried subscribing to the 'load' event, and, if this event is not fired after some time then I failover, but this only works in Firefox, since IE and Chrome fires the 'load' event when the "Page Not Found" is displayed.

    Read the article

  • WndProc to detect device unplug and plug

    - by Kev Fixx
    How can I know a devices is plug or unplug in WPF? I am using the code below to detect device changes: private void OnSourceInitialized(object sender, EventArgs e) { IntPtr windowHandle = (new WindowInteropHelper(this)).Handle; HwndSource src = HwndSource.FromHwnd(windowHandle); src.AddHook(new HwndSourceHook(WndProc)); } private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { // Handle WM_DEVICECHANGE... if (msg == 0x219) { InitHead(); } return IntPtr.Zero; } Thank you. EDITED: I did the below, still not working: if (msg == 0x0219) { switch (wParam.ToInt32()) { case 0x8000: { InitHead(); } break; } }

    Read the article

  • PHP Detect Pages Genre/Category

    - by Alexwhin
    Hey, I was wondering if their was any sort of way to detect a pages genre/category. Possibly their is a way to find keywords or something? Unfortunately I don't have any idea so far, so I don't have any code to show you. But if anybody has any ideas at all, let me know. Thanks! EDIT @Nican Perhaps their is a way to set, let's say 10 category's (Entertainment, Funny, Tech). Then creating keywords for these category's (Funny = Laughter, Funny, Joke etc). Then searching through a webpage (maybe using a cUrl) for these keywords and assigning it to the right category. Hope that makes sense.

    Read the article

  • IP Tables won't save the rule.

    - by ArchUser
    Hello, I'm using ArchLinux and I have an IP tables rule that I know works (from my other server), and it's in /etc/iptables/iptables.rules, it's the only rule set in that directory. I run, /etc/rc.d/iptables save, then /etc/rc.d/iptables/restart, but when I do "iptables --list", I get ACCEPTs on INPUT,FORWARD & OUTPUT. # Generated by iptables-save v1.4.8 on Sat Jan 8 18:42:50 2011 *filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [216:14865] :BRUTEGUARD - [0:0] :interfaces - [0:0] :open - [0:0] -A INPUT -p icmp -m icmp --icmp-type 18 -j DROP -A INPUT -p icmp -m icmp --icmp-type 17 -j DROP -A INPUT -p icmp -m icmp --icmp-type 10 -j DROP -A INPUT -p icmp -m icmp --icmp-type 9 -j DROP -A INPUT -p icmp -m icmp --icmp-type 5 -j DROP -A INPUT -p icmp -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -j interfaces -A INPUT -j open -A INPUT -p tcp -j REJECT --reject-with tcp-reset -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable -A INPUT -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP -A INPUT -f -j DROP -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,SYN,RST,PSH,ACK,URG -j DROP -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP -A INPUT -i eth+ -p icmp -m icmp --icmp-type 8 -j DROP -A BRUTEGUARD -m recent --set --name BF --rsource -A BRUTEGUARD -m recent --update --seconds 600 --hitcount 20 --name BF --rsource -j LOG --log-prefix "[BRUTEFORCE ATTEMPT] " --log-level 6 -A BRUTEGUARD -m recent --update --seconds 600 --hitcount 20 --name BF --rsource -j DROP -A interfaces -i lo -j ACCEPT -A open -p tcp -m tcp --dport 80 -j ACCEPT -A open -p tcp -m tcp --dport 10011 -j ACCEPT -A open -p udp -m udp --dport 9987 -j ACCEPT -A open -p tcp -m tcp --dport 30033 -j ACCEPT -A open -p tcp -m tcp --dport 8000 -j ACCEPT -A open -p tcp -m tcp --dport 8001 -j ACCEPT -A open -s 76.119.125.61 -p tcp -m tcp --dport 21 -j ACCEPT -A open -s 76.119.125.61 -p tcp -m tcp --dport 3306 -j ACCEPT -A open -p tcp -m tcp --dport 22 -j BRUTEGUARD -A open -s 76.119.125.61 -p tcp -m tcp --dport 22 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT COMMIT # Completed on Sat Jan 8 18:42:50 2011

    Read the article

  • Different routing rules for a particular user using firewall mark and ip rule

    - by Paul Crowley
    Running Ubuntu 12.10 on amd64. I'm trying to set up different routing rules for a particular user. I understand that the right way to do this is to create a firewall rule that marks the packets for that user, and add a routing rule for that mark. Just to get testing going, I've added a rule that discards all packets as unreachable: # ip rule 0: from all lookup local 32765: from all fwmark 0x1 unreachable 32766: from all lookup main 32767: from all lookup default With this rule in place and all firewall chains in all tables empty and policy ACCEPT, I can still ping remote hosts just fine as any user. If I then add a rule to mark all packets and try to ping Google, it fails as expected # iptables -t mangle -F OUTPUT # iptables -t mangle -A OUTPUT -j MARK --set-mark 0x01 # ping www.google.com ping: unknown host www.google.com If I restrict this rule to the VPN user, it seems to have no effect. # iptables -t mangle -F OUTPUT # iptables -t mangle -A OUTPUT -j MARK --set-mark 0x01 -m owner --uid-owner vpn # sudo -u vpn ping www.google.com PING www.google.com (173.194.78.103) 56(84) bytes of data. 64 bytes from wg-in-f103.1e100.net (173.194.78.103): icmp_req=1 ttl=50 time=36.6 ms But it appears that the mark is being set, because if I add a rule to drop these packets in the firewall, it works: # iptables -t mangle -A OUTPUT -j DROP -m mark --mark 0x01 # sudo -u vpn ping www.google.com ping: unknown host www.google.com What am I missing? Thanks!

    Read the article

< Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >