Posts by Tobias Mesquita • 22,900 points
750 posts
-
0
votes2
answers79
viewsA: Construct/start object via string parameter in a function
as it is done, you would have to take the function that instantiates the direct object in the window, this can be problematic, especially if this function is redeclared elsewhere in the script. In…
-
1
votes2
answers113
viewsA: How to codate this layout?
basically you need to play with the background-color, one rgba(r, g, b, 0.5) should solve, already the effect of revealing, you get with the box-shadow html, body { position: relative; height: 100%;…
-
4
votes2
answers2000
viewsA: What is the difference between async Task and void?
You’re comparing an asynchronous call to a synchronous call. In the case of asynchronous call, thread will be released when there is any call from IO, or when waiting for the end of an operation…
-
5
votes1
answer374
viewsA: How to get the value of el in the Vue?
you want to get the DOM manipulated by vue? you can use the property $el var appExemplo = new Vue({ el: "#appExemplo", data: { message: 'Hello World!' } }); console.log(appExemplo.$el.id,…
vue.jsanswered Tobias Mesquita 22,900 -
1
votes1
answer783
viewsA: Multiple filters on a json object?
first, you can structure your filters within a "Class". var Filtro = function () { this.data = JSON.parse(JSON.stringify(json.aPesquisa)); } Filtro.prototype.filtro1 = function(value, selecionado){…
-
4
votes3
answers333
viewsA: Help to filter a JSON with jQuery?
replace your first filter with a foreach. var filtrar = function (horamin, horamax) { var data = JSON.parse(JSON.stringify(json.aPesquisa)); let result = data.forEach(item => { let voos =…
-
1
votes3
answers569
viewsA: How to make an interactive background?
follows an example with Avascript. var circle = document.querySelector('.circle'); window.addEventListener("mousemove", function (event) { var posX = (event.clientX - (circle.clientWidth / 2)); var…
-
1
votes2
answers373
viewsA: Inheritance in Entity Framework
First a piece of advice, try to study the differences between TPH, TPC and TPT, so you can choose the best option for each scenario. TPH - Table by Hieraquia - Will have a single table for all…
-
4
votes5
answers5036
viewsA: Join two Jsons into a single object
you can use the Object.assign var obj1 = { "razao_social":"INTELIDER", "nome_fantasia":"INTELIDER LTDA", "rg_insc_estadual":"123456" }; var obj2 = { "usuario":{ "login":"gleyson", "senha":"987654" }…
-
1
votes3
answers5506
viewsA: Format string or float for currency
just dividing by 100 would not be enough? var intl = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }); var valor = 2087500; var moeda = intl.format((valor / 100));…
-
0
votes1
answer103
viewsA: Input Entityframework C#
Nicola Bogar Stop Adding Unnecessary Complexity to Your Code. the class Entity<T> and extensions as Insert(this EntityBase entity) only bring you trouble. In your specific case,…
-
2
votes2
answers161
viewsA: Increase width in % and not in px
you can also do the same thing using CSS. .progress-bar { position: fixed; top: 50%; left: 50%; width: 240px; height: 40px; padding: 5px; transform: translate(-50%, -50%); border: 5px solid…
-
6
votes3
answers25286
viewsA: Change image color with CSS
you have two options, using CSS (but with little support from browsers) or applying a filter over SVG. CSS filter: img { width: 300px; filter: grayscale(1) } <img…
cssanswered Tobias Mesquita 22,900 -
3
votes3
answers438
viewsA: Build circular menu in css
you can do it this way. The secret is to be able to deal with transform: rotate and the position #container { width: 600px; height: 400px; box-sizing: content-box; padding: 20px; box-shadow: 0px 0px…
-
0
votes1
answer36
viewsA: Migrations Entityframework C#
Your EntityFramework not installed correctly, execute the following command on Package Manage Console.: Install-Package EntityFramework
-
1
votes1
answer392
viewsA: Class mapping with Fluentapi and Entityframework C#
Look, avoid using the FluentAPI for the most basic cases, in this case it is best to use DataAnnotations.: Below is an implementation, note that in Entitybase I am using the EntityFramework.Triggers…
-
0
votes3
answers43
viewsA: Prohibit lines from being exactly the same in the database
From your description, I believe you need each field to have a unique value, after all you shouldn’t have two companies in the banco X with the same id. To do this, you must create a unique…
-
1
votes4
answers1734
viewsA: Add a sequence of numbers
You can use the code below, but I believe you will have trouble explaining it to your instructor. var soma = (function* () { while (true) { var numero = prompt("Entre com o numero: "); if (numero !=…
javascriptanswered Tobias Mesquita 22,900 -
1
votes2
answers177
viewsA: Changing frame width with mouse over javascript
you get this effect with the following css.: #meuframe { background-color: whitesmoke; border: 0px solid transparent; box-shadow: 0px 0px 5px black; border-radius: 5px; } #meuframe { width: 300px;…
-
3
votes3
answers2922
viewsA: Dynamic table with addition of rows and columns
First piece of advice I give you if you really need something so dynamic, jQUery is not the way, try the VueJS. Below follows a complete example, see that manipulating the table is not so painful.…
-
1
votes3
answers115
viewsA: Comparison with the if
It’s hard to know what you want to do with this code, but I believe the code below can help you. (function () { var value = 4; var pag1 = document.getElementById("pag-1"); var pag2 =…
-
4
votes3
answers8342
viewsA: SELECT in a table using NOT EXISTS SQL (SERVER 2012)
tb1 need to have some coluna which refers to tb2, even if this is not a constraint (a.ka. foreign key). So let’s say tb1 have the column tb2_id what reference tb2_id in tb2, you can do so.: SELECT *…
-
1
votes3
answers937
viewsA: Does the attribute "async" serve to execute dynamically loaded scripts? (AJAX)
make your script verify that the page is already loaded before registering the script for execution. However, I advise you to use "onreadystatechange" instead of "onload". var loadScript = function…
javascriptanswered Tobias Mesquita 22,900 -
1
votes2
answers189
viewsA: How to avoid repeating code that does the same thing for different Ids?
first step, is to add some reference to div in the input, for such you can apply a data-custom. (function () { var selecionado = document.querySelector(".visivel");…
-
0
votes4
answers97
viewsA: Event.clientX; and Event.clientY do not work in firefox
Follow a suggested improvement to your code. this way you create a scope for your variables and avoid unnecessary calls to the event "mouse". var MoverJanelaInicial = function (div_barra_id) { //…
javascriptanswered Tobias Mesquita 22,900 -
1
votes3
answers605
viewsA: Calling the same function twice
as you did not give details about the script jsPopunder. var jsPopunder = function (url) { window.open(url); }; [ 'http://google.com', 'http://answall.com', 'http://example.com'…
-
1
votes2
answers1736
viewsA: Partial View does not load Javascript - Asp.Net MVC
You see, a View (whether Partial or not) serves to dynamically mount an HTML page on the server side, then any code written within @{ and } is processed on the server side (included tags HTML, these…
-
1
votes2
answers310
viewsA: Create node in xml with jquery
you can manipulate a XML in the same way that it manipulates a HTML. then you just need to make a dial that got the knot usuarios and add content to it. var xmlText = `<?xml version="1.0"…
-
4
votes2
answers1687
viewsA: How to know if the scroll position is on top of a Section?
you can use the getBoundingClientRect to hold the current position of an element on the screen. //todas as paginas ocupam toda a tela. var pages = [].slice.call(document.querySelectorAll('.page'),…
-
1
votes3
answers1272
viewsA: How to add multiple elements within jQuery’s html() function?
You can add DOM elements with the help of $.html() as it would with the element.innerHTML, concatenating scripts, but this method is rather inefficient. var div1 = $('#div1'); div1.html("");…
-
2
votes1
answer468
viewsA: Left Join in LINQ
First I’d like to get into the merits of WCF longitude.: WCF Is Dead and Web API Is Dying – Long Live MVC 6! So if you’re building a new system using an architecture SOA or of Microservices, I…
-
2
votes1
answer177
viewsA: Changing date-attribute value does not work with Jquery
The data-custom are special attributes defined by HTML5, but as whatever element they can store only strings. On the other hand, jQuery’s internal collection, which is accessible by the method…
-
4
votes2
answers831
viewsA: When using the Sort() or map() method
The .map() not to sort, but to map one entity to another. let Pessoa1 = function (nome, sobrenome) { this.nome = nome; this.sobrenome = sobrenome; } let Pessoa2 = function (nome, email) { this.nome…
javascriptanswered Tobias Mesquita 22,900 -
1
votes3
answers846
viewsA: Stay in the same tab after Refresh
update the page hash when changing tab, then when loading the page check the hash. var menu = $('#menu'); menu.on('click', 'a', function () { var current = $(this).closest('li');…
-
5
votes3
answers725
viewsA: ASP.NET MVC Web - How to separate performance between the modules of a project?
As the Gypsy has already listed very well the points of his doubt and responded to the height, I will just suggest some links and make some suggestions for technologies to be used. How are you using…
-
3
votes1
answer77
viewsA: How to minimize jquery script
like the @Sergio pointed out, his HTML does not seem to be semantically correct, so it is interesting that you open a question asking a review of it. $(document).on("click", ".op", function () { var…
jqueryanswered Tobias Mesquita 22,900 -
3
votes2
answers611
viewsA: Suggestion Migration System and modeling of individuals and legal entities in system with Entity Framework
Complementing the response of Gypsy, validations that need to consult the Database, can be made direct in Context, for this to overwrite the method DbContext.ValidateEntity Before implementing this…
-
1
votes2
answers829
viewsA: Import a file containing script and link tags
You may come to use the RequireJS to manage your scripts. In this case you will only have 3 scripts, one with the RequireJS in itself, one configuration, and the other with the necessary scripts for…
-
1
votes1
answer193
viewsA: Scrollleft Javascript
I believe the problem is not in your Java or CSS, but in the way you structured your HTML, in this case the only help I can give you is in the form of a functional example. var mover =…
-
3
votes3
answers227
viewsA: EF Core - Partitioning Filter
The gypsy’s response led me to the EF Core 2.0, as well as the Roadmap and the Preview of the same. In EF 2.0 it is possible to do the following: public abstract class EntidadeBase { public Guid…
-
2
votes1
answer156
viewsA: Javascript add-on help
First step: change your script to somehow mark the selected item. I advise applying a class over the selected item. .conteudo li.sel a { color: #4682B4; background: #fff; border: 1px solid #4682B4 }…
-
3
votes1
answer263
viewsA: I want to use Web sql but I’m not able to create table or insert information in it
When you’re working with WebSql and an error occurs, add a callback error return when calling the transaction.executeSql.: let db = openDatabase('produto_teste','1.0','banco de dados para cadastro…
-
5
votes6
answers2251
viewsA: Remove all elements from an array that already exist in another
you can do next.: var objeto1 = { value: 'A' }; var objeto2 = { value: 'B' }; var objeto3 = { value: 'C' }; var objeto4 = { value: 'D' }; var objeto5 = { value: 'E' }; var listaA = [objeto1,…
-
3
votes3
answers504
viewsA: Map Many to Many in the Entity Framework
From the description of your question, it seems to me you want to build a relationship of 1:N, where a Empresa may have N Projetos and a Projeto may only have 1 Empresa, then you could have the…
-
3
votes3
answers4549
viewsA: Align span right inside div
the first thing you need to do is set a width for the div with the titles and for the with the tags. Then you can use the text-align css. heml, body { position: relative; width: 100%; height: 100%;…
-
3
votes1
answer68
viewsA: Is not Function JQUERY
var divs = $(".div"); for (var i = 0; i < divs.length; i++) { console.log(divs[i]); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div…
-
7
votes3
answers227
viewsQ: EF Core - Partitioning Filter
I am working in a database that has the following feature, 90% a clustered index that integrates two columns.: FilialID and DataCriacao. These tables are partitioned by FilialID, the simple creation…
-
2
votes2
answers277
viewsA: Help with innerHTML in Javascript
First, take care of the Template Literals, Browser support is still small. So instead of the Template Literals I will use Handlebars only to improve the compatibility of your code. But the problem…
-
7
votes2
answers5321
viewsA: Calling an asynchronous and synchronous method
First of all, I see that you’re confusing asymchronism with parallelism, even though the two are closely related, one is very different from the other. When programming asynchronously, the task…
-
1
votes4
answers188
viewsA: Increment in Javascript function
Flávio, as many said you need to put the condition inside the function, but I see that you are having problems to manage content dynamically created in Javascript. So in your case, maybe Vuejs can…
javascriptanswered Tobias Mesquita 22,900