Search Results

Search found 9410 results on 377 pages for 'simulator difference'.

Page 277/377 | < Previous Page | 273 274 275 276 277 278 279 280 281 282 283 284  | Next Page >

  • Is there a way to intersect/diff a std::map and a std::set?

    - by Jack
    I'm wondering if there a way to intersect or make the differences between two structures defined as std::set<MyData*> and std::map<MyData*, MyValue> with standard algorithms (like std::set_intersect) The problem is that I need to compute the difference between the set and the keyset of the map but I would like to avoid reallocating it (since it's something that is done many times per second with large data structures). Is there a way to obtain a "key view" of the std::map? After all what I'm looking is to consider just the keys when doing the set operation so from an implementation point it should be possible but I haven't been able to find anything.

    Read the article

  • Operator & and * at function prototype in class

    - by Puyover
    I'm having a problem with a class like this: class Sprite { ... bool checkCollision(Sprite &spr); ... }; So, if I have that class, I can do this: ball.checkCollision(bar1); But if I change the class to this: class Sprite { ... bool checkCollision(Sprite* spr); ... }; I have to do this: ball.checkCollision(&bar1); So, what's the difference?? It's better a way instead other? Thank you.

    Read the article

  • Tag suggestion (not tag autocomplete)

    - by takeshin
    AJAX autocomplete is fairly simple to implement. However, I wonder how to handle smart tag suggestion like this on SO. To clarify the difference between autocomplete and suggestion: autocomplete: foo [foobar, foobaz] suggestion: foo [barfoo, foobar, foobaz], or even better, with 'did you mean' feature: [barfoo, foobar, foobaz, fobar, fobaz] I suppose I need some full text search in tags (all letters indexed, not just words). There would be no problem to do it witch regex or other patterns for limited number of tags (even client side). But how to implement this feature for big number of tags? Is there any particular reason (besides URL) the tags on SO are dash separated? What about Unicode characters in tags? I store the tags in the table with the following columns: id, tagname. My SQL query returns objects with following fields: id, tagname, count

    Read the article

  • Class member variables, methods and their state

    - by codeMonkey
    How should class member variables be used in combination with class methods? Let's say I have a class 'C' with a member variable 'someData'. I call C.getData(), which does not return a value but instead puts data in C.someData. The class that instantiated 'C' first calls C.getData and then uses the data by accessing the member variable C.someData. I call C.getData() in the class that instantiated 'C' which is a function that returns data. I myself prefer the second way. But it also depends on the situation and it's a small difference. Is it 'bad' to have class methods that depend on the classes internal state? What are the best conventions?

    Read the article

  • Few files out of sync but GIT doesn't seem to notice.

    - by doublejosh
    I have two repos that claim to be clean. One was originally cloned from the other and is used for dev work. There are a few files that I can see are not the same. However when I try pulling either way it says everything is up to date. How is this possible? Did that file miss a commit somehow? ...but shouldn't the difference be noticed regardless? Do I need a refresh of some sort?

    Read the article

  • How the websocket bi-directional concept work?

    - by GMsoF
    I think the main difference between websocket and http streaming (I am not refering to polling and long polling) is websocket allows bi-directional communication which is similar to usual raw socket programming. (above is my understanding, could be wrong, feel free to correct me.) My question is how the web client (browser) continue to send another request in the already-opened websocket? Usual http request will treat another request as new socket connection, but websocket does not, that is why I am confused, how it achieve that? It should be handled in Server side or Client (browser) side?

    Read the article

  • WOFF Fonts, what Are they and why should I care?

    - by CS
    So mozilla has proposed a new webfont, i'm not really into that world, but i want to keep myself up2date. So whats the great thing since even Microsoft is backing it, why should I as a webdev care? Whats the difference from the old ones? Do we need another font system? In what situations should i use WOFF? Why not just stick to the existing ones? Also a new tag called WOFF might be useful.

    Read the article

  • What are the differences between struct and class in C++

    - by palm3D
    This question was already asked in the context of C#/.Net. Now I'd like to learn the differences between a struct and a class in (unmanaged) C++. Please discuss the technical differences as well as reasons for choosing one or the other in OO design. I'll start with an obvious difference: If you don't specify public: or private:, members of a struct are public by default; members of a class are private by default. I'm sure there are other differences to be found in the obscure corners of the C++ specification.

    Read the article

  • What does "static" mean in the context of declaring global template functions?

    - by smf68
    I know what static means in the context of declaring global non-template functions (see e.g. What is a "static" function?), which is useful if you write a helper function in a header that is included from several different locations and want to avoid "duplicate definition" errors. So my question is: What does static mean in the context of declaring global template functions? Please note that I'm specifically asking about global, non-member template functions that do not belong to a class. In other words, what is the difference between the following two: template <typename T> void foo(T t) { /* implementation of foo here */ } template <typename T> static void bar(T t) { /* implementation of bar here */ }

    Read the article

  • Simple CArray questions

    - by Holli
    1.) What is the difference between CArray <SomeClass> collection; and CArray <SomeClass,SomeClass> collection; or even CArray <SomeClass* ,SomeClass* > collection; ? 2.) While reading some comments on Stackoverflow I came to a note saying "Don't use CArray". Why should CArray not be used?

    Read the article

  • Is there a way to optimise finding text items on a page (not regex)

    - by Jeepstone
    After seeing several threads rubbishing the regexp method of finding a term to match within an HTML document, I've used the Simple HTML DOM PHP parser (http://simplehtmldom.sourceforge.net/) to get the bits of text I'm after, but I want to know if my code is optimal. It feels like I'm looping too many times. Is there a way to optimise the following loop? //Get the HTML and look at the text nodes $html = str_get_html($buffer); //First we match the <body> tag as we don't want to change the <head> items foreach($html->find('body') as $body) { //Then we get the text nodes, rather than any HTML foreach($body->find('text') as $text) { //Then we match each term foreach ($terms as $term) { //Match to the terms within the text nodes $text->outertext = str_replace($term, '<span class="highlight">'.$term.'</span>', $text->outertext); } } } For example, would it make a difference to determine check if I have any matches before I start the loop maybe?

    Read the article

  • javascript: what are immediate functions used for [duplicate]

    - by tkoomzaaskz
    This question already has an answer here: Why using self executing function in JavaScript? [duplicate] 4 answers I've been programming in JS since some time, but I have never came upon a need of using immediate functions, for example: (function(){ console.log('hello, I am an immediate function'); }()) What would be the difference if I just wrote: console.log('hello, I am an immediate function'); ? I don't have any access to this function anyway (it is not assigned anywhere). I think (but I'm not sure) that I can implement everything without immediate functions - so why do people use it?

    Read the article

  • Performance when accessing class members

    - by Dr. Acula
    I'm writing something performance-critical and wanted to know if it could make a difference if I use: int test( int a, int b, int c ) { // Do millions of calculations with a, b, c } or class myStorage { public: int a, b, c; }; int test( myStorage values ) { // Do millions of calculations with values.a, values.b, values.c } Does this basically result in similar code? Is there an extra overhead of accessing the class members? I'm sure that this is clear to an expert in C++ so I won't try and write an unrealistic benchmark for it right now

    Read the article

  • Why is order important in moving from tab to tab programmatically (and new in 1.8.10

    - by Bruce
    Hi folks, Up until I updated to jquery-ui-1.8.10 (already using jQuery 1.5), the following code has worked as expected: case 'baseeditor': $('#tab1').html(responseText).fadeIn(500, function() { ... load the contents of the tab and stuff... }); $("#prolearn").tabs("select",1); break; case ... The tab is fueled and then focus is moved from tab0 (from where the ajax call is initiated) to tab1. Now, that code won't work, but this version does: case 'baseeditor': $("#prolearn").tabs("select",1); $('#tab1').html(responseText).fadeIn(500, function() { ... load the contents of the tab and stuff... }); break; case ... Can someone explain the difference - have I just been lucky getting away with my original version? Thanks/Bruce

    Read the article

  • How to generalize view?

    - by MexicanHacker
    Hey guys, I'm in the process of designing a set of views that use the same model in my app, the difference is that some views will differ in Read Only and Modifiable fields. So for example for view A I want to be able to modify A.One but no A.Two properties and for view B I want to have B.One and B.Two as modifiable fields. I was thinking in having a map that will hold this information and iterate both the modifiable and non-modifiable lists in a generic view, but I was thinking that maybe I can get feedback from you guys. What do you think?

    Read the article

  • Capture IP packets on Dialup connection - Windows 7

    - by Assaf Levy
    Our product utilizes (the wonderful) Winpcap to capture ip packets from all devices with an IP address and analyze them in real time. Unfortunately, we discovered that it does NOT capture any packets on dialup (e.g. PPP) connections on Windows 7, and that there are no near-term plans for enabling this (1). So we need something else. Microsoft Network Monitor and Windows Packet Filter are two options that surfaced during a bit of googling, but before delving into research I wanted to ask the experienced: what are out options, given the following requirements: Capture all in/outbound IP packets on the machine. Complete background processing - no UI should be involved. Support Windows Vista / 7. Performance (user should not feel the difference). Thanks in advance.

    Read the article

  • Executing ffmpeg from php running in apache

    - by foobar
    I was executing ffmpeg from php running inside apache. I used to get the error " error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory". It used to work perfectly if the php script was executed from the command prompt or ffpmeg was directly invoked from the command prompt. I followed the below steps to fix the apache error: Step 1: Check if the file “libavdevice.so.52? exists in the server using the following command. find / -name ‘libavdevice.so.*’ Step 2: You will get the directory in which the file “libavdevice.so.52? exists from the above command. Suppose the directory is “/usr/local/lib/” in this example. Step 3: You have to add the directory name in the file “/etc/ld.so.conf”. Step 4: Execute the command “ldconfig”. How did doing the above make a difference to apache?

    Read the article

  • C++ pointer to functions, Beginner Question...

    - by BobAlmond
    Hi all, I want to ask about pointer in C++ I have some simple code: int add(int a, int b){ return a+b; } int runner(int x,int y, int (*functocall)(int, int)){ return (*functocall)(x,y); } now, suppose I call those functions using this way : cout<<runner(2,5,&add); or maybe cout<<runner(2,5,add); is there any difference? because when I tried, the result is the same and with no error. Thanks a lot

    Read the article

  • Dynamic View Creation in Iphone?

    - by adusum
    Hi can any one please tell me how to create Dynamic views in iphone. And I want to know like what is difference between custom views and dynamic views in iphone. Acutally i went throught google but i didn't find any proper answer. And I have one more question is like can we create all the views manually in the coding iteslf like the one we create using a Interface bulder and save it as a .nib. how can it be done?can any one please explain me this. Thanks,

    Read the article

  • Unable to make WMI connection from XP Pro machine to another (not in domain, same workgroup) in C#

    - by JCCyC
    I have two XP Pro SP3 machines. I disabled the firewall in both. The workgroup name is WORKGROUP. I have an administrator account with identical username/password in both. My code to connect is the following: ConnectionOptions options = new ConnectionOptions(); options.Username = myUsername; options.Password = myPassword; options.Authority = "ntdlmdomain:WORKGROUP"; // Commenting this or not makes no difference ManagementScope scope = new ManagementScope(String.Format("\\\\{0}\\{1}", hostname, Namespace), options); scope.Connect(); I always get a System.UnauthorizedAccessException with the text: "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))" The above code works between two machines that are part of the same AD domain. What am I doing wrong?

    Read the article

  • In Python, is it better to use list comprehensions or for-each loops?

    - by froadie
    Which of the following is better to use and why? Method 1: for k, v in os.environ.items() print "%s=%s" % (k, v) Method 2: print "\n".join(["%s=%s" % (k, v) for k,v in os.environ.items()]) I tend to lead towards the first as more understandable, but that might just be because I'm new to Python and list comprehensions are still somewhat foreign to me. Is the second way considered more Pythonic? I'm assuming there's no performance difference, but I may be wrong. What would be the advantages and disadvantages of these 2 techniques? (Code taken from Dive into Python)

    Read the article

  • Are conditional subqueries optimized out, if the condition is false?

    - by Tobias Schulte
    I have a table foo and a table bar, where each foo might have a bar (and a bar might belong to multiple foos). Now I need to select all foos with a bar. My sql looks like this SELECT * FROM foo f WHERE [...] AND ($param IS NULL OR (SELECT ((COUNT(*))>0) FROM bar b WHERE f.bar = b.id)) with $param being replaced at runtime. The question is: Will the subquery be executed even if param is null, or will the dbms optimize the subquery out? We are using mysql, mssql and oracle. Is there a difference between these regarding the above?

    Read the article

  • Information stored in a cookie file

    - by jklmuk
    Thanks for you help in advance. I am trying to figure out the structure of the cookie file, more specifically i want to be able to determine the expiry time. From the cookies i have created they all appear to be in a standard format. Name, Value, website,followed by 5 numbers and a star. See example below. name value www.website.co.uk/ 1536 3041141504 30135951 1632526096 30135949 * Obviously the expiry time is one of the numbers, the question is which one. From experiments I have determined that the first and fifth number don't seem to change. In a case where i generated three cookies at the same time with a 1000 second time difference i noticed that the fourth number appeared to increase by 2000 suggesting that this has a connection with the expiry time. Can anyone confirm if i am heading in the right direction? And does any one know how i convert this to a human time and date(preferably in php but any language would give me a starting point) thanks Jason

    Read the article

  • Why does this PNG file look so poorly when embedded as a resource in a Qt project?

    - by George Edison
    Here is the PNG file and what it looks like in a QWebView when accessed via http://sstatic.net/so/img/logo.png: When accessed via HTTP: <img src="http://sstatic.net/so/img/logo.png" width='250' height='61' /> When accessed via a resource: <img src="qrc:/images/logo.png" width='250' height='61' /> As you can see, the only modification was the src attribute of the image tag... why the drop in quality? Edit: The file is being shrunk via width: and height: in the style attribute, if that makes a difference. I updated the code.

    Read the article

  • How to print all rows in one page with Crystal Reports

    - by Matt
    I am using Crystal Reports 2011. I am totally new to crystal reports and reporting tools in general. I just added my data fields to the details section, but instead of showing all the rows in one page, a new page is created for each row. I did not use any grouping or change the section paging settings. This only happens for a blank report, when using the report wizard it works fine, but I can't see the difference between what I did and what the report wizard did.

    Read the article

< Previous Page | 273 274 275 276 277 278 279 280 281 282 283 284  | Next Page >