Posts by Joao Paulo • 11,760 points
262 posts
-
3
votes2
answers61
viewsQ: Define property based on others during object creation
I am making an attempt to 'name' popular with the result of the first two variables, but without success. var pessoa = { nome: "Joao", sobrenome: "Silva", nomecompleto : nome + sobrenome };…
javascriptasked Joao Paulo 11,760 -
4
votes3
answers3702
viewsA: Auto-click when opening site
You can use a jQuery selector to define which li you want to click and just simulate the click on it, to get the user to the point. $("li.classeDaLi").click(); Example: $(document).ready(function(){…
-
1
votes1
answer387
viewsQ: Is there any technique for synchronizing a SQL Server database structure?
I had some problems recently when making modifications in the type approval environment and for bureaucratic reasons these modifications could not be inspected in the production environment and were…
-
3
votes2
answers1115
viewsA: Count visible and active inputs in my form
To get the number of inputs visible and enabled, taking into account that you put the form class in all: alert($(".form:visible").not(":disabled").length); Example: http://jsfiddle.net/yadvs398/…
-
1
votes2
answers1413
viewsA: Loop repeat jquery
I wonder how I can pass the id of the button clicked and from it make an if and execute the procedure. Use a class on your buttons. Example: class buttons. You will only need to call him once and…
jqueryanswered Joao Paulo 11,760 -
1
votes1
answer449
viewsA: How to add an array to a value attribute?
From what I understand you want to popular a select with options. Correct me if I’m wrong... To popular the array: $.getJSON('process_forn.php?valor='+data, function (dados){ var options_val = [];…
-
2
votes2
answers769
viewsA: Error "Unknown column" in Mysql query
I think you need a Join on the first consultation, try it like this: (SELECT TB_INGREDIENTES.ID_INGREDIENTE, TB_INGREDIENTES.INGREDIENTE, TB_INGREDIENTES.QUANTIDADE_INGREDIENTE_TOTAL,…
mysqlanswered Joao Paulo 11,760 -
6
votes6
answers2305
viewsQ: Transform results combination function into a dynamic function
I have a function that generates all possible combinations of numbers from 1 to 10. The combinations are 4 numbers, that is, each combination has 4 different numbers. Ex: [1,2,3,4], [1,2,3,5],…
-
4
votes2
answers207
viewsQ: How to force the '.on("input")' method via script?
I suppose my method: $(document).on("input", "#textbox", function(){ alert("oi"); }); What script can I force the Alert call to ("hi") ? I tried a lot and nothing: $("input#textbox").val("1");…
-
8
votes1
answer9757
viewsQ: How to round up decimals to get an integer in C#?
I have the following account: var NumeroDePaginas = NumeroDeItens / 32; When I use the Math.Round It rounds both up and down. But whenever there is any decimal value I wish to return an integer…
-
1
votes1
answer1030
viewsQ: What is an "active Autonomous transaction"?
I’m getting this mistake: ORA-06519: active Autonomous transaction Detected and Rolled back ORA-06512: at "SGR20.CR_PKG", line 289 View program sources of error stack? Before anyone asks the error…
-
3
votes2
answers25883
viewsQ: How to remove backslashes ( ) and quotes (") from a string?
I would like to prevent the use of these characters in a string. I think the most elegant way would be by regular expression, but I don’t understand anything about putting together a. A replace…
-
8
votes1
answer1158
viewsQ: Recommended form for popular variables with database data
Assuming this fictitious method to obtain database data, say SQL Server: public List<DadosDTO> ObterDados() { try { comand = connectionFactory.CreateCommand(); comand.CommandText = "SELECT…
-
2
votes2
answers210
viewsQ: Query performance with date range
Assuming I have a database table with 10000 data and each record is registered with dates between 2013 and 2014. A query like this: SELECT CAMPO_DATA FROM TABELA WHERE CAMPO_DATA BETWEEN…
-
3
votes2
answers352
viewsQ: Understanding class instantiation
I have a question and I would like to understand better how class instantiation works. More specifically the most appropriate way to do (if any) and the impacts of doing in the wrong way. Assuming…
c#asked Joao Paulo 11,760 -
4
votes3
answers33401
viewsQ: Select 1 record of each ID based on the last date
I have a fictitious table TB_META with the fields: COD_VENDEDOR | DAT_ATIVACAO | VAL_META Supposing I have these values in the table: 1 | 2011-01-01 | 1 1 | 2014-04-04 | 2 2 | 2012-01-01 | 3 2 |…
-
1
votes2
answers721
viewsQ: How do I direct an Action to a view inside a folder?
In my Ugcontroller I have an Action named Register that takes me to the View Register.cshtml that is in the UG folder. That is to say: Controller: UGController Action: Cadastro() Link: /UG/Cadastro…
-
1
votes1
answer4123
viewsQ: Width adjustment to take up space remaining to be occupied in a div
Supposing I have this structure: <div style="width:1000px"> <div id="div1" style=""></div> <div id="div2" style="width:300px"></div> </div> How to make the div1…
-
11
votes5
answers33239
viewsQ: How to make a character counter of a textarea?
I tried to make one, but always ran into some limitation. I think my logic will not work, but I still could not think of another. Javascript: $(document).on("keydown", "#TxtObservacoes", function ()…
-
19
votes4
answers20874
viewsA: How to extract only numbers from a string?
I got: That code worked: String.Join("", System.Text.RegularExpressions.Regex.Split(stringAqui, @"[^\d]")) ^ within a set([]) means denial. \d shortcut to 0-9, i.e., numbers; In a nutshell to regex…
-
7
votes4
answers20874
viewsQ: How to extract only numbers from a string?
I want to extract only the numbers of a CPF that is in a string in this format; 111.222.333-44 You have to return only: 11122233344…
-
3
votes3
answers3136
viewsQ: Generate 32 character MD5 password with Cryptsharp
I am using the Cryptsharp library to generate password in MD5. I had read that MD5 generates string with hexadecimals of 32 characters but is generating 34 and with several types of characters. It’s…
-
6
votes1
answer5794
viewsQ: How to use MVC 4 session with C#?
My scenario is as follows. I have an MVC 4 application. In my controller I check the logged in user and password. (I think) I put the user data in a session after the data is checked and correct. My…
-
4
votes2
answers3522
viewsQ: Multiple objects in jquery selector
For organization and performance I usually use several selectors together to perform a jquery method. For example: $("#bola, #casa, #arvore").css("background-color", "blue"); In this example it…
jqueryasked Joao Paulo 11,760 -
5
votes1
answer13641
viewsQ: How to insert word break into textarea in text inserted via jquery/javascript?
I have a textarea and would like to list some items in it one on each line. I am already inserting the text normally in the textarea and separating the items in commas currently: nomUgs =…
-
0
votes2
answers558
viewsA: Jquery does not mount date correctly
It is easier for you to format the date in C#. Example: String.Format("{0:MM/dd/yyyy}", Variaveldadata);
-
0
votes2
answers742
viewsA: Ajax does not return text in utf-8
If the steps of Harry Potter do not help have a more "in the box" solution that is using the functions of php to convert and "disconnect" in utf8. You can print the items using utf8_encode() and…
-
3
votes2
answers3544
viewsA: Calling a jquery function when changing tabs
Try this. You do not need onclick in html. Set the "scheduling" class in your "li" <li class="agendamento"><a href="#agendamento">Agendamento</a></li> And then the function…
-
4
votes2
answers396
viewsQ: How to optimize the color palette of a Gif?
I have a method that generates images through an array of bytes that I take from the database. The generated files are between 15 and 130 kb in gif format, they were bigger but slightly decreases…
-
2
votes2
answers192
viewsQ: Remove from account when value is 0
I have the following query: SELECT ROUND((( notaAmbiente + notaApresentacaoDasPizzas + notaQualidadeDosProdutos + notaVariedadeDeSabores + notaAtendimentoNaLoja + notaAtendimentoNoTel +…
-
3
votes2
answers1680
viewsA: How to make rounding every 5 tenths (0.5)?
I got with a simple math account what I wanted: SELECT nomNome, ROUND(((notaAmbiente + notaApresentacaoDasPizzas + notaQualidadeDosProdutos + notaVariedadeDeSabores + notaAtendimentoNaLoja +…
-
3
votes2
answers1680
viewsQ: How to make rounding every 5 tenths (0.5)?
I have a select that returns the average of the columns. I used Round to remove a few decimal places and round the numbers. The possible numbers of the fields are integers from 1 to 5, and when…
-
0
votes1
answer51
viewsA: Invert object inside a table
If I understand correctly you can do this with jQuery. If you are not already using this library just reference it like this: <script…
asp.netanswered Joao Paulo 11,760 -
20
votes3
answers32049
viewsQ: How to check if a variable is set?
I tried to do it that way: else if (vCodUG === undefined) and made an error of: Uncaught Referenceerror: vCodUG is not defined…
-
0
votes2
answers1937
viewsA: How to render html by passing as a controller string to the view?
I found what I was looking for. I was able to render the html in Razor by just doing this: <div class="logo"> @Html.Raw(Model.Html) </div>
-
1
votes2
answers1937
viewsQ: How to render html by passing as a controller string to the view?
I have the following view: public ActionResult RelatorioEquipe() { ViewRelatorioEquipeDTO dto = new ViewRelatorioEquipeDTO(); dto.LstUnidadeGerencial = negocio.Relatorio.ObterLstUg();…
-
6
votes0
answers144
viewsQ: What are software tests? When should we use them?
I have read other questions about it and seen that there are test tools that automate, predict possible errors of a software/application etc. What I would like to know is what kind of…
-
2
votes2
answers5780
viewsA: Perform an action after the change has been made
Create another change function on the page after referencing this external script. See how it works: http://jsfiddle.net/johnflaster/Tavb5/1/ Example: <script src="script_externo.js">…
-
5
votes2
answers2037
viewsQ: How to set print options via javascript?
Is it possible? I would like for example to remove the default margin and remove header and footer. Already open the print window with these settings.
-
4
votes2
answers782
viewsA: Javascript and Asp.net mvc help
If you want javascript to interact with all objects use classes. By Id only one will be affected. Add the Status class <input type="text" name="Status" id="Status" class="Status"…
-
0
votes1
answer5423
viewsQ: How to disable a Constraint in ORACLE?
I have a table where two specific fields together cannot have the same values. I BELIEVE who are they: NUM_PERIODO_LANCAMENTO COD_INDICADOR Assuming I have that data: NUM_PERIODO_LANCAMENTO = 1 ,…
-
6
votes1
answer156
viewsQ: Error while using Random
I set a random number to fill a fictitious table and did so: foreach (var usuario in LstUsuarios) { htmlUsuarios.AppendLine("<tr>"); htmlUsuarios.AppendLine("<td>" + usuario.Nome +…
-
7
votes2
answers3113
viewsQ: How to pick a random string from a list of strings?
Code: nomes = new string[5]; nomes[0] = "José"; nomes[1] = "Carlos"; nomes[2] = "João"; nomes[3] = "Miriam"; nomes[4] = "Estela"; I put an array, but it doesn’t have to be with an array, it can be…
-
4
votes3
answers529
viewsQ: How to replace the last appearance of a character?
I have a loop that mounts strings in this format: var Sabor[0] = "Mussarela, Calabresa, Cebola"; var Sabor[1] = "Mussarela, Presunto, Calabresa, Tomate, Ovos, Pimentão, Cebola"; But I’d like to…
-
1
votes2
answers5325
viewsQ: How to force the "change" event of an input select, even without choosing another value?
Are two problems: 1 - When loading an input select I tried to use a Trigger to force "change", but it did not take effect. 2 - I have 2 selects. When I actually change the value of the first, the…
-
1
votes1
answer138
viewsQ: How do I send html from one view to another view?
I have a view (View1.cshtml) with filters, a whole layout and a graph within a div that is generated according to the filters. I created another view (View2.cshtml) in white and I would like to pass…
-
6
votes3
answers666
viewsQ: Function with variable amount of parameters, what better way to do?
I would like to do a function without defining the amount of parameters needed. What ways or alternatives can I use to get this result?
javascriptasked Joao Paulo 11,760 -
0
votes3
answers1211
viewsA: Concepts of Mesomorphic Allocation and Liberation in C#
My mistake in question was using this file read method in each loop: public static void DumpLog(StreamReader r) { string line; while ((line = r.ReadLine()) != null) { Console.WriteLine(line); } }…
-
11
votes3
answers1211
viewsQ: Concepts of Mesomorphic Allocation and Liberation in C#
I’m making a web application that has a finite recursive loop. But during the process the memory consumption is constantly growing and at the end Visual Studio has more than 2 Gigas of memory use. I…
-
0
votes1
answer309
viewsA: How to create Detachedcriteria criteria for a field from a Join table?
Got it, got it that way: public IList<Ficha> ObterFichas() { DetachedCriteria criteria = DetachedCriteria.For<Ficha>(); criteria.SetMaxResults(1); criteria.CreateAlias("exportacao",…