Search Results

Search found 1915 results on 77 pages for 'identical'.

Page 20/77 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • When would JavaScript == make more sense than ===?

    - by bryantsai
    As 359494 indicates they are basically identical except '===' also ensures type equality and hence '==' might perform type conversion. In Douglas Crockford's JavaScript: The Good Parts, it is advised to always avoid '=='. However, I'm wondering what the original thought of designing two set of equality operators was. Have you seen any situation that using '==' actually is more suitable than using '==='?

    Read the article

  • Stop duplicates from being added to an array of Ruby objects

    - by Dom
    how can I eliminate duplicate elements from an array of ruby objects using an attribute of the object to match identical objects. with an array of basic types I can use a set.. eg. array_list = [1, 3, 4 5, 6, 6] array_list.to_set => [1, 2, 3, 4, 5, 6] can I adapt this technique to work with object attributes? thanks

    Read the article

  • Loosely coupled implicit conversion

    - by ltjax
    Implicit conversion can be really useful when types are semantically equivalent. For example, imagine two libraries that implement a type identically, but in different namespaces. Or just a type that is mostly identical, except for some semantic-sugar here and there. Now you cannot pass one type into a function (in one of those libraries) that was designed to use the other, unless that function is a template. If it's not, you have to somehow convert one type into the other. This should be trivial (or otherwise the types are not so identical after-all!) but calling the conversion explicitly bloats your code with mostly meaningless function-calls. While such conversion functions might actually copy some values around, they essentially do nothing from a high-level "programmers" point-of-view. Implicit conversion constructors and operators could obviously help, but they introduce coupling, so that one of those types has to know about the other. Usually, at least when dealing with libraries, that is not the case, because the presence of one of those types makes the other one redundant. Also, you cannot always change libraries. Now I see two options on how to make implicit conversion work in user-code: The first would be to provide a proxy-type, that implements conversion-operators and conversion-constructors (and assignments) for all the involved types, and always use that. The second requires a minimal change to the libraries, but allows great flexibility: Add a conversion-constructor for each involved type that can be externally optionally enabled. For example, for a type A add a constructor: template <class T> A( const T& src, typename boost::enable_if<conversion_enabled<T,A>>::type* ignore=0 ) { *this = convert(src); } and a template template <class X, class Y> struct conversion_enabled : public boost::mpl::false_ {}; that disables the implicit conversion by default. Then to enable conversion between two types, specialize the template: template <> struct conversion_enabled<OtherA, A> : public boost::mpl::true_ {}; and implement a convert function that can be found through ADL. I would personally prefer to use the second variant, unless there are strong arguments against it. Now to the actual question(s): What's the preferred way to associate types for implicit conversion? Are my suggestions good ideas? Are there any downsides to either approach? Is allowing conversions like that dangerous? Should library implementers in-general supply the second method when it's likely that their type will be replicated in software they are most likely beeing used with (I'm thinking of 3d-rendering middle-ware here, where most of those packages implement a 3D vector).

    Read the article

  • R segfault when running via Rpy on linux

    - by Zhang18
    I'm running R via Rpy on a redhat linux distribution. Periodically I'll encounter this error message: *** caught segfault *** address (nil), cause 'unknown' And the entire program dies right there. It usually occurs when I run a lot of regression r.lm(). But by simply running the identical code again, the problem may or may not go away (so not always reproduceable). Does anyone know what might be causing this, and/or how I can prevent it from happening?

    Read the article

  • Linq DBML multiple sql servers

    - by Hurricanepkt
    I have an archive system that had to be on two sql databases for simplicity one is Archive2009 and the other Archive2010 they are both on the same sql server and instance and have identical structures however I have a page that needs to view the old one and the new one (I can make two seperate pages) How best would I go about doing this? Dynamically changing the connection string etc?

    Read the article

  • Who owns forum users or are user grabbers legal?

    - by Eugene
    Hi, I am not very strong in "legal or not" questions so I hope someone can help me here. How legal is the following: I create my forum, then choose a random existing forum (not mine), take a user from that forum (username, avatar, etc) and create an identical account at my forum. I know that this is extremely hard to prove and everything but anyway: how legal are the described actions? Thanks!

    Read the article

  • Can two threads of the same process produce the same GUID?

    - by mark
    Dear ladies and sirs. If two threads in a process generate a new GUID concurrently using .NET API (Guid.NewGuid()) is it possible that the two GUIDs will be identical? Thanks. UPDATE I want to get practical. I know that it is widely assumed that GUIDs are unique for all practical purposes. I am wondering if I can treat GUIDS produced by the different threads of the same process in the same manner.

    Read the article

  • comparing application with api

    - by Night Walker
    Hi all I am looking for some compare application that i will be able to use from my code . I need to compare files and know if they identical if not to get the lines and text where the difference was found. Most;y i compare a text(ASCII) files. So i need program with easy api for that thing. Thanks for help.

    Read the article

  • Why does JAXB not create a member variable in its generated code when an XML schema base type and subtype have the same element declared in them?

    - by belltower
    I have a question regarding with regard to JAXB generated classes. As you can I see, I have a complex type, DG_PaymentIdentification1, declared in my schema. Its a restriction of PaymentIdentification1. DG_PaymentIdentification1 is also identical to PaymentIdentification1. I also have a type called DG_CreditTransferTransactionInformation10 which has a base type of CreditTransferTransactionInformation10 and is identical to it. I have included the relevant XML schema snippets below. <xs:complexType name="DG_PaymentIdentification1"> <xs:complexContent> <xs:restriction base="PaymentIdentification1"> <xs:sequence> <xs:element name="InstrId" type="DG_Max35Text_REF" minOccurs="0"/> <xs:element name="EndToEndId" type="DG_Max35Text_REF" id="DG-41"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="PaymentIdentification1"> <xs:sequence> <xs:element name="InstrId" type="Max35Text" minOccurs="0"/> <xs:element name="EndToEndId" type="Max35Text"/> </xs:sequence> </xs:complexType> <xs:complexType name="DG_CreditTransferTransactionInformation10"> <xs:complexContent> <xs:restriction base="CreditTransferTransactionInformation10"> <xs:sequence> <xs:element name="PmtId" type="DG_PaymentIdentification1"/> <xs:simpleType name="DG_Max35Text_REF"> <xs:restriction base="DG_NotEmpty35"> <xs:pattern value="[\-A-Za-z0-9\+/\?:\(\)\.,'&#x20;]*"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="Max35Text"> <xs:restriction base="xs:string"> <xs:minLength value="1"/> <xs:maxLength value="35"/> </xs:restriction> </xs:simpleType> JAXB generates the following java class for DG_PaymentIdentification1: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DG_CreditTransferTransactionInformDGion10") public class DGCreditTransferTransactionInformation10 extends CreditTransferTransactionInformation10 { } My question is why doesnt the DGCreditTransferTransactionInformation10 generated class have a variable of type DG_PaymentIdentification1 in the generated code? The base class CreditTransferTransactionInformation10 does have a type PaymentIdentification1 declared in it. Is there any way of ensuring that DGCreditTransferTransactionInformation10 will have a DG_PaymentIdentification1 in it?

    Read the article

  • Why is the recursion idiom in Haskell "'n+1' and 'n'" and not "'n' and 'n-1'"?

    - by rulfzid
    I'm working my way through Graham Hutton's Haskell book, and in his recursion chapter, he often pattern-matches on "n+1", as in: myReplicate1 0 _ = [] myReplicate1 (n+1) x = x : myReplicate1 n x Why that and not the following, which (1) seems functionally identical and (2) more intuitive in terms of understanding what's happening with the recursion: myReplicate2 0 _ = [] myReplicate2 n x = x : myReplicate2 (n-1) x Is there something I'm missing here? Or is it just a matter of style?

    Read the article

  • Git: Find duplicate blobs (files) in this tree

    - by Readonly
    This is sort of a follow-up to this question. If there are multiple blobs with the same contents, they are only stored once in the git repository because their SHA-1's will be identical. How would one go about finding all duplicate files for a given tree? Would you have to walk the tree and look for duplicate hashes, or does git provide backlinks from each blob to all files in a tree that reference it?

    Read the article

  • Is this safe? Is this OK to do in MYSQL?

    - by alex
    I have always done this: mysqldump -hlocalhost -uuser -ppass MYDATABASE > /home/f/db_backup/MYDATABASE.sql mysql -uuser -ppass MYDATABASE < MYDATABASE.sql But, if I do this instead...is this safe? Is this identical to the above??? mysqldump -hlocalhost -uuser -ppass MYDATABASE | gzip > /home/f/db_backup/MYDATABASE.sql.gz zcat MYDATABASE.sql.gz | mysql -uuser -ppass MYDATABASE

    Read the article

  • windows service cannot access a webservice

    - by Tony
    Hi We have two servers, both are containing a local application connecting to local web service, applications and services are identical on both servers. One of the servers work just fine, The other one is just dead, I have impression the the security configuration are different on those servers. What prevents an application X from connecting a web-service, given that another application y on the same server can connect to it. and X is a windows service. What I should check, what is chances? Thanks

    Read the article

  • Performance impact using culture invariant resources

    - by Praveen S
    I would like to know the performance impact of using the culture invariant resources instead of culture specific ones. For example, we plan to deploy a website and not have any en-US resources. This is because our culture invariant resources are always identical to the en-US resources. Is this a good idea ? What are the cons?

    Read the article

  • Why does visual studio think js file is a cs file?

    - by divitiae
    I have a ASP.NET solution in Visual Studio 2008 and I added a file identical to http://plugins.jquery.com/files/jquery.cookie.js.txt named jquery.cookie.js in a subfolder of my project containing other javascript files and Visual Studio is treating it as a C# file, giving me errors like CS1012: Too many characters in character literal and Semicolon after method or accesssor block is not valid. Why?

    Read the article

  • Can I declare the same value for two attributes at once

    - by graphicdivine
    For example, for accessibility reasons I want my onfocus and onmouseover to have identical values. For the sake of maintainability I want to declare this once only. What I'd like to be able to do is this: <a onmouseover,onfocus="assist('hello');">linktext</a> But, of course, that would be too easy, and doesn't work. What's the best way I can achieve this DRYing out of my tags?

    Read the article

  • Changing git origin to point to an existing repository

    - by int3
    I'd like to make my local repo point to a different fork of the same project. Will this work? Do a merge with the 'target origin' Change the origin repo in my config file to the 'target origin' Also, if my local repo is not entirely identical to the new origin (say, I've resolved some merge conflicts in my favor), will these changes be pushed to the new origin when I do a git push, or will only commits made after the change of origin get pushed?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >