null

Null values - boolean expression

谁说我不能喝 提交于 2019-12-21 18:11:31
问题 So I have a question in regards to an exam assignment, in this assignment we have a bunch of Boolean expressions like: FALSE OR NULL = NULL And then we are expected to write the value of the Boolean expression. To do this I am making use of the Three-valued logic, but how does that apply when you get a Boolean expression as follow: (NULLL AND TRUE) OR FALSE or (NULL AND NULL) OR TRUE The first one can easily be found through three-valued logic, but how do I figure out the other two. Very

Sorting Nulls last

会有一股神秘感。 提交于 2019-12-21 15:08:56
问题 Want to sort Nulls and Blanks last and have read all the solutions that use either the Coalesce function or the If in the order by column. MY problems is non of these work for me because the column I am sorting on is specified dynamically by the PHP script that creates the query and some of my columns are in two tables in my join. $sortcol="boat"; $sql= "SELECT fleet,b.boat as boat,owner FROM boats as b LEFT JOIN owners as o ON b.boat=o.boat ORDER BY $sortcol"; This works great, I can change

NSDateFormatter returns null for specific dates

霸气de小男生 提交于 2019-12-21 12:37:41
问题 I'm having a problem with the NSDateFormatter . It is returning null for some specific dates. I did this function to debug the case: - (void) debugTest:(NSString *)dateStr{ NSLog(@"String: %@", dateStr); NSDateFormatter *df = [[NSDateFormatter alloc] init]; [df setDateFormat:@"yyyy-MM-dd"]; NSDate *dateObj = [df dateFromString: dateStr]; NSLog(@"Date: %@", dateObj); } This is my log output for some dates: String: 2012-10-18 Date: 2012-10-18 03:00:00 +0000 String: 2012-10-19 Date: 2012-10-19

NSDateFormatter returns null for specific dates

浪子不回头ぞ 提交于 2019-12-21 12:35:14
问题 I'm having a problem with the NSDateFormatter . It is returning null for some specific dates. I did this function to debug the case: - (void) debugTest:(NSString *)dateStr{ NSLog(@"String: %@", dateStr); NSDateFormatter *df = [[NSDateFormatter alloc] init]; [df setDateFormat:@"yyyy-MM-dd"]; NSDate *dateObj = [df dateFromString: dateStr]; NSLog(@"Date: %@", dateObj); } This is my log output for some dates: String: 2012-10-18 Date: 2012-10-18 03:00:00 +0000 String: 2012-10-19 Date: 2012-10-19

getActionBar() returns null after SDK update to 5.0

为君一笑 提交于 2019-12-21 12:30:04
问题 After I updated the Android SDK to version 5.0 the getActionBar() method started to return null causing my app to crash on launch. I am clueless to what's causing this and any existing Stackoverflow threads didn't help. Here is my manifest: <application android:name="App" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/ActionBarTheme" > styles.xml: <style name="AppBaseTheme" parent="Theme.AppCompat.Light"></style> <!--

Replace the empty or NULL value with specific value in HIVE query result

微笑、不失礼 提交于 2019-12-21 12:14:38
问题 I'm trying to show a default value, "Others", when the query does not return any result for one of the selected columns. I'll show you the example. This query returns an empty value for os(agent) SO (in the first row): select country, os(agent) SO, count(*) from clicks_data where country is not null and os(agent) is not null group by country, os(agent); Output: ZA 4 ZA Android 4 ZA Mac 8 ZA Windows 5 Instead, I would like to get this result: ZA Others 4 ZA Android 4 ZA Mac 8 ZA Windows 5 My

Getter and @Nonnull

半世苍凉 提交于 2019-12-21 12:04:23
问题 I get a warning from eclipse and I know I can remove it with suppress warning but I'd prefer to understand what makes it thing it could be null. package-info.java @ParametersAreNonnullByDefault package test; import javax.annotation.ParametersAreNonnullByDefault; test.java package test; public class Test { public static void main( final String[ ] args ) { System.out.println( new Test( "a" ).getS( ) ); } private final String s; public Test( final String s ) { this.s = s; } public String getS( )

Null stream, do I have to include ostream?

匆匆过客 提交于 2019-12-21 11:01:20
问题 I am writing a logger. If disabled, this is the code which defines the LOG macro: #ifdef NO_LOG #include <ostream> struct nullstream : std::ostream { nullstream() : std::ios(0), std::ostream(0) {} }; static nullstream logstream; #define LOG if(0) logstream #endif LOG << "Log message " << 123 << std::endl; It works correctly. The compiler should completely remove the code related to the LOG macro. However I would like to avoid the inclusion of ostream and define the logstream object as

C++ std::string and NULL const char*

五迷三道 提交于 2019-12-21 09:34:54
问题 I am working in C++ with two large pieces of code, one done in "C style" and one in "C++ style". The C-type code has functions that return const char* and the C++ code has in numerous places things like const char* somecstylefunction(); ... std::string imacppstring = somecstylefunction(); where it is constructing the string from a const char* returned by the C style code. This worked until the C style code changed and started returning NULL pointers sometimes. This of course causes seg faults

Why is localStorage[“…”] undefined, but localStorage.getItem(“…”) is null?

五迷三道 提交于 2019-12-21 09:16:21
问题 Last time I checked, the following two lines returned true : null == localStorage["foo"]; null == localStorage.getItem("foo"); Same applies when replacing null with undefined . So the first question is, why are there two ways to address the localStorage? And why does localStorage["foo"] return undefined while localStorage.getItem("foo") returns null ? Do I need to take care of that when developing JS? 回答1: The Web Storage Specification requires that .getItem() returns null for an unknown key.