Posts by Artur Trapp • 5,175 points
152 posts
-
1
votes3
answers257
viewsA: Save image with webservice
You’re making a mistake because that’s not how you use the JSON.stringify for what you’re intending. You passed two parameters to him, here: JSON.stringify(dados, WPath) According to the…
imageanswered Artur Trapp 5,175 -
2
votes2
answers564
viewsA: What are the differences between jQuery and jQuery Mobile?
Well, I’ll give here my understanding of the difference between them, correct me if I’m wrong. Jquery The main goal of Jquery is to simplify and somehow standardize cross-browser Javascript, making…
-
2
votes2
answers837
viewsQ: How to generate UUID’s/GUID’s with Javascript?
I need to create UUID’s/GUID’s with Javascript, but I did not find any function in the documentation. Know/recommend an existing library, which manages valid and satisfactorily random UUID’s?
-
1
votes1
answer51
viewsA: Search the bank from option
There is no exact answer to your question As the @rray comment says, you will need to AJAX. What is AJAX? AJAX is a technology that makes it possible to make a request to the server without having…
-
1
votes2
answers147
viewsA: how to add class in a specific input text element?
I don’t know if this is the way you wanted it, but changing the dial you have when you apply the class, it works, look: $( "input" ).focusin( function () {…
-
4
votes2
answers6031
viewsQ: How does . Closest() work in Jquery?
Hello, I wonder if I’m misinterpreting the command, or if I’m doing something wrong in the implementation. Freely translating, closest means "closer". But by clicking on an element and asking for…
jqueryasked Artur Trapp 5,175 -
4
votes2
answers701
viewsA: Json parse array
You can store this response in a variable and separate the two arrays: var arrJson = { "users":[ { "id":1, "Name":"Rafael", "label":"teste" }, { "id":2, "Name":"Carlos", "label":"teste" } ],…
-
5
votes4
answers150
viewsQ: How to use unsafe code on a Web Site
I was looking to practice the use of pointers in C#, so I created in a website the following method: public static Nodo[] MontaTree(){ //... código ... } Obviously the above code does not allow to…
-
0
votes3
answers1157
viewsA: Check whether the date range between two input’s is less than a month and apply a condition
This small script will return the difference in DAYS of your two dates. var dataIni = new Date($('#startDate').val()); var dataFim = new Date($('#endDate').val()); var diferencaEmMili =…
-
0
votes1
answer1362
viewsA: Datepicker / Just a few days a week
I noticed two errors in the datepicker code in question. First: return [dt.getDay() == 1 || dt.getDay() == 3 ? false : true]; Placing the expression between brackets means, for Javascript, an array.…
-
4
votes3
answers2361
viewsA: High consumption of RAM
Just to complement @Maniero, you can rest assured, yours is still low. I opened a small project here and put it to run (I’m not thrashing), and it’s past 300 MB…
-
2
votes2
answers1820
viewsA: Column count does not match the value count on row 1
You have one more column in your column listing than the values one. According to the query you posted, you have the following value list: id -> NULL nome -> 'Álvaro' cidade -> 'Bau' estado…
-
1
votes3
answers219
viewsQ: Check function existence in C#
How can I verify if a function exists in C#? I think I have to use some kind of reflection, but I don’t know much about it. Is there any way to get the function’s list of arguments, if it exists?…
-
0
votes4
answers2005
viewsA: Line break error in <textarea>
This happens because when you skip a line it inserts a \n\r, which are two characters, so when you go to pick it up, it has more than 255 characters. The \n is a character that breaks the line, and…
-
1
votes2
answers560
viewsA: Center a td according to width size
Hello, as I said in that answer, the way compatible with all browsers to center an element relative to your parent, is by putting the following styles: img{ left: 50%; width: 250px; /* Largura…
-
10
votes4
answers1350
viewsA: How to pass string by reference?
In the C# to pass a variable by reference, use the keyword ref. Just change your method to: static void ChangeText(ref string text) { text = "new text"; } and your call to: ChangeText(ref text); I…
-
3
votes3
answers1988
viewsA: disable button per second with jquery
This happens because when the setTimeout is called, the $(this) is no longer the button you clicked, but the object Window. To solve, simply put the $(this) in a variable. I made an example for you…
-
1
votes0
answers29
viewsQ: ; in Javascript
It’s been a while since I realized that Javascript does not care for the absence of ; between instructions, as long as there is a line break between them. My question is: is there any difference…
-
2
votes2
answers735
viewsA: Is there a css selector that selects elements through your text?
By the selectors I see on documentation, cannot do this. But you can select via attributes and attribute values, so if you put the text in an attribute it is possible yes. I did in the Jsfiddle for…
-
0
votes2
answers112
viewsA: Separation of tables in html
I put a little spacing to the right of them just by adding at the top of your CSS the following line: table { margin-right: 10px; } I put an example in Jsfiddle for you to see and edit as you want:…
-
1
votes1
answer1393
viewsQ: Difference between if and elsif
I know these two terms don’t exist in the same language (correct me if I’m wrong), but in some languages (C#, in the example below), we have the following code: if(condicao){ ... } else if…
-
2
votes1
answer1070
viewsA: Undefined function in window.onload?
This happens because the function func is defined only within the scope of window.onload. You need to declare it before calling it, according to this example: //Coloquei um alert apenas para fins de…
-
1
votes0
answers30
viewsQ: Visual Studio to run when evaluating variable
Doing some tests on an old system, I arrived at a strange behavior for the Visual Studio part. When I hover over a variable of a specific type, Visual Studio closes, as you can see in the GIF below:…
-
3
votes2
answers81
viewsA: Identify DIV by complex id
Yes, use the * selector in Jquery, which will select everything that contains such a value. I put an example on Jsfiddle for you to see In my case, I created a span and hid the div that has id with…
-
10
votes1
answer2677
viewsQ: How does Yield* work in Javascript?
I saw in some code snippets the keyword yield*. She is different from yield? Researching on, I came to the following example of code: function* g1() { yield 2; yield 3; yield 4; } What does the *…
javascriptasked Artur Trapp 5,175 -
2
votes1
answer149
viewsA: Doubt about duties in Haskell
After reading (and a question in the OS in English), I was able to understand why this happened, and I will leave the explanation here to contribute to whom it may interest. All this happened…
haskellanswered Artur Trapp 5,175 -
3
votes1
answer149
viewsQ: Doubt about duties in Haskell
I decided to dive into the world of functional programming recently, and was introduced to the Haskell language. I started researching how language works, and soon I was able to get the main…
haskellasked Artur Trapp 5,175 -
1
votes2
answers3029
viewsA: Div overlap the other
I solved your problem by putting the text div with position: absolute; and defining its width with 300px (size of the father div). I left an example here on Jsfiddle for you to see. <div…
cssanswered Artur Trapp 5,175 -
3
votes3
answers726
viewsA: Click a <tr> to open a link
Use the window.location and concatenate with your ID tr: $(document).ready(function () { $("tr").click(function () { window.location = 'suaPagina.aspx?id=' + $(this).attr('id'); }); });…
-
0
votes2
answers155
viewsA: How to get only one information from this table? VB.NET
It is not a good idea an element without identifiers, but assuming that this is the best case. (only table in the DOM, always with this amount of columns) , you can use jQuery: $('table').find…
-
-1
votes1
answer616
viewsA: Searching for separate words in the same string in Mysql
Place % between all words to be filtered: SELECT * FROM `dados` WHERE `nome` LIKE '%".Fulano%Silva."%' I put an example on Sqlfiddle for you to see working…
-
6
votes2
answers157
viewsQ: Is capturing Nullpointerexception bad practice?
I’ve been a little uneasy about security issues and vulnerabilities lately, and in my research, I came up with an article that intrigued me. According to the OWASP: Description It is generally a bad…
-
4
votes2
answers579
viewsQ: Reliability and Security of Sessions
I’ve been reading a little bit about security with sessions (both in ASP.NET and in PHP), and I read in some places that sessions, especially in PHP, can be easily stolen (even more easily if the…
-
9
votes1
answer151
viewsA: What is "global::" in C#?
global:: refers to the global namespace. For example, you can reset the class System, look at: class foo { class System { } } There, for example, if you want to use Console.WriteLine() in that…
-
0
votes2
answers77
viewsA: String#codePointAt or String#charCodeAt?
Of documentation: String.fromCodePoint() The String.fromCodePoint() static method returns a string created using the specified sequence of code points String.prototype.codePointAt() The…
-
2
votes1
answer2146
viewsA: PHP with real-time updates
Currently, the most recommended way to do this would be using Websockets, for a permanent client-server connection. Unfortunately, Websockets are still not widely supported by all browsers…
phpanswered Artur Trapp 5,175 -
1
votes4
answers196
viewsA: Get the id of where max(value) was found
I think it works that way, but maybe there’s a better solution: SELECT id, data, max(valor) FROM teste WHERE data BETWEEN '2017-03-01 00:00:00' AND '2017-04-01 00:00:00' AND valor in (select…
mysqlanswered Artur Trapp 5,175 -
10
votes3
answers179
viewsA: Why does CSS work with "fake" HTML elements?
Most browsers are designed to accept compatibility with possible future HTML elements. Therefore, unrecognized elements are added but will not have any standard rendering type associated with it.…
-
3
votes1
answer126
viewsA: How to detect changes in the DOM (Document Object Model)
Currently, the most recommended solution is the use of a Mutation Observer Full support chart by browsers can be checked at here What is a Mutation Observer? It is an API that allows a function to…
-
1
votes0
answers22
viewsQ: Difference between handlers
Using JQuery, I realize two main ways to define handlers for element events: $('#elemento').on('click',function() { ... }); and $(document).delegate('#elemento','click',function() { ... }); I’ve…
javascriptasked Artur Trapp 5,175 -
2
votes2
answers2918
viewsA: Is negative margin a bad practice?
No, negative margin on CSS is not bad practice. Negative margin is a great way to deny paddings in an element, when some internal element should be positioned in such a way. Also, I think the only…
cssanswered Artur Trapp 5,175 -
1
votes2
answers229
viewsA: Grab size from a textarea that has been added dynamically
This should work for you: $('#textarea_1').val().length I put in a fiddle a code that creates a textarea dynamically, and takes the size of its value: https://jsfiddle.net/mtmkheLv/…
-
2
votes2
answers320
viewsA: What is the difference between a plugin and a Javascript library?
Basically: A PLUGIN is a component that adds functionality to an existing program (according to Wikipedia) One LIBRARY is a set of routines and methods that can be used to develop software…
-
2
votes1
answer362
viewsA: Save selected radio button option for future query
You can save a symbolic value in the Datatable, indicating whether it was clicked or not, example: dr["Registro"] = "CPF: " + dadosfisica.CPF; dr["Nome"] = dadosfisica.Nome; dr["Endereco"] =…
-
3
votes3
answers2248
viewsA: Fill string with blank boxes
In the C#, there is the String.Padright function Of MSDN Returns a new character string of a specified length where the end of the current character string will be filled with spaces or with a…
-
1
votes1
answer2122
viewsA: Close content when click off menu
You need to catch the click of body, and see if the clicked element belongs to the target div. $('body').click(function(e){ //Essa condição verifica se o clique foi diretamente na sua div…
-
4
votes1
answer122
viewsQ: Comparison of Session and Viewstate with String
Recently, I received the following notice from Visual Studio in a code similar to the image: I understand what he wanted to say: there is a reference comparison of the two values (the session and…
-
1
votes1
answer57
viewsA: Datatable with class constructor methods for registering
I don’t know if it’s exactly what you wanted, but I put down an example using your class Dados private void bt_salvar_Click_1(object sender, EventArgs e) { //No segundo parâmetro, que está vazio,…
c#answered Artur Trapp 5,175 -
1
votes1
answer146
viewsA: Is it possible to add a Function to a json?
There is an alternative, using the function eval The function eval executes the string passed to her, as you can see in the example below: https://jsfiddle.net/yrzruztw/ eval('alert("teste")'); This…
-
1
votes2
answers59
viewsA: Error in function for load bar using a while(){}
Every call from that code snippet: setTimeout(function(){ $("#loader-progress").css({"width":count + "%"}) count++; },100) will have the value of count set to zero. That is, you have entered an…