Search Results

Search found 21097 results on 844 pages for 'check snmp'.

Page 42/844 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • python check value not in unicode list

    - by John
    Hi, I have a list and a value and want to check if the value is not in the list. list = [u'first record', u'second record'] value = 'first record' if value not in list: do something however this is not working and I think it has something to do with the list values having a u at the start, how can I fix this? And before someone suggests the list is returned from Django queryset so I can't just take the u out of the code :) Thanks

    Read the article

  • I want to check if $('#td1').text() === "x"?

    - by M.z
    I want to check if innerHtml have X or O , so i can not add again any thing else , but it's not working . it stop after adding the check code , I'm trying here to do a simple X O game to get more familiar with javascript and jquery . also I'm not sure if can do this with jQuery . <script type="text/javascript" > function ranFun() { return Math.floor((Math.random() * 9) + 1); } var a; function Elment(a) { document.getElementById("td" + a).innerHTML = "O"; } function call() { var x = ranFun(); switch (x) { case 1:case 2 :case 3: case 4 :case 5 : case 6 : case 7 : case 8 : case 9 : Elment(x); break; default: break; } } function tdElm(c) { if ($('#td1').text() === "x" || $('#td1').text() == "o") return false; else { document.getElementById("td" + c).innerHTML = "x"; call(); } } </script> <BODY> <center> <h1 >" X ,O Game "</h1> <table > <tr> <td id="td1" onclick="tdElm(1);" ></td> <td id="td2" onclick="tdElm(2);"></td> <td id="td3" onclick="tdElm(3);"></td> </tr> <tr> <td id="td4" onclick="tdElm(4);"></td> <td id="td5" onclick="tdElm(5);"></td> <td id="td6" onclick="tdElm(6);"></td> </tr> <tr> <td id="td7" onclick="tdElm(7);"></td> <td id="td8" onclick="tdElm(8);"></td> <td id="td9" onclick="tdElm(9);"></td> </tr> </table> </center> </BODY>

    Read the article

  • Longitudinal Redundancy Check fails

    - by PaulH
    I have an application that decodes data from a magnetic stripe reader. But, I'm having difficulty getting my calculated LRC check byte to match the one on the cards. If I were to grab 3 cards each with 3 tracks, I would guess the algorithm below would work on 4 of the 9 tracks in those cards. The algorithm I'm using looks like this (C#): private static char GetLRC(string s, int start, int end) { int result = 0; for (int i = start; i <= end; i++) { result ^= Convert.ToByte(s[i]); } return Convert.ToChar(result); } This is an example of track 3 data that fails the check. On this card, track 2 matched, but track 1 also failed. 0 1 2 3 4 5 6 7 8 9 A B C D E F 00 3 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 10 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 7 20 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 30 8 8 8 9 9 9 9 9 9 9 9 9 9 0 0 0 40 0 0 0 0 0 0 0 1 2 3 4 1 1 1 1 1 50 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 60 3 3 3 3 3 3 3 3 The sector delimiter is ';' and it ends with a '?'. The LRC byte from this track is 0x30. Unfortunately, the algorithm above computes an LRC of 0x00 per the following calculation (apologies for its length. I want to be thorough): 00 ^ 3b = 3b ';' 3b ^ 33 = 08 08 ^ 34 = 3c 3c ^ 34 = 08 08 ^ 34 = 3c 3c ^ 34 = 08 08 ^ 34 = 3c 3c ^ 34 = 08 08 ^ 34 = 3c 3c ^ 34 = 08 08 ^ 34 = 3c 3c ^ 34 = 08 08 ^ 35 = 3d 3d ^ 35 = 08 08 ^ 35 = 3d 3d ^ 35 = 08 08 ^ 35 = 3d 3d ^ 35 = 08 08 ^ 35 = 3d 3d ^ 35 = 08 08 ^ 35 = 3d 3d ^ 35 = 08 08 ^ 36 = 3e 3e ^ 36 = 08 08 ^ 36 = 3e 3e ^ 36 = 08 08 ^ 36 = 3e 3e ^ 36 = 08 08 ^ 36 = 3e 3e ^ 36 = 08 08 ^ 36 = 3e 3e ^ 36 = 08 08 ^ 37 = 3f 3f ^ 37 = 08 08 ^ 37 = 3f 3f ^ 37 = 08 08 ^ 37 = 3f 3f ^ 37 = 08 08 ^ 37 = 3f 3f ^ 37 = 08 08 ^ 37 = 3f 3f ^ 37 = 08 08 ^ 38 = 30 30 ^ 38 = 08 08 ^ 38 = 30 30 ^ 38 = 08 08 ^ 38 = 30 30 ^ 38 = 08 08 ^ 38 = 30 30 ^ 38 = 08 08 ^ 38 = 30 30 ^ 38 = 08 08 ^ 39 = 31 31 ^ 39 = 08 08 ^ 39 = 31 31 ^ 39 = 08 08 ^ 39 = 31 31 ^ 39 = 08 08 ^ 39 = 31 31 ^ 39 = 08 08 ^ 39 = 31 31 ^ 39 = 08 08 ^ 30 = 38 38 ^ 30 = 08 08 ^ 30 = 38 38 ^ 30 = 08 08 ^ 30 = 38 38 ^ 30 = 08 08 ^ 30 = 38 38 ^ 30 = 08 08 ^ 30 = 38 38 ^ 30 = 08 08 ^ 31 = 39 39 ^ 32 = 0b 0b ^ 33 = 38 38 ^ 34 = 0c 0c ^ 31 = 3d 3d ^ 31 = 0c 0c ^ 31 = 3d 3d ^ 31 = 0c 0c ^ 31 = 3d 3d ^ 31 = 0c 0c ^ 31 = 3d 3d ^ 31 = 0c 0c ^ 31 = 3d 3d ^ 31 = 0c 0c ^ 32 = 3e 3e ^ 32 = 0c 0c ^ 32 = 3e 3e ^ 32 = 0c 0c ^ 32 = 3e 3e ^ 32 = 0c 0c ^ 32 = 3e 3e ^ 32 = 0c 0c ^ 32 = 3e 3e ^ 32 = 0c 0c ^ 33 = 3f 3f ^ 33 = 0c 0c ^ 33 = 3f 3f ^ 33 = 0c 0c ^ 33 = 3f 3f ^ 33 = 0c 0c ^ 33 = 3f 3f ^ 33 = 0c 0c ^ 33 = 3f 3f ^ 3f = 00 '?' If anybody can point out how to fix my algorithm, I would appreciate it. Thanks, PaulH

    Read the article

  • Delete one row in html table marqued by a check box with javascript

    - by kawtousse
    Hi everyone, I build dynamically my HTML table from database like that: for(i=0;i< nomCols.length;i++) { retour.append(("<td bgcolor=#0066CC>")+ nomCols[i] + "</td>"); } retour.append("</tr>"); retour.append("<tr>"); try { s= HibernateUtil.currentSession(); tx=s.beginTransaction(); Query query = s.createQuery(HQL_QUERY); // inner join projecttasks.ProjectTypeCode as projects");// inner join projecttasks.taskCode as task inner join projects.projectCode as wa;"); for(Iterator it=query.iterate();it.hasNext();) { if(it.hasNext()){ Dailytimesheet object=(Dailytimesheet)it.next(); retour.append("<td><input type=checkbox name=cb id=cb /> </td>"); retour.append("<td>" +object.getTrackingDate() + "</td>"); retour.append("<td>" +object.getActivity() + "</td>"); retour.append("<td>" +object.getProjectCode() + "</td>"); retour.append("<td>" +object.getWAName() + "</td>"); retour.append("<td>" +object.getTaskCode() +"</td>"); retour.append("<td>" +object.getTimeSpent() + "</td>"); retour.append("<td>" +object.getPercentTaskComplete() + "</td>"); } retour.append("</tr>"); } //terminer la table. retour.append (""); tx.commit(); } catch (HibernateException e) { retour.append ("</table><H1>ERREUR:</H1>" +e.getMessage()); e.printStackTrace(); } return retour; } so I want that all check boxes having the same id. When trying to delete one row in my table witch have the check box checked i found a problem with that. Iam using simple javascript like this: function DeleteARow() { //var Rows = document.getElementById('sheet').getElementsByTagName('tr'); //var RowsCount = Rows.length; //alert('Your table has ' + RowsCount + ' rows.'); if (document.getElementById('cb').checked==true) { document.getElementById('cb').parentNode('td').parentNode('tr').remove(); }} It doesn't work approperly and only the first row have the id 'cb'. Many thanks for your help.

    Read the article

  • ASPxGridView Find control (Checkbox) and Check if it is checked or not

    - by Jorge
    I have a checkbox (you can see below) nested in detailed grid. How can I find it on updating click and check if checked or not? I'm using DevExpress GridView <dxwgv:GridViewDataCheckColumn Visible="false" VisibleIndex="14"> <EditFormSettings Visible="True" /> <EditItemTemplate> <dxe:ASPxCheckBox ID="ASPxCheckBox1" Text="" runat="server"> </dxe:ASPxCheckBox> </EditItemTemplate> </dxwgv:GridViewDataCheckColumn>

    Read the article

  • Objective-C how to check if a string is null

    - by norskben
    SO I wish to check to see if the item in my array [clientDataArray objectForKey:@"ClientCompany"] is nil. temp = [clientDataArray objectForKey:@"ClientCompany"]; if (temp != [NSNull null]) infofieldCompany.text = temp; So far I have been able to achieve this through the above code, but it does give me the warnings warning: 'NSArray' may not respond to'-objectForKey:' warning: comparison of distinct Objective-C types 'struct NSNull *' and 'struct NSString *' lacks a cast My main interest is the second warning, but the first warning also interest me. How should I adapt my above code?

    Read the article

  • LINQ 2 Entities , howto check DateTime.HasValue within the linq query

    - by Snoop Dogg
    Hi all ... I have this method that is supposed to get the latest messages posted, from the Table (& EntitySet) called ENTRY ///method gets "days" as parameter, used in new TimeSpan(days,0,0,0);!! using (Entities db = new Entities()) { var entries = from ent in db.ENTRY where ent.DATECREATE.Value > DateTime.Today.Subtract(new TimeSpan(days, 0, 0, 0)) select new ForumEntryGridView() { id = ent.id, baslik = ent.header, tarih = ent.entrydate.Value, membername = ent.Member.ToString() }; return entries.ToList<ForumEntryGridView>(); } Here the DATECREATED is Nullable in the database. I cant place "if"s in this query ... any way to check for that? Thx in advance

    Read the article

  • C# How to check if an FTP Directory Exists

    - by Billy Logan
    Hello Everyone, Looking for the best way to check for a given directory via FTP. currently i have the following code: private bool FtpDirectoryExists(string directory, string username, string password) { try { var request = (FtpWebRequest)WebRequest.Create(directory); request.Credentials = new NetworkCredential(username, password); request.Method = WebRequestMethods.Ftp.GetDateTimestamp; FtpWebResponse response = (FtpWebResponse)request.GetResponse(); } catch (WebException ex) { FtpWebResponse response = (FtpWebResponse)ex.Response; if (response.StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable) return false; else return true; } return true; } This returns false whether the directory is there or not. Can someone point me in the right direction. Thanks in advance, Billy

    Read the article

  • User input... How to check for ENTER key

    - by user69514
    I have a section of code where the user enters input from the keyboard. I want to do something when ENTER is pressed. I am checking for '\n' but it's not working. How do you check if the user pressed the ENTER key? if( shuffle == false ){ int i=0; string line; while( i<20){ cout << "Playing: "; songs[i]->printSong(); cout << "Press ENTER to stop or play next song: "; getline(cin, line); if( line.compare("\n") == 0 ){ i++; } } }

    Read the article

  • Check ReturnUrl is valid before redirecting

    - by Josh
    I'm using ASP.NET Membership and Form Authentication and before redirecting to the returnURL I wanted to validate it. For those unfamiliar with the workflow, basically if you request a page that requires that you are authenticated, you are redirected to a login page. In the URL string you'll see a parameter called returnURL, e.g. http://example.com/login.aspx?ReturnUrl=%2fprotected%2fdefault.aspx Whether you use this in a redirect such as Response.Redirect(returnURL) or indirectly through the FormsAuthentication.RedirectFromLoginPage method, it passes without validating returnURL. FormsAuthentication.RedirectFromLoginPage does have a security check that it is isn't leaving the domain, but that still doesn't stop someone from putting enough random characters to cause an error. I tried using System.IO.File.Exists(Server.MapPath(returnURL)) but given enough illegal characters it cause Server.MapPath to error. Note: URLEncoding doesn't work because we are not cleaning a parameter, but the primary URL. Any other suggestions for validating or cleaning the returnURL value?

    Read the article

  • How to check if object is sql to linq type

    - by remdao
    Hi, anyone know if there's any easy way to check if an object is an sql to ling type? I have a method like this but would like it to only accept valid types. public static void Update(params object[] items) { using (TheDataContext dc = new TheDataContext()) { System.Data.Linq.ITable table; if(items.Length > 0) table = dc.GetTable(items[0].GetType()); for (int i = 0; i < items.Length; i++) { table.Attach(items[i]); dc.Refresh(System.Data.Linq.RefreshMode.KeepCurrentValues, items[i]); } dc.SubmitChanges(); } }

    Read the article

  • Check for Block Ads/Scripts (Browser Addons, Compatibility)

    - by acidzombie24
    I'm conflicted. you guys decide if this should migrate to SU or not. I would like to test my site against popular browser ad ons. ATM i have tested against noscript and adblock plus for firefox. What other popular ad ons should i check compatibility with? By compatibility i mean to work as intent on browsers i support (opera, firefox, chrome, IE 7/8) which include ads. NoScript broke my site and for adblock plus i ask once per week to consider allowing ads. When i see IE6 i notify the user the site is known to be unusable with that browser (The site is script heavy by nature and i wouldnt want to accidentally serve ads to infect users of IE6 with a virus).

    Read the article

  • Check if user exists in Active Directory

    - by K.R.
    Hello, I need to check if an user exists in AD and if so, retrieve some user information. I have been able to do this as shown below. But, it is very slow. Is there any way to do this faster? Thanks! using System; using System.DirectoryServices; using System.DirectoryServices.AccountManagement; namespace ConsoleApplication1 { class Program { static void Main() { Console.WriteLine("Enter AD account name..."); string strADLoginName = Console.ReadLine(); using(PrincipalContext context = new PrincipalContext(ContextType.Domain,"DEVMC")) { using (UserPrincipal user = UserPrincipal.FindByIdentity(context, strADLoginName)) { bool userExists = (user != null); if (userExists) { Console.WriteLine("User exists"); Console.WriteLine(user.EmailAddress); } else { Console.WriteLine("User doesn't exist"); } } } Console.ReadKey(); } } }

    Read the article

  • How to check a print job status with C#

    - by Saab
    I'm printing a PDF file by executing a commandline application from within my C# application. Now I wanna know when this job is printed. I was hoping there would be some kind of event I could subscribe to, and handle it. But I couldn't find it. So now I'm resorting to polling. And checking the JobStatus of a PrinterSystemJobInfo object. But in my case this either gives me JobStatus = None or JobStatus = Printing. PrinterSystemJobInfo.JobStatus Can someone tell me how to reliably check a print job status using C#?

    Read the article

  • MySQLi PHP: Check if SQL INSERT query was fully successful using MySQLi

    - by Jonathan
    Hi, I have this big function that gets a lot of different data and insert it into multiple tables.. Not all the data is always available so not all the SQL INSERT queries are successful. I need to check which SQL INSERT query was fully successful and which wasn't to the do something with this data (like inserting into a log table or similar). Just to give you an example of how I think it can be done: $sql = 'INSERT INTO data_table (ID, column1, column2) VALUES(?, ?, ?)'; if ($stmt->prepare($sql)) { $stmt->bind_param('iss', $varID, $var1, $var2); if ($stmt->execute()) { $success == TRUE; //or something like that } } I'm not completely sure this is the best way and if its always really show if the data was inserted into the table... Any suggestions??

    Read the article

  • ajax: don't wait for response, but check for it periodically

    - by dnagirl
    I have a PHP process that takes a long time to run. I don't want the AJAX process that calls it to wait for it to finish. When the PHP process finishes it will set a field in a database. There should be some kind of AJAX polling call to check on the database field periodically and set a message. How do I set up a jQuery AJAX call to poll rather than wait? Does the PHP script have to do anything special?

    Read the article

  • How to check misspelled email during user registration

    - by Nulldevice
    I use an email registration and confirmation in my project (yes, I know about OpenID. In my counry, a main email service lack it). Sometimes users misspell their email addresses. I know about this due to "message could not be delivered" letters in a mailbox. A misspelled address is absolutely correct, because I check it with a regular expression - say, [email protected] intstead of [email protected]. And I do not want to duplicate a email field in a registration form (who likes it?). Request processing routine cannot wait for email delivery - it could take an unpredictable time. So, my script will return to user a confirmation message "An email was sent". And the user will wait for it forever (of cause, not - he/she will turn to an alternative project with a more perfect registration system). Does someone knows how it can be improved (in any programming language)?

    Read the article

  • How to Force iPhone to Check Orientation

    - by Shannon A.
    Here's the problem: View Controller #1 only runs in the two landscape orientations. View Controller #2 runs in any orientation. When view controller #2 is pushed on top of view controller #1 (using presentModalViewController:animated:, as it happens), there's no check for orientation. Instead, VC #2 just assumes the orientation is whichever landscape orientation VC #1 is currently in. This behavior is incorrect if the user happens to be holding the iPhone in a portrait orientation, despite the fact that he's viewing VC #1 where it's not supported. This can easily happen during startup, so it's not just a theoretical question. Is there any way to tell VC #2 to recheck what it's orientation actually is? If so, where would it be best placed? viewDidLoad?

    Read the article

  • check if(country == @"(null)" doesn't work

    - by Sean
    hi all, I got the problem that the if-statement doesn't work. After the first code line the variable contains the value "(null)", because the user who picked the contact from his iphone address book doesn't set the country key for this contact, so far so good. but if I check the variable, it won't be true, but the value is certainly "(null)"... does someone have an idea? NSString *country = [NSString [the dict objectForKey:(NSString *)kABPersonAddressCountryKey]]; if(country == @"(null)") { country = @""; } thanks in advance sean

    Read the article

  • query SQL how to check all records from a three table join share the same value

    - by Stefano
    Hello Since i'm a poor sql developer, i need support to write a sql query for the following scenario (just a simplified example of my situation): i've got 3 tables, say employe table,department table and companybranch table. the dept column , on the employe table is a fk on the department table; the branch column on the department table is a fk on the companybranch table. Finally more employee are "marked" with the same value . There's a way to select all employes with the same "mark" and, in the same query, check that they work in the same company branch ? thank you in advance Stefano

    Read the article

  • How to check if a generic type definition inherits from another generic type definition

    - by Anne
    I'm trying to check whether an open generic type definition implements some open generic interface. Look at the sample below: public interface IService<T> { } public class ServiceImpl<T> : IService<T> { } private static bool OpenGenericTypeImplementsOpenGenericInterface( Type derivedType, Type interfaceType) { return derivedType.GetInterfaces().Contains(interfaceType); } [TestMethod] public void Verify() { Type openGenericImplementation = typeof(ServiceImpl<>); Type expectedInterfaceType = typeof(IService<>); bool implDoesImplementInterface = OpenGenericTypeImplementsOpenGenericInterface( openGenericImplementation, expectedInterfaceType); // This assert fails. Why? Assert.IsTrue(implDoesImplementInterface); } I found out that the returned type from the Type.GetInterfaces() method does not match the type returned from typeof(IService<>). I can't figure out why that is and how to correctly validate whether some generic type definition inherits or implements some other generic type definition. What's going on here and how do I solve fix this problem?

    Read the article

  • javascript date and loop check

    - by StealthRT
    Hey all, this is the code i have to check for a day thats equal to the list of days in the comma seperated list: for(var i = 0; i < daysHidden.length; i++){ if (daysHidden[i] == d.getDate()); { alert(daysHidden[i] + '=' + d.getDate()); } } the daysHidden = 1 (its the only thing in the list April 1st is already gone and todays the 2nd so 1 is the only one in the list) and d.getDate() has 1-30 (for april) When i run the code, however, it keeps looping through the if code when it should only loop once (when it finds that 1=1 However, i keep getting the alert box that says: 1=1 1=2 1=3 etc.... 1=30 So i do not know what i am doing incorrect? I already tried putting them as strings: if (daysHidden[i].ToString == d.getDate().ToString); But that doesnt seem to work.... Any help would be great :) David

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >