Search Results

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

Page 119/154 | < Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >

  • Problems with first argument being string when overloading the + operator in C++

    - by Chris_45
    I have an selfmade Stringclass: //String.h String & operator = (const String &); String & operator = (char*); const String operator+ (String& s); const String operator+ (char* sA); . . //in main: String s1("hi"); String s2("hello"); str2 = str1 + "ok";//this is ok to do str2 = "ok" + str1;//but not this way //Shouldn't it automatically detect that one argument is a string and in both cases?

    Read the article

  • Determine if FieldInfo is compiler generated backingfield

    - by Steffen
    The title pretty much says it all, how do I know if I'm getting a compiler generated backingfield for a {get; set;} property ? I'm running this code to get my FieldInfos: Class MyType { private int foo; public int bar {get; private set; } } Type type = TypeOf(MyType); foreach (FieldInfo fi in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.NonPublic)) { // Gets both foo and bar, however bar is called <bar>k__backingfield. } so the question is, can I somehow detect that the FieldInfo is a backingfield, without relying on checking its name ? (Which is pretty undocumented, and could be broken in next version of the framework)

    Read the article

  • Detecting when a process has finished (but not exited)

    - by Egwor
    I have a program that's run in unix (that I have no control over) that when finished prints 'Completed successfully' but does not exit. I want to automatically detect when the process finishes (by checking the output of the command), so that I can kill the process and so that I can proceed do other activities. The complexity comes because I want to be able to run multiples of these scripts concurrently. (One activity I need to do requires the script to be called with various inputs, but each time the script runs it takes a while to return, and so I want to do them in parallel) Has anyone done something similar to this? I could redirect the stderr and stdout output of the command to a temporary file which has a random file name, then tail the file and pipe to grep for the end conditions (I.e. the certain log lines). The problem is, surely tail -f would keep running, and so it would never exit. Should I poll? If so, what's the best approach?

    Read the article

  • Waiting for ServerSocket accept() to put socket into "listen" mode

    - by inazaruk
    I need a simple client-server communication in order to implement unit-test. My steps: Create server thread Wait for server thread to put server socket into listen mode ( serverSocket.accept() ) Create client Make some request, verify responses Basically, I have a problem with step #2. I can't find a way to signal me when server socket is put to "listen" state. An asynchronous call to "accept" will do in this case, but java doesn't support this (it seems to support only asynchronous channels and those are incompatible with "accept()" method according to documentation). Of cause I can put a simple "sleep", but that is not really a solution for production code. So, to summarize, I need to detect when ServerSocket has been put into listen mode without using sleeps and/or polling.

    Read the article

  • How to tell an iphone app user what will happen before opening Facebook login dialogue

    - by docno
    Apps that allow users to log in over a 3rd party authentication provider (e.g. Facebook, Google, Twoitter,...) should open a browser window to let the user authenticate against the provider. That means, at some point, an app is backgrounded and the user interacts with a browser window. Just before the browser opens, it's a recommended pratctice to inform the user about what will happen (see e.g. Getting Started with OAuth 2.0 - O'Reilly), let's say an alert window with something like "you will leave now the XYZ app and a browser window will open where you can enter your credentials safely". My question: How can that be done if I use the facebook SDK for ios? Looking at the SDK, there seem to be no notifications and no designated states that would allow me to detect that the sdk is about to background my app and about to opening either Safari or the Facebook app.

    Read the article

  • Core Data: Detecting the type and casting it

    - by Tim Sullivan
    I have set up a Core Data model that includes an entity, Item with a 1-M relationship with the abstract entity Place, so that an item has many places. There are several entities with the parent set to Place. I want to set up several UI elements depending on the descendent place types. I have a loop that looks something like this: for (Place *place in item.places) { } ... but I'm not sure how to detect what type the place is, and how to cast it to the proper type so that I can access its properties. Thanks for any help!

    Read the article

  • Python: get windows OS version and architecture

    - by Thorfin
    First of all, I don't think this question is a duplicate of http://stackoverflow.com/questions/2208828/detect-64bit-os-windows-in-python because imho it has not been thoroughly answered. The only approaching answer is: Use sys.getwindowsversion() or the existence of PROGRAMFILES(X86) (if 'PROGRAMFILES(X86)' in os.environ) But: Can we completely rely on the windows environment variable PROGRAMFILES(X86)? I fear that anyone can create it, even if it's not present on the system. How can we use sys.getwindowsversion() to get the architecture? Regarding sys.getwindowsversion(): The link http://docs.python.org/library/sys.html#sys.getwindowsversion leads us to http://msdn.microsoft.com/en-us/library/ms724451%28VS.85%29.aspx but I don't see anything related to the architecture (32bit/64bit). Moreover, the platform element if the returned tuple seems to be independent of the architecture. One last note, I'm using python 2.5. Thanks!

    Read the article

  • Java: Anyone know of a library that detects the quality of an internet connection?

    - by Zombies
    I know a simple URLConnection to google can detect if I am connected to the internet, after all I am confident that the internet is all well and fine If I cant connect to google. But what I am looking for at this juncture is a library that can measure how effective my connection to the internet is in terms of BOTH responsiveness and bandwidth available. BUT, I do not want to measure how much bandwidth is potentially available as that is too resource intensive. I really just need to be able to test wether or not I can recieve something like X kB's in Y amount of time. Does such a library already exist?

    Read the article

  • How to identify/handle text file newlines in Java?

    - by rafrafUk
    Hi Everyone! I get files in different formats coming from different systems that I need to import into our database. Part of the import process it to check the line length to make sure the format is correct. We seem to be having issues with files coming from UNIX systems where one character is added. I suspect this is due to the return carriage being encoded differently on UNIX and windows platform. Is there a way to detect on which file system a file was created, other than checking the last character on the line? Or maybe a way of reading the files as text and not binary which I suspect is the issue? Thanks Guys !

    Read the article

  • How do I remove &#13 ; from my text file using VBScript Replace() or a regex?

    - by Eric Lachance
    Hi! I'm doing a conversion between two software which both use XML so the actual conversion part is fairly straightforward - adding text here, removing others here, converting a few information. I'm using VBSCript WSH. The only issue I'm still having is the darn &#13; character - that's my problem! I've tried both strText = Replace(strText, "&#13;", "") and using a regex with Regex.pattern = "&#13;" ... neither works. I also tried replacing char(13), VBCR... nothing seems to detect the actual string itself and not the character it's creating. Can anyone help me?

    Read the article

  • WMF image data validation?

    - by deostroll
    There is an image capturing device which gives its output in wmf. This output is stored in the database directly. We have cases where at times some of these images do not appear on a web page in IE. But if we right click on the page we are able to save the image on to the hard disk; meaning the image does exist on the page, but does not appear visible. I think this is because of some file corruption issue, but I don't know how to resolve it. We are however able to view such files using MS Picture Viewer (desktop app). Is there anyway we can detect such problematic files?

    Read the article

  • previousFailureCount always stays on 0 (zero)

    - by itai alter
    Hello all, First of all, I'd like to thank the good people who helped me around on this site. Thanks. I'm trying to detect a failed authentication attempt in my app... I'm using the didReceiveAuthenticationChallenge method, and the checking if [challenge previousFailureCount] is equal to 0. The problem is that it's always stays on zero, even if the username and password that I send with the credentials are incorrect. I couldn't find any info about this kind of issue, any help will be much appreciated. Thanks!

    Read the article

  • Android: Access to an already paired connection

    - by poeschlorn
    Hi community, I have a question on accessing already existing paired bluetooth connections... How can a remote service detect an already paired connection and await a file transfer from it? In all comments on stackoverflow, on tutorials, ebooks or on google there is always shown how to create a new connection using sockets and so on, but no word about accessing to an existing one. Is it possible at all? If yes, can you also tell/show me how? At the moment I have no clue how to get started with it. Would be great if someone can help me get started :)

    Read the article

  • Array-size macro that rejects pointers

    - by nneonneo
    The standard array-size macro that is often taught is #define ARRAYSIZE(arr) (sizeof(arr) / sizeof(arr[0])) or some equivalent formation. However, this kind of thing silently succeeds when a pointer is passed in, and gives results that can seem plausible at runtime until things mysteriously fall apart. It's all-too-easy to make this mistake: a function that has a local array variable is refactored, moving a bit of array manipulation into a new function called with the array as a parameter. So, the question is: is there a "sanitary" macro to detect misuse of the ARRAYSIZE macro in C, preferably at compile-time? In C++ we'd just use a template specialized for array arguments only; in C, it seems we'll need some way to distinguish arrays and pointers. (If I wanted to reject arrays, for instance, I'd just do e.g. (arr=arr, ...) because array assignment is illegal).

    Read the article

  • php web based portal authentication through IP.

    - by user434885
    i have a web portal running which involves basic data entry. The issue being that this is highly sensitive data. And the credibility of the data entry personel is very low. Therefore i have implemented recording of IP when an entry is made. The Problem i am facing is if this if this person starts forwarding his IP from a proxy server then i am unable to track authenticity of the data. How do i detect if the IP forwarding is happening/ get the real ip address of the person.

    Read the article

  • Dropdown menu getting hidden by images

    - by Bob
    I have a set of dropdown menus across the top of a web page. Below is text and some images. When I hover over the top of each menu the menu then expands below as expected but while it overlaps any text on the page it is hidden behind any images. I set the z-index to 9999 and the position is set to absolute. I found if I lower the opacity of the images to say 0.6 then the menu will overlap it. So one solution would be to detect when the menu is being hovered over and then in JavaScript or JQuery temporarily reduce the opacity of the rest of the page until the cursor moves off the menu. If so I'm not sure how to do that but is that the best approach?

    Read the article

  • PHP: Convert web-page to utf8

    - by Paul Tarjan
    I would like to only work with UTF8. The problem is I don't know the charset of every webpage. How can I detect it and convert to UTF8? <?php $url = "http://vkontakte.ru"; $ch = curl_init($url); $options = array( CURLOPT_RETURNTRANSFER => true, ); curl_setopt_array($ch, $options); $data = curl_exec($ch); // $data = magic($data); print $data; See this at: http://paulisageek.com/tmp/curl-utf8 What is magic()?

    Read the article

  • DAQ Triggers in Matlab

    - by RidePlanet
    I'm writing a program that detects the speed of a object by hall effect sensors that are run into MATLAB through a DAQ (MCC USB-1408FS) The problem that has arisen is that I'm using a non-stop scan technique to detect the state of one of 3 sensors. Unfortunately this means that unless the object is rotating past each sensor at the exact rate the program runs, I will see an instantaneous speed (done by comparing the time between two sensors) of zero. I need the sensors to signal the program to count when they are hit, instead of constantly scanning for the signal. How can this be done?

    Read the article

  • how divide herader from binary data

    - by fixo2020
    Hi, I have this code: ofstream dest("test.txt",ios::binary); while (true){ size_t retval = recv (sd, buffer, sizeof(buffer), 0); dest.write(buffer,retval); if(retval <= 0) { delete[] buffer; break;} } Now, the recv() function return 4 bytes each loop right? and buffer contain it, this return all data so, pseudo-header and binary data (image), but I want know how capture only binary data, I know that the end of header are "\n\r" right? but what's are the solution better for make this? I make a function that detect when are "\n\r"? and after how capture binary data? Or, I put all data in memory, and after parse it? but how? I'm desperate :(

    Read the article

  • Macros giving problems with dladdr()

    - by Veger
    I have implemented tracing behavior using the -finstrument-functions option of gcc and this (simplified) code: void __cyg_profile_func_enter(void *this_fn, void *call_site) { Dl_info di; if(dladdr(this_fn, &di)) printf("entered %s\n", (di.dli_sname?di_dli_sname:"<unknown>")); } This works great, except for one thing: macros are processed as well, but the function prints the information of the function which contains the macro. So functions containing macros have their information printed multiple times (which is of course undesired). Is there anything to detect that a macro is being processed? Or is is possible to turn off instrumenting macros at all? PS Same problems occur with sizeof()

    Read the article

  • Can I have an android activity run only on the first time an application is opened?

    - by The Trav
    OK, so I'm playing around with an android app. The 90% use case is that users want to go straight to the primary list screen to find what they're looking for. That's what I want as my default screen. The first time a user loads the app however, some configuration is required before their list screen is of any value to them. So my question, is how I can go about displaying the configuration activity the first time the app is opened up, and then the list screen for future openings. I also want to put a demo button on the configuration screen, so I suppose more than just detecting that it's the first time, I specifically want to detect whether the user has performed certain configurations within the first screen.

    Read the article

  • Calculating toolbar icon width

    - by TheWzrdOz
    I am building an RDP client and I have toolbar that shows the running applications, same as the Windows toolbar. I need to support dual monitors, so my questions are 1) How do I detect that there is more than one monitor and 2) Is there a formula for calculating the width of the icons on the toolbar? I know that at the start, the width is not dependent on the number of monitors, and is always the same size. What does change is the number of icons I can display before I must start "shrinking" their width, and it will depend on the screen resolution as well. Any ideas?

    Read the article

  • Capturing clicks even when stopPropagation has been called (ie by 3rd party code)?

    - by josh
    I want to detect any click that happens on a page (to close a custom context menu). I'm using jQuery and trying to do $(document).click(function(){ ...close my context menu ... }); However, I'm using some code that calls evt.stopPropagation() in the click handlers for certain elements on the page, and those clicks aren't making it up to my top-level handler. Is there any way of capturing those clicks? Can be jQuery or not jQuery, as long as it works cross-browser.

    Read the article

  • Is this possible?

    - by Stud33
    I want to incorporate some Accelerometer code into a Android application im working and want to see if this is possible. Basically what I need is for the code to detect car acceleration motion. I am not wanting to determine speed with the code but just distinguish if the phone is in a car and has accelerated motion (Hence the car is moving for the first time). I have gone through many different accelerometer applications to see if this motion produces a viable profile to go off of and it appears it does. Just looking for something that popups a "Hello World" dialog when it detects your in the car and its moving for the first time down the street. Any help would be appreciated and a simple yes or no its possible would work. I would also be interested in compensating anyone that is capable of doing this as well. I need this done like yesterday so please let me know. Thank You, JTW

    Read the article

  • xcode convert iPhone to iPad

    - by user1625435
    help please. my code that change UIImageView is: - (void) viewDidLoad { background.image = [UIImage imageNamed:@"myImage.png"]; } It works good on iPhone and also on iPad but, how can I change "myImage.png" to "myImageHD.png" when I will run this app on my iPad???? I just need to show myImageHD if my app will run on iPad. IT CAN BE DONE WITH XIB FILE, BUT I NEED WITH CODE TO FIX IT. To detect if app run on iPad, and show myImageHD. Thanks.

    Read the article

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