Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 97/332 | < Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >

  • Error 'duplicate definition' when compiling 2 c files that reference 1 header file

    - by super newbie
    I have two C files and one header that are as follows: Header file header.h: char c = 0; file1.c: #include "header.h" file2.c: #include "header.h" I was warned about 'duplicate definition' when compiling. I understand the cause as the variable c is defined twice in both file1.c and file2.c; however, I do need to reference the header.h in both c files. How should I overcome this issue?

    Read the article

  • Link User32 with gcc

    - by Tim Cooper
    I have a C program which has a function call that is defined in windows.h (which I have included), however, when I try and compile it with gcc, I get the error: warning: implicit declaration of function `LockWorkStation' I looked at the MSDN documentation and I see that this function is the User32 library file, and I was wondering how I would go about linking that to my file.

    Read the article

  • Nested luabind classes declared in Lua

    - by Matt Fichman
    I am trying to declare a class B in a namespace A using Luabind (from the Lua side). I figure that if Luabind has a clean way to do this, it would look something like this: class 'A.B' (Super) function A.B:__init() Super.__init(self) end Notice that the B class is defined in the A table. I know the following hackish way of doing this: class 'A.B' (Super) A = {} A.B = _G['A.B'] However, I would really like to know if Luabind provides this feature explicitly.

    Read the article

  • Conditional SQLite check constraint?

    - by Rezzie
    I have a table defined by the following SQL: CREATE TABLE test ( id integer PRIMARY KEY NOT NULL UNIQUE, status text NOT NULL, enddate date, /* Checks */ CHECK (status IN ("Current", "Complete")) ); I'd like to add a constraint that requires enddate to be non-null if the status is "Complete". Is this possible? I am using SQLite v3.6.16.

    Read the article

  • typeInteger undeclared in EyeTunes framework

    - by Chris
    I copied the EyeTunes framework into my project and it says that is not declared. In the original project I go to definition and it takes me to AEDataModel.h where it is defined. However in my project it doesn't do that and it's not found. How do I add AEDataModel to my project? Thanks

    Read the article

  • How do I make links in a TextView clickable?

    - by Richard
    I have the following TextView defined: <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/txtCredits" android:autoLink="web" android:id="@+id/infoTxtCredits" android:layout_centerInParent="true" android:linksClickable="true"></TextView> where @string/txtCredits is a string resource that contains Link text. Android is highlighting the links in the TextView, but they do not respond to clicks. Can someone tell me what I'm doing wrong? Do I have to set an onClickListener for the TextView in my activity for something as simple as this?

    Read the article

  • Why facebook.php does not work?

    - by Roman
    I am trying to use facebook API and some functions/objects used in tutorials are NOT defined in facebook.php (downloaded from github.com). Am I so silly or is there some other think I should know? Thanks for help, Roman

    Read the article

  • SQL Server 2005 Performance Dashboard Missing Index

    - by n8wrl
    I am using the performance dashboard with our SQL Server 2005 databases and it lists what it considers to be missing indexes. But some of those indexes DO exist! They are not disabled, and they are defined exactly as the dashboard says they should be. Why are they reported as missing?

    Read the article

  • Use of infix operator hack in production code (Python)

    - by Casebash
    What is your opinion of using the infix operator hack in production code? Issues: The effect this will have on speed. The potential for a clashes with an object with these operators already defined. This seems particularly dangerous with generic code that is intended to handle objects of any type. It is a shame that this isn't built in - it really does improve readability

    Read the article

  • In Sphinx, can I register a bunch of keywords that should always be translated into links?

    - by Ross Rogers
    My doc strings have references to other python classes that I've defined. Every time Sphinx encounters one of these classes, I want it to insert a link to the documentation for that other class. Is this possible in Sphinx? Specifically, I have a doc string like: '''This class contains a bunch of Foo objects''' I could write: '''This class contains a bunch of :class:`~foo.Foo` objects''' but I would prefer that Sphinx finds all text matching Foo and makes it seem as though I had typed :class:~foo.Foo

    Read the article

  • Retrieve names of running processes

    - by Dave DeLong
    Hi everyone, First off, I know that similar questions have been asked, but the answers provided haven't been very helpful so far (they all recommend one of the following options). I have a user application that needs to determine if a particular process is running. Here's what I know about the process: The name The user (root) It should already be running, since it's a LaunchDaemon, which means Its parent process should be launchd (pid 1) I've tried several ways to get this, but none have worked so far. Here's what I've tried: Running ps and parsing the output. This works, but it's slow (fork/exec is expensive), and I'd like this to be as fast as possible. Using the GetBSDProcessList function listed here. This also works, but the way in which they say to retrieve the process name (accessing kp_proc.p_comm from each kinfo_proc structure) is flawed. The resulting char* only contains the first 16 characters of the process name, which can be seen in the definition of the kp_proc structure: #define MAXCOMLEN 16 //defined in param.h struct extern_proc { //defined in proc.h ...snip... char p_comm[MAXCOMLEN+1]; ...snip... }; Using libProc.h to retrieve process information: pid_t pids[1024]; int numberOfProcesses = proc_listpids(PROC_ALL_PIDS, 0, NULL, 0); proc_listpids(PROC_ALL_PIDS, 0, pids, sizeof(pids)); for (int i = 0; i < numberOfProcesses; ++i) { if (pids[i] == 0) { continue; } char name[1024]; proc_name(pids[i], name, sizeof(name)); printf("Found process: %s\n", name); } This works, except it has the same flaw as GetBSDProcessList. Only the first portion of the process name is returned. Using the ProcessManager function in Carbon: ProcessSerialNumber psn; psn.lowLongOfPSN = kNoProcess; psn.highLongOfPSN = 0; while (GetNextProcess(&psn) == noErr) { CFStringRef procName = NULL; if (CopyProcessName(&psn, &procName) == noErr) { NSLog(@"Found process: %@", (NSString *)procName); } CFRelease(procName); } This does not work. It only returns process that are registered with the WindowServer (or something like that). In other words, it only returns apps with UIs, and only for the current user. I can't use -[NSWorkspace launchedApplications], since this must be 10.5-compatible. In addition, this only returns information about applications that appear in the Dock for the current user. I know that it's possible to retrieve the name of running processes (since ps can do it), but the question is "Can I do it without forking and exec'ing ps?". Any suggestions?

    Read the article

  • Great Circle & Rhumb line intersection

    - by Karl T
    I have a Latitude, Longitude, and a direction of travel in degrees true north. I would like to calculate if I will intersect a line defined by two more Lat/Lon points. I figure the two points defining the line would create my great circle and my location and azimuth would define my Rhumb line. I am only interested in intersections that will occur with a few hundred kilometers so I do not need every possible solution. I have no idea where to begin.

    Read the article

  • get average from set of objects in django

    - by dotty
    Hay, i have a simple rating system for a property. You give it a mark out of 5 (stars). The models are defined like this def Property(models.Model) # stuff here def Rating(models.Model) property = models.ForeignKey(Property) stars = models.IntegerField() What i want to do is get a property, find all the Rating objects, collect them, then get the average 'stars' from them. any ideas how to do this?

    Read the article

  • new and delete container Dlls

    - by ahmed-zeb
    I want to hook new and delete operators. But I am unable to locate the original DLLs where these operators reside. I used msvcr90.dll, msvsr90d.dll, msvcrt.dll, kernal32.dll, ole32.dll and some more dlls as well. But my spying application is unable to locate new and delete operators. Kindly if someone could tell me in which DLL new and delete operators are defined.

    Read the article

  • How can you make an emacs macro wait for cscope query results?

    - by Sudhanshu
    I am trying to write a macro which calls cscope-find-functions-calling-this-function on each and every tag in a file displayed in the *Tags List* buffer (created by list-tags command). This should create a buffer which contains list of all functions calling a set of functions defined in a certain file. This is the sequence of keystrokes: 1. <f11> ;; cscope-find-functions-calling-this-function 2. RET ;; newline [shows results of cscope in a split window] 3. C-x C-p ;; mark-page 4. C-x C-x ;; icicle-exchange-point-and-mark 5. <up> ;; previous-line 6. <end> ;; end-of-line [region to copy has been marked] 7. <f7> ;; append-results-to-buffer 8. C-x ESC O ;; [move back to split window on the right] 9. C-x b ;; icicle-buffer [Switch back to *Tags List* buffer] 10. *Tags ;; self-insert-command * 5 11. SPC ;; self-insert-command 12. List* ;; self-insert-command * 5 13. RET ;; newline 14 . <down> ;; next-line [Position point on next tag in the list] Problem: I get no results in the buffer, and I found out that's because Step 3-7 execute even before cscope prints the results of query made on Steps 1-2. I can insert a pause in the macro by using C-x q, but I'd rather like the macro to wait after Step 2, until cscope has returned with the results and only then continue further. I suspect this is not possible through a macro, maybe a LISP function... I'm not a lisp expert myself. Can someone please help? Thanks! Details: I have Icicles installed so by default I get word at point in current buffer as input in minibuffer. F11 is bound to cscope-find-functions-calling-this-function windmove is installed and C-x (C-x ESC o - as shown below) takes you to the right window. F7 is bound to append-results-to-buffer which is defined as: (defun append-results-to-buffer () (interactive) (append-to-buffer (get-buffer-create "c1") (point) (mark))) This function just appends the currently marked region to a buffer named "c1".

    Read the article

  • Looking for marg_setValue in UIKit

    - by John Smith
    I am trying to compile a library originally written for Cocoa. Things are good until it looks for the function marg_setValue(). It says it can't find it. I have googled and found it is defined in How can I use this file in cocoa-touch? Or does cocoa-touch not support runtime.

    Read the article

  • C# - calling ext. DLL function containing Delphi "variant record" parameter

    - by CaldonCZE
    Hello, In external (Delphi-created) DLL I've got the following function that I need to call from C# application. function ReadMsg(handle: longword; var Msg: TRxMsg): longword; stdcall; external 'MyDll.dll' name 'ReadMsg'; The "TRxMsg" type is variant record, defined as follows: TRxMsg = record case TypeMsg: byte of 1: (accept, mask: longword); 2: (SN: string[6]); 3: (rx_rate, tx_rate: word); 4: (rx_status, tx_status, ctl0, ctl1, rflg: byte); end; In order to call the function from C#, I declared auxiliary structure "my9Bytes" containing array of bytes and defined that it should be marshalled as 9 bytes long array (which is exactly the size of the Delphi record). private struct my9Bytes { [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 9)] public byte[] data; } Then I declared the imported "ReadMsg" function, using the "my9bytes" struct. [DllImport("MyDll.dll")] private static extern uint ReadMsg(uint handle, ref my9Bytes myMsg); I can call the function with no problem... Then I need to create structure corresponding to the original "TRxMsg" variant record and convert my auxiliary "myMsg" array into this structure. I don't know any C# equivalent of Delphi variant array, so I used inheritance and created the following classes. public abstract class TRxMsg { public byte typeMsg; } public class TRxMsgAcceptMask:TRxMsg { public uint accept, mask; //... } public class TRxMsgSN:TRxMsg { public string SN; //... } public class TRxMsgMRate:TRxMsg { public ushort rx_rate, tx_rate; //... } public class TRxMsgStatus:TRxMsg { public byte rx_status, tx_status, ctl0, ctl1, rflg; //... } Finally I create the appropriate object and initialize it with values manually converted from "myMsg" array (I used BitConverter for this). This does work fine, this solution seems to me a little too complicated, and that it should be possible to do this somehow more directly, without the auxiliary "my9bytes" structures or the inheritance and manual converting of individual values. So I'd like to ask you for a suggestions for the best way to do this. Thanks a lot!

    Read the article

  • How do I open iPhone camera and restrict to a frame?

    - by Thomas
    Hello All: I'd like to know how to open the camera inside of a pre-defined frame (not the entire screen). When the view loads, I have a box, and inside it, I want to display what the camera sees. I don't want to snap a picture, just basically use the camera as a viewfinder. I have searched this site and have not yet found what I'm looking for. Please help. Thanks! Thomas

    Read the article

  • Linq DateTime expressions wont compare if only one is nullable

    - by tigermain
    I have been getting the following exception: The binary operator GreaterThanOrEqual is not defined for the types 'System.Nullable`1[System.DateTime]' and 'System.DateTime'. I am getting the left hand expression from a class property which is a nullable datetime variable and my right hand side is using Expression.Constant(new Nullable<DateTime>(DateTime.Now)) However I still get the above exception despite explicitly setting the right hand expression to a nullable type

    Read the article

  • Use reflection to get a list of static classes

    - by Christian
    Hi, many questions are close, but none answers my problem... How do I use reflection in C# 3.5 to get all classes which are static from an assembly. I already get all Types defined, but there is no IsStatic property. Counting 0 constructors is really slow and did not work either. Any tips or a line of code? :-) Chris

    Read the article

  • Specify debug/release build in qt

    - by Royi Freifeld
    I would like Qt Creator to build the project according to the type I specify in the little computer button. Using: CONFIG(debug, debug|release) { DESTDIR = Debug OBJECTS_DIR = Debug/.obj MOC_DIR = Debug/.moc RCC_DIR = Debug/.rcc UI_DIR = Debug/.ui } CONFIG(release, debug|release) { DESTDIR = Release OBJECTS_DIR = Release/.obj MOC_DIR = Release/.moc RCC_DIR = Release/.rcc UI_DIR = Release/.ui } Or, using the answer from here, makes qmake chose the last time a variable was defined. How do I set it? Thnx P.S I don't know if it has something to do with my problem, but I'm using Ubuntu and not Windows

    Read the article

< Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >