Is there a fast/efficiency way to check if a table is empty?
DECLARE @StartEndTimes TABLE
(
id bigint,
StartTime datetime,
EndTime datetime
)
IF @StartEndTimes IS NOT NULL
What is the easiest way to check if something is a list?
A method doSomething has the parameters a and b. In the method, it will loop through the list a and do something. I'd like a way to make sure a is a list, before looping through - thus avoiding an error or the unfortunate circumstance of passing in a string then getting back each letter.
This question must have been asked before - however my googles failed me. Cheers.
Is there an easy way of programmatically checking if a serial COM port is already open/being used?
Normally I would use:
try
{
// open port
}
catch (Exception ex)
{
// handle the exception
}
However, I would like to programatically check so I can attempt to use another COM port or some such.
I have this command
h = urllib.urlopen("http://google.com/")
How can I check if it retrieves me some error, internet down or something I don't expect?
For example, something like
if error
print 'ERROR'
Thank you
I want to use mod-rewrite to check for a file in two separate locations: at the requested URL, and at the requested URL within the "public" directory.
Here's what I have so far:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/public/$0 !-f #this line isn't working
RewriteRule ^(.*)$ index.php?$1 [L]
It can correctly determine if the file is there, but it's not correctly determining if the file is at /public/supplied/file/path/file.extension. How do I test for that?
When I create a thread I save it handle in a list.
After a time I want to check which of them still exists.
I'm not looking for other kind of implementation, I want to know if is there some how to get a thread by it handle ?
Take a look at the ssl_requirement plugin.
Shouldn't it check to see if you're in production mode? We're seeing a redirect to https in development mode, which seems odd. Or is that the normal behavior for the plugin? I thought it behaved differently in the past.
How do you check to see if a file does not exist in SQL Server Integration Services 2005?
Is there a native SSIS component which will just do this for you?
Hi,
I created a view in the AppDelegate, that I add to the window like this:[window addSubview:myView]; I wanna be able to check for the device orientation everytime I come back to this view, so I can make some modifications to it. How can I do that in the appDelegate?
I want to check if the node <Type> is either "Debit" or "Credit"
so that I can transform the information from just credit card information into Debit or Credit transactions.
any suggestion????
I'm trying to prevent users from uploading (accidentally or maliciously) very large files to my website.
I have nginx max_client_body_size set to 4M, but if a file larger than this is uploaded, then it uploads the entire file before returning 413 (entity too large).
I want to make nginx check the Content-Length header, so that it rejects the request before it's uploaded.
Alternatively, a Rails solution would also be acceptable.
Any help appreciated.
How do I check If a Class already exists in Ruby,
My code is:
puts "enter the name of the Class to see if it exists"
nameofclass=gets.chomp
eval (" #{nameofclass}...... Not sure what to write here")
I was thinking of using:
eval "#{nameofclass}ancestors. ....."
my question is:
i have a member that can pay in 3 different way
credit card
check
transfer from bank account
how design the table that contain the history of payment.
the fields of every way is different .
if i save all in one table , i have lot of blank field ?
what the right way to deal it ?
We are using software that registers its own protocol. We can run application from browser then by link like:
customprotocol://do_this.
but is there a way to check is such custom protocol supported by user`s system? If not we would like to ask user to install software first.
E.g.
if (canHandle ('customprotocol')) {
// run software
}
else {
// ask to install
}
How do I check the type of a Parameter in an Expression Tree (and get the Expression Tree equivalent of a bool if it the right type)? If it were normal code, I would do this:
if(myObj is int)
I see there is a Expression.Convert method but this converts the object instead of just checking its type.
EDIT: I found the answer, you use a Expression.TypeIs
Does anybody know of a good Jquery solution to checking for swear words when a form is submitted?
Basically I have a form which submits to Twitter, upon successfully passing a swear word check it will submit via ajax. I know how to do it in PHP (for non javascript enabled users), I did a foreach loop through an array of predefined bad words and checked them against what was submitted.
How would I do a similar thing with Jquery?
Thanks
Hi, I have a string and I want to check if it represents a proper namespace, eg. System.IO is ok, but System.Lol is not.
I guess some reflection should be used, but I can't figure this out.
Any thoughts?
Hi. I need to write a program that check if a graph is bipartite.
I have read through wikipedia articles about graph coloring and bipartite graph. These two article suggest methods to test bipartiteness like BFS search, but I cannot write a program implementing these methods.
Any help would be appreciated!
This function everytime gives "false", even if image_url exists
// some .each {
var item = $('.item', this);
$.ajax({
url: image_url,
success: function() {
item.html("true");
},
error: function() {
item.html("false");
}
});
// }
Its used to check existance of image_url file - this variable gives url like http://blog.com/teddybear.png
Any idea?
I am doing the below in a perl script:
my @pm1_CS_missing_months = `sqlplus -s $connstr \@DLmissing_months.sql`;
it takes the output of an sql query.
if i have to check for no rows selected,how could i do it?
i want to do like this:
if(no rows selected)
{
do this;
}
Hello!
In my javascript i want to open URL in new window with this method:
var win = window.open(url...);
How can i check this, not to open the same window and lose all inputted data.
For example, if i opened "www.musite.com/addproduct" URL in new window, input data, leave my work place. then i click open window again, new window open and i lost all my data.
i want to check select statement(string) is valid or not in c#.net, if select statement is right then retrieve data and fill dropdown list box else drop down should be empty