Questions tagged [null]
6337 questions
1
votes
1
answer
5.6k
Views
Cannot index into a null array
I am using a template that sets the cell color based on a condition if a server backup was successful or not.
I have the below code which is continuously throwing the error: Cannot index into a null array:
Cannot index into a null array.
At C:\Users\admin\Desktop\new.html.ps1:65 char:17
+ ......
1
votes
1
answer
680
Views
Does JPA return “null” or empty collection for a collection property that is empty in the DB?
If I have a JPA entity containing a collection field, such as
public class Post {
// [...]
@OneToMany
private List tags;
the corresponding database schema will typically contain a separate table for storing the tags, where each record contains one tag and a foreign key reference to the 'Post' ta...
1
votes
2
answer
51
Views
Assign values to a pointer which was initialised to NULL before
Can someone tell me why do I get this segmentation fault?
Is it because I have set a pointer to NULL and passed it to a function?
Should I use arrays or pointers when I want to send an array to function?
#include
#include
int* ComputeFibo(int _size);
void PrintFibo(int* _arr, int _size);
int mai...
1
votes
2
answer
36
Views
After sending a pointer to an external function to make it null, it doesn't change to null [duplicate]
This question already has an answer here:
Passing by reference in C
17 answers
I have created a pointer of type 'Vector' (see code). After creation I want to send a pointer of type Vector (meaning Vector*) to a function called 'VectorDestroy(Vector* _vector), which frees the struct from memory and...
1
votes
3
answer
25
Views
Remove NaNs from Dataframe?
I have the following code:
sample_data = OrderedDict((df.name, df['col'].sample(n=3)) for df in test_cases[1:])
sample = pd.DataFrame(sample_data)
Which gives the following dataframe:
col1 col2
A NaN
P NaN
NaN E
NaN R
U NaN
NaN Y
How do I get the following dataframe:
col1...
0
votes
0
answer
5
Views
Java objects created with Google Web Toolkit ClickHandler is null when the handler is finished being run
My overall application is that I have the user upload two csv files and I parse the two files before creating a visualization of the data contained with a Canvas element. I got the first part working, where the user uploads the two files and it gets parsed okay.
Here is the handler I have to submit...
0
votes
2
answer
31
Views
Can only pointers hold NULL values?
I was trying to set a struct to NULL but the compiler was saying 'invalid initializer', but the moment I made a pointer for that struct it worked properly.
struct node {
int value;
struct node * left;
struct node * right;
};
struct node a = NULL; /* doesn't work */
struct node * b = NULL; /* works f...
1
votes
3
answer
57
Views
Get rid of null values in mysql query
I have a database where I store fishing licenses. The licenses have from- and to-dates, and I'm using a calendar table to count the amount of sold licenses for each day. Each license has a defined licensetype. The licensetype can be valid for one or more fishing zones.
I'm trying to build a query w...
1
votes
2
answer
211
Views
How can I create a file with null bytes in the filename?
For a security test, I need to pass a file that contains null characters in its content and its filename.
For the body content, it's easy to use printf:
$ printf 'Hello\00, Null!' > containsnull.txt
$ xxd contains.null
0000000: 4865 6c6c 6f00 2c20 4e75 6c6c 21 Hello., Null!
But how can I cr...
1
votes
1
answer
65
Views
Android (Java): how to use LayoutInflater.inflate() for Dialogs?
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) n...
1
votes
2
answer
29
Views
Set char pointer to NULL after using in a function
In C, I have a function in which I am getting a string as a parameter and then after using it, I want to destroy it, because I have to call it in an infinite loop and getting Process returned -1073741819 (0xC0000005) after 5 minutes.
Here's my function:
void renderText(char *text) {
//use it here an...
1
votes
1
answer
12
Views
Angular 6 - null, undefined check not working -ERROR TypeError: Cannot read property 'Region' of undefined
This Kendo-dropdownlist exists as a Kendo Grid column.
Here is component code:
handleRegionChange(value: any, dataItem: any) {
if ((dataItem.Region !== null || dataItem.Region !== undefined) && value.Region) {
this.SelectedRegion = value.Region;
dataItem.Region = value.Region;
dataItem.RegionMaster...
1
votes
3
answer
3.5k
Views
1
votes
2
answer
2.6k
Views
PostgreSQL: LEFT JOIN creates blank row
See important new discoveries 1 and 2 at end of this explanation.
I am running Postgres 9.1.3 and am having a weird left join issue.
I have a table named consistent.master with over 2 million rows. It has a column named citation_id, and that column has no nulls. I can verify that with this:
SELECT C...
1
votes
1
answer
21
Views
non-aggregate min() with NULLs
I am using the the multi-argument form of min but some values are NULL.
For example:
SELECT min(1,2,NULL);
How do I update this query to ignore NULLs and return the desired value 1?
1
votes
1
answer
228
Views
MySQL GROUP BY ignore or skip other null column
I have a table:
(id, storage_id, product_id, quantity, property_storage_group_id)
And I need min quantity, but when prouct_id is several, I need to ignore product_id with property_storage_group_id = null.
Something like this:
SELECT MIN(quantity), product_id
FROM storage_quantity
WHERE storage_id =...
1
votes
0
answer
241
Views
Interstitial Ad returns a null value
I programmed an app named 'Trumple Run' for android. Like the name says it is a Jump & Run game and I want to release it soon. Before that I would like to implement Interstitial Ads from AdMob. I followed the official guide for the implementation of Ads but the app always crashes when I tried to sho...
1
votes
0
answer
257
Views
Python 3.6 - heroku local command cannot find Procfile - Help troubleshooting error message
I am trying to get a working example of my Django app before deployment to Heroku server. If I run python manage.py or heroku open the website runs with no problems. When I attempt to run heroku local web I get the following error:
C:\Users\Jup\Drop>heroku local web
[OKAY] Loaded ENV .env File as KE...
1
votes
1
answer
51
Views
Displaying Row In Resultset Where No Values Exist
I've read a couple of questions on here that seem to answer this e.g. Return a value if no rows are found SQL
However, I'm struggling to get it to work for me. This is the output of my query as it stands:
As an example there are actually six classes, but only three display because they actually hav...
1
votes
0
answer
297
Views
Cannot read property 'props' of null with mapStateToProps
Hi i am getting in to react native with redux and redux saga and currently i need to load cities array to a picker via ajax called and this is my code so far.
inside render method :
render() {
if (this.props.loaded) {
//
}
return (
this.setState({ email })}
value={this.state.email}
placeholder={I...
1
votes
1
answer
128
Views
querying null fields using pyorient OGM
I'm trying to use the OGM from pyorient to match records which have nulls in some of their fields.
I managed to get most things working by looking through the unit tests on GitHub but I couldn't find any examples there or in the docs. I also couldn't see any issues on GitHub, so I guess I'm just app...
1
votes
1
answer
285
Views
How to handle object null in python
I am using flask. When I do not pass StartingSequenceNumber to flask app then How can I handle null object.
class Meta():
def __init__(self, j):
self.__dict__ = json.loads(j)
in bootstrap.py
meta = Meta(request.get_data().decode())
if meta.StartingSequenceNumber is not None:
# do something
Error :...
1
votes
0
answer
115
Views
why could not get results of mysql query in php?
I'm making a test login page using php, javascript. but, I can not get a result of select query in php. What was the wrong in my code?
Thank you for your help.
This is my local table
And This is what I entered email(id), password in a login page.
(apache2 - error.log)
[Mon Jan 15 17:22:55.208889 2...
1
votes
0
answer
301
Views
Kotlin, Bluetooth - intent.getParcelableExtra(Bluetooth.EXTRA_DEVICE) returns Null and crashes
var pairedDevice = mBluetoothAdapter.bondedDevices
deviceAdapter = DeviceAdapter(this,pairedDevice)
bluetooth_listView.adapter = deviceAdapter
layoutManager = LinearLayoutManager(this)
bluetooth_listView.layoutManager = layoutManager
mBroadcastReceiver = object : BroadcastReceiver() {
override fun o...
1
votes
0
answer
45
Views
Why do Static Methods & Enumerations have unexpected behavior in Xamarin Forms? Objects Passed to Static Methods become null & enums are stored as int
I have been using C#/.NET/Visual Studio since 2000, but I just started working with Xamarin Forms recently. It's a pretty great platform, however I have run across a couple of issues that I cannot figure out. (I'm using Visual Studio 2017 Community). I have been researching this behavior extensively...
0
votes
1
answer
25
Views
Scala: Filtering List of case class with fields of Option
I have a List[A] where A is a case class with a number of fields, from which x and y are Option[double]. I am trying to filter this list based on two conditions as below:
val resFiltered = res.filter(c => (c.x.getOrElse(num) != num) &&
(c.y.getOrElse(num) != num)
)
where num is really a random numb...
0
votes
0
answer
4
Views
Accept.js POST is causing part of my model to have null properties
I'm using the Accept.js credit card form in their Sandbox environment. I was able to get everything to work yesterday such that when i post and hit our API all of the MVC model properties were filled like i expected. However, today, suddenly there are several properties that are null but some are...
1
votes
0
answer
48
Views
Portable null device in R
Is there a portable way to get the null device in R?
At the moment I am doing this:
dev.null
1
votes
2
answer
55
Views
Calling a function that takes a completion handler that I'm not going to use, do I use nil, NULL or something else?
When calling a method that has a completion handler as one of it's arguments, if I don't plan on using it, what is an appropriate argument to use?
e.g.
[self.navigationController dismissViewControllerAnimated:YES completion:NULL];
There are lots of examples of the differences between NULL and nil, I...
1
votes
2
answer
42
Views
Mysql count rows and rows with null
Hy Guys,
I have a table like that:
+----+------+
| id | grade|
+----+------+
| 1 | 1 |
| 2 | 1 |
| 3 | 2 |
| 4 | NULL |
| 5 | NULL |
| 6 | NULL |
+----+------+
Where
1 Bad
2 Good
3 Very Good
Im trying to get a result something like that:
+--------------+------+
| grade | count...
1
votes
1
answer
172
Views
Android null pointer in getfilesdir() [duplicate]
This question already has an answer here:
What is a NullPointerException, and how do I fix it?
12 answers
Trying to write a string to a file on Android app crashes on opening [duplicate]
1 answer
I'm am getting a NULL pointer message on getfilesdir(). I'm sure it has something to do with my imple...
1
votes
1
answer
609
Views
Tableau missing dates with value 0
I want to build a line graph, and I have missing dates in my data. I would like to get value 0 for the missing dates.
With the option 'Show Missing values', all dates are shown in the graph. But the missing dates do not have any values but they appear and the line passes over them.
Values for miss...
1
votes
1
answer
47
Views
Tell resharper that a Func<string> will never return null
[NotNull]
private readonly Func FunctionThatWillNeverBeNullNorReturnNull;
void Test(){
string thisStringIsNotNull = FunctionThatWillNeverBeNullNorReturnNull();
}
How do I tell resharper that the above function will never return null? Putting [NotNull] implies that the Function reference cannot be nu...
1
votes
1
answer
621
Views
Google Sheets Query - Sort By Date; Blanks/Null to the bottom
Running into an issue when running a query in Google Sheets. The results of the array formula query are correct but the column utilized to order the results (Col1) is comprised of both blank/null cells and dates. As such, when ordered by this column the blank/null values are listed first before the...
1
votes
1
answer
68
Views
Can you create a new instance with the copy assignment operator?
I'm trying to wrap my head around the copy assignment operator in C++, and I'm wondering if there's a way to create a new instance if the object is null.
class Person {
public:
Person(string name) { pName_ = new string(name); }
~Person() { delete pName_; }
Person(const Person& rhs) {
if (pName_ != N...
1
votes
0
answer
42
Views
Represent unset values in Jackson without null
I have a few API model objects defined in Kotlin, so all fields are non-nullable by default.
data class MyParam(val name : String,
val myField1 : ClassOne = ClassOne.NO_OP,
val myField2 : ClassTwo = ClassTwo.NO_OP)
For unspecified values, I use the null-objects ClassOne.NO_OP and ClassTwo.NO_OP whic...
0
votes
1
answer
36
Views
Actual array is null - JUnit
Im trying to unit test my overwriting method that overwrites the file (or create new one if given file does not exists). My idea was to compare two arrays before overwriting and after overwriting, so I made it, but unfortunately, it says that actual array is null.
I am using TemporaryFolder so that...
1
votes
1
answer
55
Views
Tolerate certain characters in RegEx
I am writing a message formatting parser that has the capability (among others) to parse links. This specific case requires parsing a link in the from of and replacing that text with just the linkname. The issue here is that both url or linkname may or may not contain \1 or \2 characters anywhere i...
1
votes
1
answer
154
Views
IBM Data Studio - SQL query returns NULL when there is data
I'm running SQL queries against DB2 database using IBM Data Studio. For CHAR columns (72 in length) that contain special characters within the text such as an apostrophe, the result for that record column is NULL.
When I connect to the same DB2 database using SAS or MS Access, I get the results of...
1
votes
2
answer
170
Views
How can I check if my parameter is null in the script when it's a list that allow multiple values?
I created non-required parameters in a cascading parameters :
The month-opt parameter isn't required AND is allow multiple values.
I used this parameter in the query, so I created a script :
if(params['MONTH-OPT'].value != null && params['MONTH-OPT'].value != ''){
this.queryText = this.queryText...