Posts by Andre Figueiredo • 5,030 points
79 posts
-
1
votes2
answers111
viewsA: How to block special characters in a textarea field
Indicate in the jQuery selector that you want to apply the Blacklist function in the textarea as well, and add $('input,textarea').bind('input', function(){ and add the external function Binding in…
-
0
votes1
answer53
viewsA: Detect if it’s inside a callback?
First, it has to be said that magic does not exist. And the possibilities of a solution are as many as imagination allows. Where you have no competition and asynchronous, a solution that you don’t…
-
3
votes1
answer33
viewsA: How to look for the same occurrence of a term independent of its position in a string?
(<img\s[^>]*)(src="[^"]*")(.*>) <img\s: ensures that the tag is IMG [^>]*: allows anything except closing the tag (src="[^"]*"): attribute src (.*>): allows any attribution after…
-
0
votes5
answers1540
viewsA: Regex with Javascript - Taking only part of the string
A. Com Regexp One among the infinite (ie: .* x Infinity) possibilities, a generic is: str.match(/^.*(:\/\/)*.*\/(.*)[#\?].*/)[2] which can be translated from the beginning (^), any string…
-
0
votes1
answer242
viewsA: Webcamjs - Function does not work sometimes
According to the documentation, you need to pass a callback function as parameter to be executed after the snap. To snap a picture, just call the Webcam.snap() Function, Passing in a callback…
javascriptanswered Andre Figueiredo 5,030 -
3
votes1
answer633
viewsA: Directive to restrict regular expression typing in Angularjs
To solve the problem (2) of diacritics: <input type="text" allow-typing="^[A-zÀ-ÿ]+$"/> To solve the problem (1) use timeout and compare the pre and post keydown value. But it still allows you…
-
1
votes1
answer777
viewsA: Is it possible to create a button that makes the person add the site on the mobile screen?
Yes. But it depends on the implementation of the service worker browsers (see here) and the support for web manifests. Chrome is the only one to support both: The site must have been visited more…
-
1
votes1
answer2522
viewsA: Calculate average call time
Average with integer values by converting times to seconds and then converting to time type again: SELECT SEC_TO_TIME(AVG(TIME_TO_SEC(`tempo_atendimento`)))
-
1
votes1
answer354
viewsA: Performance Webpack Build.js
In fact Webpack offers alternatives, the Code Splitting using plugins, and demand loading using import library Systemjs, to which returns a Promise. But I see from your code that you’re using…
-
3
votes2
answers1856
viewsA: Clear VUE v-model data at once
You will have to clear one by one, but one option is to put the form attributes inside the separate object in the data. So you access them by this.fields.campo1 etc.. and can iterate the object by…
-
6
votes3
answers759
viewsA: The null value automatically becomes 0
Manages a INSERT using COALESCE (or ISNULL) that generates the final query: INSERT INTO Veiculo(nome, valor) VALUES('Gol', COALESCE(NULL, 0)); And, of course, change the column to NOT NULL Or,…
-
7
votes4
answers936
viewsA: Why is the use of Dynamic something to be avoided?
More a different perception. By its nature the dynamic can be used for purposes other than your goal. So it is bad practice to use it when there is clearly a better alternative available. And what…
-
1
votes1
answer2579
viewsA: Open a new tab and redirect the current tab to another page on a Javascript link
HTML: <a href="https://www.google.com" target="_blank" id="xx">abrir em nova janela</a> JS: document.getElementById('xx').addEventListener('click', function(){…
-
0
votes2
answers285
viewsA: CSS alignment
Try to use the class text-center own bootstrap to center the graphics, once they inside the span: class="col-lg-4 col-sm-12 text-center" -> alinha-chart é realmente necessário aqui? If not…
cssanswered Andre Figueiredo 5,030 -
3
votes1
answer324
viewsA: How to change the color of the Repeater line at runtime
Judging by <tr> and <td> in the Repeater, you will have a table outside the Repeater. Use CSS to place the class in the table: HTML: <table class="table-striped">…
-
5
votes2
answers391
viewsA: Is there a difference between First and Single?
Single will launch an exception if the query returns more than one record. Only one record is expected. First will not throw exception to this case, and will return TOP 1 of the result. Expected 1…
-
3
votes2
answers1269
viewsA: Save without accents and uppercase SQL Server
Solution 1: Combine collation function UPPER when adding records in column. INSERT INTO Cidades(Descricao, CodEstado, CodIBGE) values(UPPER('São Paulo'), 1, 1) output: CodCidade Descricao CodEstado…
-
1
votes3
answers779
viewsA: Assigning an image(s) value to the Javascript input
the method .val() jQuery only returns information about the first Arrays item. The input file contains the property files of the kind FileList, containing the information of the selected images.…
-
1
votes1
answer118
viewsA: Error when implementing method to take photo by application
DRT: Use getActivity().getContentResolver() where you have getContentResolver(). Your mistake clearly says: error: cannot find Symbol method getContentResolver() Because in the method…
androidanswered Andre Figueiredo 5,030 -
24
votes2
answers576
viewsA: Why shouldn’t Regex be used to handle HTML?
TL;DR The HTML is simply more complex than Regex, to the point that it is impossible to have a Regular Expression that treats HTML satisfactorily. Explanation The most direct explanation is in…
-
2
votes1
answer50
viewsA: "Hide" a cell from a table
"Hide" a cell from a table Hide by keeping the space occupied by it: td { visibility: hidden; } Hide content and space occupied by it: td { display: none; } Using a table is the best solution? Not.…
-
12
votes4
answers82811
viewsA: What is and what does a full stack web Developer do?
There is no formal definition for this term, there are different views on the limits of attributions and even criticism on the part of some. The most commonly accepted definition is the one…
terminologyanswered Andre Figueiredo 5,030 -
0
votes1
answer58
viewsA: Problem in code C#
When you execute the command write.Close(); he closes the appeal NetworkStream stream and therefore cannot record. Try: using (BinaryWriter writer = new BinaryWriter(stream))){ writer.Write(Resp); }…
c#answered Andre Figueiredo 5,030 -
1
votes1
answer148
viewsA: WCF Service Reference generates empty file
occurred because there was a Reference to a DLL external to the failed project, which Visual Studio did not point to. I found this error by removing the references one by one until the bug stopped.…
-
1
votes1
answer148
viewsQ: WCF Service Reference generates empty file
I’m having trouble referencing WCF services in Visual Studio. It does not generate any reference to the service classes to be referenced, the file Reference.vb is almost empty:…
-
2
votes2
answers628
viewsA: Use validation function in different HTML fields
You need to generalize your function to be able to call for each field. Instead of looking for "$('#nif')", search for a generic field - which can be "nif1" or "nif2", or whatever the ID is,…
-
6
votes2
answers863
viewsA: How to include a indent when using the tab key in a textarea?
The keyCode of the TAB is 9. Add an event to the textarea, so when the user type TAB, he insert a \t at the current cursor position: document.getElementById('textedit').addEventListener('keydown',…
-
5
votes1
answer15042
viewsA: Object reference not defined for an object instance. in an object declaration
You cannot declare a variable outside the class! It has to be contextualized in some object. That’s why when you comment on the line, it works fine, because there are no variables declared loose in…
-
1
votes1
answer720
viewsA: How to take "/" from the end of a server folder?
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase / DirectorySlash off RewriteRule ^(.*)\/(\?.*)?$ $1$2 [R=301,L] </IfModule> Remembering that you will have to have the module…
htaccessanswered Andre Figueiredo 5,030 -
1
votes3
answers3234
viewsA: Make an UPDATE with the value of another database
If the other database is in the same instance as the SQL server: SELECT ds_endereco FROM [OutroBD].[schema].tb_enderecos WHERE cd_endereco = ... If you are on another instance or another server -…
-
3
votes1
answer967
viewsA: Monitor space in sqlserver datafile
From version SQL Server 2008 you can make a query the catalog view sys.database_files: SELECT DB_NAME() as NomeBD, name as NomeArquivo, size/128 as TamanhoMB, max_size/128 as MaxTamanhoMB, cast(100…
sql-serveranswered Andre Figueiredo 5,030 -
1
votes2
answers116
viewsA: How to debug to know which database or table are running with Asp.Net
Repeater dynamic content is normally loaded as follows: rptGerenciaProcessos.DataSource = RetornaDados(parametro1, parametro2); rptGerenciaProcessos.DataBind(); To know which Procedure is run to…
-
1
votes2
answers365
viewsA: Recover data from a Linq SQL query with Join
When you do not set the return type of your query, it is typed as Anonymous Type. In this case, you are placing it in a variable object to return it from the method. However, this variable object…
-
4
votes2
answers1020
viewsA: How to open the Twitter site within an Iframe
Twitter blocks this by a configuration of their own server, sent a flag by the HTTP Reply: X-Frame-Options = "SAMEORIGIN" Thus, uploading pages from their website to an iframe will only be possible…
-
4
votes2
answers300
viewsQ: Return N elements from a list in jQuery
I have a list of elements, let’s say a list of rows in a table: $('#minha_tabela tr'); There is a selector, method or overload in jQuery that I can return more than one line by passing multiple…
-
5
votes1
answer115
viewsQ: Variable reference in Javascript
To generate the following matrix: 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 Consider the following code for constructing a matrix with equal lines: var linha = [1, 2, 3, 4]; var matriz =…
-
8
votes2
answers348
viewsQ: Singleton in Javascript
How to implement the Singleton standard in Javascript in a simple and correct way - which assures me that the instance will be unique? I’ve seen somewhat complex implementations, but it wouldn’t be…
-
7
votes2
answers3368
viewsQ: Multiple variable declaration in Javascript
It has become quite common to declare variables in multiple lines in Javascript. Especially when they are initialized later: var var1 = null, var2 = null, var3 = 0; The "normal" would be like this:…
-
4
votes2
answers11418
viewsA: How to open a page in a new tab without leaving the current page
New tab x New window First, just to clarify: about opening in a "new tab". If you want to open only in a "new tab" and not in a "new window", this is not currently possible. CSS3 defines the…
-
1
votes1
answer1330
viewsA: Scroll DIV content without leaving the DIV
Use the values table+table-cell to the property display of the CSS: .div-pai { display: table; width: 100%; } .div-filha-esquerda, .div-filha-direita { display: table-cell; width: 50%; } This will…
-
0
votes2
answers254
viewsA: Retrieve part of a string (split or index)
By the way, the format "url_Fonte/sua pasta/etc./nomearquivo" is fixed. Then.. string subdir = nome_dir.ToLower().Replace(url_Fonte.ToLower() + "/", "").Split('/')[0]; // ou string subdir =…
c#answered Andre Figueiredo 5,030 -
2
votes2
answers21088
viewsA: How to make these Divs responsive?
Media queries Use media-queries css3. The most widely accepted mode is the same as the one applied by Bootstrap: .row::before, .row::after { display: table; content: " "; clear: both; line-height:…
-
1
votes6
answers41250
viewsA: How to prevent Submit from an empty form?
Use the HTML5 attribute required with fallback for browsers (or versions) that do not support this attribute, which represent 30% of global users and 15% of users in Brazil, currently (November…
javascriptanswered Andre Figueiredo 5,030 -
12
votes1
answer680
viewsQ: Code First versus Database First?
I’m used to creating projects on Asp.net-MVC with Entity Framework Database First. From a modeling, the database and the system are created. However, I see a lot of programmers prefer Code First,…
-
4
votes1
answer1089
viewsA: dir, html or css attribute
Question 1: I have tested screen readers, but at the time I did not notice it. They identify the direction of the text by the attribute, or are preconfigured? Neither one nor the other. They do not…
-
2
votes2
answers1413
viewsA: Calculate the size of the div
You are doing the wrong account for displacement: largura das caixas + margin+left = deslocamento 50px + 11px = 61px Shift +/- 61px, instead of 65px. See your updated jsFiddle here.…
-
7
votes1
answer545
viewsA: Are there online programming learning environments with hands-on exercises and challenges for C#?
Some websites that accept C#: Topcoder Codejam USACO Training Program Codechef Sphere Online Judge Timus Online Judge Projecteuler Codeeval Code Hunt…
-
6
votes0
answers152
viewsQ: Issue of permission to install Mediawiki on Sql Server
I am having problems trying to install Mediawiki using Sql Server. The following error occurs: [SQLSTATE 42000][Error Code 2760][Microsoft][SQL Server Native Client 11.0][SQL Server]The specified…
sql-serverasked Andre Figueiredo 5,030 -
6
votes2
answers7925
viewsQ: How to run a PHP application on IIS?
I have a PHP website that I want to install on IIS (Apache for Windows is not an option). It will not run naturally as an . NET application. So I already downloaded a release of PHP on the site…
-
4
votes2
answers8294
viewsQ: Can you change the vertical order of Divs by CSS?
I have the following automatically generated page layout: I’d like to bring to Source, next to the Date (below). But I cannot change the layout of the generated elements. I can only change a…