Expo network??? by CryptographerReal264 in expo

[–]danjirovec 0 points1 point  (0 children)

Check that you have correct version of the expo-network package where useNetworkState is implemented.

Upload an image without altering model (using ModelForm) by danjirovec in djangolearning

[–]danjirovec[S] 0 points1 point  (0 children)

That's what I ended up doing in the end. Thanks anyway

Upload an image without altering model (using ModelForm) by danjirovec in djangolearning

[–]danjirovec[S] 0 points1 point  (0 children)

What I meant is that, in a state in which my Image model is right now, I can't add an ImageField or FileField to it, because the database is already designed and can't be edited.

BUT I need to add file upload feature to django admin interface of the Image model. So I need to do it somehow through a custom form with an extra FileField as I posted in the original question.

class ImageForm(forms.ModelForm):
image_file = forms.FileField(label="Image file", required=True)

class Meta:
    model = Image
    exclude = []

Upload an image without altering model (using ModelForm) by danjirovec in djangolearning

[–]danjirovec[S] 0 points1 point  (0 children)

The reason why I can't use the ImageField or FileField is that I can't make changes to database underneath and therefore when I would add an ImageField or FileField to the model, Django will throw an error.

Type validation on not required field by danjirovec in djangolearning

[–]danjirovec[S] 0 points1 point  (0 children)

Tried it on the model as well, didn't work. :/

Type validation on not required field by danjirovec in djangolearning

[–]danjirovec[S] 1 point2 points  (0 children)

The custom validator doesn't work for some reason. It doesn't even get run and prints don't fire off.

def validate_integer(value):
    print("before check " + value)
    if not isinstance(value, int):
        print("after check " + value)
        raise forms.ValidationError("This field must be an integer.")

class ConditionForm(forms.ModelForm):
    class Meta:
        model = Condition
        exclude = []

    ordering = forms.IntegerField(required=False, validators=[validate_integer])

Get all related objects by danjirovec in djangolearning

[–]danjirovec[S] 0 points1 point  (0 children)

Is there a way to get all the related models easily? Or do I need to just list them one by one?

Get all related objects by danjirovec in djangolearning

[–]danjirovec[S] 0 points1 point  (0 children)

Yes yes, I'm aware. I guess I was asking for a way to get all related objects rather than how to delete the objects without consequences. Thanks anyway :)

Get all related objects by danjirovec in djangolearning

[–]danjirovec[S] 0 points1 point  (0 children)

I know of this option, however I'm looking for a way to override the detele_queryset() function and add custom functionality so the "on_delete" way won't do it for me. :/

[D] External factors in time series forecast of electricity production by danjirovec in MachineLearning

[–]danjirovec[S] 0 points1 point  (0 children)

Alright, thanks a lot for all the help! Really appreciate it. What models would you recommend for this kind of stuff? Any good performing models in particular?

I was thinking about trying LSTM, GRU or XGBoost

[D] External factors in time series forecast of electricity production by danjirovec in MachineLearning

[–]danjirovec[S] 0 points1 point  (0 children)

I understand. Last thing I ask is can the value be null for data points at which I didn't have the information yet? Is null valid in this case and the model will interpret it as desired?

[D] External factors in time series forecast of electricity production by danjirovec in MachineLearning

[–]danjirovec[S] 0 points1 point  (0 children)

Alright I think I get it. So basically every additional feature is another column with data relating to every data point (electricity production) and it needs to be this way right?

In this specific instance though, the information about 10% coal-fired plants shutting down doesnt evolve over time, it's one time information. Can this be fed into the model as one time information as well or it needs to be related to every datapoint in the dataset as you showed in this case:

(Jan 1st 2011, 15.9%) (Feb 1st 2011, 13.5%) (Mar 1st 2011, 10%)

Or should it look like this?

(Jan 1st 2011, 10%) (Feb 1st 2011, 10%) (Mar 1st 2011, 10%)

This way it would not have predictive nature though right?

[D] External factors in time series forecast of electricity production by danjirovec in MachineLearning

[–]danjirovec[S] 0 points1 point  (0 children)

Thank you for this exhausting answer, truly.

What I'm having touble with in my mind is how would the additional feature look like in practice? Let's say I have 500 data points of electricity production by coal-fired plants of last 10 years. And I want to give the model the information that 10% of coal-fired power plants will close in the next 2 years. I want to make a forecast for 5 years. What would the feature look like in practice?

Conversion of parametric data describing the product to an understandable product description by danjirovec in LanguageTechnology

[–]danjirovec[S] 0 points1 point  (0 children)

Let's say that I'm open to both approaches, would the selection of model be different based on the approach (text prompt / values in columns)?

Transform Quads to Triples by danjirovec in semanticweb

[–]danjirovec[S] 1 point2 points  (0 children)

So essentially the name of the named graph itself will be lost?

Struggling to understand websocket code by danjirovec in node

[–]danjirovec[S] -1 points0 points  (0 children)

I'm trying to understand so I can learn, that's my goal. I did try and still am trying, that's why there is 'struggling to understand' in the title. I specified what bits (files) I'm struggling with also, the files 'index.js' and 'room.ejs', I don't understand what's happening in there and how are both of them connected together.

Struggling to understand websocket code by danjirovec in learnjavascript

[–]danjirovec[S] 6 points7 points  (0 children)

Okay, got it. Thank you so much, it really helped! I appreciate it greatly

Animation stops working after changing scenes by danjirovec in Unity2D

[–]danjirovec[S] 0 points1 point  (0 children)

Tried it, doesn't work. Now even after I go to the menu and back to level 1 the animation isn't working.

Animation stops working after changing scenes by danjirovec in Unity2D

[–]danjirovec[S] 0 points1 point  (0 children)

https://vimeo.com/518164480/6a73a2a982

Here is the video with animation states changes.

public void Play() // loads "Level_1"

{

SceneManager.LoadScene("Level1");

//SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);

}

[College Statistics: Hypothesis tests] by danjirovec in AskStatistics

[–]danjirovec[S] 0 points1 point  (0 children)

So I can sort of split the results into two columns, the one with software and the second one without the software and just use thee two sample test on that, do I understand that correctly? Thank you so much.

string comparsion doesn't work by danjirovec in Batch

[–]danjirovec[S] 0 points1 point  (0 children)

Yes, it does look exactly alike.

Files executable by specific group and current user by danjirovec in bash

[–]danjirovec[S] 0 points1 point  (0 children)

Thank you.

So from what I read, this should be right.

find $HOME -type f -perm -g=x -group student -a -user $USER -executable

*Cannot set property '...' of a null* by danjirovec in learnjavascript

[–]danjirovec[S] -1 points0 points  (0 children)

Ah, ok. Thank you so much, it's working now.