Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 87/584 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • Is pthread_spin_trylock safe inside of sigsegv handler of multithreaded application?

    - by TWMouton
    I am trying to implement a handler that on SIGSEGV will collect some information such as process-id, thread-id and a backtrace and write this information to a file/pipe/socket. The problem lies in that there is the (probably pretty high) possibility that if one thread experienced a SIGSEGV that the others will shortly follow. If two threads happen to make it to the bit of code where they're writing their report out at the same time then they'll interleave their writing (to the same file). I know that I should only be using async-signal-safe functions as detailed in signal(7) I also have seen at least two cases here and video linked in top answer here where others have used pthread_spin_trylock to get around this problem. Is this a safe way to prevent the above problem?

    Read the article

  • Is it possible for a parent to use a child's constant or static variables from inside a static metho

    - by ryeguy
    Below is an example of what I'm trying to do. The parent can't access any of the child's variables. It doesn't matter what technique I use (static or constants), I just need some kind of functionality like this. class ParentClass { public static function staticFunc() { //both of these will throw a (static|const) not defined error echo self::$myStatic; echo self::MY_CONSTANT; } } class ChildClass extends ParentClass { const MY_CONSTANT = 1; public static $myStatic = 2; } ChildClass::staticFunc();

    Read the article

  • How to use a variable inside a _T wrapper?

    - by karikari
    I want to make the hostname part of this string to be variable.. Currently, it is only fix to this URL: _T(" --url=http://www.myurl.com/ --out=c:\\current.png"); I want to make something like this, so the URL is changeable.. _T(" --url=http://www." + myurl + "/ --out=c:\\current.png"); update. Below is my latest attempt: CString one = _T(" --url=http://www."); CString two(url->bstrVal); CString three = _T("/ --out=c:\\current.png"); CString full = one + two + three; ShellExecute(0, _T("open"), // Operation to perform _T("c:\\IECapt"), // Application name _T(full),// Additional parameters 0, // Default directory SW_HIDE); The error is : Error 1 error C2065: 'Lfull' : undeclared identifier c:\test.cpp

    Read the article

  • What's the most performance effective way to have a webbrowser inside a class library ?

    - by Xaqron
    I'm developing a class library. Need some data from internet and this cannot be done with HttpWebRequest in my case so I wanna use WebBrowser component. WebBrowser is used for opening a single page and fetch some data from it, so WebBrowser life-time is very short. Running thread is MTA and no message pump or STA thread is available by default (class library is used by an ASP.NET application). How to create a WebBrowser object, run it with a STA thread, fetch data from a web page and finally dispose it with the least performance impact on the application ? I just need the idea/concept and will find details myself. Thanks guys

    Read the article

  • How to get variable value from inside a stored procedure in DB2?

    - by Sylvia
    This seems like it should be very easy...anyway, it is in MS SQL Server In a DB2 stored procedure, how can I just get the value of a variable? Say I have the following stored procedure: CREATE PROCEDURE etl.TestABC( ) LANGUAGE SQL BEGIN declare Stmt varchar(2048); set Stmt = 'this is a test'; -- print Stmt; -- select Stmt; return 0; END @ I'd like to print out the value of Stmt after I set it. Print doesn't work, select doesn't work. Somebody said I have to insert it to a table first, and then get it after I run the stored procedure. Is this really necessary? Thanks, Sylvia EDIT: I should have made clearer that I want to see the value of Stmt each time after I set it, and I may need to set it multiple times within the same stored procedure.

    Read the article

  • How to access Oracle system tables from inside of a PL/SQL function or procedure?

    - by mjumbewu
    I am trying to access information from an Oracle meta-data table from within a function. For example (purposefully simplified): CREATE OR REPLACE PROCEDURE MyProcedure IS users_datafile_path VARCHAR2(100); BEGIN SELECT file_name INTO users_datafile_path FROM dba_data_files WHERE tablespace_name='USERS' AND rownum=1; END MyProcedure; / When I try to execute this command in an sqlplus process, I get the following errors: LINE/COL ERROR -------- ----------------------------------------------------------------- 5/5 PL/SQL: SQL Statement ignored 6/12 PL/SQL: ORA-00942: table or view does not exist I know the user has access to the table, because when I execute the following command from the same sqlplus process, it displays the expected information: SELECT file_name FROM dba_data_files WHERE tablespace_name='USERS' AND rownum=1; Which results in: FILE_NAME -------------------------------------------------------------------------------- /usr/lib/oracle/xe/oradata/XE/users.dbf Is there something I need to do differently?

    Read the article

  • (iphone) How to access CGRect member variable inside c++ class?

    - by Eugene
    i have a c++ class with CGrect variable and i'm getting segfault when trying to access it. class Parent { //with some virtual functions/dtors }; class Child { public: void SetRect(CGRect rect) { mRect = rect; } CGRect GetRect() { return mRect; } int GetIndex() { return mIndex; } private: CGRect mRect; int mIndex; }; i'm doing CGRect rect = childPtr->GetRect(); from object c code and it segfaults. I printed *childPtr just before the call and rect looks fine with intended data value. int index = childPtr->GetIndex(); from same object c code(*.mm), works fine though. Any idea why I'm getting segfaults? Thank you edit - It's got something to do with virtual functions. (gdb) p singlePuzzlePiece-GetRect() Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000001 0x00000001 in ?? () Cannot access memory at address 0x1 The program being debugged was signaled while in a function called from GDB. GDB remains in the frame where the signal was received. To change this behavior use "set unwindonsignal on" Evaluation of the expression containing the function (at 0x1) will be abandoned. (gdb) Somehow, the function is not properly compiled?

    Read the article

  • PHP: A way for a file to have its own MD5 inside?

    - by Eli
    Hi all, In considering several possible solutions to a recent task, I found myself considering how to get a php file that includes it's own MD5 hash. I ended up doing something else, but the question stayed with me. Something along the lines of: <?php echo("Hello, my MD5 is [MD5 OF THIS FILE HERE]"); ?> Whatever placeholder you have in the file, the second you take its MD5 and insert it, you've changed it.

    Read the article

  • Is it possible to change iframe src using javascript exists in page inside that iframe?

    - by Amr ElGarhy
    I want to change the iframe source when something change in this iframe content, the iframe is in a different domian than the parent page. is this can be done or not? I just need to add a hash to this iframe src, so that i can access this hash value from the parent page and do some stuff based on this value. What i did: In the iframe page i wrote: window.location.hash = "close_child"; and in the parent page i wrote: if (document.getElementById("MyIFrameId").src.indexOf("#close_child") > 0) { but i always find that the src is empty

    Read the article

  • How to restart Linux from inside a C++ program?

    - by Dave K
    I have a Qt 4 GUI where I need to have a option in a drop-down menu that allows the user to choose to restart the computer. I realize this might seem redunant with the ability to restart the computer in other ways, but the choice needs to stay there. I've tried using system() to call the following: a suid-root shell script a non-suid shell script a suid-root binary program and all of them just cause reboot: must be superuser to be printed. Using system() to call reboot directly does the same thing. I'm not especially attached to using system() to do this, but it seemed like the most direct choice. How can I reboot the system from the GUI?

    Read the article

  • How to access web page hierarchy inside a application.

    - by Hazior
    Trying to figure out how to programmatically access the web pages in the application. Just something simple like a list of them would be awesome. I know I can create a list but I was wondering if there was something that could 'look' at the pages and add a new one to the list if you make a new page for the application. Example with 7 pages: Error Default Login Content Users ContactUs Admin I am half awake so I may be a little unclear. Maybe puting it all in a single question will be easier. How do you autogenerate a list of all webpages in your current application?

    Read the article

  • How to copy a structure with pointers to data inside (so to copy pointers and data they point to)?

    - by Kabumbus
    so I have a structure like struct GetResultStructure { int length; char* ptr; }; I need a way to make a full copy of it meaning I need a copy to have a structure with new ptr poinnting on to copy of data I had in original structure. Is It any how possible? I mean any structure I have which contains ptrs will have some fields with its lengths I need a function that would copy my structure coping all ptrs and data they point to by given array of lengthes... Any cool boost function for it? Or any way how to create such function?

    Read the article

  • How to get the content of two xml tags even when they have another xml tags inside them (PHP-XML)

    - by Harry
    In simple terms, let's suppose you have the following xml structure: <TEXT>Well, I need some help as you <CUSTOMTAG>can</CUSTOMTAG> see.</TEXT> When extracting the text of this node in PHP with strip_tags(), I am not getting the content of tags. First step: What I want to do, is to extract and thus have the following string: "Well, I need some help as you can see." Second step: I would also like to convert the <CUSTOMTAG> and </CUSTOMTAG> to something else, like <e> and </e> for example, and finally have the following string: "Well, I need some help as you <e>can</e> see." I would appreciate only tested and working code. Thanks in advance! Kind Regards

    Read the article

  • Is it a bad programming practice to have "Public" members inside an "Internal" class?

    - by Amby
    I mean, won;t it be more specific and appropriate if i "only" keep "protected","internal" and "private" members (field,method,property,event) in a class which is declared as "internal" ? I have seen this practice ( having "public" members in an "internal" class) in various code so just wanted to know is it a bad practice or does it has some benefit or advantage. [Only concerned about C#] Thanks for your interest.

    Read the article

  • Why people define class, trait, object inside another object in Scala?

    - by Zwcat
    Ok, I'll explain why I ask this question. I begin to read Lift 2.2 source code these days. In Lift, I found that, define inner class and inner trait are very heavily used. object Menu has 2 inner traits and 4 inner classes. object Loc has 18 inner classes, 5 inner traits, 7 inner objects. There're tons of codes write like this. I wanna to know why the author write it like this. Is it because it's the author's personal taste or a powerful use of language feature?

    Read the article

  • Getting information about where c++ exceptions are thrown inside of catch block?

    - by tfinniga
    I've got a c++ app that wraps large parts of code in try blocks. When I catch exceptions I can return the user to a stable state, which is nice. But I'm not longer receiving crash dumps. I'd really like to figure out where in the code the exception is taking place, so I can log it and fix it. Being able to get a dump without halting the application would be ideal, but I'm not sure that's possible. Is there some way I can figure out where the exception was thrown from within the catch block? If it's useful, I'm using native msvc++ on windows xp and higher. My plan is to simply log the crashes to a file on the various users' machines, and then upload the crashlogs once they get to a certain size.

    Read the article

  • Best method for creating absolute path in PHP? (See 3 methods listed inside)

    - by mark
    I can create paths with no problem, but I want to know which of these 3 methods is the most rock solid and reliable and will work on the most servers. Right now I am using method 1 in my script and some users are having path issues. I just want the method that will work on any version of php and almost any server config. 1. <?php echo $_SERVER['DOCUMENT_ROOT']; ?> 2. <?php echo getcwd(); ?> 3. <?php echo dirname(__FILE__); ?> Thank you so much for any expertise you can provide about this!

    Read the article

  • How can I embed a XML document inside a XHTML document?

    - by Oriol
    For example, how can I embed <?xml version="1.0" encoding="utf-8"?> <root> <node><![CDATA[Text]]></node> </root> in my XHTML? I know I can put it in a CDATA section... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>My title</title> </head> <body> <p>I am a XHTML paragraph!</p> <div> <![CDATA[ <?xml version="1.0" encoding="utf-8"?> <root> <node>Text</node> </root> ]]> </div> </body> </html> ... but then I have to remove XML file's CDATA sections and the XML is parsed as text instead of XML. Then, I get this... ... but I want something like this:

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >