Search Results

Search found 8367 results on 335 pages for 'temporal difference'.

Page 61/335 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • What is the difference between these two LINQ statements?

    - by jamone
    I had the 1nd statement in my code and found it not giving an accurate count, it was returning 1 when the correct answer is 18. To try and debug the problem I broke it out creating the 2nd statement here and the count returns 18. I just don't see what the difference is between these two. It seems like the 1st is just more compact. I'm currently running these two statements back to back and I'm sure that the database isn't changing between the two. int count = (from s in surveysThisQuarter where s.FacilityID == facility.LocationID select s.Deficiencies).Count(); vs var tempSurveys = from s in surveysThisQuarter where s.FacilityID == facility.LocationID select s; int count = 0; foreach (Survey s in tempSurveys) count += s.Deficiencies.Count();

    Read the article

  • Whats the difference between Paxos and W+R>=N in Cassandra?

    - by user1128016
    Dynamo-like databases (e.g. Cassandra) provide ability to enforce consistency by means of quorum, i.e. a number of synchronously written replicas (W) and a number of replicas to read (R) should be chosen in such a way that W+RN where N is a replication factor. On the other hand, PAXOS-based systems like Zookeeper are also used as a consistent fault-tolerant storage. What is the difference between these two approaches? Does PAXOS provide guarantees that are not provided by W+RN schema?

    Read the article

  • What is the difference between the add and offer methods in a queue?

    - by Finbarr
    Take the PriorityQueue for example http://java.sun.com/j2se/1.5.0/docs/api/java/util/PriorityQueue.html#offer(E) According to the Collection API entry http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collection.html the add method will often seek to ensure that an element exists within the Collection rather than adding duplicates. So my question is, what is the difference between the add and offer methods? Is it that the Offer method will add duplicates regardless? (I doubt that it is because if a Collection should only have distinct elements this would circumvent that).

    Read the article

  • Task vs. process, is there really any difference?

    - by DASKAjA
    Hi there, I'm studying for my final exams in my CS major on the subject distributed systems and operating systems. I'm in the need for a good definition for the terms task, process and threads. So far I'm confident that a process is the representation of running (or suspended, but initiated) program with its own memory, program counter, registers, stack, etc (process control block). Processes can run threads which share memory, so that communication via shared memory is possible in contrast to processes which have to communicate via IPC. But what's the difference between tasks and process. I often read that they're interchangable and that the term task isn't used anymore. Is that really true?

    Read the article

  • Why are difference lists more efficient than regular concatenation?

    - by Craig Innes
    I am currently working my way through the Learn you a haskell book online, and have come to a chapter where the author is explaining that some list concatenations can be ineffiecient: For example ((((a ++ b) ++ c) ++ d) ++ e) ++ f Is supposedly inefficient. The solution the author comes up with is to use 'difference lists' defined as newtype DiffList a = DiffList {getDiffList :: [a] -> [a] } instance Monoid (DiffList a) where mempty = DiffList (\xs -> [] ++ xs) (DiffList f) `mappend` (DiffList g) = DiffList (\xs -> f (g xs)) I am struggling to understand why DiffList is more computationally efficient than a simple concatenation in some cases. Could someone explain to me in simple terms why the above example is so inefficient, and in what way the DiffList solves this problem?

    Read the article

  • sqlalchemy: what is the difference between declaring the cascade within the foreign key vs relation?

    - by steve
    what is the difference between declaring the cascade within a foreign key vs relations? class Contact(Base): __tablename__ = 'contacts' id = Column(Integer, primary_key=True) addresses = relation("Address", backref="contact") class Address(Base): __tablename__ = 'addresses' id = Column(Integer, primary_key=True) contact_id = Column(Integer, ForeignKey('contact.id', onupdate="CASCADE", ondelete="CASCADE"))) vs class Contact(Base): __tablename__ = 'contacts' id = Column(Integer, primary_key=True) addresses = relation("Address", backref="contact", cascade="all, delete-orphan") class Address(Base): __tablename__ = 'addresses' id = Column(Integer, primary_key=True) contact_id = Column(Integer, ForeignKey('contact.id')) with the foreign key declaration, it seems like the cascade is enforced at the database level. how does the relations approach work? thanks!

    Read the article

  • Interview question: difference between object and object-oriented languages.

    - by Bar
    My friend was asked the following question: what's the difference between object language and object-oriented language? It's a little unintelligible question. What does term «object language» correspond to? Does that mean «pure» object-oriented language, like the Wikipedia article says: Languages called "pure" OO languages, because everything in them is treated consistently as an object, from primitives such as characters and punctuation, all the way up to whole classes, prototypes, blocks, modules, etc. They were designed specifically to facilitate, even enforce, OO methods. Examples: Smalltalk, Eiffel, Ruby, JADE, VB.NET.

    Read the article

  • Is there any difference in which order I createCriteria and beginTransaction using Hibernate?

    - by user2519543
    Just wondering is there any difference when I beginTransaction [org.hibernate] before or after creating Criteria/Query etc.? example 1: ... Transaction tx= session.beginTransaction(); Criteria c = session.createCriteria(class); result = c.uniqueResult(); tx.commit(); ... example 2: ... Criteria c = session.createCriteria(class); Transaction tx= session.beginTransaction(); result = c.uniqueResult(); tx.commit(); ... Thanks.

    Read the article

  • (C++) What's the difference between these overloaded operator functions?

    - by cv3000
    What is the difference between these two ways of overloading the != operator below. Which is consider better? Class Test { ...// private: int iTest public: BOOL operator==(const &Test test) const; BOOL operator!=(const &Test test) const; } BOOL operator==(const &Test test) const { return (iTest == test.iTest); } //overload function 1 BOOL Test::operator!=(const &Test test) const { return !operator==(test); } //overload function 2 BOOL Test::operator!=(const &Test test) const { return (iTest != test.iTest); } I've just recently seen function 1's syntax for calling a sibling operator function and wonder if writing it that way provides any benefits.

    Read the article

  • Why There is a difference between assembly languages like Windows, Linux ?

    - by mcaaltuntas
    I am relatively new to all this low level stuff,assembly language.. and want to learn more detail. Why there is a difference between Linux, Windows Assembly languages? As I understand when I compile a C code Operating system does not really produce pure machine or assembly code, it produces OS dependent binary code.But why ? For example when I use a x86 system, CPU only understands x86 ASM am I right?.So Why we dont write pure x86 assembly code and why there are different assembly variations based on Operating system? If we would write pure ASM or OS produce pure ASM there wouldn't be binary compatilibty issues between Operating systems or Not ? I am really wondering all reasons behind them. Any detailed answer, article, book would be great. Thanks.

    Read the article

  • What difference does it make to use several script blocks on a web page?

    - by Jan Aagaard
    What difference does it make to use more than one script block on a web page? I have pasted in the standard code for including Google Analytics as an example, and I have seen the same pattern used in other places. Why is this code separated into two separate script blocks instead of just using a single one? <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try{ var pageTracker = _gat._getTracker("UA-xxxxxx-x"); pageTracker._trackPageview(); } catch(err) {} </script>

    Read the article

  • Is there a semantic difference <span>'s and <div>'s?

    - by DavidR
    I know when coding HTML, I'm supposed to keep semantics in mind, e.g., h1 needs to be a main header, h2 needs to be a subheader, tables need to be tables, use <em> for emphasis instead of <i>, etc. Is there a proper difference between divs and spans except one is a block and the other is in-line? When I was learning I was told that <span>'s were for styling text mid-line. If I had a small blurb of text that I needed positioned at a certain point in my webpage, one that doesn't warrent a <p> tag, would I use a span should I stick with div's? What if that text needs to cover two lines (i.e., it needs a width) if it contains nothing but text, what should I use?

    Read the article

  • C++ is there a difference between assignment inside a pass by value and pass by reference function?

    - by Rémy DAVID
    Is there a difference between foo and bar: class A { Object __o; void foo(Object& o) { __o = o; } void bar(Object o) { __o = o; } } As I understand it, foo performs no copy operation on object o when it is called, and one copy operation for assignment. Bar performs one copy operation on object o when it is called and another one for assignment. So I can more or less say that foo uses 2 times less memory than bar (if o is big enough). Is that correct ? Is it possible that the compiler optimises the bar function to perform only one copy operation on o ? i.e. makes __o pointing on the local copy of argument o instead of creating a new copy?

    Read the article

  • Is there a difference between NSString compare: and isEqual(ToString): ?

    - by frenetisch applaudierend
    Occasionally I find code which tests if two NSStrings are the same like this: if ([str1 compare:str2] == NSOrderedSame) { // Do something } Now, I believe this is less readable than using isEqualToString: and it also has some nasty side effects, like if str1 == nil the if(..) evaluates to true, or when str2 == nil havoc might break upon us according to the Apple docs. But before I crusade against those statements in my companys code, I wanted to make sure I didn't miss some important point. So my question basically boils down to: Is there any difference between a compare: to NSOrderedSame and isEqual:?

    Read the article

  • What is the difference between as="element()+" and as="element()*" in XSL?

    - by Rachel
    What is the difference between using as="element(data)+" and as="element(data)" in xsl:variable. The below XSL solution works if use "+" but not when i use "". Can some one clarify. XSL code: <xsl:variable name="insert-data" as="element(data)+"> <xsl:for-each select="$insert-file/insert-data/data"> <xsl:sort select="xsd:integer(@index)"/> <xsl:variable name="index" select="xsd:integer(@index)" /> <xsl:variable name="nodeName" select="@nodeName" /> <data nodeName="{$nodeName}" index="{@index}" text-id="{$main-root/*//*[@id=$nodeName]/text()[sum((preceding::text(), .)/string-length(.)) ge $index]/generate-id(.)}"> <xsl:copy-of select="node()"/> </data> </xsl:for-each>

    Read the article

  • What's the Difference Between These Two Ruby Class Initialization Definitions?

    - by michaelmichael
    I'm working through a book on Ruby, and the author used a slightly different form for writing a class initialization definition than he has in previous sections of the book. It looks like this: class Ticket attr_accessor :venue, :date def initialize(venue, date) self.venue = venue self.date = date end end In previous sections of the book, it would've been defined like this: class Ticket attr_accessor :venue, :date def initialize(venue, date) @venue = venue @date = date end end Is there any functional difference between using the setter method, as in the first example, vs. using the instance variable as in the second? They both seem to work. Even mixing them up works: class Ticket attr_accessor :venue, :date def initialize(venue, date) @venue = venue self.date = date end end

    Read the article

  • What's the Difference Between These Two Ruby Class Initialaztion Definitions?

    - by michaelmichael
    I'm working through a book on Ruby, and the author used a slightly different form for writing a class initialization definition than he has in previous sections of the book. It looks like this: class Ticket attr_accessor :venue, :date def initialize(venue, date) self.venue = venue self.date = date end end In previous sections of the book, it would've been defined like this: class Ticket attr_accessor :venue, :date def initialize(venue, date) @venue = venue @date = date end end Is there any functional difference between using the setter method, as in the first example vs. using the instance variable in the second? They both seem to work. Even mixing them up seems to work: class Ticket attr_accessor :venue, :date def initialize(venue, date) @venue = venue self.date = date end end

    Read the article

  • What's the difference between Path and Polygon control? + issues when designing custom drawing user

    - by tomo
    I'm starting to design a custom control with rather complex drawing. It will be a kind of chart (a kind of radar chart). It will be composed of a few axises with labels, line-regions (like spider-network) and filled shapes. The main question is what's the difference between using Path control and Polygon control? What's better to use here? The goal is to prepare control with minimal amount of c# and try to do as much as possible in xaml / binding. The next important requirement is that control should resize to parent containers' width - if possible without any long recalulations in c#.

    Read the article

  • Percentage difference between different values in the same keys of two different arrays.

    - by Paul
    Hey. I'm looking for a solution to this problem. I got 2 arrays, like this: array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "19088" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "15566" } } array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "12043" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "11953" } } Now I'd like to create a new array, with the % difference between the values per key. Would be something like this: array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "88,23" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "74,54" } } Can anyone help me how to create that array?

    Read the article

  • What is the difference between binding data in data grid view methods ??

    - by Ashish
    What is the difference between binding data in data grid view methods ?? <ItemTemplate> <asp:LinkButton ID="lnkBtnUserName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"UserFirstName")%>' CommandArgument='<%# Eval("UserID") %>' OnClick="lnkBtnUserName_Click" /> </ItemTemplate> and this second one <asp:TemplateField HeaderText="Employee ID"> <ItemTemplate> <asp:Label ID="lblempid" runat="server" Text='<%# Bind("EmpId.EmpId") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> means in method 1 Text='<%# DataBinder.Eval(Container.DataItem,"UserFirstName")%>' CommandArgument='<%# Eval("UserID") %>' method 2 Text='<%# Bind("EmpId.EmpId") also explain use one this CommandArgument='<%# Eval("UserID") in 1st one ????

    Read the article

  • Difference between Class Abstraction and Object Interfaces in PHP?

    - by Mark Tomlin
    What is the difference between a Class Abstraction and an Object Interfaces in PHP? I ask because, I don't really see the point to both of them, they both do the same thing! So, what are the advantages of disadvantages using both against one or the other? Class Abstraction: abstract class aClass { // Force extending class to define these methods abstract public function setVariable($name, $var); abstract public function getHtml($template); } Object Interface: interface iClass { // Force impementing class to define these methods public function setVariable($name, $var); public function getHtml($template); }

    Read the article

  • what is the difference between static class and normal class?

    - by Phsika
    when i prefer static or normal class? Or what is the difference between them? using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace staticmethodlar { class Program { static void Main(string[] args) { SinifA.method1(); } } static class SinifA { public static void method1() { Console.WriteLine("Deneme1"); } } public static class SinifB { public static void method2() { Console.WriteLine("Deneme2"); } } public class sinifC { public void method3() { Console.WriteLine("Deneme3"); } } public class sinifD : sinifC { void method4() { Console.WriteLine("Deneme4"); } sinifC sinifc = new sinifC(); // i need to use it:) } }

    Read the article

  • Jython: Is there any difference between adding to sys.path vs passing -D?

    - by trinth
    I have a python application that is trying to load some Java libraries (specifically Axis2 web services). When I add the necessary jars in Eclipse via PyDev Project Source Folders, everything seems to work fine. However, I want to be able to do this at run time by adding to sys.path, but then my application doesn't seem to work. In both cases I can load the jars just fine, but something must be different for there to be different results. My question is, is there a difference between adding jars via the sys.path at run time with sys.path.append() versus passing -D to the jython interpreter?

    Read the article

  • Whats the difference between a C++ and a Cocoa Project in Xcode?

    - by david
    I need to work with TagLib for my project. I've created a framework (and I tried using it as a lib) but the compiler cannot find #include < strings on compiling (No such file or Directory). I've created a test C++ project and it #includes < strings just fine. I've looked at the project settings and I cannot find a difference between them. But the standard cocoa projects obviously so not have the search path set to include C++ libraries (Or am I completely getting it wrong?). I've searched for a solution but no one else seems to have run into this problem.

    Read the article

  • What is the difference between these two ways of creating NSStrings?

    - by adame
    NSString *myString = @"Hello"; NSString *myString = [NSString stringWithString:@"Hello"]; I understand that using method (1) creates a pointer to a string literal that is defined as static memory (and cannot be deallocated) and that using (2) creates an NSString object that will be autoreleased. Is using method (1) bad? What are the major differences? Is there any instances where you would want to use (1)? Is there a performance difference? P.S. I have searched extensively on Stack Overflow and while there are questions on the same topic, none of them have answers to the questions I have posted above.

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >