Questions tagged [model]

19284 questions
1

votes
1

answer
601

Views

How validate data from post in restful api

I need to validate some data before insert into the database, for that i create a little service that return invalid fields from an entity. It works ok when validating single entities. class EntityValidator { protected $validator; public function __construct(ValidatorInterface $validator) { $this->v...
fajuchem
1

votes
1

answer
436

Views

Python - PyQt5 - MVC

I'm creating my first application in Python. Currently I'm implementing the first view with PyQt5 and the MVC pattern. Therefore I created a 'main' class that is starting the controller by creating a new controller object (The first programming language I learned was Java, so maybe this is not necas...
DummerTroll
1

votes
2

answer
42

Views

Should multiple Spring controllers direct to same view file?

Suppose in Controller A, I have @GetMapping('/path/1') public String getIndex() { //it's own unique logic ... return 'path/to/file'; } and in Controller B, I have @GetMapping('/path/2') public String getIndex() { //It's own unique logic ... return 'path/to/file'; } Is it a good practice to have two...
John Doe
1

votes
2

answer
190

Views

How to customize error response in web api with .net core?

I am using .net core 2.2 with web api. I have created one class i.e. as below : public class NotificationRequestModel { [Required] public string DeviceId { get; set; } [Required] public string FirebaseToken { get; set; } [Required] public string OS { get; set; } public int StoreId { get; set; } } U...
Srusti Thakkar
1

votes
2

answer
81

Views

JSON string from server side not coming properly using ajax jquery

What I am doing is, i am getting data from server side using mvc. The data is properly coming in return part. But when I m debugging in the client side, I am only getting the parameter value as [. Below is the JSON response which I am getting. [{'VENDORNAME':'ABC','VENDORCODE':'1234'},{'VENDORNAME':...
B N
1

votes
1

answer
57

Views

Understanding release sequence and synchronize with in C11

I'm trying to understand memory model and reads 5.1.2.4 Multi-threaded executions and data races and is confused by the release sequence concept defined at 5.1.2.4(p10) as follows: A release sequence headed by a release operation A on an atomic object M is a maximal contiguous sub-sequence of side e...
Some Name
1

votes
2

answer
48

Views

Observer Pattern on MVC for specific fields

On the MVC pattern, which is the best option for the Model to notify the View (if this is the right approach in the first place) where, from all the fields of data the Model is storing, only a couple of them are updated. Specifically when we only want to update specific fields of the View. I am curr...
Fred
0

votes
0

answer
11

Views

Have a sql statement that is executing twice on IIS but once on MSVS, why?

I have a sql statement that executes twice when posted to the IIS, but it only executes once when in MSVS I am not sure why it works in one but not the other. Some other information I have a wildcard SSL that is attached to the server, and I only see one post request in the network Log. The actual...
Danimal
1

votes
2

answer
1.6k

Views

Using accepts_nested_attributes_for on a join table with its own attributes - Duplicate rows

I have the following three models (Rails 2.3.8) class Outbreak < ActiveRecord::Base has_many :incidents, :dependent => :destroy has_many :locations, :through => :incidents accepts_nested_attributes_for :incidents, :allow_destroy => true accepts_nested_attributes_for :locations, :allow_destroy => tru...
Pasted
1

votes
0

answer
5

Views

Is it possible to load a pre-trained model into spacy?

I want to be able to use spacy's full functionality, but my language of choice does not currently have it's own model on spacy. By full functionality, I mean convolutional layer that is shared between the tagger, parser and NER; and be able to update all of these different models by extending the v...
user2827262
0

votes
1

answer
20

Views

How does one identify if the ML model is overfitting the dataset or not?

I have been comparing different regression models from sklearn, On doing so I was confused with the model's score value that i got. Below in the code you can see that i have used both Linear Regression and Ridge Regression but the difference in score values for the training and test data set vary by...
Shankar Ganapathy
0

votes
0

answer
13

Views

HttpClient - An existing connection was forcibly closed by the remote host - IIS Published web app

I have tried a ton of solutions that I searched about this issue, but none of them fixed my web app. So, I have a web app that uses a vendor API to populate my data. I was able to successfully connect to the API and transact different kinds of API calls locally. After I completed my web app, I trie...
Lex
0

votes
0

answer
7

Views

Improving the relevance of production errors reporting

The support mailbox became unusable : In our mvc application, we catch exceptions thrown at several places (OnException implemented, try/catch in InvokeActionMethod, etc.) and we send a mail for each place (with a log4net appender). This results in an abundance of error mails in the common exchange...
Jean-Luc T.
0

votes
0

answer
6

Views

How to manage multiple clients website having same code structure but different UI?

I want to create websites for many colleges using MVC. Since coding structure will be common for all the client websites but the website templates will be different I need suggestions on handling this. Do I need to create a core framework for this and use the same for other website projects? If I do...
Karthik
1

votes
3

answer
4.2k

Views

Spring MVC - how to pass data from filter to controller

I use Spring MVC in my web application. For every request I'd like to prepare the environment, for example load some data from the datastore and save it so every controller could access that information. I assume that's what filters are for (among other things). I can attach an information to the re...
tobik
1

votes
3

answer
1.6k

Views

Rails association primary_key option

I understand that foreign keys are for specifying when you have a different column name (different than parent child's class name) on the child class. I know what primary keys and foreign keys are and have read the rails documentation on associations several times, but I can't figure out what the pr...
JaTo
1

votes
1

answer
954

Views

Umbraco Surface Controller Not Routing Correctly

I have a bit of trouble getting a surface controller to fire correctly. public class SocialShareSurfaceController : Umbraco.Web.Mvc.SurfaceController { public ActionResult Index() { return Content('hello world'); } } I'm trying to get to the controller via this URL: http://website.local/umbraco/surf...
Ayo Adesina
1

votes
1

answer
978

Views

Yii 2 Update All Not IN

Based on the code below, I want to update all in customer to status 1 where status = 2. However, i want to run the code below where customer_id not in (1, 3, 5, 8). $customerNotIn = array(1, 3, 5 ,8); Customer::updateAll(['status' => 1], 'status = 2'); How can i achieve that?
CloudSeph
1

votes
1

answer
61

Views

Kentico 12 MVC ComponentDefinitionProvider Warning

Does anyone know what the 'ComponentDefinitionProvider' in K12 is and where I can disable this feature? I do not use it and I get warnings in the event log. I would like to disable it to stop this.
Elmar Höfinghoff
1

votes
2

answer
43

Views

Javascript MVC, addEventListener cannot be attached to dom element

I have these javascript files. It is really small test project to understand how MVC works with javascript. When I try to click 'Delete Bloak' button, nothing happens except with last button, which has id of 100. The other buttons do not have any click event attached to them. Why? Controller.js var...
Oakar
1

votes
2

answer
40

Views

How to develop an edit option on hover of a div

I'm trying to use the hover option to display an small edit image/button in the top right hand corner of a div. I have a dynamically created table of x by y number of cells. What I would like to do is have a tiny edit button in the top right hand corner that allows me to click on that button and bri...
user1397978
1

votes
1

answer
45

Views

Why 3d models are visible in Three.js without using any light sources?

What I have As shown in the figure below i use Three.js library to create a WEBGL canvas and load a .gltf model in the scene using GLTFLoader.js. The Code I use //Add THREE Renderer renderer_Main = new THREE.WebGLRenderer({ antialias: true }); renderer_Main.setSize(canvasWidth, canvasHeight); //Set...
Loizos Vasileiou
1

votes
2

answer
29

Views

Django keeps returning local variable 'product' referenced before assignment error

I stored a list of products in my django models with multiple images attached to each product as a foreignkey. I am trying to retrieve all the products and their respective images in my django views so that I can print them on the screen. However no matter what I do I keep getting the local variable...
Osaro
0

votes
1

answer
15

Views

How to specify the elements that the forms.select() must show in django

i am developing a project with django, and i have a little problem. I am trying to make a forms.py, and i have a widget form with 'forms.select()'. I just want to know what can i do if i want to specify what elements of that widget should show: This is a part from my forms.py: fields = [ ... 'id_cla...
Luis Bermúdez
0

votes
0

answer
2

Views

How to fix this ajax request to stop failing in MVC5

I'm the similar ajax requests to get other database info working. Perhaps its something minor that is causing the issue. Each time I execute this function it fails and throws the alert. It is returning the 13 user records stored in my database, during debugging I can see that these 13 records are al...
1

votes
4

answer
1.5k

Views

How do I ensure unique id is indeed unique in Rails?

I want to replace an object's url from /object/123 to /object/f8a3b2, so instead of using the id column I'm generating an uid column manually when the object is created. I can use the uuid libraries available to generate uid, but how do I make sure that the generated value is always unique? I have a...
foobar
1

votes
1

answer
59

Views

Send data to another JavaScript file from a JavaScript file

I want to see the information of this admin in the panel when admin enters the panel. But there are more than one admin on the system. Therefore, I need to find the administrator who logs in to the system according to the mail entered from the login page. When I click submit button, I need to send t...
Engr. Arda
1

votes
2

answer
149

Views

laravel - How to get data by pivot table

I have a problem with laravel. I have created relationships between tables and relationships at the model level in laravel but if I want to display data to the view, I get an error: Property [category] does not exist on this collection instance. the table with the films is called: videos the table w...
White Cat
1

votes
0

answer
420

Views

sapui5 QUnit testing - how to use controller functions in my testcontroller

I am really new to the sapui5 language. And currently I'm starting with Qunit testing. My question is, how can I Import functions from other controlls to my test- controlls? e.g. in python there is an 'Import function from module'. this is my test for my configuration.controller this is my _getParen...
Not Me
1

votes
0

answer
482

Views

How to save & load Xgboost model.best_ntree_limit

I use the model.save_model('xgb.model') and model = xgb.Booster(model_file='xgb.model') to save & load xgboost model. But I found that this is not the best model in training. So, how to save the best model (best_ntree_limit) and load it?
j.j
1

votes
1

answer
1.9k

Views

Cannot find type definition file for 'node' error in angular

I am new in Anguar2. I am working on MVC Core. When I am trying to run my application after debugging, I can view the screen but after few seconds I am getting the following error: 'in E:\Websites2017\MVC\MVC6\Angular2ASPCORE\Angular2ASPCORE\node_modules\angular2-platform-node\node-location.d.ts (1,...
Partha
1

votes
0

answer
77

Views

Query on Datalog Least Fixpoint Evaluation

Can someone help me with this? Is the following statement true? If a least fixpoint evaluation of a datalog program does not terminate, then the least model must be infinite My Answer: Yes, it is True, as in cases of function, the least fixpoint evaluation would not terminate. Thank you
Susha Suresh
1

votes
0

answer
104

Views

MVC DropDownList Displays System.web.mvc.SelectListItem

I made a drop down list using @Html.DropDownList() But instead of displaying my list items, it displays System.web.mvc,selectlist item Here's the code: @{ List listItems = new List(); listItems.Add(new SelectListItem { Text = 'Department', Value = 'dep' }); listItems.Add(new SelectListItem { Text =...
Peer Sahab
1

votes
0

answer
310

Views

FormGroup.patchValue not patching object element correctly Ionic 2 Angular 2

I know guys there are lot of solutions regarding this question. But none works for me. I'm working with Ionic 2 Angular 2. On keyup event I want to patch Validator.required. Here Ownership is ion-select with 2 ion-options. On selecting Double 2 more fields open. I want to validate both first and sec...
Zeeshan Malik
1

votes
0

answer
1.1k

Views

Tensorflow: Attention heatmap visualization

I am trying to create a heat map the same as the image below using attention in TensorFlow r1.4. I am using tf.contrib.seq2seq.BahdanauAttention and tf.contrib.seq2seq.AttentionWrapper for implementation of attention mechanism. I have seen a workaround here (Visualizing attention activation in Tenso...
nix
1

votes
1

answer
1.5k

Views

ErrorException thrown with message "htmlspecialchars() expects parameter 1 to be string, object given Stacktrace: #59

ErrorException thrown with message 'htmlspecialchars() expects parameter 1 to be string, object given (View: G:\xampp\htdocs\Blog\resources\views\songs\index.blade.php)' Stacktrace: #59 ErrorException in G:\xampp\htdocs\Blog\vendor\laravel\framework\src\Illuminate\Support\helpers.php:577 #58 ErrorEx...
Istiyak Amin
1

votes
1

answer
360

Views

R influence variables on y target [closed]

One task of Machine Learning / Data Science is making predictions. But, I want to get more insights in the variables of my model. To get more insights, I tried different methods: Logistic Regression (The output provides some 'insights' in the influence of the different variables, see: Checking int...
R overflow
1

votes
1

answer
88

Views

Model as a “domain model” with ModelWrapper class in mvvmFX library

I want to ask you about model and ModelWrapper behavior. According to Wikipedia article about model component of MVVM: Model refers either to a domain model, which represents real state content (an object-oriented approach), or to the data access layer, which represents content (a data-centric appr...
Dmitry Melnikov
1

votes
1

answer
136

Views

MVC Structure in swift

Do we need to create the Web services singleton class file out of the MVC folder, while following MVC Structure or it stays in Model folder together with the Mapper classes
Sushmita Sinha
1

votes
0

answer
19

Views

What exactly could be the reason that my .htaccess file disturbs my script (because of redirecting)?

I am programming a php model-view-controller. Basic structure: mvc | |app | |_ models | |_ views | |_ controllers | |web |_index.php |_css |_js ... As so I use my .htaccess file for redirecting the url: RewriteEngine On RewriteBase /mvc/web/ # Let any content of web be shown (css, fonts, images,...
po0l

View additional questions