check

PHP spell checking tool

Is there such a tool that finds language/spelling errors in code comment and strings in PHP code? for example, <?php $myVar = "Hollo World"; //this is a code commont with spelling error /*this is anothor wrong comment*/ ?> If I run such a tool, then it will find 'Hollo', 'commont', and 'anothor' spelling errors for me. Thanks for an...

How do I check if a file is text-based?

I am working on a small text replacement application that basically lets the user select a file and replace text in it without ever having to open the file itself. However, I want to make sure that the function only runs for files that are text-based. I thought I could accomplish this by checking the encoding of the file, but I've found ...

Sharing Constants Between Cocoa and Cocoa-Touch apps

I have a class that I want to share between two different applications. The on,y real difference is the base framework it references. Cocoa imports and of course Cocoa-Touch imports . I would like to use a precompiler directive to check what I am compiling to and allow the correct import. What can I check to see if what My target is...

Using equal(),find() on a vector<complex <double> >

Hi all, This is a pretty straightforward thing, but I've been bashing my head trying to understand. I'm trying to compare the elements of a vector<complex <double> > vec with a complex <double> num to check if num already exists on vec. If it does, it is not added. I tried to use the equal() and algorithm, with no success. Does anybody ...

Checking for invalid date in SQL Server Stored Procedure

I have a stored procedure in SQL Server 2008 that will insert a record into a table. The sproc looks similar to this: -- params @f1 int, @f2 datetime = null, @f3 datetime, @f4 bit = 0 BEGIN INSERT INTO dbo.table (fields......) VALUES (@params.....) RETURN @@IDENTITY END Prior to running the INSERT stateme...

Testing Username / Password against Active Directory Domain in VBScript?

I need to test a username and password pair against a given domain in a VBScript. The script will know the username, password, and domain against which it needs to check for access, and all I need returned is a true or false as to whether the account is valid. Can anyone suggest a good way to accomplish this? Thanks! ...

Webbrowser control , Detect internet connection

Hello Everyone, Here is my code scenario, I display html page in webbrowser control. The content will be loaded from some RSS url dynamically (used JQuery to load the content from URL) and displayed in WB. My problem is, i have to check for the "Internet Connectivity" when a loop is completed by scrolling text. I tried using "navigat...

How to check wether an URL already has a parameter inside it?

Using PHP I need to check wether an URL I am appending information to already has a parameter or not. So if the URL is http://test.com/url?a=1 I would need to add on &b=2, ie http://test.com/url?a=1&amp;b=2 However if the URL was http://test.com/url I would need to append http://test.com/url?b=2 Is it possible to check for t...

if div has content show div

ok heres what i have... it works fine but it looks for a word rather than content. i just want it to show when there is any content.. $(document).ready(function(){ if ($("#box3:contains('Product')").length) { $('#third').show(); } }); i dont think you need the htm...

Check if value already exists within list of dictionaries?

I don't think this question has been asked in this form on SO before. I've got a Python list of dictionaries, as follows: a = [{ 'main_color': 'red', 'second_color':'blue'}, { 'main_color': 'yellow', 'second_color':'green'}, { 'main_color': 'yellow', 'second_color':'blue'}] I'd like to check whether a dictionary with a particular ke...

C# How to check is there any value before converting ToString()

Hi, I have some dataset with values and now I need to put that values into textbox but there is some decimal and double type values so I need to cast them toString() and it happens that sometime dataset values are empty so before casting toString() I need to check Is there any value ??? This is sample line: I need something like this...

Python Check if all of the following items is in a list

I found, that there is related question, about how to find if at least one item exists in a list: http://stackoverflow.com/questions/740287/python-check-if-one-of-the-following-items-is-in-a-list But what is the best and pythonic way to find whether all items exists in a list? Searching througth the docs I found this solution: >>> l =...

Os Check And prompt proper if

Can python see which windows i use e.x. windows 7 windows xp windows vista and if windows vista print you use windows vista, or execute other command ...

Using the check test unit framework in an embedded device?

Has anyone used check as the unit test framework in an embedded device which also requires cross-compilation? Is it even a good idea, or should I just use something else (e.g. embunit or similar)? If so, how should I write the Makefile.ams and configure.ac? I haven't used autotools to begin with so all this cross-compilation stuff cert...

PHP MySQL? Problem

I am using a simple PHP script for the activation part of one of my applications. The applications posts one variable to the page (http://validate.zbrowntechnology.info/WebLock.php?method=validate). The variable is the serial number, posted as 'Serial'. Each time I post to this page, it returns Invalid. Here is the code: <?php $serial...

JavaScript - detecting if user is browsing the internet using Fullscreen mode

Hello again, I don't want to open my site in fullscreen mode (as it's not possible without using Flash) or to open it in 'kiosk mode'. I want to ask the user to press F11 on his/her keyboard to turn the browser into fullscreen mode. And I want to know if he/she did it. Is there a way to determine if the current window is being browsed ...

Check for unread emails

Greetings! I'm looking for a way to check the number of unread emails on an email account. Any tips? EDIT: As described in the tags, for C#. As I learned IMAP is the way to go and I confirmed all email accounts I'm going to use have IMAP activated :) ...

Is it possible to make "password" validation without refreshing a window?

Hello again, I've made a simple web application where a lot of things is done without refreshing a window. Now I faced a problem which I haven't realized before. If I won't find a solution, I'll have to redesign the whole app which will take a lot of time and probably kill some coolness of using it. Ouch. Ok, back to the problem. To re...

Java Generic - subtypes check?

How do I check generic subtypes passed as parameter? For example: public class A<T> { public T get();} public class AString extends A<String> {} public class ADate extends A<Date> {} public void checkparam(List<? extends A<?>> params) { ///Want to check if params is of type List<AString> or List<ADate> ? } Is it possible? What part ...

Batch script: how to check for admin rights

How do I check if the current batch script has admin rights? I know how to make it call itself with runas but not how to check for admin rights. The only solutions I've seen are crude hack jobs or use external programs. Well, actually I don't care if it is a hack job as long as it works on Windows XP and newer. ...