Posts by Marllon Nasser • 3,845 points
113 posts
-
1
votes1
answer187
viewsA: javascript selects to filter json data
I still think you need to review your scope and mainly define better what you want. At the end of the computers what you need is just to filter the json according to what the user wants. I’ve…
-
3
votes4
answers453
viewsA: Table change constraint with subquery
Informix also has this restriction. I would say that it is for the sake of the same implementation. In the background it is due to the danger of entering a loop infinite. To avoid error, I usually…
-
8
votes3
answers852
viewsQ: Web Security api: SSL?
I wonder if you have how to restrict requests to a web api specifically for a machine. My web api will be hosted on computer A. My client (at first only one) will stay on the computer B. Different…
-
4
votes2
answers181
viewsA: Do not ask for credentials if user is not authenticated
I’ve had similar problems... Unfortunately after long lost searching for a solution, I came to the conclusion that I had nothing to do because - in my case - it is a windows authentication, managed…
-
2
votes3
answers403
viewsA: Loop for inside a function
I don’t think you need to do the whole process... For what you wrote, you just want to change the classes active, right? Then just remove the current and assign the new element (from the event):…
-
1
votes2
answers1081
viewsA: List table with condition ASP.NET MVC
The error is in the Detail link. Notice that in your Controller you expect an "id" - which you also allow to be null by declaring him as nullable. If the id are not allowed to be null, which…
-
4
votes3
answers8500
viewsQ: Angular + ASP.NET MVC: Does it make sense?
I’m starting to study Angular2. As I am working a lot with . NET I decided to do a project with ASP.NET MVC 4 and Angular2. Giving a read on hello world of Angular I noticed that Angular has its own…
-
5
votes1
answer137
viewsQ: How does the request session work?
An idea arose among the developers to use the standard of Session per request - Session by request. Researching on the subject, I found some topics in the OS that generally said that the indication…
-
1
votes2
answers161
viewsA: Customized Viewbag, how to do?
The problem is that you don’t put your List in your dropdown. Adjust your old list to return only one Collection. var listaProfessores = from u in db.Pessoas.OfType<Professor>() join v in…
-
0
votes2
answers643
viewsA: Disable button during javascript processing c#
A solution with jQuery: 1- I removed the OnClientClick: <asp:Button ID="btnOk" runat="server" AutoPostBack="true" CausesValidation="true" ClientIDMode="Static" Text="Ok" Width="80px"…
-
10
votes2
answers487
viewsA: How to sort by two properties in Linq
Utilize ThenBy in the second sort if you want the default sort (ASC) return View(trabalhos.Where( a => a.Usuario == User.Identity.Name && a.Data.Month == DateTime.Today.Month &&…
-
5
votes2
answers216
viewsA: How to show elements in sequence?
Just isolate in a method only to display and add a delay between calls. var tempoDeEspera = 1000; //milisegundos $(".desc").each(function() { var elemento = $(this); setTimeout(function() {…
jqueryanswered Marllon Nasser 3,845 -
6
votes2
answers3503
viewsA: How can I count fields that are NULL?
Missing the Where clause correctly.. SELECT COUNT(DataFim) AS QTD FROM AtivacaoGuincho WHERE DataFim is null EDIT: Sorry for the mistake of Ctrl+c/Ctrl+v, the correct is: SELECT COUNT(*) AS QTD FROM…
-
1
votes2
answers888
viewsA: How to compare 2 cells in different columns - SQL
Just use on condition (where) a comparison operator between columns. select * from tabela where val1 <> val2
-
1
votes2
answers172
viewsA: Capture Document click to close menu that is open
You can do this validation by target of the event. $(document).click(function(event) { if (event.target.id == 'btnAbrirMenu' || event.target.id == 'div_do_menu') alert("clicou no menu ou no botão de…
-
2
votes3
answers11972
viewsA: Updating page after time
Can do with Jquery also: $(document).ready(function () { setTimeout(function () { window.location.reload(1); }, 5000); //tempo em milisegundos. Neste caso, o refresh vai acontecer de 5 em 5…
-
3
votes2
answers125
viewsA: How to remove rows from a table A that has no relationship to table B?
That’s one way to do it: DELETE FROM TABELA_A where TABELA_A.FK_ID not in (select FK_ID FROM TABELA_B)
-
0
votes1
answer233
viewsA: SQL - Select with possible concatenation
I think you want to turn rows into columns. There are already several topics that address the same subject. See one of them here. I made an example using oracle, which you can use as a basis for…
-
-1
votes2
answers149
viewsA: Perform calculations between inputs
I will not focus exclusively on the quality of your code, I will directly answer your question about the evento of input. The same way you have a treatment for when they click on the "up arrow" and…
-
1
votes1
answer67
viewsA: Item is not deleted dynamically using foreach
It is not good practice to have multiple forms on one page. I don’t know if I can say if it’s wrong the way dynamics which you implemented, but me would not use that approach. I would do so: echo…
-
2
votes1
answer178
viewsA: Query not working, problem to compare years
I suggest we make the comparison by dates. Something like: INSERT INTO EMPRESAS_FILIAL(IDPERIODO, IDEMPRESA, IDFILIAL) select ".{IDPERIODO}.", IDEMPRESAS emp, COD_PLANTA fi FROM EMPRESAS emp, FILIAL…
-
0
votes2
answers93
viewsA: Group views in SQL Oracle
What you seek is to turn rows into columns, which can be reached through the PIVOT I made an example for you to achieve your goal: create table teste ( codigo number, nome varchar2(50), uso…
-
22
votes6
answers17379
viewsA: How to improve reading performance of a SQL Server database?
What to do to optimize the speed of queries? Well, the creation of right is fundamental in large and small size tables. However there are cases that the index can be harmful. More details here In…
-
7
votes4
answers6983
viewsA: Delete thousands of records from a table
I’m not an oracle expert, but you can also create a table with the records you want keep up. Something like: create table pessoa_new as select * from pessoa where idade <= 40; After that, run a…
-
2
votes3
answers2005
viewsA: Picking up content within multiple Ivs
There are several ways to do...: First you concatenate all the contents of the class Ivs conteudo and puts all the htmls inside one array. Then put all the contents of array in your div resultado.…
-
2
votes3
answers686
viewsA: How to change a text variable to number value?
Just use the parseint() in the variable. $(document).ready(function(e) { $('.pizzadisponivel').click(function(e){ $(this).toggleClass('pizzaselecionada'); var P =…
-
2
votes3
answers878
viewsA: How to hide URL ID?
I made a comment but I decided to put as a response. Just use the protocol POST instead of GET. Speaking for MVC itself, you cannot make the direct modification on your ActionLink. The ActionLink in…
-
3
votes1
answer637
viewsA: filter table Asp.net mvc
Putting as answer to help anyone who has the same problem. (or who is too lazy to read comments) Error happens due to a typo in the function success of $.ajax: function Buscar() { $.ajax({ url:…
-
4
votes1
answer499
viewsQ: Delete user session in ASP.NET MVC with [Authorize]
I have a web system developed in ASP.NET MVC 4. One of the features is user management. A CRUD of users. My method of login is as follows: [HttpPost] public ActionResult Login(LoginViewModel…
-
5
votes2
answers687
viewsA: How is the query generated in Linq mounted when we do UPDATE?
The Context has some form to generate the same syntax? I don’t know, but I don’t think... the use of entity when you want to do "things" of ADO.NET. Is there any way to see the query being sent to…
-
2
votes4
answers1129
viewsA: Last Child of Element Chain
jQuery can help you with the .last() alert($("span:last").html()) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <table> <tr>…
javascriptanswered Marllon Nasser 3,845 -
3
votes2
answers52
viewsA: How to add the <li> tags
With Jquery, use $("li").length. $(".mostrar_resultado").text($("li").length) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <ul>…
-
8
votes2
answers240
viewsA: Keep Data Equal
Well, since it’s a question based on opinions, I’m going to expose my. First of all I would make a local bank (Sqlite). That bank would be a mirror of my remote bank. To ensure greater data security…
androidanswered Marllon Nasser 3,845 -
3
votes2
answers1282
viewsA: Pass results from an Else if array
I think the big question is whether you really need such conditions.... always validate the same in this way with the same conditions seems a wrong logic.. But anyway, I would do it as follows: if…
-
3
votes4
answers6145
viewsA: Character limit in a DIV
Due to lack of information, I will put a solution reached via jquery: In other words, a short answer to a short question. var divXpto = $('#id_da_sua_div');…
-
1
votes1
answer58
viewsA: How to limit display of records according to parameters
I recommend the direct filter by query. Based on your question, it implies that you want to filter the records based by the hour, more specifically at 1:00 p.m. That is, anything from 13 hours, you…
-
4
votes1
answer758
viewsA: SELECT for date with format dd/MM/yyyy hh:mm:ss
Use the function Date(), which works more or less like the TRUNC() oracle. SELECT campo FROM Tabela WHERE Date(data) BETWEEN '2016-10-20' AND '2016-10-20'…
-
2
votes1
answer52
viewsA: Replace in update, change extension in filenames
Use the replace() update tabela set file_name = replace(file_name, '.jpg', '.png'); You just have to be careful not to have more than one occurrence of .jpg in your column caminho_foto.…
-
1
votes1
answer80
viewsA: Enable/Disable input text with via loop
You need to assign a unique identifier to the elements VersaoAntiga, which is what you will validate if it is empty to be able to disable the other elements. To do this, add an attribute class…
-
3
votes3
answers1626
viewsA: It is possible to collect data of the whole month in postgresql
Option 1: Use of TO_CHAR: select * from dados where TO_CHAR(data_registro, 'MM/YYYY') = '01/2016' Option 2: Use with ranges: select * from dados where data_registro >= '2016-01-01'::DATE and…
-
0
votes3
answers184
viewsA: Return BD values via ajax
Depending on your application’s IIS post, put the URL directly to controller/action may not be legal. Use the power of razor. $(".visits-table tr a").click(function () { var id =…
-
2
votes2
answers85
viewsA: Change function jQuery
Following the documentation of dataTable, just add: "ordering": false in the datatable constructor. Thus remaining: <!DOCTYPE html> <html> <head> <title>TODO supply a…
-
1
votes1
answer982
viewsA: Dynamic Combobox with Codeigniter 3
You need to have a solid JSON object to be able to display in select dynamically. A solid JSON example for an X query: [{"resultadoBusca": "teste"},{"resultadoBusca": "teste2"},{"resultadoBusca":…
-
0
votes2
answers2106
viewsA: Filter date by hour intervals to the last possible time within the same day
Answer given in stackoverflow: SELECT TRUNC(dt) AS data, COUNT(DISTINCT TRUNC(dt - 20 / (24 * 60) - (35 + TO_NUMBER(TO_CHAR(dt, 'HH24')) - 9) / (24 * 60 * 60), 'HH24')) AS qtd FROM tabela GROUP BY…
-
0
votes2
answers2106
viewsQ: Filter date by hour intervals to the last possible time within the same day
The rule All records that are within a 1 hour interval should be counted as 1 records only. Dice ID DATA 1 06/07/2017 09:20:35 2 06/07/2017 10:20:35 3 06/07/2017 10:25:30 4 06/07/2017 10:40:35 5…
-
0
votes0
answers59
viewsQ: A query per request or a query only for N requests?
I honestly do not know if I am asking a very obvious question, that face we look and talk like this: Obviously the dynamic query by request is better! But come on... The application We are talking…
-
3
votes1
answer842
viewsQ: Best way to structure history table with large amount of data
Functional requirement I own devices. Each device roughly has its unique identifier, an IP address, and a type. I have a routine of pings for every device that has an ip address. This routine is…
-
0
votes0
answers235
viewsQ: Multiple Database Connections - Multi-task c# executable
I have an executable that I need to run a database giant. How the processing time would be unviable if I did it in a single Thread.... Following the idea of this question, I decided to create an…
-
31
votes1
answer5828
viewsQ: Difference between Task and Thread
I need to create an executable c# and the question was: Do with thread or do with task? In practice there is some difference between using Task and the "traditional" multi-thread?? It is true that a…
-
0
votes2
answers744
viewsA: Adding a class to a bootstrap link
Just adjust your JS to remove all classes style: $('a.menu').click(function() { $('a.menu').removeClass("style"); $(this).addClass("style"); }); Online example In the example above, I changed the…