Search Results

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

Page 94/144 | < Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >

  • How can I create a collection of references in C#

    - by Jonathan Kaufman
    Ok I am having a cross language hiccup. In C# with it's great collections like List and I have: a Map class with properties of: List<byte[]> Images; List<Tile> Tiles; a Tile Class of: byte[] ImageData; int X; int Y; Now I want to add an image to the Map class and have the ImageData property of the Tile Classes to "reference" it. I have discovered I can't just assign it Images[0]. You can't have a reference to an object of a List. My fix was to create a Dictionary. Is this the best way or can I somehow have a "pointer" to a collection of objects?

    Read the article

  • What was that tutorial on pointers?

    - by pecker
    Hello, I once read a tutorial/article on Pointers somewhere. It was not a general tutorial but it explained how to clearly understand the complex & confusing pointers (especially like the ones that are usually asked in interview). It was more like http://www.codeweblog.com/right-left-rule-complex-pointer-analysis/ I'm unable to find it. Could any one post it here. PS: I did tried to google it but couldn't find. I'm asking it here because I thought it was popular.

    Read the article

  • Unable to create unmanaged object using new keyword in managed C++

    - by chair79
    Hi all, I've created a class with a boost::unordered_map as a member, Linkage.h #ifndef LINKAGE_H #define LINKAGE_H #include <boost/unordered_map.hpp> class Linkage { private: boost::unordered_map<int, int> m_IOMap; public: .... }; Linkage.cpp #include "stdafx.h" ... // methods and in the managed side of C++, I try to create the pointer of the obj: private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { Linkage* m_pLink = new Linkage(); ..... } However this produces errors: Error 4 error LNK2005: "private: static unsigned int const boost::detail::type_with_alignment_imp<4>::found" (?found@?$type_with_alignment_imp@$03@detail@boost@@$$Q0IB) already defined in Proj_Test.obj Linkage.obj ..... Error 7 fatal error LNK1169: one or more multiply defined symbols found Could anyone explain to me pls? Thanks.

    Read the article

  • How to debug macruby?

    - by Dan
    Hi, I've encountered an inconsistent bug with MacRuby and have no idea how to go about debugging this. If anyone could help would be great. I don't know if this is due to my own code or is it a bug in the MacRuby framework. I have a feeling it's my own code, something about over-retaining a piece of memory and hence the garbage collection failed. This is the error from Xcode. Thanks. CSV Wizard(30245,0x7fff704f7ca0) malloc: resurrection error for object 0x20199da20 while assigning {conservative-block}[196608](0x302360060)[117616] = Array[64](0x20199da20) garbage pointer stored into reachable memory, break on auto_zone_resurrection_error to debug CSV Wizard(30245,0x103781000) malloc: garbage block 0x20199da20(Array[64]) was over-retained during finalization, refcount = 1 This could be an unbalanced CFRetain(), or CFRetain() balanced with -release. Break on auto_zone_resurrection_error() to debug. CSV Wizard(30245,0x103781000) malloc: fatal resurrection error for garbage block 0x20199da20(Array[64]): over-retained during finalization, refcount = 1

    Read the article

  • How to unmangle exported symbols from C++ in dynamic libraries in XCode on OSX

    - by Gerald
    I've been trying to develop a dynamic library in C++ that can be run-time loaded in an application. I finally got it working, but it's a little ugly. I have a function that takes a pointer to a C++ class as an argument, which looks like this: bool registerGrindPlugin( Grind::PluginManager* mgr ); But of course it's being exported as: _Z19registerGrindPluginPN5Grind13PluginManagerE I tried a .c file with a simple function and it exported fine as "registerGrindPlugin", but of course I can't pass a C++ class as the argument that way. Soo... my question is, is there a way to unmangle or alias the exported symbol so that I don't have to use a monstrosity like Z19registerGrindPluginPN5Grind13PluginManagerE in my dlsym call? I did see something about -alias_list as a linker option, but I haven't quite figured out how to use it in XCode. If that is the solution, can somebody provide some more details on how to use this?

    Read the article

  • C++ Memory Allocation & Linked List Implementation

    - by pws5068
    I'm writing software to simulate the "first-fit" memory allocation schema. Basically, I allocate a large X megabyte chunk of memory and subdivide it into blocks when chunks are requested according to the schema. I'm using a linked list called "node" as a header for each block of memory (so that we can find the next block without tediously looping through every address value. head_ptr = (char*) malloc(total_size + sizeof(node)); if(head_ptr == NULL) return -1; // Malloc Error .. :-( node* head_node = new node; // Build block header head_node->next = NULL; head_node->previous = NULL; // Header points to next block (which doesn't exist yet) memset(head_ptr,head_node, sizeof(node)); ` But this last line returns: error: invalid conversion from 'node*' to 'int' I understand why this is invalid.. but how can I place my node into the pointer location of my newly allocated memory?

    Read the article

  • 2 Classes need each other declared C++

    - by Prodigga
    I have a "Game" class which holds all the games settings and manages the game. I have a "Grid" class which is the grid the game is played on. The "Game" class initializes a "Grid" object as one of its members (passing itself ("this") as one of the parameters for "Grid"s constructor).. The "Grid" object therefor needs to deal with a "Game*" pointer. To do this it needs to know what "Game" is; i need to declare it before "Grid". But "Game" uses "Grid"...so it also needs "Grid" declared before it. so confused on how to include headers/etc correctly here..

    Read the article

  • Django sys.path.append for project *and* app needed under WSGI

    - by GerardJP
    Hi all, Could somebody give me a pointer on why I need to add my project root path to the python path as well as the application itself in my WSGI file? Project base is called 'djapp', the application is called 'myapp'. sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..') sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../djapp') os.environ['DJANGO_SETTINGS_MODULE'] = 'djapp.settings' If I omit the line with "/../djapp/" the log tells my that 'myapp' can not be imported, even though 'djapp.settings' is. (validating 'djapp' was imported) It al runs properly with the ./manage.py command. there's a __init__ in the project folder. For testings sake, I see the same issue using addsitedir: site.addsitedir('/home/user/web/project/') site.addsitedir('/home/user/web/project/djapp') Thanx a lot. Gerard.

    Read the article

  • ASP.NET MVC, JSON & non JavaScript clients

    - by redsquare
    I need to ensure that an application I am developing is accessable and also works with JavaScript turned off. I just need a pointer to assist with the following. I had 3 'chained' select boxes and I wanted JavaScript enabled clients to have a nice Ajax experience. I can easily write the required functionality to populate the chained boxes on the change event of the preceeding select using jQuery and JSON with a WCF service. However what about the non JavaScript client? Would I wrap a submit next to the select and place these inside their own form to post back with a certain action or different querstring parameter? Can the same controller give me a partial JSON response as well as feeding the full HTML response. Can anyone point me to a good demo that utilises both JSON and normal HTTP posts to produce the same result in ASP.NET MVC. All ASP.NET MVC demo/examples I see forget about the non JavaScript enabled client.

    Read the article

  • Jquery toggle should expand after Page reload

    - by James123
    I wrote below code for Collapse/Expand some section. It is working fine. Finally If I click "Save" button and I am re-loading page again in asp.net. So then sections are going default Colleapse again. I need them back to expand. How can I do that? $(function() { $('tr.subCategory') .css("cursor", "pointer") .attr("title", "Click to expand/collapse") .click(function() { $(this).siblings('.RegText-' + this.id).toggle(); }); $('tr[@class^=RegText-]').hide().children('td'); })

    Read the article

  • Advanced LINQ Update Statement

    - by user1902490
    I have a data base with Price_old like: Date --- Hour --- Price _____________________________ Jan 1 --- 1 --- $3.0 Jan 1 --- 2 --- $3.1 Jan 1 --- 3 --- $3.3 Jan 1 --- 4 --- $3.15 Jan 2 --- 1 --- $2.95 Jan 2 --- 2 --- $3.2 Jan 2 --- 3 --- $3.05 What I then have is a spreadsheet, with the same structure, that I will be reading into a datatable, I'll call the new datatable Price_New, note that price new may not have all the same date/hours as Price_Old So, I end up with 2 datatables, Price_Old, and Price_New, and what I need to do is update Price_old with the new prices in Price_New, and then commit those new prices to the Database. I am kinda new to LINQ (about 30 mins of experience) and would really appreciate if someone could give me a pointer or two on whether or not this is doing in LINQ and what the best method would be. Thanks

    Read the article

  • Socket programming question

    - by dfddf
    I am given the following declaration: char inbuff[500], *ptr; int n, bufferlen; Write a program segement to receive a message having 500 bits from the TCP socket sock and store this message in inbuff. My answer is: n = recv( sock, inbuff, strlen( inbuff ), 0 ); However, I am not sure why *ptr is given in the declaration. So, I would like ask, what is the purpose of the pointer in this question?? Or my program segement is wrong? Thank you for all of yours help first!

    Read the article

  • A question on vectors, pointers and iterators

    - by xbonez
    Guys, I have a midterm examination tomorrow, and I was looking over the sample paper, and I'm not sure about this question. Any help would be appreciated. Let v be a vector<Thingie*>, so that each element v[i] contains a pointer to a Thingie. If p is a vector<Thingie*>::iterator, answer the following questions: what type is p? what type is *p? what code provides the address of the actual Thingie? what code provides the actual Thingie?

    Read the article

  • When to pass by value?

    - by Dervin Thunk
    Dear all. I was wondering if there are examples of situations where you would purposefully pass an argument by value in C. Let me rephrase. When do you purposefully use C's pass-by-value for large objects? Or, when do you care that the object argument is fully copied in a local variable? EDIT: Now that I think about it, if you can avoid pointers, then do. Nowadays, "deep" copying is possible for mostly everything in small apps, and shallow copying is more prone to pointer bugs. Maybe.

    Read the article

  • How to signal a buffer full state between posix threads

    - by mikip
    Hi I have two threads, the main thread 'A' is responsible for message handling between a number of processes. When thread A gets a buffer full message, it should inform thread B and pass a pointer to the buffer which thread B will then process. When thread B has finished it should inform thread A that it has finished. How do I go about implementing this using posix threads using C on linux. I have looked at conditional variables, is this the way to go? . I'm not experienced in multi threaded programming and would like some advice on the best avenue to take. Thanks

    Read the article

  • jQuery li:has(ul) selector issue

    - by sushil bharwani
    I was creating a tree using UL LI list and jQuery. I used a jQuery Selector jQuery(li:has(ul)) to find all the list nodes having childs and then added a click event to it. jQuery(li:has(ul)).click(function(event) { jQuery(this).children.toggle(); jQuery(this).css("cursor","hand"); }); This works for me except i dont understand why i get a cursor hand and click event triggering even when i take mouse pointer to childs of my selected li <li> Parent // it works here that is fine <ul> <li> child1 // it works here i dont understand need explanation </li> <li> child2 // it works here i dont understand need explanation </li> </ul> </li>

    Read the article

  • which lightweight SQL Server type could I use on my Dev machine for a C# VS2010 project?

    - by Greg
    Hi, Which lightweight SQL Server type could I use on my Dev machine for a C# VS2010 project? (e.g. sql server express, sql server ce, full version etc). That is, I'm running on a VMWare fusion instance on my MacBook, and just want something to develop against for a C# VS2010 project. I'm planning on having a simple database (not many tables) but will use Entity Framework. I haven't used SQL Server before so a quick pointer re what is the best database admin interface/app to use for the version you recommend (e.g. to create database, tables etc).

    Read the article

  • correct way to store an exception in a variable

    - by Evan Teran
    I have an API which internally has some exceptions for error reporting. The basic structure is that it has a root exception object which inherits from std::exception, then it will throw some subclass of that. Since catching an exception thrown in one library and catching it in another can lead to undefined behavior (at least Qt complains about it and disallows it in many contexts). I would like to wrap the library calls in functions which will return a status code, and if an exception occurred, a copy of the exception object. What is the best way to store an exception (with it's polymorphic behavior) for later use? I believe that the c++0x futures API makes use of something like this. So what is the best approach? The best I can think of is to have a clone() method in each exception class which will return a pointer to an exception of the same type. But that's not very generic and doesn't deal with standard exceptions at all. Any thoughts?

    Read the article

  • can't click on input element behind div element

    - by Preston
    On my site: http://alsite.com.br/solalev/ I have some elements on the bottom of page that I can't click through. Above the elements is a div called push.. I use this div to make the footer always stay on the bottom of my page even when the content is smaller... (I dont know if I do this right.. but it has worked).. So.. on Chrome and Firefox I can't click.. but on IE this works.... I use this: .push{ pointer-events: none; } but nothing happens...

    Read the article

  • how to open many files simultaneously for reading in c

    - by monkeyking
    I'm trying to port some of my c++ code into c. I have the following construct class reader{ private: FILE *fp; alot_of_data data;//updated by read_until() method public: reader(const char*filename) read_until(some conditional dependent on the contents of the file, and the arg supplied) } Im then instantiating hundreds of these object and iterate over them using several 'read_until()' for each file until allfiles is at eof. I'm failing to see any clever way to do this in c, the only solution I can come up with is making an array of FILE pointers, and do the same with all the private member data from my class. But this seems very messy, can I implement the functionality of my class as a function pointer, or anything better, I think I'm missing a fundamental design pattern? The files are way to big to have all in memory, so reading everything from every file is not feasible Thanks

    Read the article

  • STL map containing references does not compile

    - by MTsoul
    The following: std::map<int, ClassA &> test; gives: error C2101: '&' on constant While the following std::map<ClassA &, int> test; gives error C2528: '_First' : pointer to reference is illegal The latter seems like map cannot contain a reference for the key value, since it needs to instantiate the class sometimes and a reference cannot be instantiated without an object. But why does the first case not work?

    Read the article

  • use callback function to report stack backtrace

    - by user353394
    Assume I have the following: typedef struct { char *name; char binding; int address; } Fn_Symbol //definition of function symbol static Fn_Symbol *fnSymbols; //array of function symbols in a file statc int total; //number of symbol functions in the array and file static void PrintBacktrace(int sigum, siginfo_t * siginfo, void *context) { printf("\nSignal received %d (%s)\n", signum, strsignal(signum)); const int eip_index = 14; void *eip = (void *)((struct ucontext *)context)->uc_mcontext.gregs[eip_index]; printf("Error at [%p] %s (+0x%x), eip, fnName, offset from start); //????? exit(0); } I have this so far, but what is the best way using the fnSymbols static global pointer to identify the function where the error occured and then back trace through the stack to identify each calling function by address, name, and offset?

    Read the article

  • Determining a location's side of the road position with MapKit

    - by idStar
    Is there a way to use MapKit in iOS7 to not only get geocoding for an address, but determine what side of the road it is on? I'm not trying to build a full function navigation app, but similar to navigation apps that tell you things like "Your destination is in 100 feet on the right", I'd like to be able to obtain this information. Does MapKit give one a way to do this? Do I need to adopt routing privileges to access such, or is this just not available in the SDK period? If not available in the iOS7 SDK, knowing what options exist as services, would be a helpful pointer.

    Read the article

  • How do I draw an arrow on a histogram drawn using ggplot2?

    - by jon
    Here is dataset: set.seed(123) myd <- data.frame (class = rep(1:4, each = 100), yvar = rnorm(400, 50,30)) require(ggplot2) m <- ggplot(myd, aes(x = yvar)) p <- m + geom_histogram(colour = "grey40", fill = "grey40", binwidth = 10) + facet_wrap(~class) + theme_bw( ) p + opts(panel.margin=unit(0 ,"lines")) I want to add labels to bars which each subject class fall into and produce something like the post-powerpoint processed graph. Is there way to do this within R ? ...... Edit: we can think of different pointer such as dot or error bar, if arrow is not impossible Let's say the following is subjects to be labelled: class name yvar 2 subject4 104.0 3 subject3 8.5 3 subject1 80.0 4 subject2 40.0 4 subject1 115.0 classd <- data.frame (class = c(2,3,3,4,4), name = c ("subject4", "subject3", "subject1", "subject2", "subject1"), yvar = c(104.0, 8.5,80.0,40.0, 115.0))

    Read the article

  • JQuery Autocomplete - Stop mouseover+Return submitting data

    - by ILT
    I'm using JQuery Autocomplete (bassistance) and have run into a problem. If the mouse rolls over one of the autocomplete suggestions and the user hits the return key (rather than clicking to make selection), the form is submitted and goes to whatever link was rolled over at the time. This is a problem as people click in the textbox, and when typing their search, leave the pointer where the autocomplete popup appears. So when they hit enter, it doesn't do the search for whatever they typed in the box but whatever was highlighted in the autocomplete suggestions. Is there a way to stop this? Using Google as the functionality I'm after... So just to clarify - I want selections via mouse and keyboard to go to the same place, but if the UP or DOWN arrow has not been pressed (user not selected an autocomplete option via the keyword), dont go to the URL specified in the autosuggest - instead submit the form (traditional method without JQuery) based on what has been typed in the textbox. I hope I'm explaining this clearly? :S

    Read the article

< Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >