Posts by Oralista de Sistemas • 23,115 points
435 posts
-
-1
votes1
answer48
viewsQ: Normalize encoding of an entire solution
I was working with Gitlab and noticed that it serves all the files on its front end with UTF-8. I have a solution that has source files with various encodings. UTF-8 files are displayed correctly in…
-
1
votes1
answer2333
viewsA: Datepicker Month and Year
This looks a lot like a CSS problem. Of two a: There was a conflict between the CSS of the datepicker component you use (which is not native to bootstrap) and the CSS of the bootstrap or your…
-
1
votes2
answers544
viewsA: Map Enum with search conditions
A shorter answer. Assuming you have a method that takes a list, a number to compare and an instance of your enumeration: public List<int> Metodo(List<int> input, int comparado,…
-
6
votes3
answers570
viewsA: How to jump from one tab to the other in Sublime Text?
RTFM TL;DR: CTRL + Page Up and CTRL + Page Down navigate between tabs, forwards and backwards respectively.…
sublime-textanswered Oralista de Sistemas 23,115 -
5
votes4
answers69
viewsA: How to convert fields to a line with string?
You can use a method or property in the Model. For example: public class Usuario { public string Campo1{ get; set; } public string Campo2{ get; set; } public string Campo3{ get; set; } public string…
c#answered Oralista de Sistemas 23,115 -
21
votes2
answers18808
viewsA: What’s a pull request for?
When you have multiple people working on the same text file base, the ideal is for each person to have a copy of the code to work on. Don’t believe just because I’m telling you, try to open up…
-
4
votes3
answers3072
viewsA: Provide file download from server
You may have seen that controller methods that meet page requests return type objects ActionResult. Normally you return HTML content through the method View controller itself. You can change the…
-
6
votes3
answers569
viewsA: What are the consequences of programming in 32 bits or 64 bits?
One more piece of information to complement Rodrigo and Maniero’s answers. If you compile the application as 64-bit, it will not run on machines with 32-bit processors (or less). Since we haven’t…
-
2
votes1
answer121
viewsA: Repeated nodes xml c#
You can store the values already displayed in a list, and not display what is already in the list. For example: List<string> valoresExibidos = new List<string>(); XmlNodeList xnList =…
-
5
votes3
answers868
viewsA: Run javascript only when accessing a mobile phone’s website
NAY. Your website will work today for a specific amount of mobile devices. It will probably meet 95% of cases. But it has two problems: Minor problem: will leave out a few devices. All right, not a…
-
2
votes2
answers950
viewsA: If an int variable does not receive anything from select it is zero or not
I did a test here, and if the SELECT statement that fills in a variable does not return any row, the variable does not have its value changed. i and..: In your case, the fetch loop will only be…
-
0
votes2
answers462
viewsA: Code128 source rendering error
In order for the user to view the source correctly, the source must be on his computer, not on the server. If you are going to serve a PDF as a page element, the only cohesive solution is to…
-
9
votes5
answers2915
viewsA: What is actually the array?
"Array" is a word that existed long before programming. This is its meaning, according to the Dictionary.: Verb (used with Object) 1. to place in Proper or desired order; marshal: (...) Noun 3.…
-
1
votes3
answers8033
viewsA: Do not repeat records in a Join
You get more records than the amount present in the smallest table because of the following axiom (which I am deducing): For each element present in the smaller table, there are N elements in the…
-
0
votes2
answers996
viewsA: How do I protect my JSON application?
You can try basic access authentication. Serve JSON only over HTTPS. Hence you use the header Authorization to pass credentials, coded with Base64. Here is an example of what the header would look…
-
0
votes1
answer34
viewsA: Getting date from a C#website
The object response that you use is of the type HttpResponse. He owns a property called Headers, a collection of values through which it should be possible to read page headers. Something like:…
-
2
votes3
answers184
viewsA: Search in String
You can do it like this: String cantadaHorrivel = "oi tudo bem como vai #01?"; String[] primeiroSplit = cantadaHorrivel.split("#"); String[] segundoSplit = primeiroSplit[1].split(" "); String texto…
-
0
votes1
answer174
viewsA: Error message when opening exported excel file in PHP
The problem is because the way you generate the file leads to an invalid XML (as the error message says). xlsx files are, internally, collections of XML files. To solve your problem, you must…
-
0
votes4
answers768
viewsA: Add mask from a select
Note that the value of the CPF option is not "CPF". <option value="user_cpf">CPF</option> Emphasis in: value="user_cpf" You need to change your value comparison to: if( $select ==…
-
1
votes2
answers283
viewsA: Array ordering based on the order of another array
Since both arrays have the same values (although ordered differently), and the reordering of array 1 would leave it "equivalent" to array two, you could do this: array1 = array2; But in this way the…
-
1
votes2
answers1526
viewsA: How to remove a character that is not a letter in a string?
In Unicode, The first accented Latin letter has the code \u00c0 ("À") and the last is \u024F ("y"). You can select all letters using the basic (a-zA-Z) and the range between these two special…
phpanswered Oralista de Sistemas 23,115 -
0
votes2
answers221
viewsA: Error trying to host app on itunes
He was refused for not supporting IPV6. I joined the site http://validador.ipv6.br/index.php?site=www.useunic.com.br&lang=pt and I checked that it does not support access by IPV6. Apple requires…
-
1
votes2
answers4666
viewsA: Remove disabled attribute when a condition is met
No use changing the value of the attribute disabled for fake. Browsers do not read the value of the attribute. They only consider its presence. If the attribute exists, the element that has it is…
-
2
votes1
answer46
viewsA: Jquery, sum up table
Your problem occurs because of these lines: $("#table tr").each(function() { This instruction runs through all rows of the table - including the first row of the header, which has no values for…
-
8
votes1
answer105
viewsA: Why does one script freeze the browser and the other not if the number of loops is the same?
TL; DR: the browser "freezes" because it has many more calculations to do in the algorithm To. It’s a matter of mathematics. The two codes are similar. The main difference is in the number of…
javascriptanswered Oralista de Sistemas 23,115 -
3
votes3
answers722
viewsA: Initialize private fields in the declaration or constructor?
For most cases, either initialize in the declaration or constructor, if you want to give a default value. The object only exists in memory even at the time it is built. If you want to be very…
-
6
votes3
answers146
viewsA: Performance "Where in foreach vs if"
The right answer is: it depends. jbueno already explained how it works in case your list was created based on data available only in the application memory space, i.e.: that your application…
-
1
votes3
answers749
viewsA: How to treat High and Low Letters Box along with Symbols
To do this as performatively as possible, I suggest using a map/dictionary. In Javascript, every object is a dictionary, so you’re halfway there. Place all your elements in a dictionary. I suggest…
-
2
votes2
answers212
viewsA: Assign Tuple return in two variables
Has. var tupla = SearchTerra(artista, musica); string retorno1 = tupla.item1; string retorn2 = tupla.item2;
-
1
votes2
answers202
viewsA: How to work with the file:// and Angular protocol
The problem is safety. clappr.js:30025 Xmlhttprequest cannot load file:/audio/0379442681742547b1cc4baacab409c3/320/ts_.m3u8. Cross origin requests are only supported for Protocol schemes: http,…
-
2
votes2
answers3155
viewsA: How can I know if a font is free for use, even commercial
Stack Overflow in Portuguese has certain questions related to development, but that are not about programming itself, due to the fact that Stacks in Portuguese are still very recent in relation to…
-
2
votes1
answer1615
viewsA: How to concatenate variable in element id? jQuery
Of the two forms you used, only the second form: $("#bkpLoja"+id).html(data); ... You will fill out the div correctly. The problem is not your jQuery code. The problem is the object data. I suggest…
-
11
votes3
answers425
viewsA: Difference between '$()' and 'jQuery()'
jQuery goes by both names. There are several libraries that also use the dollar sign ($) as a name of some main function, which may conflict with jQuery. Calling jQuery by the jQuery() function…
-
0
votes2
answers1601
viewsA: Use more than one template in View - C# MVC
You already have a model class that is a composition, IE, contains brands and cell phones. This is the only model you need. If you want the user to select a specific brand and mobile phone on…
-
0
votes2
answers513
viewsA: Autocomplete with jquery and mysql does not list the options when starting to type
You included jQuery UI in your code, but you don’t use it anywhere. In the official documentation you can see the simplest use case of all. The autocomplete is used like this: $( "#tags"…
-
3
votes3
answers2361
viewsA: High consumption of RAM
Thousands (maybe millions) of developers use Visual Studio every day professionally. Slowness is not a common complaint. If debugging is slow for you, the most likely causes are: Your machine is…
-
1
votes1
answer107
viewsA: How to select in c# using data base / Sql-Server?
You need the function DATEPART of SQL Server. This function works like this: you inform the part of the date by which you want to perform the search, and the date itself. The function returns the…
-
7
votes4
answers12426
viewsA: How do I detect a mobile device in Javascript?
DON’T USE USERAGENT. Really. No. Just not. Pass away. If you go this way, you will only ensure that the day they launch a new browser, or when one of the current mobile browsers changes its value…
-
0
votes1
answer69
viewsA: How to remove external js cache?
Browse the site and check the URL of the script. Try to access this URL alone from your browser. You will find that one of two things is occurring: The script is hosted on a server that you control.…
-
1
votes2
answers441
viewsA: How to select a date in c#?
In the call of the method AddWithValue, the parameter name must contain the arroba. Substitute: cmd.Parameters.AddWithValue("data_registo", DateTime.Now); For:…
-
1
votes1
answer138
viewsA: How to reverse mouse click events?
For his comment: @Inkeliz I did test with download method, but even so the video opened inside the browser, IE, it was downloaded into the native player of the browser and did not display the…
-
0
votes1
answer125
viewsA: Difference between Server Object Explorer and Server Explorer
I believe that the Server Explorer to which you refer is the SQL Server Object Explorer, right? Server Explorer is a component of Visual Studio that lists servers in general, not just databases. It…
c#answered Oralista de Sistemas 23,115 -
1
votes2
answers1106
viewsA: Block direct access to a URL via webconfig
There’s no way to do what you want with just the web.config. What you can do is an Handler that the user accesses to view the video, and condition access to a session variable. On the page the user…
-
29
votes6
answers1694
viewsA: Why not use a Boolean parameter?
Each case is a case. Every time I see some "don’t do it this way," "this is bad practice," "avoid it," I expect the explanation of the reason right away. If there is no reason why the technique…
function encoding-style software-engineering parameters booleananswered Oralista de Sistemas 23,115 -
2
votes3
answers759
viewsA: Replace in substring in c#
This happens because the method Replace receives a value to search and replace as the first parameter. In this parameter you pass: str.Substring(78, 2) Which, in this case, is 00. In other words,…
c#answered Oralista de Sistemas 23,115 -
2
votes2
answers255
viewsA: Replace Undefined javascript value
Every Javascript function that does not declare a return with the keyword return, returns undefined by default. I think that’s all that’s missing. return vl; at the end of the function should solve…
-
3
votes3
answers350
viewsA: Selecting src from an input using ID in Jquery
When jQuery finds no element, an object comes arraylike empty. This is not considered logically false by javascript, so the code you posted is equivalent to: if (true) { } What you can do, is take a…
-
13
votes2
answers254
viewsA: Explain in a simpler way what are these attacks?
Keylogger: It occurs when someone uses hardware or software to record each key the user used. The attacker can then do a text analysis to find user names, passwords, bank account numbers etc. How to…
-
27
votes2
answers576
viewsQ: Why shouldn’t Regex be used to handle HTML?
I understand that if I try to use Regex over HTML, HTML tags will drip from my eyes like liquid pain, among other horrors. And that I should use an XML parser or something like. My curious child…
-
3
votes2
answers382
viewsA: Filter SQL query
If you want to obtain only part of the contents of a field that stores XML, the ideal is to use an application external to SQL to handle this information. You can do with SQL, but it is not the most…