empty

Detect empty buffer on a windows handle without using readfile()

I was wondering if there was any function along the lines of IsBufferEmpty() to use on a synchronous handle rather than using ReadFile() and waiting for it to return false. I need something to eliminate the delay that ReadFile() takes to try to read data. ...

Empty response during ajax request in Chrome but not IE nor FF

Hi! I am receiving an empty response when calling a web method using asp.net in Chrome but not IE nor FF. I get this behavior using the ASP PageMethod.func as well as using jquery ajax call. I can 'fix' the symptom by adding a delay sleep call on the server which makes me believe code is just plain wrong somewhere. I have the webkit...

PHP - if(!empty) issues

What is wrong with this? The code in the "if statement" runs if $forwardformat isn't empty empty, but the "else" code doesn't run if $forwardformat is empty. Any ideas?! while ($row = mysql_fetch_array($forwardresult)) { $forward = $row["id"]; $forwardformat = str_replace(" ","",$forward); if (!empty($forwardformat)) { ...

WPF ComboBox with empty item?

Hi! Suppose we have a DataSource bind to a collection from Database. There is no null item of course. How to add a void item into a ComboBox, so that at first load user would see an empty string. I don't want to add a dummy/void object into the Collection. Optimally in XAML. Any proposals? ...

In where shall I use isset() and !empty()

I read somewhere that isset() function is that an empty string tests as TRUE, os isset() is not an effective way to validate text inputs and text boxes from a HTML form. So you can use empty() to check that a user typed something.... Q1. Is it true that isset() function treat an empty string as TRUE? Q2. Then in which situation I shou...

Most efficient way to determine if a Lua table is empty (contains no entries)?

What's the most efficient way to determine if a table is empty (that is, currently contains neither array-style values nor dict-style values)? Currently, I'm using next(): if not next(myTable) then -- Table is empty end Is there a more efficient way? Note: The # operator does not suffice here, as it only operates on the array-st...

Jquery empty() div except for matched elements

Is there a way to empty a div leaving only elements with a specific class name? Or, is there a way to remove all elements within a div leaving only elements with a specified class? ...

php $_POST array empty upon form submission...

Hi folks, I'm baffled on this after much googling. This issue is simple, I have a custom CMS i've built that works perfectly on my dev box (Ubuntu/PHP5+/MySQL5+). I just moved it up to the production box for my client and now all form submissions are showing up as empty $_POST arrays. I found a trick to verify the data is actually being...

To check `0 rows` from the SQL query in Postgres / PHP

How can you check an empty database result and then make an action based this? My code which puts matching result to the if -clause while( $tags_and_Qid = pg_fetch_array( $result_tags )) { // Add the Tag to an array of tags for that question $end_array [ $tags_and_Qid['question_id'] ] ['tag'] [] = $tags_and_Qid['tag']; ...

Lookup field in Edit in Datasheet mode in sharepoint doesn't work

I've added a lookup field to a document library, and it is possible to choose values as expected in "Edit properties" for a single document. However, when in Edit in Datasheet mode all of the dropdowns for the lookup field are EMPTY!!!! Is this just the way it is, or have I done something wrong? Has anyone managed to get lookup fields t...

Handling empty set in MySQL CASE statement

MySQL server version 5.0.45. Consider the following: ( SELECT CASE WHEN t.group_id = 12 THEN 'yes' ELSE 'no' END FROM sample_table t WHERE t.user_id = 2 AND t.group_id = 12 ) as foo This subquery of a larger statement works as I'd expect, yielding a 'yes' or 'no' string value most of the time. It's not ideal...

vbscript return empty data

Hi there, I am using vbscript .vbs in windows scheduler. Sample code: objWinHttp.Open "POST", http://bla.com/blabla.asp, false objWinHttp.Send CallHTTP= objWinHttp.ResponseText strRESP= CallHTTP(strURL) WScript.Echo "after doInstallNewSite: " & strRESP Problem: blabla.asp is handling a task that need around 1-2 minute to complete...

Check whether an array is empty without using a loop?

Is there any function available in PHP to check whether an array is empty or how can I do this without using loop? For example: $b = array('key1' => '', 'key2' => '', 'key3' => '', 'key4' => ''); How can I check array $b contains empty values without using a loop? ...

SQL Reporting Services empty string handling

Hello, I'd like to display a string without the last 2 chars in a text field in Reporting Services 2005 vs2005. I tried several ways and if the string is empty or null I get an error: rsRuntimeErrorInExpression - The value expression for the textbox contains an error: Argument 'Length' must be greater or equal to zero. Here are the way...

To disable a send button if fields empty by jQuery

How can you disable the send -button if there is one or more input -fields empty? My attempt in pseudo-code if ( $("input:empty") ) { $("input:disabled") } else // enable the ask_question -button I have been reading these articles without finding a right solution Official docs about empty: this is like not relevant because ...

Making if -statement in jQuery

How can you say the following in jQuery? If If textarea AND input.title are NOT empty, then put input.button ON. My attempt in pseudo-code if ( $(textarea).not.empty() AND $(input.title).not.empty() ) { $('.ask_question').attr('enabled, 'enabled'); } ...

$_FILES Empty When Uploading

When trying to access the $_FILES array, PHP returns the error "Undefined index: picture". In my php.ini file, File Uploads are turned on, and any user can write in the /tmp directory. In the HTML form, enctype is set to "multipart/form-data". Interestingly enough, the basename for the uploaded file prints so I believe that PHP has actua...

CSS properties being passed up to the parent element when the DIV is empty

This problem is happening for me on IE8 and Chrome which makes me think this is a standards thing. I am creating a site with header and menu using DIVs that do not have any content but do have background images and heights / widths set in CSS. I want the inner DIV to have margin against the parent div but it applies the margin to the pa...

PHP Dom XML Parsing on empty self closing tags

HI Guys, I'm using DOM to parse an xml file. And I am having trouble catching an error that throws when the XML tag is empty and self closed. eg. <Title /> $xml=("http://www.exampleUrl.com/xmltoparse.xml"); $xmlDoc = new DOMDocument(); $xmlDoc->load($xml); $x=$xmlDoc->getElementsByTagName('Root'); for ($i=0; $i<=10; $i++) { $id=...

How to implement is_empty() in PHP?

The empty() native in PHP will fail if the string is "0" or something like that. So how to implement the exact is_empty() function in PHP? ...