Search Results

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

Page 80/841 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • Java: How to check if a date Object equals yesterday?

    - by tzippy
    Right now I am using this code Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE) - 1, 12, 0, 0); //Sets Calendar to "yeserday, 12am" if(sdf.format(getDateFromLine(line)).equals(sdf.format(cal.getTime()))) //getDateFromLine() returns a Date Object that is always at 12pm {...CODE There's got to be a smoother way to check if the date returned by getdateFromLine() is yesterday's date. Only the date matters, not the time. That's why I used SimpleDateFormat. Thanks for your help in advance!

    Read the article

  • how to raise warning if return value is disregarded - gcc or static code check?

    - by Drakosha
    I'd like to see all the places in my code (C++) which disregard return value of a function. How can I do it - with gcc or static code analysis tool? Bad code example: int f(int z) { return z + (z*2) + z/3 + z*z + 23; } int main() { int i = 7; f(i); ///// <<----- here I disregard the return value return 1; } Update: it should work even if the function and its use are in different files free static check tool

    Read the article

  • How to automatically check out a database file in a source controlled web application ?

    - by TheRHCP
    Hello, I am working on an ASP.NET web application, we are a small team (4 students) and we do not have access to a dedicated server to host the database instance. So for this web application we decided just to put the database file in the App_Data folder. The problem is that our project is source controled on TFS, so every time you open the solution and try to launch the web application, we get an expcetion saying that database is read-only. That is logical because the databse file is not automatically checked-out. Is there a workaround to avoid a manual check-out of the database file everytime we open the solution ? Thanks.

    Read the article

  • How to check input text into web form? java script

    - by butteff
    how to check input text before POST operation? it must be numbers only <form method="post" action="credit.php"> ????? ???????: <input type="text" name="sum"> <br /> ?????? ?????: <input type="text" name="pv"> <br /> ????: <input type="text" name="srok"> <br /> ?????????? ??????: <input type="text" name="percent"> <br /> <input type="submit"> </form> sorry for my bad english.

    Read the article

  • how do I check if a c++ string is an int?

    - by user342231
    when I use getline, I would input a bunch of strings or numbers, but I only want the while loop to output the "word" if it is not a number. so is there any way to check if "word" is a number or not, I know I could use atoi() for c-strings but how about for strings of the string class int main () { stringstream ss (stringstream::in | stringstream::out); string word; string str; getline(cin,str); ss<<str; while(ss>>word) { //if( ) cout<<word<<endl; } }

    Read the article

  • Under Windows CE, how can I check which RAM based DLLs are loaded in virtual memory space?

    - by Michal Drozdowicz
    I have a problem with loading a DLL under Windows Mobile 5.0. I'm pretty confident that this is caused by running out of the application virtual memory (the 32 MB slot of the process, as explained in Windows CE .NET Advanced Memory Management). I'm looking for a way to actually make sure that this is the issue and investigate whether my efforts bring expected results. Do you know of a way to check the contents of the virtual memory application slot? Any applications that can help me with this task?

    Read the article

  • Is there any convenient way to check if a DOM element is `$compile`d in AngularJS?

    - by Tong Shen
    I'm trying to integrate some plain JavaScript library with AngularJS, in which I need to manually $compile some DOM elements. I'm doing the compilation like this: $compile(e.srcElement)($scope); e.srcElement is the DOM element I want to $compile. I wonder, if there is any established way to check if a given DOM element has been compiled. I know it's possible if I attach some data attributes to the DOM during compiling, and try to retrieve that later. What I want to know is if there is any existing method in AngularJS. Thank you!

    Read the article

  • How to check whether iterators form a contiguous memory zone?

    - by Vincent
    I currently have the following function to read an array or a vector of raw data (_readStream is a std::ifstream) : template<typename IteratorType> inline bool MyClass::readRawData( const IteratorType& first, const IteratorType& last, typename std::iterator_traits<IteratorType>::iterator_category* = nullptr ) { _readStream.read(reinterpret_cast<char*>(&*first), (last-first)*sizeof(*first)); return _readStream.good(); } First question : does this function seem ok for you ? As we read directly a block of memory, it will only work if the memory block from first to last is contiguous in memory. How to check that ?

    Read the article

  • How would I go about writing a conditional statement to check if visitor is coming from a particular

    - by Matthew
    Hello guys, What I have in mind is this... We are going to have people come from a particular site during a acquisition campaign and was wondering how I could conditionalize a certain section of my site to display a thank you message instead of the sign up form as they would have had the opportunity to fill this out before coming to my landing page. I have seen solutions like: $referal = mysql_real_escape_string($_SERVER['HTTP_REFERER']); I would like to know if this is the best way to get this to work??? - okay this is what i think might work. The third party website that is referring people to our landing page once the form on that site has been filled out can push into the record a hidden input value of "www.sample.com" or whatever... then I can have something check the for that particular value and fire off the conidtional. Does that even sound right?

    Read the article

  • How to check that this event would occur after DOM is ready in jquery ?

    - by Rachel
    I want to get page_tag information from the page and want to make sure that DOM for this page is already ready before getting the page tag information. I am doing $(document).ready( { alert("test"); var page_tag : $("head meta[name='page_tag']").attr('content'); page_tag : (page_tag) ? page_tag : ''; } But it gives me errors, missing : after property id alert("Check if document is ready");\n Any suggestions on what could be the possible reasons for it or any other way of checking if the dom is ready or not before getting page_tag information.

    Read the article

  • How to check whether a String fully matches a Regex in Scala?

    - by mkneissl
    Assume I have a Regex pattern I want to match many Strings to. val Digit = """\d""".r I just want to check whether a given String fully matches the Regex. What is a good and idiomatic way to do this in Scala? I know that I can pattern match on Regexes, but this is syntactically not very pleasing in this case, because I have no groups to extract: scala> "5" match { case Digit() => true case _ => false } res4: Boolean = true Or I could fall back to the underlying Java pattern: scala> Digit.pattern.matcher("5").matches res6: Boolean = true which is not elegant, either. Is there a better solution?

    Read the article

  • Is there a way to check if a host is up?

    - by Rob
    I'm trying to do this in PHP. I need to check if a specified host is "up" I thought of pinging the specified host (though I'm not sure how I would, since that would require root. --help here?) I also though of using fsockopen() to try to connect on a specified port, but that would fail too, if the host wasn't listening for connections on that port. Additionally, some hosts block ping requests, so how might I get around this? This part isn't a necessity, though, so don't worry about this too much. I realize this one might get tricky.

    Read the article

  • How to check if Google Street View available and display message?

    - by Vafello
    I am passing lat and lng variables and display google sreet view in a div. The problem is that when the StreetView is unavilable then nothing is displayed. I would like to check if there is a streetview for a given lat and lng and display a message. Here is my code: var myPano = new GStreetviewPanorama(document.getElementById("street2"), panoOpts); var location = new GLatLng(lat,lng) myPano.setLocationAndPOV(location); Maybe I should use something like: Event.addListener(myPano, "error", errorMessage()); Any ideas?

    Read the article

  • How can I check if a value is in a list in Perl?

    - by ablimit
    I have a file in which every line is an integer which represents an id. What I want to do is just check whether some specific ids are in this list. But the code didn't work. It never tells me it exists even if 123 is a line in that file. I don't know why? Help appreciated. open (FILE, "list.txt") or die ("unable to open !"); my @data=<FILE>; my %lookup =map {chop($_) => undef} @data; my $element= '123'; if (exists $lookup{$element}) { print "Exists"; } Thanks in advance.

    Read the article

  • In PHP can I check a boolean on a function call?

    - by Chris
    I have a function which checks the passed value and returns false or true, if false I want it to add something to an array. The code I've written is below. if(!check_input($_POST['username'])){ $errors[] = "Username"; } Right now it adds to my array anyway, regardless of what is entered in the form. Is the way I've written that the correct way to check if the return from check_input() is false? I've checked the function's logic by altering the returns to echoes and it's returning the correct value, I'm just not sure if I'm checking it wrong. I'd previously attempted to write it as $X=check_input etc, and then if(check_value == false) but that doesn't seem to give me the desired result either. Hmmm a quick pointer please!

    Read the article

  • In the context of an asp.net website, what's the most efficient way to check whether a User has acce

    - by scaramouch
    I have a webpage that you pass in an id parameter (via a querystring), which it then uses to fetch data from a database. Typically, a user would navigate to this page from another page that lists only those records that the user has access to. However, if they go directly to the page by typing in the URL in the Address Bar, they can effectively view any record they like. Eg. If they were to type something like http://localhost/TestSite/ClientAdmin/ManageLocation.aspx?LocationID=5 into their Address Bar, they can access the database record with the LocationID equal to five - even though they shouldn't have access to it. Now, I could solve this by doing a database check every time the page is loaded to see whether the current user has access to the record they're trying to view. However this doesn't seem very efficient given that in most cases a user won't be trying to access a record that isn't theirs. Does anyone have a better suggestion? Thanks.

    Read the article

  • How can you check if a file exists before including/importing it in JSP?

    - by codeninja
    Assuming that requestScope.importMe is expecting a path to a jsp file <c:choose> <c:when test="${!empty requestScope.importMe && fileExists(requestScope.importMe) }"> <c:import url="${requestScope.importMe}" /> ... How can I check if the file exists before trying to include it so that an error is not thrown? I'd like to avoid using inline Java. Something using one of the JSTL tags is the preferred approach.

    Read the article

  • how to check if entity already exists in database before inserting in doctrine?

    - by fayer
    whenever i insert a entity that already exists in database (i have a unique constraint on email) i get an error message on the screen. so i want to check if it already exists, if not i insert it. at the moment it looks like this: $q = Doctrine_Query::create() ->from('User u') ->where('u.email = ?', $email); $object = $q->fetchOne(); if( ! is_object($object)) { $user = new User(); $user-email = $email; $user->save(); } i wonder, if there an easier way to do this? thanks

    Read the article

  • sumList predicate needs to check to see if their Sum is equal to the sum of all the elements in the list

    - by nick bonnet
    I am implementing a method that when given Sum and a List. It will check to see that if you add the elements in the list, their sum is equal to the Sum given. Here is what I am trying to do thus far, but I am pretty sure it is wrong... I'm not really sure how to think about it. sumList([],0). sumList([X|Xrest], Sum) :- sumList[Xrest, Sum1), Sum is X + Sum1. Could you give me a point in the right direction or at least let me know how to try to think about the problem?

    Read the article

  • c# xml function to check whether a string is equal to a xml attribute, to add selected combobox item

    - by fuch
    i want to check the combobox.selecteditem.tostring() on combobox select in a given xml with several nodes, where each one has an attribute called "name" private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { try { textBox1.AppendText(nameAttributeCheck(comboBox1.SelectedItem.ToString())); } catch { } } private string nameAttributeCheck(string a) { XmlDocument doc = new XmlDocument(); doc.Load("armor.xml"); XmlElement root = doc.DocumentElement; XmlNodeList items = root.SelectNodes("/items"); String result = null; try { foreach (XmlNode item in items) { if (string.Equals(a, item.Attributes["name"].InnerText.ToString())) { result += item.Attributes["picture"].InnerText.ToString(); } } } catch { } return result; } each time i try it, nothing happens

    Read the article

  • How to check null element if it is integer array in Java?

    - by masato-san
    I'm quite new to Java and having an issue checking null element in integer array. I'm using Eclipse for editor and the line that checks null element is showing error: Line that complains: if(a[i] != null) { Error msg from Eclipse: The operator != is undefined for the argument type(s) int, null In PHP, this works without any problem but in Java it seems like I have to change the array type from integer to Object to make the line not complain (like below) Object[] a = new Object[3]; So my question is if I still want to declare as integer array and still want to check null, what is the syntax for it? Code: public void test() { int[] a = new int[3]; for(int i=0; i<a.length; i++) { if(a[i] != null) { //this line complains... System.out.println('null!'); } } }

    Read the article

  • You have an error in your SQL syntax; check the manual that corresponds to your MySQL

    - by LuisEValencia
    I am trying to run a mysql query to find all occurences of a text. I have a syntax error but dont know where or how to fix it I am using sqlyog to execute this script DECLARE @url VARCHAR(255) SET @url = '1720' SELECT 'select * from ' + RTRIM(tbl.name) + ' where ' + RTRIM(col.name) + ' like %' + RTRIM(@url) + '%' FROM sysobjects tbl INNER JOIN syscolumns col ON tbl.id = col.id AND col.xtype IN (167, 175, 231, 239) -- (n)char and (n)varchar, there may be others to include AND col.length > 30 -- arbitrary min length into which you might store a URL WHERE tbl.type = 'U' -- user defined table 1 queries executed, 0 success, 1 errors, 0 warnings Query: declare @url varchar(255) set @url = '1720' select 'select * from ' + rtrim(tbl.name) + ' where ' + rtrim(col.name) + ' like %' ... Error Code: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'declare @url varchar(255)

    Read the article

  • How to check CPU temperature on a HP P2000?

    - by Pavel
    I have a HP StorageWorks MSA Storage P2000 G3 SAS. show sensor-status gives something like # show sensor-status Sensor Name Value Status ---------------------------------------------------- On-Board Temperature 1-Ctlr A 53 C OK On-Board Temperature 1-Ctlr B 52 C OK On-Board Temperature 2-Ctlr A 61 C OK On-Board Temperature 2-Ctlr B 63 C OK On-Board Temperature 3-Ctlr A 53 C OK On-Board Temperature 3-Ctlr B 53 C OK Disk Controller Temp-Ctlr A 34 C OK Disk Controller Temp-Ctlr B 32 C OK Memory Controller Temp-Ctlr A 66 C OK Memory Controller Temp-Ctlr B 67 C OK [...] Overall Unit Status OK OK Temperature Loc: upper-IOM A 40 C OK Temperature Loc: lower-IOM B 38 C OK Temperature Loc: left-PSU 36 C OK Temperature Loc: right-PSU 40 C OK [...] is one of the values the CPU/FPGA temperature? Or, if not, how do I get it? Thanks!

    Read the article

  • Does a manually initiated crash (bugcheck 0xdeaddead) trigger a disk-check?

    - by Synetech
    Windows has an advanced function built-in that lets a user manually initiate a BSOD. It is a debugging tool used to halt the system in the event of (though not necessarily limited to) a hang or freeze. When used, it causes a BSOD with the string MANUALLY_INITIATED_CRASH1 and whimsical code 0xDEADDEAD. The point to this crash is that it is purposely done by the user, so it is not (or at least should not) be an unpredictable event caused by hardware errors or bad drivers (at least not necessarily bad drivers). The question then is whether performing a manual crash properly flushes the disk caches and such so that the drive is in a valid state when rebooting and thus forgoing the need to have chkdsk run.

    Read the article

  • Windows 7 BSOD with Service Exception Error and Randomly Reboots

    - by Jason Shultz
    I've got a windows 7 laptop that BSOD with a Service Exception Error when I connect to a wireless network. It also does it when it's just sitting still doing nothing. I ran bluescreenview and here are the last four BSOD's from today: ================================================== Dump File : 051210-18642-01.dmp Crash Time : 5/12/2010 8:36:14 AM Bug Check String : SYSTEM_SERVICE_EXCEPTION Bug Check Code : 0x0000003b Parameter 1 : 00000000`c000001d Parameter 2 : fffff880`00000000 Parameter 3 : fffff880`06fda160 Parameter 4 : 00000000`00000000 Caused By Driver : Ntfs.sys Caused By Address : Ntfs.sys+7f030 File Description : Product Name : Company : File Version : Processor : x64 Computer Name : Full Path : C:\Windows\Minidump\051210-18642-01.dmp Processors Count : 2 Major Version : 15 Minor Version : 7600 ================================================== ================================================== Dump File : 051210-16551-01.dmp Crash Time : 5/12/2010 8:41:04 AM Bug Check String : SYSTEM_SERVICE_EXCEPTION Bug Check Code : 0x0000003b Parameter 1 : 00000000`c000001d Parameter 2 : fffff880`00000000 Parameter 3 : fffff880`06f40160 Parameter 4 : 00000000`00000000 Caused By Driver : ntoskrnl.exe Caused By Address : ntoskrnl.exe+70600 File Description : NT Kernel & System Product Name : Microsoft® Windows® Operating System Company : Microsoft Corporation File Version : 6.1.7600.16539 (win7_gdr.100226-1909) Processor : x64 Computer Name : Full Path : C:\Windows\Minidump\051210-16551-01.dmp Processors Count : 2 Major Version : 15 Minor Version : 7600 ================================================== ================================================== Dump File : 051210-17269-01.dmp Crash Time : 5/12/2010 8:45:51 AM Bug Check String : SYSTEM_SERVICE_EXCEPTION Bug Check Code : 0x0000003b Parameter 1 : 00000000`c000001d Parameter 2 : fffff880`00000000 Parameter 3 : fffff880`07db1160 Parameter 4 : 00000000`00000000 Caused By Driver : Ntfs.sys Caused By Address : Ntfs.sys+7f030 File Description : Product Name : Company : File Version : Processor : x64 Computer Name : Full Path : C:\Windows\Minidump\051210-17269-01.dmp Processors Count : 2 Major Version : 15 Minor Version : 7600 ================================================== ================================================== Dump File : 051210-19453-01.dmp Crash Time : 5/12/2010 5:46:25 PM Bug Check String : SYSTEM_SERVICE_EXCEPTION Bug Check Code : 0x0000003b Parameter 1 : 00000000`c000001d Parameter 2 : fffff880`00000000 Parameter 3 : fffff880`02625160 Parameter 4 : 00000000`00000000 Caused By Driver : win32k.sys Caused By Address : win32k.sys+2d4201 File Description : Product Name : Company : File Version : Processor : x64 Computer Name : Full Path : C:\Windows\Minidump\051210-19453-01.dmp Processors Count : 2 Major Version : 15 Minor Version : 7600 ==================================================  

    Read the article

< Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >