Search Results

Search found 11178 results on 448 pages for 'syntax checking'.

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

  • Checking values in this array, JQuery

    - by Felix Guerrero
    Hi. I have this array (JQuery) where I add all my form's controls, it looks like: var name = $("#name"), surname = $("#surname"), address = $("#address"), phone = $("#phone"), photo = $("#photo"), grade = $("#grade"), profession = $("#profession"), email = $('#email'), title = $('#title'), allFields = $([]).add(name) .add(surname) .add(address) .add(phone) .add(photo) .add(grade) .add(profession) .add(email) .add(title) .add(grade); I want to check the values of each element into the 'allFields' array with function checkingFieldsArentEmpty(){ var valid = true; for (var f in allFields){ if(allFields[f].val() === null) //if any val is null just return false return false; } //true return valid; } I need ideas in order to improve the last function. Thanks.

    Read the article

  • URL equals and checking Internet access

    - by James P.
    On http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html it states that: Compares this URL for equality with another object. If the given object is not a URL then this method immediately returns false. Two URL objects are equal if they have the same protocol, reference equivalent hosts, have the same port number on the host, and the same file and fragment of the file. Two hosts are considered equivalent if both host names can be resolved into the same IP addresses; else if either host name can't be resolved, the host names must be equal without regard to case; or both host names equal to null. Since hosts comparison requires name resolution, this operation is a blocking operation. Note: The defined behavior for equals is known to be inconsistent with virtual hosting in HTTP. According to this, equals will only work if name resolution is possible. Since I can't be sure that a computer has internet access at a given time, should I just use Strings to store addresses instead? Also, how do I go about testing if access is available when requested?

    Read the article

  • Most efficient way of checking for a return from a function call in Perl

    - by Gaurav Dadhania
    I want to add the return value from the function call to an array iff something is returned (not by default, i.e. if I have a return statement in the subroutine.) so I'm using unshift @{$errors}, "HashValidator::$vfunction($hashref)"; but this actually adds the string of the function call to the array. I also tried unshift @{$errors}, $temp if defined my $temp = "HashValidator::$vfunction($hashref)"; with the same result. What would a perl one-liner look like that does this efficiently (I know I can do the ugly, multi-line check but I want to learn). Thanks,

    Read the article

  • Checking if an SSH tunnel is up and running

    - by Jarmund
    I have a perl script which, when destilled a bit, looks like this: my $randport = int(10000 + rand(1000)); # Random port as other scripts like this run at the same time my $localip = '192.168.100.' . ($port - 4000); # Don't ask... backwards compatibility system("ssh -NL $randport:$localip:23 root\@$ip -o ConnectTimeout=60 -i somekey &"); # create the tunnel in the background sleep 10; # Give the tunnel some time to come up # Create the telnet object my $telnet = new Net::Telnet( Timeout => 10, Host => 'localhost', Port => $randport, Telnetmode => 0, Errmode => \&fail, ); # SNIPPED... a bunch of parsing data from $telnet The thing is that the target $ip is on a link with very unpredictable bandwidth, so the tunnel might come up right away, it might take a while, it might not come up at all. So a sleep is necessary to give the tunnel some time to get up and running. So the question is: How can i test if the tunnel is up and running? 10 seconds is a really undesirable delay if the tunnel comes up straight away. Ideally, i would like to check if it's up and continue with creating the telnet object once it is, to a maximum of, say, 30 seconds.

    Read the article

  • Checking an empty Core Data relationship (SQLite)

    - by rwat
    I have a to-many relationship in my data model, and I'd like to get all the objects that have no corresponding objects in the relationship. For example: Customer - Purchases I want to get all Customers that have 0 Purchases. I've read somewhere that I could use "Purchases[SIZE] = 0", but this gives me an unsupported function expression error, which I think means it doesn't work with a SQLite backing store (which I don't want to switch from, due to some performance constraints). Any ideas?

    Read the article

  • Checking for DBNull throws a StrongTypingException

    - by calico-cat
    I am using a dataset to pull data from a DB. One of the fields in a row is NULL. I know this. However, the following vb.net code throws a StrongTypingException (in the autogenerated get_SomeField() method in the dataset designer): If Not IsDBNull(aRow.SomeField) Then 'do something End If According to documentation and this question it should be fine. edit: If aRow.SomeField is DBNull.Value Then also returns the same error. Argh.

    Read the article

  • MouseListener fired without checking JCheckBox

    - by Morinar
    This one is pretty crazy: I've got an AppSight recording (for those not familiar, it's a recording of what they did including keyboard/mouse input + network traffic, etc) of a customer reproducing a bug. Basically, we've got a series of items listed on the screen with JCheckBox-es down the left side. We've got a MouseListener set for the JPanel that looks something like this: private MouseAdapter createMouseListener() { return new MouseAdapter(){ public void mousePressed( MouseEvent e ) { if( e.getComponent() instanceof JCheckBox ) { // Do stuff } } }; } Based on the recording, it appears very strongly that they click just above one of the checkboxes. After that, it's my belief that this listener fired and the "Do stuff" block happened. However, it did NOT check the box. The user then saw that the box was unchecked, so they clicked on it. This caused the "Do stuff" block to fire again, thus undoing what it had done the first time. This time, the box was checked. Therefore, the user thinks that the box is checked, and it looks like it is, but our client thinks that the box is unchecked as it was clicked twice. Is this possible at all? For the life of me, I can't reproduce it or see how it could be possible, but based on the recording and the data the client sent to the server, I can't see any other logical explanation. Any help, thoughts, and or ideas would be much appreciated.

    Read the article

  • Checking for a null int value from a Java ResultSet

    - by ian_scho_es
    In Java I'm trying to test for a null value, from a ResultSet, where the column is being cast to a primitive int type. int iVal; ResultSet rs = magicallyAppearingStmt.executeQuery(query); if (rs.next()) { if (rs.getObject("ID_PARENT") != null && !rs.wasNull()) { iVal = rs.getInt("ID_PARENT"); } } From the code fragment above, is there a better way to do this, and I assume that the second wasNull() test is redundant? Educate us, and Thanks

    Read the article

  • Checking JRE version inside browser

    - by Brian Lewis
    Basically, I'm wanting to figure out the best way to check the user's JRE version on a web page. I have a link to a JNLP file that I only want to display if the user's JRE version is 1.6 or greater. I've been playing around with the deployJava JavaScript code (http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html) and have gotten it to work in every browser but Safari (by using deployJava.versionCheck). For whatever reason, Safari doesn't give the most updated JRE version number - I found this out by displaying the value of the getJREs() function. I have 1.6.0_20 installed, which is displayed in every other browser, but Safari keeps saying that only 1.5.0 is currently installed. I've also tried using the createWebStartLaunchButtonEx() function and specifying '1.6.0' as the minimum version, but when I click the button nothing happens (in any browser). Any suggestions?

    Read the article

  • Checking if a boolean column is true in MySQL/Rails

    - by Pygmalion
    Rails and MySQL: I have a table with several boolean columns representing tags. I want to find all the rows for which a specific one of these columns is 'true' (or I guess in the case of MySQL, '1'). I have the following code in my view. @tag = params[:tag] @supplies = Supply.find(:all, :conditions=>["? IS NOT NULL and ? !=''", @tag, @tag], :order=>'name') The @tag is being passed in from the url. Why is it then that I am instead getting all of my @supplies (i.e. every row) rather than just those that are true for the column for @tag. Thanks!

    Read the article

  • Checking digital signature on EXE

    - by LTR
    My .NET exe is signed using signtool. Using this code, I can verify the validity of the certificate itself: var cert = X509Certificate.CreateFromSignedFile("application.exe"); var cert2 = new X509Certificate2(cert.Handle); bool valid = cert2.Verify(); However, this only checks the certificate itself, and not the signature of the EXE. Therefore, if the EXE is tampered with, this method doesn't detect it. How can I check the signature?

    Read the article

  • Checking for nulls in ASP.NET MVC Controllers

    - by Brian McCord
    Another opinion question: What is the proper (in your opinion) to check for nulls in an MVC controller. For instance, if you have an edit controller that fetches a record from the db based on an id, what do you do if that record is not found? I found this article, but I'm not sure I like that method. Do you just check for it with an if statement and redirect to a 404 page? What solution do you use?

    Read the article

  • Checking type sizes in C with macros.

    - by Seisatsu
    I'm writing a program that needs to have unsigned types with definite sizes. I need a uint8, uint16, uint32, and uint64, and I need them defined in types.h, in a way that they will always be defined correctly regardless of platform. My question is, how can I check the sizes of different types on each platform using preprocessor macros, so that I can define my custom types correctly in the types.h header?

    Read the article

  • problem while checking second check checkbox checked.

    - by kumar
    $('#nextpage').click(function() { $('#Details input[type=checkbox]').each( function() { if( $(this).attr('checked') ) { $("#tabs").tabs('enable', 3).tabs('select', 3); } else { $().ShowDialog('please select atleast one'); } }); }); <fieldset> <legend>information</legend> <input type="checkbox"> <label>ID#: <span><%=(null != a) ? Model.ID: 0%></span></label> <label>Name:<span><%=(null != a) ? Model.Name: null%></span></label> </fieldset> this filedset is for multiple users.. that is on the same page there are multiple fiedsetsfor multiple users.. how to handle those things.. thanks

    Read the article

  • [bash] checking wget's return value [if]

    - by wwrob
    I'm writing a script to download a bunch of files, and I want it to inform when a particular file doesn't exist. r=`wget -q www.someurl.com` if [ $r -ne 0 ] then echo "Not there" else echo "OK" fi But it gives the following error on execution: ./file: line 2: [: -ne: unary operator expected What's wrong?

    Read the article

  • Checking deployed port in ruby on rails application

    - by john chan
    Is there an elegant way to check which port you deployed a ruby on rails application using mongrel? I could not find a directive (i.e. such as #{RAILS_ROOT} which contains the root directory of the application) that I can use to perform a check. I need this to do a check since I am deploying the same application on different ports and I need the app to do different things according to the port that is being accessed. Any help would be appreciated, Thanks

    Read the article

  • checking virtual sub domains

    - by Persian.
    I create a project that check the sub domain and redirect to the exist subdomain ( username ) but I can't find out why when the username is in database it can't show it . on local system it works finely .. but when I upload it on server it not works .. of course I change the commented place to uncomment for test .. but it's not working .. it shows this error : Object reference not set to an instance of an object. My code is this in page load : //Uri MyUrl = new Uri(Request.Url.ToString()); //string Url = MyUrl.Host.ToString(); Uri MyUrl = new Uri("http://Subdomain.Mydomain.com/"); string Url = MyUrl.Host.ToString(); string St1 = Url.Split('.')[0]; if ((St1.ToLower() == "Mydomain") || (St1.ToLower() == "Mydomain")) { Response.Redirect("Intro.aspx"); } else if (St1.ToLower() == "www") { string St2 = Url.Split('.')[1]; if ((St2.ToLower() == "Mydomain") || (St2.ToLower() == "Mydomain")) { Response.Redirect("Intro.aspx"); } else { object Blogger = ClsPublic.GetBlogger(St2); if (Blogger != null) { lblBloger.Text = Blogger.ToString(); if (Request.QueryString["id"] != null) { GvImage.DataSourceID = "SqlDataSourceImageId"; GvComments.DataSourceID = "SqlDataSourceCommentsId"; this.BindItemsList(); GetSubComments(); } else { SqlConnection scn = new SqlConnection(ClsPublic.GetConnectionString()); SqlCommand scm = new SqlCommand("SELECT TOP (1) fId FROM tblImages WHERE (fxAccepted = 1) AND (fBloging = 1) AND (fxSender = @fxSender) ORDER BY fId DESC", scn); scm.Parameters.AddWithValue("@fxSender", lblBloger.Text); scn.Open(); lblLastNo.Text = scm.ExecuteScalar().ToString(); scn.Close(); GvImage.DataSourceID = "SqlDataSourceLastImage"; GvComments.DataSourceID = "SqlDataSourceCommentsWId"; this.BindItemsList(); GetSubComments(); } if (Session["User"] != null) { MultiViewCommenting.ActiveViewIndex = 0; } else { MultiViewCommenting.ActiveViewIndex = 1; } } else { Response.Redirect("Intro.aspx"); } } } else { object Blogger = ClsPublic.GetBlogger(St1); if (Blogger != null) { lblBloger.Text = Blogger.ToString(); if (Request.QueryString["id"] != null) { GvImage.DataSourceID = "SqlDataSourceImageId"; GvComments.DataSourceID = "SqlDataSourceCommentsId"; this.BindItemsList(); GetSubComments(); } else { SqlConnection scn = new SqlConnection(ClsPublic.GetConnectionString()); SqlCommand scm = new SqlCommand("SELECT TOP (1) fId FROM tblImages WHERE (fxAccepted = 1) AND (fBloging = 1) AND (fxSender = @fxSender) ORDER BY fId DESC", scn); scm.Parameters.AddWithValue("@fxSender", lblBloger.Text); scn.Open(); lblLastNo.Text = scm.ExecuteScalar().ToString(); scn.Close(); GvImage.DataSourceID = "SqlDataSourceLastImage"; GvComments.DataSourceID = "SqlDataSourceCommentsWId"; this.BindItemsList(); GetSubComments(); } if (Session["User"] != null) { MultiViewCommenting.ActiveViewIndex = 0; } else { MultiViewCommenting.ActiveViewIndex = 1; } } else { Response.Redirect("Intro.aspx"); } } and my class : public static object GetBlogger(string User) { SqlConnection scn = new SqlConnection(ClsPublic.GetConnectionString()); SqlCommand scm = new SqlCommand("SELECT fUsername FROM tblMembers WHERE fUsername = @fUsername", scn); scm.Parameters.AddWithValue("@fUsername", User); scn.Open(); object Blogger = scm.ExecuteScalar(); if (Blogger != null) { SqlCommand sccm = new SqlCommand("SELECT COUNT(fId) AS Exp1 FROM tblImages WHERE (fxSender = @fxSender) AND (fxAccepted = 1)", scn); sccm.Parameters.AddWithValue("fxSender", Blogger); object HasQuty = sccm.ExecuteScalar(); scn.Close(); if (HasQuty != null) { int Count = Int32.Parse(HasQuty.ToString()); if (Count < 10) { Blogger = null; } } } return Blogger; } Which place if my code has problem ?

    Read the article

  • Checking if an element is visible in Chrome using Selenium Remote WebDriver

    - by Stuart
    Is there a cross browser solution to check if an element is visible using WebDriver? The solution for IE and firefox is to cast the object to a RenderedRemoteWebElement and then call the property Displayed. I'm using the following methods to return if a element is visible: /// <summary> /// Check if the control is visible. /// </summary> public bool IsVisible() { IWebElement control = mSelenium.FindElement(mFindBy); return ((RenderedRemoteWebElement)control).Displayed; } The problem is when I run this using Chrome, I get an exception when casting to type RenderedRemoteWebElement, this is not really the problem as I can catch this, but I need to a solution to check if an element is visible in chrome. Thanks

    Read the article

  • SSRS - Checking whether the data is null

    - by NLV
    Hello I've the following expression in my report. =FormatNumber(MAX(Fields!Reading.Value, "CellReading_Reading"),3) Now when the dataset is empty 'Fields!Reading.Value' becomes empty and finding their maximum is invalid. How can i check if the entire column is empty? I tried the following with no luck. =iif(IsNothing(Fields!.Reading.Value),"",FormatNumber(MAX(Fields!Reading.Value, "CellReading_Reading"),3)) But still i'm getting #Error in the report. I also checked out link and was not able to get a clue from it. I want to handle it in the report level. Thank you. NLV

    Read the article

  • Scala : cleanest way to recursively parse files checking for multiple strings

    - by fred basset
    Hi All, I want to write a Scala script to recursively process all files in a directory. For each file I'd like to see if there are any cases where a string occurs at line X and line X - 2. If a case like that occurs I'd like to stop processing that file, and add that filename to a map of filenames to occurrence counts. I just started learning Scala today, I've got the file recurse code working, and need some help with the string searching, here's what I have so far: import java.io.File import scala.io.Source val s1= "CmdNum = 506" val s2 = "Data = [0000,]" def processFile(f: File) { val lines = scala.io.Source.fromFile(f).getLines.toArray for (i = 0 to lines.length - 1) { // want to do string searches here, see if line contains s1 and line two lines above also contains s1 //println(lines(i)) } } def recursiveListFiles(f: File): Array[File] = { val these = f.listFiles if (these != null) { for (i = 0 to these.length - 1) { if (these(i).isFile) { processFile(these(i)) } } these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles) } else { Array[File]() } } println(recursiveListFiles(new File(args(0))))

    Read the article

  • php, checking correctnes of text splitting

    - by Ferol
    I need to split html document on two parts. First part, should contain N(30) words, and next one should contain everything else. And the main problem, is to prevent splitting tags (description and body of tags). Give me please suggestions (or if you have already written such function, please share your code), how to realize it! Thanks.

    Read the article

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