null

Convert jcalendar Date into XMLGregorianCalendar Getting Null Value

别来无恙 提交于 2019-12-12 05:20:47
问题 i have some problem, i just getting null value from jDateChooser in jCalendar. This method is function to convert java.util.Date into XMlGregorianCalendar : DatatypeFactory df; public XMLGregorianCalendar function_ConvertAsXMLGregorianCalendar(Date date) { if (date == null) { System.out.println("Error on Function Convert Date into XML Gregorian Calendar"); return null; } else { GregorianCalendar gc = new GregorianCalendar(); gc.setTimeInMillis(date.getTime()); return df

How to check if only one value is not null in Javascript?

百般思念 提交于 2019-12-12 05:15:41
问题 Let's say I have 3 textboxes in cshtml. What I am trying to do in Javascript is the following: Check if ANY OF those 3 values and ONLY THEM is not null. The only way I can think of is doing it manually: if ((val1 & !val2 & !val3) || (!val1 & val2 & !val3) || (!val1 & !val2 & val3)) It is okay if it is a small number of textboxes, but if such number grows to 10+, it might become a hassle. Is there any efficient way to implement such logic in Javascript regardless of how many textboxes we are

Google App Script Regex exec() returns null only in one function

房东的猫 提交于 2019-12-12 04:58:33
问题 I am writing a Google Apps script to create a calendar event based on automated emails I receive for jobs. I am using regex expressions to extract information that I need to populate the event in Google Calendar. So far, I have everything functioning as expected except for one function, getEndTime(), which should find the end time of the job, but presently returns null any time it's called. All of my other functions using exec() work fine. I have read many other questions regarding exec()

removing null value from string

允我心安 提交于 2019-12-12 04:57:09
问题 I want to show the translated name and description with language_id 'us' and 'ru'. My question is how can I remove the null values? SELECT DISTINCT CASE WHEN LANGUAGE_ID = 'US' THEN COALESCE(TO_CHAR(TRANSLATED_NAME), ' ') END AS PRODUCT_NAME_US, CASE WHEN LANGUAGE_ID = 'US' THEN INITCAP(CONCAT(SUBSTR(TRANSLATED_DESCRIPTION, 1, 30), '...')) END AS PRODUCT_DESC_US, CASE WHEN LANGUAGE_ID = 'RU' THEN COALESCE(TO_CHAR(TRANSLATED_NAME), ' ') END AS PRODUCT_NAME_RU, CASE WHEN LANGUAGE_ID = 'RU' THEN

What is a NullReferenceException, and how do I fix it?

拈花ヽ惹草 提交于 2019-12-12 04:51:41
问题 This post is a Community Wiki . Edit existing answers to improve this post. It is not currently accepting new answers. I have some code and when it executes, it throws a NullReferenceException , saying: Object reference not set to an instance of an object. What does this mean, and what can I do to fix this error? 回答1: What is the cause? Bottom Line You are trying to use something that is null (or Nothing in VB.NET). This means you either set it to null , or you never set it to anything at all

How to include null value in the JSON via NSJSONSerialization?

旧城冷巷雨未停 提交于 2019-12-12 04:43:05
问题 I think I get it how to use the NSJSONSerialization over all. The call I am making is: [NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error] where parameters is a NSDictionary which includes keys and values to use in the JSON request. Everything is fine and all, until I have to use null as a value instead of an empty string. I can't find a way to set the value as null at all. The example of json that I need to create is: {"target" {"firstname":<firstname>, "lastname":

Lamp / Cakephp: Streaming an image : Binary 0x00 replaced by 0x20

妖精的绣舞 提交于 2019-12-12 04:31:24
问题 I'm trying to create a script that pulls an image out of the database and displays it to the user, called by <img src="viewImage/someImageName"> But the problem I'm having is when the image is displayed all of the Nulls (0x00) are replaced by 0x20 and I have no idea why. The data in the database shows it being nulls but somewhere along the way it gets changed to 0x20s. Does anyone have any idea? is there something I'm missing? Here is the code I'm using: $data = $this->Image->read(NULL,

Php PDO: Why does Inserting NULL yields to 0

孤街浪徒 提交于 2019-12-12 04:06:44
问题 I searched any possible help that can be found online but still the problem with INSERT NULL using PHP PDO persists. The script is a csvupload script originally came from here Import CSV into MySQL To make the story short, Let me present the possible cause.. if($linearray[4]=='Unknown') $linearray[4]=null; $linemysql = implode("','",$linearray); $linemysql = "'".$linemysql."'"; $setsu->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $tsuika = $setsu->prepare("INSERT INTO tablename

dplyr to replace all variable which matches specific string

北城以北 提交于 2019-12-12 04:06:20
问题 Is there an equivalent dplyr which does this? I'm after 'replace all' which matches string xxx with NA is.na(df) <- df=="xxx" I want to execute a sparklyr command using the pipe function from R to Spark dataframe tbl(sc,"df") %>% and sticking the first script above doesn't work. 回答1: Replace "XXX" with the string you want to look for: #Using dplyr piping library(dplyr) df[] = df %>% lapply(., function(x) ifelse(grepl("XXX", x), NA, x)) #Using only the base package df[] = lapply(df, function(x

MySQL updating nullable date column to NULL

耗尽温柔 提交于 2019-12-12 04:05:58
问题 I have a nullable date column in a MySQL InnoDB table. How do I update that column to NULL when issuing an update? UPDATE memo_codes_student SET `resolved_date_client` = NULL, `status` = 'Rejected' WHERE `guid_enrollment` = @guid_enrollment AND `guid` = @itemGUID When I run the statement above, it updates the field to 0000-00-00. How can I get it to update the field to NULL? 回答1: You are probably running in NO_ZERO_DATE mode. See this post for more information: https://stackoverflow.com/a