Search Results

Search found 28563 results on 1143 pages for 'strange but true'.

Page 18/1143 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • When is (true == x) === !!x false?

    - by Paul S.
    JavaScript has different equality comparison operators Equal == Strict equal === It also has a logical NOT ! and I've tended to think of using a double logical NOT, !!x, as basically the same as true == x. However I know this is not always the case, e.g. x = [] because [] is truthy for ! but falsy for ==. So, for which xs would (true == x) === !!x give false? Alternatively, what is falsy by == but not !! (or vice versa)?

    Read the article

  • jQuery clone( true ) not working with dynamic elements

    - by elclanrs
    Take the following example: $.fn.foo = function() { var $input = $('<input type="text"/>'); var $button_one = $('<button>One</button>'); var $button_two = $('<button>Two</button>'); $button_one.click(function(){ $input.val('hey'); }); $button_two.click(function(){ $input.replaceWith( $input.val('').clone( true ) ); }); this.append($input, $button_one, $button_two); }; Check the demo: http://jsbin.com/ezexah/1/edit Now click "one" and you should see "hey" in the input. Next click "two" and then click "one" again and it doesn't work. Even using the true option in clone to copy all events it still does not work. Any ideas?

    Read the article

  • Testing a SQL Query for True or False

    - by KickingLettuce
    $sql = "SELECT # FROM users WHERE onduty = 1 AND loc_id = '{$site}';"; $result = mysql_query($sql); I simply want to test if this is true or false. If it returns 0 rows, I want next line to be something like: if (!$result) { //do this; } However, in my test, I am getting false when I know it should be true. Is this sound logic here? (note, yes I know I should be using mysqli_query, that is not what I am asking here)

    Read the article

  • Only get the value if a condition is true

    - by Autolycus
    I am checking to see if element1, element 2 or element 3 exists and then add them to finalData if they exist. However if one of those dont exist or are not true then I just want to add the elements whose bool value is true! Below is my code bool hasElement1 = ( from Playlist in loaded.Descendants("Node") select Playlist.Descendants("Element1").Any() ).Single(); bool hasElement2 = ( from Playlist in loaded.Descendants("Node") select Playlist.Descendants("Element2").Any() ).Single(); bool hasElement3 = ( from Playlist in loaded.Descendants("Node") select Playlist.Descendants("Element2").Any() ).Single(); var finalData = from x in loaded.Descendants("Node") select new { Element1 = x.Descendants("Element1").First().Value, Element2 = x.Descendants("Element2").First().Value, Element3 = x.Descendants("Element3").First().Value, };

    Read the article

  • PHP strange issue with memcache

    - by Industrial
    Hi everyone, I am testing out some memcache code here in PHP: 1: $testInstance = new Memcache; $var = @$testInstance->connect('localhost', 11211); echo $var; // Outputs true no matter if the memcached is running or not. 2: $testInstance = new Memcache; $var = @$testInstance->connect('blablabla', 11211); echo $var; // Outputs false Why on earth is this occuring? I am running WinXP in my development environment and I cant see how the localhost version always returns true no matter if the memcached is running or not. Thanks!

    Read the article

  • Excess errors on model from somewhere

    - by gmile
    I have a User model, and use an acts_as_authentic (from authlogic) on it. My User model have 3 validations on username and looks as following: User < ActiveRecord::Base acts_as_authentic validates_presence_of :username validates_length_of :username, :within => 4..40 validates_uniqueness_of :username end I'm writing a test to see my validations in action. Somehow, I get 2 errors instead of one when validating a uniqueness of a name. To see excess error, I do the following test: describe User do before(:each) do @user = Factory.build(:user) end it "should have a username longer then 3 symbols" do @user2 = Factory(:user) @user.username = @user2.username @user.save puts @user.errors.inspect end end I got 2 errors on username: @errors={"username"=>["has already been taken", "has already been taken"]}. Somehow the validation passes two times. I think authlogic causes that, but I don't have a clue on how to avoid that. Another case of problem is when I set username to nil. Somehow I get four validation errors instead of three: @errors={"username"=>["is too short (minimum is 3 characters)", "should use only letters, numbers, spaces, and .-_@ please.", "can't be blank", "is too short (minimum is 4 characters)"]} I think authlogic is one that causes this strange behaviour. But I can't even imagine on how to solve that. Any ideas?

    Read the article

  • Aptana generating strange error.

    - by RPK
    I just added PDT plugin to Aptana Studio 2.0. When I create a new PHP project and add a blank PHP file, Aptana displays following strange error. I am not following from where it is fetching this "Job Title" thing when I have not added anything in my PHP project.

    Read the article

  • WebBrowser.InnerHtml strange behavior

    - by Poma
    I'm trying to load page and then remove some elements in it. While doing that I encountered strange behavior. When I do webBrowser1.Document.Body.InnerHtml = webBrowser1.Document.Body.InnerHtml; It turns off some JavaScript code, for example for Google.com it turns off auto completion. Why is that? I suppose it has something to do with JavaScript initialization, if so how can I reinitialize the page?

    Read the article

  • strange behaviour of git

    - by Alexey Poimtsev
    Hi, i have strange behaviour of git - push is working, but clone is not :( alec$ git clone git://host/repo.git Initialized empty Git repository in /Users/alec/Temp/repo/.git/ host[0: x.x.x.x]: errno=Connection refused fatal: unable to connect a socket (Connection refused) whats wrong?

    Read the article

  • Sifr & Colorbox: strange gap in border of colorbox

    - by knalstaaf
    There seems to be a strange gap on the left side of the colorbox when it's laying over a Sifr element. This picture shows the Sifr titles: i39.tinypic.com/zthws0.gif (paste in address bar) This one shows the colorbox being toggled on. Mind the gaps near the Sifr titles: http://i42.tinypic.com/25ft1td.gif Does anyone know how to solve this?

    Read the article

  • strange behavior when changing UINavigationController backItem title

    - by Rafael
    Hi, I'm changing the back button item title in the viewDidAppear of a controller in the following way: self.navigationController.navigationBar.backItem.title = @"Previous"; It changes the tittle properly, but the I'm having a strange behaviour. When I select the "previous" button, it changes the tittle of the controller that is up in the stack (i.e the parent controller now has the title "Previous". Do you now why this happened ??? Thanks in advanced for your help.

    Read the article

  • Strange Values in SYS.DM_TRAN_LOCKS table RESOURCE_ASSOCIATED_ENTITY_ID column

    - by AJM
    I’ve been trying to understand some strange values in the RESOURCE_ASSOCIATED_ENTITY_ID column of SYS.DM_TRAN_LOCKS when RESOURCE_TYPE is “OBJECT”. Although these should be object Ids, I cannot determine what object they actually refer to. I’ve tried everything I can think of, including querying all system tables with columns of type INT and BIGINT to see if I can find the value. No luck. The funny values actually appear in SYS.DM_TRAN_LOCKS, SYS.SYSLOCKINFO and SP_LOCK.

    Read the article

  • UITablevViewCellStyle strange behaviour with detailTextLabel

    - by joec
    I have set my UITableViewCellStyle to be Value2, and it shows the detailTextLabel and textLabel, but instead of the detailTextLabel being the small text to the left of the cell, it is now the primary text in the cell, and the textLabel is the small text. Strange behaviour and i'm not sure why? For now i'm just swapping the values over, but I'm pretty sure its not correct. Anyone else experienced this issue? Thanks

    Read the article

  • VBA Access Import Specification strange error

    - by captonssj
    I am trying to import a text file into Access using a saved "Import Specification" in my access database using VBA. The import generates the Import Error table showing the errors in the last two fields. BUT if I use the same import specification manually to import the text file, the Import works perfect !!!!! Strange ..... why would they have different behavior ? Here is the database and the text file http://www.box.net/shared/ro7n3b7a77

    Read the article

  • Strange phantom header margin bug html/css

    - by MickyJimbo
    So I'm creating this website and there is a strange untraceable bug that causes the header to move down 10 or so pixels. On a refresh the header could be correct or it could be broken. I've been testing it on Adobe Browserlab and the results are different every time.There is no discernible pattern making it incredible hard to track down. http://www.freeimagehosting.net/uploads/c866bf594d.jpg Has anyone ever had this problem and been able to fix it?

    Read the article

  • xdebug profiler output strange results

    - by nic28
    I'm using xdebug to profile some PHP code on Windows and using WinCacheGrind/Webgrind to analyse the output, but I'm getting some strange results. Specifically, the total cumulative time for a single method is greater than 100%! How is it possible that more time is spent executing this function's code and all the functions that it calls than the total time it took to execute the whole script? What am I missing here?

    Read the article

  • Hibernate - strange order of native SQL parameters

    - by Xorty
    Hello, I am trying to use native MySQL's MD5 crypto func, so I defined custom insert in my mapping file. <hibernate-mapping package="tutorial"> <class name="com.xorty.mailclient.client.domain.User" table="user"> <id name="login" type="string" column="login"></id> <property name="password"> <column name="password" /> </property> <sql-insert>INSERT INTO user (login,password) VALUES ( ?, MD5(?) )</sql-insert> </class> </hibernate-mapping> Then I create User (pretty simple POJO with just 2 Strings - login and password) and try to persist it. session.beginTransaction(); // we have no such user in here yet User junitUser = (User) session.load(User.class, "junit_user"); assert (null == junitUser); // insert new user junitUser = new User(); junitUser.setLogin("junit_user"); junitUser.setPassword("junitpass"); session.save(junitUser); session.getTransaction().commit(); What actually happens? User is created, but with reversed parameters order. He has login "junitpass" and "junit_user" is MD5 encrypted and stored as password. What did I wrong? Thanks EDIT: ADDING POJO class package com.xorty.mailclient.client.domain; import java.io.Serializable; /** * POJO class representing user. * @author MisoV * @version 0.1 */ public class User implements Serializable { /** * Generated UID */ private static final long serialVersionUID = -969127095912324468L; private String login; private String password; /** * @return login */ public String getLogin() { return login; } /** * @return password */ public String getPassword() { return password; } /** * @param login the login to set */ public void setLogin(String login) { this.login = login; } /** * @param password the password to set */ public void setPassword(String password) { this.password = password; } /** * @see java.lang.Object#toString() * @return login */ @Override public String toString() { return login; } /** * Creates new User. * @param login User's login. * @param password User's password. */ public User(String login, String password) { setLogin(login); setPassword(password); } /** * Default constructor */ public User() { } /** * @return hashCode * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((null == login) ? 0 : login.hashCode()); result = prime * result + ((null == password) ? 0 : password.hashCode()); return result; } /** * @param obj Compared object * @return True, if objects are same. Else false. * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof User)) { return false; } User other = (User) obj; if (login == null) { if (other.login != null) { return false; } } else if (!login.equals(other.login)) { return false; } if (password == null) { if (other.password != null) { return false; } } else if (!password.equals(other.password)) { return false; } return true; } }

    Read the article

  • .NET Reference "Copy Local" True / False Being Set Based on Contents of GAC

    - by D-Sect
    We had a very interesting problem with a Win Forms project. It's been resolved. We know what happened, but we want to understand why it happened. This may help other people out in the future who have a similar problem. The WinForms project failed on 2 of our client's PCs. The error was an obscure kernel.dll error. The project ran fine on 3 other PCs. We found that a .DLL (log4net.dll - a very popular open-source logging library) was missing from our release folder. It was previously in our release folder. Why was it missing in this latest release? It was missing because I must have installed a program on my Dev box that used log4net.dll and it was added to the Global Assembly Cache. When I checked the solution's references for log4net.dll, they were changed to "copy local=FALSE". They must have changed automatically because log4net.dll was present in my GAC. Here's where my question starts: Why did my reference for log4net.dll get changed from COPY LOCAL = TRUE to COPY LOCAL = FALSE? I suspect it's because it was added to my GAC by another program. How can we prevent this from happening again? As it stands now, if I install a piece of software that uses a common library and it adds it to my GAC, then my SLNs that reference that DLL will change from Copy Local TRUE to FALSE.

    Read the article

  • DOM: element created with cloneNode(true) missing element when added to DOM

    - by user149327
    I'm creating a tree control and I'm attempting to use a parent element as a template for its children. To this end I'm using the element.cloneNode(true) method to deep clone the parent element. However when I insert the cloned element into the DOM it is missing certain inner elements despite having an outerHTML value identical to its parent. Surprisingly I observe the same behavior is in IE, Firefox, and Chrome leading me to believe that it is by design. This is the HTML for the node I'm attempting to clone. <SPAN class=node><A class=nodeLink href="/SparklerRestService2.aspx?q={0}" name=http://dbpedia.org/data/Taylor_Swift.rdf> <IMG class=nodeIcon alt="Taylor Swift" src="images/node.png"><SPAN class=nodeText>Taylor Swift</SPAN></A><SPAN class=nodeDescription>Taylor Swift is a swell gall who is realy great.</SPAN></SPAN> Once I've cloned the node using cloneNode(true) I examine the outerHTML property and find that it is indeed identical to the original. <SPAN class=node><A class=nodeLink href="/SparklerRestService2.aspx?q={0}" name=http://dbpedia.org/data/Taylor_Swift.rdf><IMG class=nodeIcon alt="Taylor Swift" src="images/node.png"><SPAN class=nodeText>Taylor Swift</SPAN></A><SPAN class=nodeDescription>Taylor Swift is a swell gall who is realy great.</SPAN></SPAN> However when I insert it into the DOM and inspect the result using FireBug I find that the element has been transformed: <span class="node" style="top: 0px; left: 0px;"<a class=nodeLink href="/SparklerRestService2.aspx?q={0}" name=http://dbpedia.org/data/Taylor_Swift.rdf>Taylor Swift</a><span class="nodeDescription">It's great</span></span> Notice that the grandchildren of the node (the image tag and the span tag surrounding "Taylor Swift") are missing, although strangely the great grandchild "Taylor Swift" text node has made it into the tree. Can anyone shed some light on this behavior? Why would nodes disappear after insertion into the DOM, and why am I seeing the same result in all three major browser engines?

    Read the article

  • .NET Reference "Copy Local" True / Fasle Being Set Based on Contents of General Assembly

    - by D-Sect
    Hello All. First question for me here. We had a very interesting problem with a Win Forms project. It's been resolved. We know what happened, but we want to understand why it happened. This may help other people out in the future who have a similar problem. The WinForms project failed on 2 of our client's PCs. The error was an obscure kernel.dll error. The project ran fine on 3 other PCs. We found that a .DLL (log4net.dll - a very popular open-source logging library) was missing from our release folder. It was previously in our release folder. Why was it missing in this latest release? It was missing because I must have installed a program on my Dev box that used log4net.dll and it was added to the general assembly. When I checked the SLN's references for log4net.dll, they were changed to "copy local=FALSE". They must have changed automagicially because log4net.dll was present in my GAC. Here's where my question starts: Why did my reference for log4net.dll get changed from COPY LOCAL = TRUE to COPY LOCAL = FALSE? I suspect it's because it was added to my GAC by another program. How can we prevent this from happening again? As it stands now, if I install a piece of software that uses a common library and it adds it to my GAC, then my SLNs that REF that DLL will change from Copy Local TRUE to FALSE. Thank you so much. I hope this helps people out who have a piece of software that runs in some places, but not in others, when it used to run fine in ALL places.

    Read the article

  • "Cannot open user default database" error with "User Instance=True"

    - by Keith
    I have a desktop application that uses Sql user instancing. This is my connection string: "Data Source=.\SqlExpress; AttachDbFilename=C:\path\file.mdf; Integrated Security=True; User Instance=True; Connect Timeout=100;" My application creates this DB, downloads a load of data into it from a web service and then does a lot of actions with it. The problem comes when I attempt to re-open the connection. I get a SqlException: "Cannot open user default database. Login failed. Login failed for user 'myDomain\myusername'." This error makes no sense in this context - I have no default database. I'm logging in to an instance created just for the current application, running separately from SqlExpress. There's no other way to connect to this DB. If I start the SqlExpress service and connect to the default instance it won't be visible. It only exists for this application. The file on disk is locked by the SqlExpress instance service running under the application. if I stop the app and restart it the connection works first time, but fails on re-opening. If I just stop the app I can delete the .mdf files and begin again, but it still crashes when I re-open the connection. As my app started the instance running as me my current user should have access to every DB in the instance. This doesn't happen for other users of the same code, which suggests that it's a SQL config issue. Does anyone have any idea what causes this and how to work around it?

    Read the article

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