Questions tagged [null]

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?
William Entriken
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 =...
Backen
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...
Lennart
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...
juju
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...
Matt
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...
laksh jay
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...
grahamjamesaddis
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 :...
lucy
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...
js. c
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...
Lowkin
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...
John
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...
ahoosh
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...
crodgers123
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
Calimo
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...
mdb29
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...
Kris Armstrong
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...
Jordina Orcajo
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...
rolls
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...
StonePanda
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...
DrHankPym
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...
metacubed
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...
pipilam
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...
Potassium Ion
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...
Robin M
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...
Bob
1

votes
2

answer
151

Views

Entity Framework - ICollection Property Always Null - getter setter troubles?

I have a .net core 2.0 project using .netcore identity' . I have a classApplicationUser'(aka Owner) and 3 other classes of media objects Videos, Images, and Audio ('Clips'). So far all is great. where i am hitting a wall is when i try to refactor so that rather than having to hit the DB and say some...
Jose Freyre
1

votes
1

answer
73

Views

Java null dereference - micro focus security vulnerability

I am going through a code analysis report of my project and got a lot of issues on null dereference. We always declare a object as null. Let's say String str = null; Perform business logic with conditional operators if (a.equals(b)) { s = 'Assigned'; } then assign the string to value objects. form...
1

votes
0

answer
163

Views

C# and Linq predicate false when value is null

I am writing a program in c# using Linq and debugging in Visual Studio. And I am trying to test if all values in a data table can be converted to an integer. The data table allows columns to be null (AllowDBNull=true). I have tried using the .All method, but the predicate evaluates to false as so...
A L Morris
1

votes
0

answer
49

Views

Why cant resharper null analysis determine this cannot be null?

Why does resharper warn that File2 may be null? If File2 is null, then file2Data will be null, therefore it is impossible for the else condition to evaluate. public File File2; .... var file2Data = File2?.Data; if (file2Data == null) { CanSaveFile2 = false; } else { //File2 -> Warning: Possible Null...
rolls
1

votes
1

answer
310

Views

Convert json null to nan in python

I have been using the simplejson module to correctly handle all NaN --> null conversions (going from python to json). Specifically, I've been using the ignore-nan=True flag in the simplejson.dump function). I can't seem to find the equivalent functionality going the other way - i.e. from json null t...
djmac
1

votes
0

answer
38

Views

Spark/Scala - processing last 10 notNull observations

I have data collected from sensors coming daily, and from there I need to generate daily report. The simplified input data is like this: case class measurement(Date: String, item: String, value: Integer) The report is based on the most recents 10 measurements of each item. The problem is that we do...
Averell
1

votes
2

answer
292

Views

JS IOS issue: null is not an object

I have two arrays: var tableIdsSold = [3, 38, 43, 44]; var tableIdsBook = [40]; I receive array elements from backend, right after 'body' tag opens. Then, before 'body' tags closes, i put link to 'main.js'. In 'main.js' i have this code runnin: for (var i = 0; i < tableIdsSold.length; i++) { documen...
neku894
0

votes
0

answer
14

Views

IS NOT NULL is still returning null values in my query

I am using Loader for a query using CursorLoader and the appropriate parameters to derive values. I am using a recyclerview to display data. Without the use of IS NOT NULL in my SELECTION parameter, which is the same as a WHERE clause my recylerview shows 2 blank rows. When I add IS NOT NULL in my...
NVA
1

votes
1

answer
60

Views

flask mysql not null

c.execute('SELECT * FROM image where year=%s and day=%s and month=%s and station=%s ',(year,day,month,station)) I use this query for fetching all data and I bring the data from html page just below code year = request.form.get('Year') day = request.form.get('day') month = request.form.get('Mo...
Daniel
1

votes
0

answer
47

Views

Why does R evaluate a subsetted NULL?

AFAIK, any subsetting of NULL, such as NULL[1] in R will return NULL again. It seems though, that R still evaluates the part to use for subsetting: system.time(NULL[1]) user system elapsed 0 0 0 system.time(sample(1e7)) user system elapsed 0.582 0.010 0.598 system.time(NULL[sam...
MartijnVanAttekum
1

votes
1

answer
259

Views

Angular 5 HttpClient Post List to Web Api - always null?

The setup is Angular 5 and .net core Web Api. At the controller, model binding always results in null while trying to bind to a complex object. Code is provided below. This example is adapted from another SO answer . but its not working for me. Controller: [Route('demopost1')] [HttpPost] public...
blogs4t
1

votes
1

answer
55

Views

I've added things into my ArrayList but still not working for loop, and function

So I have to create a movie kiosk rental system for one of my assignments, and I have to add five films into the database. I have done that properly (I believe) but when I implement the removeMovie() function it is returning null, especially. I'm not sure what I'm doing wrong. Here is my code: impor...
Solstice Snow
1

votes
0

answer
38

Views

Wildfly Eclipselink checkForUnregisteredExistingObject NullPointerException

I have a problem that I can't save a simple object to database. The project was originally using Hibernate but I changed to Eclipselink. I have others project with Eclipselink but not with this configuration and this server (Wildfly 10.x). I'm not sure if can be a conflict with some JBOSS libs. Thi...
user9764386
1

votes
4

answer
114

Views

How can I type cast when using the null coalescing operator?

Say I have this: $username = (string) $inputs['username'] ?? null; If $inputs['username'] is set then I want it to cast to string. If it's not set then $username should be null. However, at the moment if $inputs['username'] is not set it will be an empty string instead of null. How can I fix this? O...
Optimae

View additional questions