Posts by Oralista de Sistemas • 23,115 points
435 posts
-
6
votes2
answers570
viewsA: What is the difference between Object.create or new Object() in Javascript?
The method Object.create receive parameters. The first is required and will be used as prototype of the new object. The second is a map of properties with which object is already "born". Already new…
-
1
votes2
answers275
viewsA: Mount html by c#
You’re putting together an element ul, so my advice is to use control Bulletedlist. There is an example of how to use it at the end of the cited page. Any more element you want will invariably have…
-
4
votes2
answers2689
viewsA: How to access an element within another HTML element with pure Javascript
Let’s assume an element you recovered with pure Javascript, called foo. You can get foo by the methods you already know. For example: // experimento no fonte desta página! var foo =…
-
0
votes2
answers2413
viewsA: How to calculate the average speed (Km/h)?
If you really want to calculate speed on your own, go and study geodesic geometry. It’s more of a math problem than a programming problem. Or you can assume that, for small distances, the earth is…
androidanswered Oralista de Sistemas 23,115 -
3
votes1
answer164
viewsA: Using Sendmessage with applications like Notepad, Word, Dreamweaver
The Windows API is very powerful, and it’s fun to try the things we can do with it. However, you are literally hacking into these programs if you want to write on your windows (or click on their…
c#answered Oralista de Sistemas 23,115 -
4
votes1
answer325
viewsA: In a service-oriented architecture, is the database decentralized?
Ideally, the bank should be abstracted. I am assuming a case in which the "bank" stores a mass of data that belongs to and relates exclusively to the system that covers the services themselves.…
-
11
votes4
answers317
viewsQ: Why are maps "faster" than arrays?
I have always read and heard that maps are much faster than search arrays. Until I decided to see how much and did a jsperf: http://jsperf.com/maps-vs-arrays/ What I’d like to do is understand which…
-
1
votes1
answer728
viewsA: Expect response from a method to proceed
The ideal would be to show the popup as a modal dialog. If this is not possible due to some logic you need specific to the method ShowPopUp of this class, the way is to appeal. Block the parent form…
-
1
votes1
answer167
viewsA: How to position a text inclined in Reportviewer?
There is a somewhat crude form. You can use the graphical framework libraries to insert the text in the report as image. You start by getting a class object Graphics. There are several ways... From…
-
9
votes3
answers17316
viewsA: Run external application with Javascript
HTML is not a programming language. It is not with HTML that this is possible, but with scripting languages like Javascript and Vbscript. With no language can you do it from a browser. The reason is…
-
1
votes2
answers83
viewsA: Rotate CSS3 and Tables
The way is to force the width in the box. Add: width: 20px; To the paragraph. Note that this causes the text to rise somewhat. To correct, you need to add a margin above. I got a good margin for…
css3answered Oralista de Sistemas 23,115 -
21
votes3
answers2752
viewsA: What are indexes in SQL Server for?
TL;DR: Imagine that the database is a postman who has just arrived in a city unknown to him, and that the data is the recipients of the letters he has to deliver. A simpler index would be like the…
-
2
votes1
answer270
viewsA: Error publishing application in iis 8.5
I’m 99.999% sure that the site on IIS is not actually associated with a .NET. application when a site is part of an ASP.NET application, a page call. aspx to for an Handler that will internally call…
-
4
votes2
answers379
viewsA: How many images can I save to a mysql blob field?
A field blob stores a binary data set. You can store more than one image, turn both into a single data stream before. This has two immediate side effects: you need to know where one image starts and…
-
3
votes4
answers3461
viewsA: How to center a rectangular image on a square div
You can give a display: table-cell in div container. Hence only use alignment properties text-align: center and vertical-align: middle and run for it. If the display as table cell is inconvenient,…
-
4
votes1
answer185
viewsA: Should I create a table by category, or a single table?
If category is a very closed concept, the ideal is nay create a table for each category. A good sanity exercise: imagine that you already have a thousand news on the site, and now every news or…
-
16
votes1
answer167
viewsA: What is the character function ? in the variable type in C#?
This is syntactic sugar for nullables (cancellable types). Equals: public Nullable<bool> Status It is a way for you to have a variable that can contain a null reference or a value. Types by…
-
3
votes3
answers176
viewsA: Syntactic Sugar in PHP
Virtually all repeating structures (for, foreach, do-while, for-in) of the most modern programming languages can be considered syntactic sugar for the simplest structure of all, the while (which is…
-
2
votes1
answer803
viewsA: Svg is not rendered, the browser downloads the file in iis
Every time IIS receives a request, it retrieves the requested resource (a page, image, etc.) and returns it in the HTTP channel. Imagine that the IIS response is delivered to the browser within an…
-
4
votes1
answer599
viewsA: Taking an object from a list by reference and not by position
There are some Framework classes that work like this. You can use a dictionary. In a dictionary there is no order. You access the elements by keys. The key can be of any type - if it is a type by…
c#answered Oralista de Sistemas 23,115 -
6
votes2
answers1258
viewsA: Word filter
I’ll let you turn around and get the div and change property innerHtml or innerText from her, since you don’t want to use jQuery. Otherwise: var badWords = { // Isso vai ser nosso dicionário.…
javascriptanswered Oralista de Sistemas 23,115 -
46
votes7
answers1478
viewsA: Is using many interfaces a bad programming practice?
When modeling an object-oriented system, one of the most important things we should do is to assign to each type (whether interface, class, structure, enumeration or delegate) a set of concepts and…
-
12
votes3
answers8297
viewsA: What are the principles DRY, KISS and YAGNI?
These are some basic rules to make your job easier, especially when it comes to maintenance. The meaning of each is: DRY: Don’t Repeat Yourself. Do not repeat yourself. Suppose the effort to fix a…
-
34
votes7
answers33990
viewsA: How do SELECT all fields except a few?
That nay is possible with SQL Server or Oracle. I don’t know if it’s possible with other banks, like Mysql. If anyone knows, feel free to edit my answer. The Oracle select specification is found…
-
4
votes2
answers1035
viewsA: Crop image with JS
It is something that is very badly documented - I looked for official documentation on the Jcrop website but I found absolutely nothing. However, it is possible. Let’s assume that the object you are…
-
2
votes2
answers246
viewsA: Javascript reaching number 100
Swap a comma for a period. In Javascript, the decimal separator is the point ;) i and..: 1,88 * 100 // 8800 This is because the interpreter sees it as: 1; 88 * 100; Already the code below approaches…
javascriptanswered Oralista de Sistemas 23,115 -
1
votes2
answers67
viewsQ: Consider null and empty strings as equivalent to each other
I want to compare strings that come from two different sources. If they’re different, I’ll do something. Something like this: if (foo != bar) { noop(); } However, in my specific case, I am…
c#asked Oralista de Sistemas 23,115 -
7
votes1
answer950
viewsA: Intercept AJAX requests
You can use a technique called Monkey Patching to modify the way Ajax calls work. Every Javascript function can be overwritten. Try it on your browser console, it’s fun :) For example, the code…
-
14
votes3
answers32049
viewsA: How to check if a variable is set?
The answers of Leofilipe and brandizzi are correct. There is however an alternative you can use for a similar check: var vCogUG; vCogUG === undefined; If the variable vCogUG already exists and is…
-
4
votes5
answers1182
viewsA: HTML element does not become visible
The answers of Sergio and Leofelipe are correct. For my part I will propose a different way of doing the same thing, with less code: var nome_erro = $(".nome_erro"); $("#nome").blur(function () {…
-
1
votes1
answer98
viewsQ: Vertical wrap instead of horizontal
When the contents of a series of HTML elements with inline display does not fit in a container fixed size, the normal is that the content is broken as text. That is, from left to right. Something…
-
1
votes3
answers442
viewsA: Powershell - How to create a sub-site in Sharepoint Online
Two things: If you can let your customers create websites, it might make things easier for you. Just have the permission to Manage Hierarchy in the collection of websites. Then in the settings of…
-
5
votes4
answers5615
viewsA: What is the difference in the use of the Equals method for the ==operator?
If by "primitive" types you mean those for which the Framework has synonyms, such as System.Int32 (int), System.Boolean (bool), System.DateTime (DateTime) etc.. If they are structs, you need to…
-
0
votes2
answers312
viewsA: Store Click on cookie
I liked Guilherme’s reply. I will propose an alternative: Make a user session last 24 hours, without renewal by activity; When the user makes the request that can be accounted for, check if there is…
-
3
votes2
answers1980
viewsA: Blur effect on different browsers
Using nothing but pure CSS and a little imagination... You can superimpose the image on itself, in multiple layers. Make all (except the lowest) slightly transparent. Now move each image a little in…
-
4
votes3
answers307
viewsA: How do I use Python to search and store data from the Stack Overflow API?
I’ll give you a data about the Stack Overflow: both here and in the English matrix people in general do not like questions asking for tutorials. There is even a standard reason for closing…
-
22
votes3
answers24286
viewsQ: What is the difference between <div> and <Section>?
I was reading here about the element <section>. I read the specification, I read some articles about, and I still can’t understand what benefit this element brings that is no longer covered by…
html5asked Oralista de Sistemas 23,115 -
1
votes2
answers520
viewsA: XSL does not enter the correct condition
Instead of comparing, you are assigning the value '' to the variable PublishingRollupImage. To check if it is filled, just do so: <xsl:when test="@PublishingRollupImage">…
-
2
votes4
answers243
viewsA: Within a decision structure, does the order of terms change the outcome?
I will give a partial response, aimed at . NET and Mono. The behaviour of the operator == varies as follows: For reference types, it checks whether the references are equal, i.e.: if both objects…
-
16
votes3
answers7149
viewsA: Clear ZIP code with Javascript
If all you want is to remove the strokes and dots... var str = str.replace("-", "").replace(".", ""); Where str is the string with the ZIP code. If you want to see if a string is a valid zip code,…
-
11
votes3
answers15042
viewsA: What is the difference between BOM and BOM encoding files?
BOM means Byte Order Mark. In our world people cannot understand themselves about various things, even if the bits of a lesser value byte should be aligned left or right. Believe me, there are…
character-encodinganswered Oralista de Sistemas 23,115 -
2
votes1
answer270
viewsA: What’s wrong with this pseudo-code?
There is no "official" pseudo-code language. There are several different ways of expressing itself textually about how a structure should be, or how it should behave; but since pseudocode is not…
pseudocodeanswered Oralista de Sistemas 23,115 -
2
votes7
answers46159
viewsA: Remove repeated elements within a Javascript array
The most performative way is to convert the vector into a dictionary, and then convert to vector again. function Foo (vetor) { var dicionario = {}; for (var i = 0; i < vetor.length; i++) {…
javascriptanswered Oralista de Sistemas 23,115 -
8
votes3
answers1231
viewsA: Function that writes the first 50 numbers whose sum of the formant digits is 10
I imagine something like: var numeros = []; var contador = 0; while (numeros.length < 50) { var acumulador = 0; var algarismos = (contador + "").split(""); for (var i = 0; i <…
-
8
votes3
answers666
viewsA: Function with variable amount of parameters, what better way to do?
Sergio’s answer is excellent and I agree it’s the right one. I will leave an alternative only to increase the range of options for those who want to work with multiple parameters. There is a…
javascriptanswered Oralista de Sistemas 23,115 -
1
votes1
answer117
viewsA: Failure to access Spservices in a Sharepoint list
The option webURL should indicate the path of a site. In its code it indicates the path of a list. Modify the value of the option to contain the path only to the site, that is, assuming the site is…
-
8
votes2
answers110
viewsQ: String assembler (or How to improve the performance of massive replacements)
TL;DR: I know there is a class called Stringbuilder, both in .NET how much in Java, that allows performing operations on a text without generating a new string for each method call. It would be very…
javascriptasked Oralista de Sistemas 23,115 -
7
votes2
answers483
viewsA: AVG accuses Windows Service Application infection if Windows Firewall addition command is present
If an application requires a special firewall configuration, the configuration must be done by an administrator. In your case, antivirus is correct in assuming that your program is malware. Think…
-
5
votes1
answer213
viewsA: How to increase the thickness of a text-shadow
Two suggestions to solve the problem: Use a better contrast. The white shadow diffuses in the blue behind and is not very noticeable; Use multiple shadows. The shadows via CSS for text are really…
cssanswered Oralista de Sistemas 23,115 -
24
votes7
answers87300
viewsA: How to validate with regex a string containing only letters, whitespace and accented letters?
I liked the bfavaretto solution better, but I’ll leave a shorter alternative here: var reg = /[a-zA-Z\u00C0-\u00FF ]+/i Explanation: this is a match of the characters 'a' to 'z', 'A' to 'Z', and…