isnullorempty

Skipping empty files in Gnuplot

对着背影说爱祢 提交于 2019-12-06 16:39:46
I am using gnuplot 4.6 . Also, I know that a similar question was asked more than a year ago here . The answer to that requires to write a small bash script. I want to know if it is possible to achieve this from within gnuplot script, especially when gnuplot-4.6 has so many cool features added. I am trying to achieve something like this : set xrange[xL:xU] set yrange[yL:yU] plot "file1.dat" using 1:2 w l lt 1 lw 1 lc 3,\ "file2.dat" using 1:2 w l lt 1 lw 1 lc 3 I am repeating the above process in a loop and the xrange & yrange parameters are being updated in each iteration. Also, I am saving

Check if variable is_undefined in PHP

冷暖自知 提交于 2019-12-03 16:54:14
问题 In PHP, I want to check if a variable has not been set/defined, where setting a variable NULL is considered set/defined . I'm aware everything here: http://php.net/manual/en/types.comparisons.php including isset(), empty(), and is_null(). None of these appear to be what I'm looking for. Consider the following example: <?php $myNull = null; echo 'isset($myNull): "'.isset($myNull).'"<br />'; echo '$myNull value = "'.$myNull . '"<br />'; echo "<br />"; echo 'isset($myUndefined): "'.isset(

Check if variable is_undefined in PHP

百般思念 提交于 2019-12-03 06:01:01
In PHP, I want to check if a variable has not been set/defined, where setting a variable NULL is considered set/defined . I'm aware everything here: http://php.net/manual/en/types.comparisons.php including isset(), empty(), and is_null(). None of these appear to be what I'm looking for. Consider the following example: <?php $myNull = null; echo 'isset($myNull): "'.isset($myNull).'"<br />'; echo '$myNull value = "'.$myNull . '"<br />'; echo "<br />"; echo 'isset($myUndefined): "'.isset($myUndefined).'"<br />'; echo '$myUndefined value = "'.$myUndefined . '"<br />'; ?> This example outputs

SQLite select where empty?

孤者浪人 提交于 2019-12-03 00:58:55
问题 In SQLite, how can I select records where some_column is empty? Empty counts as both NULL and "". 回答1: There are several ways, like: where some_column is null or some_column = '' or where ifnull(some_column, '') = '' or where coalesce(some_column, '') = '' of where ifnull(length(some_column), 0) = 0 回答2: It looks like you can simply do: SELECT * FROM your_table WHERE some_column IS NULL OR some_column = ''; Test case: CREATE TABLE your_table (id int, some_column varchar(10)); INSERT INTO your

SQLite select where empty?

拈花ヽ惹草 提交于 2019-12-02 14:20:11
In SQLite, how can I select records where some_column is empty? Empty counts as both NULL and "". There are several ways, like: where some_column is null or some_column = '' or where ifnull(some_column, '') = '' or where coalesce(some_column, '') = '' of where ifnull(length(some_column), 0) = 0 It looks like you can simply do: SELECT * FROM your_table WHERE some_column IS NULL OR some_column = ''; Test case: CREATE TABLE your_table (id int, some_column varchar(10)); INSERT INTO your_table VALUES (1, NULL); INSERT INTO your_table VALUES (2, ''); INSERT INTO your_table VALUES (3, 'test'); INSERT

Does C# have IsNullOrEmpty for List/IEnumerable?

江枫思渺然 提交于 2019-11-29 20:32:55
I know generally empty List is more prefer than NULL. But I am going to return NULL, for mainly two reasons I have to check and handle null values explicitly, avoiding bugs and attacks. It is easy to perform ?? operation afterwards to get a return value. For strings, we have IsNullOrEmpty. Is there anything from C# itself doing the same thing for List or IEnumerable? Matthew Vines nothing baked into the framework, but it's a pretty straight forward extension method. See here /// <summary> /// Determines whether the collection is null or contains no elements. /// </summary> /// <typeparam name=

Check if list is empty in C# [closed]

≡放荡痞女 提交于 2019-11-28 19:02:45
I have a list of objects populated from a database. I need to display an error message if the list is empty and display a grid view otherwise. How do I check if a List<T> is empty in C#? Tim Schmelter Why not... bool isEmpty = !list.Any(); if(isEmpty) { // error message } else { // show grid } The GridView has also an EmptyDataTemplate which is shown if the datasource is empty. This is an approach in ASP.NET: <emptydatarowstyle backcolor="LightBlue" forecolor="Red"/> <emptydatatemplate> <asp:image id="NoDataErrorImg" imageurl="~/images/NoDataError.jpg" runat="server"/> No Data Found! <

Does C# have IsNullOrEmpty for List/IEnumerable?

做~自己de王妃 提交于 2019-11-28 17:14:17
问题 I know generally empty List is more prefer than NULL. But I am going to return NULL, for mainly two reasons I have to check and handle null values explicitly, avoiding bugs and attacks. It is easy to perform ?? operation afterwards to get a return value. For strings, we have IsNullOrEmpty. Is there anything from C# itself doing the same thing for List or IEnumerable? 回答1: nothing baked into the framework, but it's a pretty straight forward extension method. See here /// <summary> ///

R: Remove multiple empty columns of character variables

社会主义新天地 提交于 2019-11-28 06:58:23
I have a data frame where all the variables are of character type. Many of the columns are completely empty, i.e. only the variable headers are there, but no values. Is there any way to subset out the empty columns? If your empty columns are really empty character columns, something like the following should work. It will need to be modified if your "empty" character columns include, say, spaces. Sample data: mydf <- data.frame( A = c("a", "b"), B = c("y", ""), C = c("", ""), D = c("", ""), E = c("", "z") ) mydf # A B C D E # 1 a y # 2 b z Identifying and removing the "empty" columns. mydf[

One liner for If string is not null or empty else

与世无争的帅哥 提交于 2019-11-28 06:40:34
I usually use something like this for various reasons throughout an application: if (String.IsNullOrEmpty(strFoo)) { FooTextBox.Text = "0"; } else { FooTextBox.Text = strFoo; } If I'm going to be using it a lot I will create a method that returns the desired string. For example: public string NonBlankValueOf(string strTestString) { if (String.IsNullOrEmpty(strTestString)) return "0"; else return strTestString; } and use it like: FooTextBox.Text = NonBlankValueOf(strFoo); I always wondered if there was something that was part of C# that would do this for me. Something that could be called like: