Search Results

Search found 3592 results on 144 pages for 'pointer'.

Page 99/144 | < Previous Page | 95 96 97 98 99 100 101 102 103 104 105 106  | Next Page >

  • "Cannot use fixed local inside lambda expression"

    - by JulianR
    I have an XNA 3.0 project that compiled just fine in VS2008, but that gives compile errors in VS2010 (with XNA 4.0 CTP). The error: Cannot use fixed local 'depthPtr' inside an anonymous method, lambda expression, or query expression depthPtr is a fixed float* into an array, that is used inside a Parallel.For lambda expression from System.Threading. As I said, this compiled and ran just fine on VS2008, but it does not on VS2010, even when targeting .NET 3.5. Has this changed in .NET 4.0, and even so, shouldn't it still compile when I choose .NET 3.5 as the target framework? Searching for the term "Cannot use fixed local" yields exactly one (useless) result, both in Google and Bing. If this has changed, what is the reason for this? I can imagine capturing a fixed pointer-type in a closure could get a bit weird, is that why? So I'm guessing this is bad practice? And before anyone asks: no, the use of pointers is not absolutely critical here. I would still like to know though :)

    Read the article

  • Get path to a file via flash

    - by jeffkolez
    I'm not a flash dev, but I'm turning to it to try and meet a requirement. I'm to allow a user to select a file on their computer, then pass it to my web application. I know it's not possible to do this using Javascript, hence wanting to use flash. First, is this possible? Second, can I get a pointer on how its done? To clarify: I'm just looking for the path to the file. I don't want to upload it.

    Read the article

  • c++ Array passing dilemma

    - by Thomas
    Hi, I am writing a function that takes a string, string pointer and an int. The function splits the string based on a set of rules and puts each token into an array. I need to return the array out of the function with the number of elements in the int variable etc. I am stuck as to how I return the array as I can not use auto other wise it is destroyed and I am reluctant to use new as I feel this is patchy. I have other ideas on how to go about this but would like to see how other people go about this first. I could also be wrong and it could be possible to pass an auto out of an array. I can also not use vectors so there goes a copy constructor.

    Read the article

  • Symfony 1.3: different form filters generated

    - by user248959
    Hi, i have this class in rs1/lib/filter/doctrine/FelizFormFilter.class.php <?php /** * Feliz filter form. * * @package rs * @subpackage filter * @author Your name here * @version SVN: $Id: sfDoctrineFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ */ class FelizFormFilter extends BaseFelizFormFilter { public function configure() { } } and this in rs2/lib/filter/doctrine/FelizFormFilter.class.php <?php /** * Feliz filter form. * * @package filters * @subpackage Feliz * * @version SVN: $Id: sfDoctrineFormFilterTemplate.php 11675 2008-09-19 15:21:38Z fabien $ */ class FelizFormFilter extends BaseFelizFormFilter { public function configure() { } } Both were generated using "php symfony doctrine:build --all --and-load" and the version of symfony is 1.3.4 in both. This is the schema of both cases: Feliz: columns: name: string(20) Could you tell me why are different? One more thing in Eclipse: when i go with the mouse pointer to the word "BaseFelizFormFilter", in the second case (rs2) the yellow window with the information about the class is showed, but in the first case that yellow popup is not showed. Why? Javi

    Read the article

  • How can i use listDictionary?

    - by Phsika
    i can fill my listdictinary but, if running error returns to me in " foreach (string ky in ld.Keys)"(invalid operation Exception was unhandled) Error Detail : After creating a pointer to the list of sample collection has been changed. C# ListDictionary ld = new ListDictionary(); foreach (DataColumn dc in dTable.Columns) { MessageBox.Show(dTable.Rows[0][dc].ToString()); ld.Add(dc.ColumnName, dTable.Rows[0][dc].ToString()); } foreach (string ky in ld.Keys) if (int.TryParse(ld[ky].ToString(), out QuantityInt)) ld[ky] = "integer"; else if(double.TryParse(ld[ky].ToString(), out QuantityDouble)) ld[ky]="double"; else ld[ky]="nvarchar";

    Read the article

  • When is C++ covariance the best solution?

    - by Neil Butterworth
    This question was asked here a few hours ago and made me realise that I have never actually used covariant return types in my own code. For those not sure what covariance is, it's allowing the return type of (typically) virtual functions to differ provided the types are part of the same inheritance hierarchy. For example: struct A { virtual ~A(); virtual A * f(); ... }; struct B : public A { virtual B * f(); ... }; The different return types of the two f() functions are said to be covariant. Older versions of C++ required the return types to be the same, so B would have to look like: struct B : public A { virtual A * f(); ... }; So, my question: Does anyone have a real-world example where covariant return types of virtual functions are required, or produce a superior solution to simply returning a base pointer or reference?

    Read the article

  • How to save/export a DOM element to an image?

    - by Don Don
    Hi, I have a web page which has a form element (with its ID known) and inside the form there are multiple DIVs, and the position of each div may be changed. What I'd like to do is: a) Save the current state of this form // var currentForm=document.forms['myFrm'].innerHTML; would probably suffice... b) Save or export the entire form with the most current position of each DIV to an image file. // how to save/export the javascript var of currentForm to an image file is the key question. Any help/pointer would be appreciated.

    Read the article

  • C++: How to use types that have not been defined?

    - by Jen
    C++ requires all types to be defined before they can be used, which makes it important to include header files in the right order. Fine. But what about my situation: Bunny.h: class Bunny { ... private: Reference<Bunny> parent; } The compiler complains, because technically Bunny has not been completely defined at the point where I use it in its own class definition. This is not sufficient: class Bunny; class Bunny { ... private: Reference<Bunny> parent; } Apart from re-writing my template class Reference so it takes a pointer type (in which case I can use the forward declaration of Bunny), I don't know how to solve this. Any suggestions?

    Read the article

  • Is it possible to change the border color of the strip wrapper from the jQuery plugin GalleryView?

    - by janoChen
    I found a very nice jquery plugin: http://spaceforaname.com/gallery-light.html I want to change the border color of the strip wrapper (default is white) position: absolute; z-index: 1000; cursor: pointer; top: 304px; left: 74px; height: 98px; width: 98px; border: 2px solid white; The problem is that the border color seems to be generated via javascript any suggestions?

    Read the article

  • C# Drag and Drop Effect with Overlay/Opaque Image

    - by CallMeLaNN
    Hi, I think this would be simple question and should be asked in the pas few years but unable to google around and dont know if there is a specific keyword. In c# WinForm I want to do drag and drop but I dont want the image of DragDropEffects Move, Copy or whatever. I want to display an image with half opaque. Just like Firefox when dragging an image, you would see the image folowing the mouse pointer like a ghost :) I already Implement DoDragDrop, DragEnter and DragDrop events. I just want to customize the dragging effects with overlay image.

    Read the article

  • Constructing a function call in C

    - by 0x6adb015
    Given that I have a pointer to a function (provided by dlsym() for example) and a linked list of typed arguments, how can I construct a C function call with those arguments? Example: struct param { enum type { INT32, INT64, STRING, BOOL } type; union { int i32; long long i64; char *str; bool b; } value; struct param *next; }; int call_this(int (*function)(), struct param *args) { int result; /* magic here that calls function(), which has a prototype of f(int, long long, char *, bool); , when args consist of a linked list of INT32, INT64, STRING, BOOL types. */ return result; } The OS is Linux. I would like the solution to be portable across MIPS, PPC and x86 (all 32 bits) architecture, using GCC as the compiler. Thanks!

    Read the article

  • How is inheritance implemented at the memory level?

    - by cambr
    Suppose I have class A { public: void print(){cout<<"A"; }}; class B: public A { public: void print(){cout<<"B"; }}; class C: public C { }; How is inheritance implemented at the memory level? Does C copy print() code to itself or does it have a pointer to the it that points somewhere in A part of the code? How does the same thing happen when we override the previous definition, for example in B (at the memory level)?

    Read the article

  • What elegant method callback design should be used ?

    - by ereOn
    Hi, I'm surprised this question wasn't asked before on SO (well, at least I couldn't find it). Have you ever designed a method-callback pattern (something like a "pointer" to a class method) in C++ and, if so, how did you do it ? I know a method is just a regular function with some hidden this parameter to serve as a context and I have a pretty simple design in mind. However, since things are often more complex than they seem to, I wonder how our C++ gurus would implement this, preferably in an elegant and standard way. All suggestions are welcome !

    Read the article

  • Looking at the C++ new[] cookie. How portable is this code?

    - by carleeto
    I came up with this as a quick solution to a debugging problem - I have the pointer variable and its type, I know it points to an array of objects allocated on the heap, but I don't know how many. So I wrote this function to look at the cookie that stores the number of bytes when memory is allocated on the heap. template< typename T > int num_allocated_items( T *p ) { return *((int*)p-4)/sizeof(T); } //test #include <iostream> int main( int argc, char *argv[] ) { using std::cout; using std::endl; typedef long double testtype; testtype *p = new testtype[ 45 ]; //prints 45 std::cout<<"num allocated = "<<num_allocated_items<testtype>(p)<<std::endl; delete[] p; return 0; } I'd like to know just how portable this code is.

    Read the article

  • NULL In a Class Destructor

    - by Hyper-DarkStar
    Simple question; Is it pointless to set a pointer( which allocates heap memory ) to NULL in the destructor? class SampleClass { public: SampleClass( int Init = 0 ) { Value = new int( Init ); } ~SampleClass( void ) { delete Value; Value = NULL; // Is this pointless? } int *Value; }; While on the subject of classes, when should I use the explicit keyword? Thanks.

    Read the article

  • How to create an image from canvas data?

    - by Jakub Hampl
    In my application I am trying to save an arbitrary part of a rendered HTML canvas to an image file. In my Javascript I call ctx.getImageData(x, y, w, h) and pass the resulting object to my macruby code (though if you know a solution in objc I am also very interested). There I'm trying to create a NSBitmapImageRep object so that I can then save to an image format the user desires. This is my code so far (the function gets a WebScriptObject as it's argument): def setimagedata(d) w = d.valueForKey("width").to_i h = d.valueForKey("height").to_i data = Pointer.new(:char, d.valueForKey("data").valueForKey("length").to_i) d.valueForKey("data").valueForKey("length").to_i.times do |i| data[i] = d.valueForKey("data").webScriptValueAtIndex(i).to_i end puts "data complete" # get's called @exported_image = NSBitmapImageRep.alloc.initWithBitmapDataPlanes(data, pixelsWide: w, pixelsHigh:h, bitsPerSample: 32, samplesPerPixel: 4, hasAlpha: true, isPlanar: false, colorSpaceName: NSCalibratedRGBColorSpace, bitmapFormat: NSAlphaNonpremultipliedBitmapFormat, bytesPerRow: 0, bitsPerPixel: 0) puts "done" # doesn't get called end The code doesn't seem to get through the initWithBitmapDataPlanes function but gives no error. My question is: what am I doing wrong? Is this approach reasonable (if not, what would be better?).

    Read the article

  • What is on the 68000 stack when classic MacOS enters a program?

    - by John Källén
    I'm trying to understand an old classic Mac application's entry point. I've disassembled the first CODE resource (not CODE#0, which is the jump table). The code refers to some variables off the stack: a word at 0004(A7), an array of long words of starting at 000C(A7) whose length is the value at 0004(A7), and a final long word beyond that array that seems to be a pointer to a character string. The array of long words looks like strings at first glance, so it looks superficially like we're dealing with an (int argc, char ** argv) situation, except the "argv" array is inline in the stack frame. What should a program be expecting on its stack / registers when it first gets called by the Mac OS?

    Read the article

  • Openning an App on click of link in email in android?

    - by Amit
    I have a strange requirement for my project.. Suppose I have an app say XYZ installed in an android phone and than I receive an email from the mail server which contains a link like http://XYZ.com/?params(i.e. X=1&Y=2&Z=3) now on click of this link I want to open the XYZ app if it is installed in the phone and in the Activity I would like to get these parameters X,Y and Z and if the app is not installed user should be redirected to play store for downloading XYZ app and after installation app takes charge and behaves as if it was already installed (Opening the first activity with those parameters). How can I achieve that ? I have no idea where to start so even the smallest pointer in right direction will be of great help.

    Read the article

  • How to name variables which are structs

    - by evilpie
    Hello, i often work on private projects using the WinApi, and as you might know, it has thousands of named and typedefed structs like MEMORY_BASIC_INFORMATION. I will stick to this one in my question, what still is preferred, or better when you want to name a variable of this type. Is there some kind of style guide for this case? For example if i need that variable for the VirtualQueryEx function. Some ideas: MEMORY_BASIC_INFORMATION memoryBasicInformation; MEMORY_BASIC_INFORMATION memory_basic_information; Just use the name of the struct non capitalized and with or without the underlines. MEMORY_BASIC_INFORMATION basicInformation; MEMORY_BASIC_INFORMATION information; Short form? MEMORY_BASIC_INFORMATION mbi; I often see this style, using the abbreviation of the struct name. MEMORY_BASIC_INFORMATION buffer; VirtualQueryEx defines the third parameter lpBuffer (where you pass the pointer to the struct), so using this name might be an idea, too. Cheers

    Read the article

  • Is there a way to cause a new C++ class instance to fail, if certain conditions in the contructor ar

    - by Jim Fell
    As I understand it, when a new class is instantiated in C++, a pointer to the new class is returned, or NULL, if there is insufficient memory. I am writing a class that initializes a linked list in the constructor. If there is an error while initializing the list, I would like the class instantiator to return NULL. For example: MyClass * pRags = new MyClass; If the linked list in the MyClass constructor fails to initialize properly, I would like pRags to equal NULL. I know that I can use flags and additional checks to do this, but I would like to avoid that, if possible. Does anyone know of a way to do this? Thanks.

    Read the article

  • pass by reference but reference to data and not to variable

    - by dorelal
    This is psesudo code. In what programming language this is possible ? def lab(input) input = ['90'] end x = ['80'] lab(x) puts x #=> value of x has changed from ['80'] to ['90] I have written this in ruby but in ruby I get the final x value of 80 because ruby is pass-by-reference. However what is passed is the reference to the data held by x and not pointer to x itself same is true in JavaScript. So I am wondering if there is any programming language where the following is true.

    Read the article

  • const ready only local copies

    - by robUK
    Hello gcc 4.4.4 c89 I am just wondering is it worth passing a const into a function. i.e. void do_something(const char *dest, const int size) The size is a ready-only so I don't want to change it. However, some developers never have this as const has it is a local copy that is being used. The pointer is const as you can change the value in the calling routine. I always have a const on ready-only local copies, as it confirms to anyone reading my code that it is a ready-only variable. And also, when coding I don't make the mistake of changing it without realizing. Many thanks for any suggestions,

    Read the article

  • How does C++ free the memory when a constructor throws an exception and a custom new is used

    - by Joshua
    I see the following constructs: new X will free the memory if X constructor throws. operator new() can be overloaded. The canonical definition of an operator new overload is void *operator new(heap h) and the corrisponding operator delete. The most common operator new overload is pacement new, which is void *operator new(void *p) { return p; } You almost always cannot call delete on the pointer given to placement new. This leads to a single question. How is memory cleaned up when X constructor throws and an overloaded new is used?

    Read the article

  • Is there any reason for a blocking call to winsock send() function on Vista to return immediately ?

    - by ivymike
    Hi All, Is there any reason for a blocking call to winsock's send() function on Vista to return immediately ? It works with expected delay on XP and below. I'm wondering if this has got anything to do with auto-tuning feature of Vista. Code: char *pBuffer; // pointer to data int bytes; // total size int i = 0, j=0; while (i < bytes) { j = send(m_sock, pBuffer+i, bytes-i, 0); i+=j; } Thanks, Pavan

    Read the article

  • basename() returning int?

    - by EB
    Probably something stupid I'm missing but, why am I getting this warning? static void foo(char *path) { char *bname; char *path2 = strdup(path); bname = basename(path2); (line with basename() call): warning: assignment makes pointer from integer without a cast Indeed, if I change to this, the warning goes away: bname = (char *)basename(path2); man 3 basename tells me: char *basename(char *path); Both dirname() and basename() return pointers to null-terminated strings. What gives?

    Read the article

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