Posts by Artur Trapp • 5,175 points
152 posts
-
5
votes5
answers3695
viewsA: Regular expression to find bar
I’m not very good at Regex, but I think this one’s for you: [A-Z]{2}[\/][0-9]{1,} Explanation: [A-Z]{2}:Find two characters from A to Z [\/]: Find a bar [1-9]{1,}: Finds from 1 to infinity numbers…
-
1
votes1
answer949
viewsQ: Parameterized query error: Must declare scalar variable
I am aware of the existence of this question: Error in previous "Must declare the scalar variable" But it does not solve my problem. My situation is as follows: I have a common sql query: select id…
-
3
votes1
answer135
viewsA: fetch all records from a sqlite column
You are moving the cursor to the first record every time. Removes the cursor.moveToFirst(); from within the do
-
2
votes2
answers560
viewsA: Pick up selected textContent from the combobox with javascript
You can pick up the values by setting a id for the Controls and catching by getElementById. See if it fits you document.getElementById('btSalvar').onclick = function () { var nome =…
-
2
votes2
answers116
viewsQ: Find attribute value with regex
I get a string for an RSS feed, the part that matters is the following: <table feedtag="divinegoblin" ... Each piece of the feed will always have this attribute feedtag="...". I would…
regexasked Artur Trapp 5,175 -
1
votes2
answers752
viewsA: How to create an event where when the user presses the space key something happens?
Just check if Event.keycode was 32, which is the space. Click on the example below and press space $('#teste').keyup(function (e) { var press = e.which || e.keyCode || 0; if(press == 32) {…
-
33
votes5
answers1273
viewsQ: Why Nan Nan == 0?
Check out these tests I did on the browser console: NaN / NaN NaN NaN * NaN NaN typeof NaN "number" NaN ** NaN NaN NaN ^ NaN 0 Because exactly that happens?…
javascriptasked Artur Trapp 5,175 -
2
votes1
answer171
viewsA: Display elements one by one with . each jquery
You gave . find by usuarios, but you only have 1 usuarios. Try just putting usuario, that way: var xml = '<dados><usuarios><usuario…
-
6
votes2
answers1402
viewsA: Shaman is completely free?
https://blog.xamarin.com/xamarin-for-all/ A part that is interesting: Visual Studio now includes Xamarin. Xamarin will be in all versions of Visual Studio (from the date of the post), including in…
-
0
votes2
answers1591
viewsA: Identification of guide exchange
I think to check if the tab is active, only with pro browser plugins, but alternatively, you can use the events of focus window: var interval_id; $(window).focus(function() { if (!interval_id)…
-
4
votes2
answers1808
viewsA: second degree equation c#
With those values you put on, your delta will be = 0. Look at this passage: if (delta < 0) { MessageBox.Show("Esta equação não possui raizes reais"); btLimpar.Focus(); } else if (delta == 0) { x1…
c#answered Artur Trapp 5,175 -
1
votes1
answer131
viewsA: Closing app that are in the background
According to that one OS response in English, you can do something like: @Override public void onBackPressed() { android.os.Process.killProcess(android.os.Process.myPid()); // a linha acima mata o…
androidanswered Artur Trapp 5,175 -
2
votes2
answers1745
viewsA: How to align the button to two inputs?
I recommend you take a look at Bootstrap grid system if you are going to use bootstrap. To align your button below (I assumed it was below you wanted, based on the code snippet you gave), I simply…
-
1
votes0
answers685
viewsQ: What is a statically typed language?
After reading a statement that weakly typed languages were bad, I researched the subject, and eventually discovered the term "statically typed". Here, in this SO question in English, it is said…
-
0
votes1
answer7832
viewsA: Caption in CSS and HTML images
I don’t know if this is what you wanted. If you need to adjust the caption, move the position in css. .posicionado { right: 200px; position: absolute; } .ar img { width: 200px; height: 130px;…
-
2
votes1
answer685
viewsA: What is the difference between stopPropagation and stopImmediatePropagation?
stopPropagation() will prevent the handlers of parent elements to shoot. Already the stopImmediatePropagation(), prevents the handlers of parent elements, and also prevents any other Handler of the…
-
6
votes1
answer401
viewsA: What is the difference between exec(), system() and passthru()?
In that OS response in English, it is said: exec() - calls a system command, and you handle the output yourself system() - executes a system command and displays output immediately (usually text)…
phpanswered Artur Trapp 5,175 -
0
votes2
answers2414
viewsA: Pure Javascript add class function [can’t be left 2015/2016]
Change this part of your script: $('#btnPack1').on('click', function(){ $('#pack1, #pack2, #imgBullet1, #imgBullet2, #imgBullet3').addClass('active'); }); For:…
-
2
votes1
answer62
viewsA: Empty vector displays the final result of the function
I think this happens because the vector is a reference, and so, the values are always inserted in this memory. See if this code helps you understand: var lista = document.querySelectorAll("li"); var…
-
3
votes3
answers2817
viewsA: view var Javascript in div html
You are trying to put the value in the div before it is created. Just put your code inside window.onload, for it to run after the screen is loaded window.onload = function () { var vars =…
-
3
votes1
answer2754
viewsA: How to adjust the alignment of a <th>?
You can line up with CSS and nothing else, look: table, th, td { border: 1px solid black; } th, td{ width: 100px; } th{ text-align: left; } <table> <tr> <th>Month</th>…
-
3
votes2
answers29
viewsA: Modify TAG that does not have such a class
Anderson Carlos Woss' answer will probably meet your needs, but if you want to know, there is also the :not in css, look: .teste:not(.testando){ background-color: red; height: 50px; width: 100px; }…
-
1
votes1
answer30
viewsA: Jquery adds "Selected" in an option
Not having the rest of the code, it’s hard to give a functional example, but it should do what you need: $('#billing').val(seuValor); function testar(){ $('#billing').val('485'); } <script…
jqueryanswered Artur Trapp 5,175 -
9
votes4
answers2076
viewsQ: How to check if IP exists with bat
I can drip all the network addresses with something similar to this: for /l %%x in (1, 1, 100) do ping 10.1.1.%%x However, not all addresses are valid, and in that case, he of the timeout. Is there…
batchasked Artur Trapp 5,175 -
2
votes2
answers1184
viewsA: How to update select with jQuery
You can use the .val() directly on select: $('#selectValue').click(function (){ $('#numeros').val($('#valor').val()); $('.custom-select').text($('#numeros').val()); }); <script…
-
3
votes3
answers2161
viewsQ: How to leave buttons fixed in floating div
I have in my system a situation similar to the one I gave of example. A modal bootstrap that can open in basically any place of the screen. This modal does not occupy every screen. Within this…
-
2
votes1
answer1062
viewsQ: Calculate space between Div and Body
I want to know the space between Div A’s bottom and Body’s bottom. I read about the $.offset(), but this always returns me 0. PS: I only want what appears on the screen. If the body is larger than…
-
0
votes1
answer546
viewsA: Difference between Users and Logins
A Login gives access to the SERVER (localhost type), whereas a user gives access to a DATABASE A login may be associated with multiple users.
-
3
votes8
answers2184
viewsA: How to know all possible combinations of 0 and 1 in Java?
According to that one answer, you can do something like that: for (int i = 0; i < 2; i++){ for (int j = 0; j < 2; j++){ for (int k = 0; k < 2; k++){ for (int l = 0; l < 2; l++){ for (int…
-
3
votes1
answer462
viewsQ: Alternative to multiple inheritance
It is not possible to inherit more than one class in C#, so I come here looking for suggestions for my problem. I am building a small game using Unity. In Unity the game objects (GameObject) inherit…
-
2
votes1
answer168
viewsA: Code mute in iframe
According to the documentation, you can pass a parameter mute for him, where 0 is not mute and 1 is mute: <iframe frameborder="0" width="480" height="270"…
iframeanswered Artur Trapp 5,175 -
2
votes3
answers441
viewsA: Integer conversation in the rounding account 0.1
The floating point math doesn’t work perfectly as we hope, look: console.log(0.1 + 0.7) If you run this snippet, the result will be 0.799999.... Converting this number to integer causes rounding…
-
3
votes3
answers5502
viewsA: Remove TAG with Javascript
I usually use the jQuery.remove, but there are actually reports of problems with older versions of IE. Alternatively, you can use .removeChild in the parent element. (Remember that this answer uses…
-
2
votes1
answer1304
viewsA: How to read attributes of a line in XML?
It’s actually quite simple. The class XMLDocument has an attribute Attributes, look: XmlDocument doc = new XmlDocument(); doc.LoadXml("<teste atributo=\"batata\">uma simples tag…
c#answered Artur Trapp 5,175 -
2
votes3
answers2079
viewsA: How do I activate the Caps Lock key warning?
The logic behind this is simple: check if the typed letter is uppercase, and if shift is not pressed: document.getElementById('txtSenha').onkeyup = function (e) { var key = e.charCode || e.keyCode;…
-
1
votes1
answer5296
viewsA: Copy text by clicking on a DIV
It’s pretty simple, and it doesn’t necessarily need Jquery. There’s a native function that does this: $('#ola').click(function(){ //Visto que o 'copy' copia o texto que estiver selecionado, talvez…
-
0
votes2
answers1190
viewsA: How to assign a java variable to Document.getElementBy Id
I didn’t really understand the purpose of your question, and it seems to me that you don’t have well-established concepts of attribution and use of variables. Your code also has some errors: var…
-
1
votes0
answers92
viewsQ: Doubt with Firebase
After hearing about Firebase, and reading about it, I decided it was a good idea to test its use in my Unity app. I read the documentation, followed the configuration tutorials, and even defined the…
firebaseasked Artur Trapp 5,175 -
3
votes1
answer45
viewsQ: How can I read custom Attributes without using reflection?
I have the following code snippet: [Campo(Chave=true)] public System.Guid EscalaId { get; set; } I know I can read these tributes using class MemberInfo, as it says example in the documentation:…
c#asked Artur Trapp 5,175 -
1
votes1
answer112
viewsQ: Alternative to Overlapping of Sprites
You’ve probably seen/played a game where you can change your character’s outfit/outfit/appearance. I’m building a little game for Android that provides this function, and currently I get it using…
-
1
votes0
answers50
viewsQ: Identify drawing in character - Canvas (Android)
I can already draw on the screen using a DrawingView, as shown in the example: I wonder if there is any library to identify the drawing and check if it is a character, and if possible, give a…
-
4
votes2
answers1184
viewsA: Differences between System.out x System.err x System.in?
System out. is the standard output of the system you are using. System.err is the default system error output. In a normal console application, both will probably print on the console. But you can…
javaanswered Artur Trapp 5,175 -
-1
votes1
answer159
viewsA: Are there paradoxes in computing?
As the jbueno commented, perhaps the question is too broad. But I like this theme and I usually read a lot about paradoxes (not only related to computing, but to everything). So, I don’t know if…
computer-theoryanswered Artur Trapp 5,175 -
1
votes0
answers16
viewsQ: Use full class name or import?
My question is this:: if I’m going to use a specific class only once in a location, I should import all of it up there in the code? Example: Suppose I want to get some information from web.config in…
-
8
votes5
answers1461
viewsA: Is it possible to code the size of the object in memory?
I believe it is not possible to measure the size of the object directly, but here in the MSDN they suggested to measure the total memory before and after creating the object, like this: long…
-
0
votes1
answer84
viewsQ: Problem picking up file key . resx
I have a NullReferenceException in this line: string from = HttpContext.GetGlobalResourceObject("globalization", "mail_from").ToString(); because it is not finding the file . resx, so it does not…
c#asked Artur Trapp 5,175 -
4
votes3
answers419
viewsA: How to know if a key in sql server is Identity
SELECT is_identity FROM sys.columns WHERE object_id = object_id('Nome_da_sua_tabela') AND name = 'Nome_da_sua_coluna' Will return 1 if column is Identity
-
2
votes0
answers89
viewsQ: How to set language according to file . resx
I am aware of the existence of this question: Internationalization using ASP.Net MVC but I’m having some questions. I have these language files (I’ll have more in the future): The system in question…
-
0
votes2
answers642
viewsA: apply event to an input with jQuery
I think the simplest solution is to simply return if it has no value: $(".custo").on("keyup", function() { $(".margem").keyup(); }); $(".margem").on("keyup", function() { // Margem var margem =…
-
1
votes1
answer51
viewsA: Infinite loop in listing
for (var t = 0; t < times.length; i++) Here you are increasing the i instead of the t, so the loop will continue forever, because the t will never get out of place. Switch to t++ Same thing here:…
javascriptanswered Artur Trapp 5,175