null

mysql: select query when the column that has condition on has NULL value

99封情书 提交于 2019-12-24 18:12:51
问题 This is my example table: CREATE TABLE test( name VARCHAR(35), age INT(3)) And some values: insert into test values ('alex', 13); insert into test values ('dan', 17); insert into test (name) values ('pete'); insert into test (name) values ('david'); When I use SELECT query with the condition on column 'age': select * from test where age!=13; The result I got is: +------+------+ | name | age | +------+------+ | dan | 17 | +------+------+ But I want all the record with age!=13 which includes

NfcAdapter.getDefaultAdapter(this) returns null but NFC works

心已入冬 提交于 2019-12-24 17:46:04
问题 my app uses NFC reading on background and on foreground. For user info I use CountDownTimer(120 * 1000, 5 * 1000) in my activity and method onTick(long l) to check NFC status each 5 seconds. Sometimes (on Android 4.2.2, my client says, it never happend to me) NfcAdapter.getDefaultAdapter(BaseActivity.this) returns null but background and foreground NFC reading still works! Turning off and on doesn't help. Re-install helps. BG reading via manifest: <activity android:name=".activity

c#语言学习 专题二 String

淺唱寂寞╮ 提交于 2019-12-24 16:35:48
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前记 msdn上前几个部分我就不说了吧!就从string开始说起!一个程序员的职业生涯很多时候都是在跟这个东西打交道! 内容 一,string和String MSDN中对string的说明: string is an alias for String in the .NET Framework。string是String的别名而已,string是c#中的类,String是Framework的类,C# string 映射为 Framework的 String。如果用string,编译器会把它编译成String,所以如果直接用String就可以让编译器少做一点点工作。 如果使用C#,建议使用string,比较符合规范 。 string始终代表 System.String(1.x) 或 ::System.String(2.0) ,String只有在前面有using System;的时候并且当前命名空间中没有名为String的类型(class、struct、delegate、enum)的时候才代表System.String。 string是c#中的类,String是.net Framework的类(在c# IDE中不会显示蓝色) c# string映射为.net Framework的String 如果用string

What is the null-object error with this AS3 code for loading external swf?

岁酱吖の 提交于 2019-12-24 16:33:37
问题 I am getting a null object error when I add the mouse event listener for the log in button. (Look at the comments in the constructor) I am using Flash CS6, and objects such as logInbutton and screen_log_in are instance names from the .fla file. This here is the .as file. Error I get is: TypeError: Error #1009: Cannot access a property or method of a null object reference. at actions::indexPage() My AS3 code: package actions { import flash.display.MovieClip; import flash.events.Event; import

C#中的null,"", String.Empty的比较

不想你离开。 提交于 2019-12-24 16:19:23
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> string s; string s=null; string s=""; string s=String.Empty; 的区别 null名词解释:(MSDN)null是一个字面文本,它代表空引用,即引用变量没有引用( 指向)到任何对象,它是引用类型的默认值。 同样会在栈上保存一个地址,这个地址也占4字节,但是这个地址是没有明确指向的,它哪也不指,其内容为0x00000000。 string s; 该语句表示 只是声明了一个引用变量,但是并没有初始化引用, 所以对变量s的任何操作(除了初始化赋值外)都将引发异常。 string s=null; 该语句表示声明了 一个引用变量并初始化引用,但是该引用没有指向任何对象, 但可以把它作为参数传递或其它使用,但是不能调用它作为对象的方法 ,如toString,getHashCode等。 string s=""; 该语句表示声明 并引用到一个对象,只不过这个对象为0个字节 .所以既然有了对象,就可以调用对象的方法, string s=String.Empty; String中Empty的源码定义: publci static readonly string Empty = ""; 如果你不知道static readonly的作用,自己搜下,我简单说下为什么String

Oracle SQL count() per hour

你离开我真会死。 提交于 2019-12-24 15:33:34
问题 I have a query that shows the amount of shipments per hour, per carrier. I have it cased by hour, but it is showing zero's until the previous hour is complete before reporting data for next hour. Essentially, would like to read left to right, and have NULL if carrier didn't have shipment during that hour. Code: select router_destination_code, count(case when to_char(app_last_updated_date_utc, 'HH24') = '00' then router_destination_code else NULL end) as "Hour 1", count(case when to_char(app

Android (Java): how to use LayoutInflater.inflate() for Dialogs?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 15:27:34
问题 I'm using the LayoutInflater within a Dialog and don't know what to set as a 2nd parameter, which is null for now. I found answers for onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle bundle) , but that method isn't available for a Dialog . Faking the null by something like (ViewGroup) null is not an option for me. MyDialog public class MyDialog extends Dialog implements View.OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

C# LINQ NULL check

折月煮酒 提交于 2019-12-24 14:16:02
问题 On my form I want to disable the bt_rent button if the movie has no date in the bringback colum(date type) so it means the dvd is still out and not available for renting: var j = (from s in db.Rentals where s.Movietitle == (string)listbox1.SelectedValue select s).FirstOrDefault(); if (j.Bringback==null) { elerhetotext.Text = "The dvd is not available for renting"; bt_rent.Enabled = false; } else { elerhetotext.Text = "Rentable"; bt_rent.Enabled = true; } The error I get:

Select the last value of each column, per user, the simplest way

浪子不回头ぞ 提交于 2019-12-24 13:55:00
问题 This is an extended version of a related previous question. I have posted it a new question for Erwin Brandstetter suggested me to do so. (I realized that I actually wanted this, after people replied to my first question) Having the following data (blank means NULL): ID User ColA ColB ColC 1 1 15 20 2 1 11 4 3 1 3 4 2 5 5 10 5 2 6 6 2 8 7 1 1 How can I get the last not-NULL values of each column for all users, the simplest way? So the resulting for the given data would be: User ColA ColB ColC

C++ Call a non-virtual non-static method from a null pointer, without accessing members : is this guaranteed to work? [duplicate]

匆匆过客 提交于 2019-12-24 11:55:42
问题 This question already has answers here : Is it legal/well-defined C++ to call a non-static method that doesn't access members through a null pointer? (5 answers) When does invoking a member function on a null instance result in undefined behavior? (2 answers) Closed 5 years ago . Can I call a non-static, non-virtual method of a class from a null pointer? The member function would then test if this==nullptr, and return immediately if it's true. I know it will work in most cases, but is this a