Search Results

Search found 21001 results on 841 pages for 'spelling check'.

Page 56/841 | < Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >

  • Python check if object is in list of objects

    - by John
    Hi, I have a list of objects in Python. I then have another list of objects. I want to go through the first list and see if any items appear in the second list. I thought I could simply do for item1 in list1: for item2 in list2: if item1 == item2: print "item %s in both lists" However this does not seem to work. Although if I do: if item1.title == item2.title: it works okay. I have more attributes than this though so don't really want to do 1 big if statement comparing all the attributes if I don't have to. Can anyone give me help or advise on what I can do to find the objects which appear in both lists. Thanks

    Read the article

  • Using Django.test.client to check template vars

    - by scott
    I've got a view that I'm trying to test with the Client object. Can I get to the variables I injected into the render_to_response of my view? Example View: def myView(request): if request.method == "POST": # do the search return render_to_response('search.html',{'results':results},context_instance=RequestContext(request)) else: return render_to_response('search.html',context_instance=RequestContext(request) Test: c = Client() response = c.post('/school/search/', {'keyword':'beagles'}) # how do I get to the 'results' variable??

    Read the article

  • ASP Classic and JavaScript check for session status

    - by StealthRT
    I am in need of some help with trying to figure out how to go about checking the users session and seeing if they are still logged in or not. The problem being is because i have a static page that pretty much loads everything into "tabs" using jquery. So when the user navigates the page, it really never leaves that same page they started out on. Hints my problem in trying to determine if they are still logged in or not when they click on update their information on their profile or whatnot.

    Read the article

  • Check if a GtkEntryCompletion is currently visible

    - by Joe
    I have a GtkEntry with a GtkEntryCompletion attached to it. The Entry does something fairly expensive if the user hasn't changed the text in it for a second (to preview search results). However it's very common for the user to stop typing in order to select the correct autocompletion. So I'd like to delay the preview until the user has stopped typing and the GtkEntryCompletion is not currently suggesting anything. GtkEntryCompletion is not a real widget however, and doesn't seem to have any way to get to whatever widget does own the CellRenderers it uses. Is there a way I can detect if it's visible or not?

    Read the article

  • password-check directive in angularjs

    - by mpm
    I'm writing a password verify directive : Directives.directive("passwordVerify",function(){ return { require:"ngModel", link: function(scope,element,attrs,ctrl){ ctrl.$parsers.unshift(function(viewValue){ var origin = scope.$eval(attrs["passwordVerify"]); if(origin!==viewValue){ ctrl.$setValidity("passwordVerify",false); return undefined; }else{ ctrl.$setValidity("passwordVerify",true); return viewValue; } }); } }; }); html : <input data-ng-model='user.password' type="password" name='password' placeholder='password' required> <input data-ng-model='user.password_verify' type="password" name='confirm_password' placeholder='confirm password' required data-password-verify="user.password"> Given 2 password fields in a form, if both password values are equal then the field affected by the directive is valid. The issue is that it works one way (i.e. when I type a password in the password-verify field). However, when the original password field is updated, the password-verify doesn't become valid. Any idea how I could have a "two way binding verify?"

    Read the article

  • How to check whether your code environment on Windows or on Linux or other OS

    - by justjoe
    hi, right now, i code custom wordpress theme and testing it in xampp windows XP on apache server. But as long as i concern, there's no wp build-in function to identify the code environment. Is there's any PHP build-in function to identify such thing ? for the record, what i want to code need to read a directory. in my apache (in windows), the path will be c:/xampp/htdocs where apache on linux will be \somepath\somepath\ so, is there any code solution to know what is the OS environment without i have to compare the path ? i hope it will also work on other OS with other webserver then APACHE such as IIS

    Read the article

  • Is this the best approach using generics to check for nulls

    - by user294747
    public static T IsNull<T>(object value, T defaultValue) { turn ((Object.Equals(value,null)) | (Object.Equals(value,DBNull.Value)) ? defaultValue : (T)value); } public static T IsNull<T>(object value) where T :new() { T defaultvalue = new T(); return IsNull(value, defaultvalue); } Have tested, and can use against data objects, classes and variables. Just want to know if there is better way to go about this.

    Read the article

  • CCRC unable to check in and check out issue.

    - by Rational Admin
    Hi; One of the team with Clearcase already set up is facing issues in checking and checking out files. They don't have issue in adding a new file to source control. The team has been complaining that they are unable to do so due to domain problem. Seems like Clearcase server is in a domain and the users are logging to the server from a different domain. I haven't yet had a look at the environment. Do you have any idea or would be able to give me heads up on the cause of this issue. Have you ever faced this issue in the past?

    Read the article

  • jQuery: manipulating through children to check the checkbox in a table row

    - by gsquare567
    $("tr.clickable").each(function() {$(this).click(function() { $(this).children("td:first > input").is(":checked") ? $(this).children("td:first > input").removeAttr("checked") : $(this).children("td:first > input").attr("checked","checked"); })}); this only checks the first row in my table (no matter which row i click on). how can i apply it so that it checks the input on the specific row i click on? thanks! HTML: <tr id="row0" class="alternate clickable"> <td><img width="11" height="11" title="This email failed to send." alt="Failed" src="images/error_warning.png"><br> <input type="checkbox" value="6751" name="emailCheck[]" class="emailCheck"> </td>...

    Read the article

  • function to efficiently check a change of value in a nested hashmap

    - by zcaudate
    the motivation is for checking what has changed in a deeply nest map, kind of like a reverse of update-in. This is a simple example: (def p1 {:a {:a1 :1 :a2 :2} :b {:b1 :1 :b2 :2}}) (def p2 (update-in p1 [:a :a1] (constantly :updated)) ;; => {:a {:a1 :updated :a2 :2} ;; :b {:b1 :1 :b2 :2}} (what-changed? p1 p2) ;; => {:keys [:a :a1] :value :updated) (what-changed? p2 p1) ;; => {:keys [:a :a1] :value :2) I'm hoping that because clojure maps are persistent data-structures, there may be a smart algorithm to figure this out by looking at the underlying structure as opposed to walking through the nested maps and comparing the difference.

    Read the article

  • fastest way to check to see if a certain index in a linq statement is null

    - by tehdoommarine
    Basic Details I have a linq statement that grabs some records from a database and puts them in a System.Linq.Enumerable: var someRecords = someRepoAttachedToDatabase.Where(p=>true); Suppose this grabs tons (25k+) of records, and i need to perform operations on all of them. to speed things up, I have to decided to use paging and perform the operations needed in blocks of 100 instead of all of the records at the same time. The Question The line in question is the line where I count the number of records in the subset to see if we are on the last page; if the number of records in subset is less than the size of paging - then that means there are no more records left. What I would like to know is what is the fastest way to do this? Code in Question int pageSize = 100; bool moreData = true; int currentPage = 1; while (moreData) { var subsetOfRecords = someRecords.Skip((currentPage - 1) * pageSize).Take(pageSize); //this is also a System.Linq.Enumerable if (subsetOfRecords.Count() < pageSize){ moreData = false;} //line in question //do stuff to records in subset currentPage++; } Things I Have Considered subsetOfRecords.Count() < pageSize subsetOfRecords.ElementAt(pageSize - 1) == null (causes out of bounds exception - can catch exception and set moreData to false there) Converting subsetOfRecords to an array (converting someRecords to an array will not work due to the way subsetOfRecords is declared - but I am open to changing it) I'm sure there are plenty of other ideas that I have missed.

    Read the article

  • Zend Namespace - Check if Session Exists

    - by Vincent
    All, I am using Zend Framework and Zend_Session to do global session management for my application. I plan to clear all sessions on logout and hence am using the following code: if($this->sessionExists()) { $this->destroy(); } But it seems like it's not doing a good job.. I am getting an error: PHP Warning: session_destroy() [<a href='function.session-destroy'> function.session-destroy</a>]: Trying to destroy uninitialized session How can I get rid of this error? Is there an alternative to sessionExists()?

    Read the article

  • Select statement to check multiple rows against 2 variables

    - by Duncan Cook
    I have the following table : alertID inspectorID datelive dateread 1 none 2012-11-06 10:36:03.350 NULL 2 none 2012-11-06 10:36:25.043 NULL 3 none 2012-11-06 10:36:42.433 NULL 1 31030 2012-11-06 10:37:19.193 2012-06-11 10:34:47.000 I want to select the alerts that dont have the inspectors ID against it AND where the alert ID doenst match the one that has the inspectorID against it, ie inspector has read alert 1 so i only want it to return alerts 2 & 3 Am using Classic ASP and MS-SQL Cheers

    Read the article

  • Implementing a Version check between an Abstract class and it's implementation

    - by Michael Stum
    I have this abstract class and concrete implementation (they are in different assemblies): public abstract class MyAbstractClass { private static readonly int MyAbstractClassVersion = 1; public abstract int ImplementedVersion { get; } protected MyAbstractClass() { CheckVersion(); } private void CheckVersion() { var message = string.Format( "MyAbstractClass implements Version {0}, concrete is Version {1}", RepositoryVersion, ImplementedVersion); if (!MyAbstractClassVersion.Equals(ImplementedVersion)) throw new InvalidOperationException(message); } } public class ConcreteClass : MyAbstractClass { public ConcreteClass() : base() { // ConcreteClass is guaranteed to have // a constructor that calls the base constructor // I just simplified the example } public override int ImplementedVersion { get { return 2; } } } As you see, I call CheckVersion() from the abstract constructor, to get rid of the "virtual member call in base constructor" message, but I am not sure if that's really the way to do it. Sure, it works, but that doesn't mean it will always work, will it? Also, I wonder if I can get the name of the Concrete Type from the CheckVersion() function? I know that adding new abstract members will force an error anyway (System.TypeLoadException) and I'm not sure if I want this type of strict Versioning, but I'm just curious how it would be done properly given only the abstract class and an implementation (I know I could do it by using interfaces and/or a Factory pattern).

    Read the article

< Previous Page | 52 53 54 55 56 57 58 59 60 61 62 63  | Next Page >