Posts by Oralista de Sistemas • 23,115 points
435 posts
-
3
votes2
answers61
viewsA: Database overloads while deleting lines with relationships?
In any relational system, if you have a relation indicating that the parent element deletion removes the child elements in cascade, the deletion of a single parent element and all your children will…
-
4
votes1
answer99
viewsA: Treat 404 on video Html5
If to check if a video exists or not, you might want to check this before loading the tag video. If the video exists you mount the tag, otherwise mount an error message in HTML for example. To check…
-
4
votes1
answer133
viewsA: Bookmarks Specific Lines Visual Studio
Yes, it is possible. The keyboard shortcut is CTRL+K+K. To navigate between bookmarks, use CTRL+K+N to advance to the next Bookmark. Editing I just found that the "official" shortcuts are different:…
-
13
votes2
answers1642
viewsA: Is Eval a good guy or a bad guy?
Consider that every technique, pattern or programming philosophy you learn is a weapon. Algorithms with data structures are a pistol, you need to learn how to handle at least that if you want to go…
evalanswered Oralista de Sistemas 23,115 -
3
votes2
answers897
viewsA: How to filter items that do not contain a word in a list?
I think the problem is that you are looking for the larger string inside the smaller one, i.e.: you are seeing if the filter contains the phrase and not the other way around. I suggest: string[]…
-
3
votes1
answer1688
viewsA: Capture GET Coordinates in the Google Maps api
If you want to get these query string values , to fill both your controls and your variables, you can read it in location.search. Type: var querystring = location.search; var lato =…
-
1
votes2
answers2820
viewsA: How to generate an array using Random to assign values, but make it never repeat values?
It seems to me what you want is to place the numbers one through ten in a ten position vector, randomly. If that’s right, what you need is an auxiliary structure from which the numbers will be drawn…
-
2
votes1
answer62
viewsA: How to create a shortcut to open a website in the browser?
To do what you want, you need to create a Windows shortcut. If the shortcut points to a web address, the system’s default browser will open, with a new tab already focused and loading the address…
androidanswered Oralista de Sistemas 23,115 -
1
votes2
answers468
viewsA: Regular expression to replace src attribute contents of html <img> tag
I think the expression you seek is: \<img(.|\n|\r)+src="[^"]*$1"(.|\r.|\n)+\> Where: \<img is self-explanatory; (.|\n|\r) means any character. The dot means any character that is not a line…
-
5
votes3
answers195
viewsA: Can you do a + or - value operation in a Mysql query?
The logic of "marromeno" can be made with an auxiliary variable of variation. DECLARE @marromeno DECIMAL(0,2) DECLARE @eixoDaGrampola DECIMAL(2,2) -- atribua valores aqui SELECT * FROM inmetro WHERE…
mysqlanswered Oralista de Sistemas 23,115 -
0
votes2
answers102
viewsA: HTML Forms with PHP
Notice that, the way it is, its button the footer has no logic. I venture to say that for this reason it does nothing. If you want the button to make a post, you have two options: Tag <input>…
-
2
votes4
answers8648
viewsA: Remove space and break string lines
NEVER treat XML as text. There are terms for those who do this that, although they are technical terms and even used in books, would cause me to be banned from here if I used them ;) Instead,…
-
2
votes2
answers6093
viewsA: how to test with sql Injection
When you say: "select * from usuarios where nome='$_POST[nome]'" You are sending the following command to the database: select * from usuarios where nome='$_POST[nome]' If you want to concatenate…
-
2
votes2
answers350
viewsA: Doubt in string, and comparison
The operator =, in C, it is not a comparison, it is an assignment. In the passage you make: string2[i]=string1[i] You are overwriting the i-none character of string2. And yes, inside a if an…
-
1
votes1
answer1197
viewsA: Boleto.Net Component Generating Wrong Code
I was looking at the barcode source code here... https://github.com/BoletoNet/boletonet/blob/master/src/Boleto.Net/Boleto/CodigoBarra.cs Apparently the free camp is misinformed. When you ask for the…
-
1
votes5
answers13398
viewsA: How to declare a date variable in C?
C has a type of data that stores dates. Uilque mentioned the library in his answer (time.h). It follows the official documentation in Portuguese: http://pt.cppreference.com/w/c/chrono/tm Here’s an…
-
5
votes1
answer2133
viewsQ: Identify what is in the USB port
When a device is connected to a USB port, the operating system identifies the device. For example, on Windows, you can see which devices are connected to USB ports in Device Manager. I need to…
delphiasked Oralista de Sistemas 23,115 -
3
votes1
answer84
viewsQ: Gulp task does not rotate (but turns callback)
I have a task in Gulp, defined more or less like this: gulp.task('tarefa', ['a', 'b', 'c'], function () { console.log("tarefa executada com sucesso"); }); From what I understand of documentation,…
gulpasked Oralista de Sistemas 23,115 -
4
votes2
answers5857
viewsQ: How to break a string
I want to break a string in the old Delphi (pre-Avaidero). I would love to be able to do something like: function Quebra (input: String; separador: String) : Array of String var resultado: Array of…
delphi-7asked Oralista de Sistemas 23,115 -
3
votes2
answers546
viewsA: Lock/fade screen during postback
One approach you can try is to put all your controls with which the user can interact on one UpdatePanel. This takes care of the Ajax part, since the controls for Ajax encapsulate all the…
-
4
votes3
answers500
viewsA: Security key in Asp.net mvc
The computer name can be replicated on the "pirate" machine. In fact, any feature of your machine can be "cloned" by a hacker with enough free time on your hands. But if you really want to…
-
2
votes1
answer264
viewsQ: Find commit in which file was deleted
I have a project in Git. I need to retrieve a file that was deleted several months ago. If it were something that was now in the repository it would be trivial to find it, see its history and…
gitasked Oralista de Sistemas 23,115 -
7
votes2
answers1076
viewsA: Identify extension installed in google Chrome
Every extension has an ID and, when installed, a manifest that stays on the user’s computer. Just go to the following address: chrome-extension://ID/manifest.json <!-- Substitua o "ID" acima pelo…
-
1
votes3
answers1405
viewsA: How to export SQL records without duplicates?
I am to "steal" an answer I found in the OS in English ;) You should group the records. I think we can ignore the repeated Ids (let me know if that’s not convenient). So we will use all fields…
-
2
votes1
answer156
viewsA: What is more advisable? Perform the query through a list or directly in the database?
The most advisable way depends on your final goal with the code. Only by the text around the code would it be easy to dismiss the question as opinion dependent. By looking more carefully at the two…
-
8
votes2
answers209
viewsA: Processing time is affected by the size of variable names?
In compiled languages, your code is translated into machine language. The variables you call "foo", "bar", "_auxTempObj" etc... Saw sequences of zeros and ones generated at compiler convenience.…
-
4
votes4
answers2204
viewsA: How to get page load percentage?
Maniero has already answered the question very well. If you still want to insist... You can spread several scripts around the page. As follows: <body> <div><!-- Inicialize seu…
-
4
votes1
answer1100
viewsA: Select with value lookup in another table
If you guarantee that the relationship is 1 to 1, that is, there is only one MQPK for each MQ1FK, simply add TOP 1 to the sub-consumption: select valor from engenharia_maquina where MQPK = (select…
-
1
votes2
answers243
viewsA: Regex between words
Brute force never failed me. First you take all member statements with the expression: (public|private) .+?; Put that on a list. Then, on the list, you take the ones you nay either with the…
-
3
votes2
answers452
viewsA: How to display a upload image while the iframe content is loaded?
The big problem is that the iframe is in a different context than yours. I would point out that this may be tortuous, or even impossible, if the iframe contains material from a field other than…
iframeanswered Oralista de Sistemas 23,115 -
3
votes5
answers611
viewsA: How to count items correctly?
Counting amounts over strings is not a very recommended way. The ideal is to place the ID of each episode in an Array. This way you check the length of the Array. If the length is longer than one…
phpanswered Oralista de Sistemas 23,115 -
7
votes3
answers4284
viewsA: What is the probability of generating a Repeated Guid?
Although the generation of GUID’s is pseudo-random, I think we can consider it completely random for a doily calculation. The variable characters are 32, each of which has 16 possible values. This…
-
3
votes3
answers71
viewsA: .length locks all the code
The mistake Unexpected token ( means that there is a pair of poorly enclosed parentheses in the code. Two considerations: It was initially indicated in the question that a parenthesis was missing…
-
7
votes3
answers5317
viewsA: Why use get and set in Java?
Being short and thick... If all your accessor get does is return a class field, and all your accessor set does is change the value of this field, like this: public class Pessoa { private int _idade;…
-
4
votes1
answer1412
viewsA: How to instantiate an object of this class in C#
1-) Open Visual Studio; 2-) Create a Windows project; 3-) You should now see the drawing of a form. If you do not see, fuck there until you find; 4-) There should be a left tab with several…
-
2
votes3
answers648
viewsA: How to hide the tooltip created by the Title attribute?
Editing: the original question was about the attribute alt. About the attribute title, the W3C has the following considerations: Information should be complementary and useful, such as what is…
-
3
votes3
answers1146
viewsA: How to stop running $.map?
You can create your own mapping function if jQuery’s does not solve you. var stoppableMap = function (inputArray, mainFunction, haltFunction) { var result = []; for (var i = 0; i <…
jqueryanswered Oralista de Sistemas 23,115 -
2
votes2
answers1016
viewsA: Find a snippet of an HTML
Editing to include a Disclaimer: obviously at some point in your process is made a thing called scraping on the recipe page. As Maniero said in his reply and comment, this is not very reliable. My…
-
0
votes1
answer74
viewsA: Sharepoint Foundation 2010 Survey
This error usually occurs because the search service will have the same permissions as the logged in user. It aggregates user permissions logged in with their own. You must find the service in your…
sharepointanswered Oralista de Sistemas 23,115 -
2
votes1
answer327
viewsQ: Access URL without receiving the reply
I have a page that performs several tasks. This page is open to end users of the system, who can access it via browser. In certain situations I would like to trigger page processing with a console…
-
12
votes2
answers160
viewsA: What happens when we run PHP scripts with long tasks?
Script loses performance over server as time passes? It depends on the code. Most programmers I know think that Garbage Collector solves any problem with memory and ends up causing leaks (this is…
-
5
votes1
answer4268
viewsA: How to select only the days of the week?
Depends on the DBMS you use. If you are SQL Server, use the function DATEPART. I will leave it to you to read the documentation on the link. The form would be as follows: WHERE DATEPART(p.dtvenc,…
sqlanswered Oralista de Sistemas 23,115 -
-1
votes2
answers4192
viewsA: Build and build. What are the differences and when to use?
I’m going to steal an answer to a similar question asked in the O.R. The question was specific about Java but I think this applies to other platforms and languages. The build process involves…
-
3
votes1
answer403
viewsA: Instantiate a standard global function to call functions
Just create a global object and add functions to it. When you make a global object, as below, it becomes visible... Well, globally. var foo = {}; // foo só será global se essa linha rodar no escopo…
-
3
votes1
answer681
viewsA: How to change the src of a <script> using jQuery
One way to solve it is to put all your important scripts in a known path, and use absolute paths. For example, instead of: <script src="../foo/bar.js"></script> Use: <script…
-
2
votes1
answer722
viewsA: Username and password appear on console after POST
When you post, these variables are not only visible on the console. The request the browser makes goes through dozens of machines until it reaches the server. All machines can read the request. If…
-
2
votes3
answers13033
viewsA: Split to separate part of a string considers first separator
Just be creative with the code ;) string foo = "_2910_0908_401 _600_ERV__P_119552_GUARITA ERV SEM ENERGIA RADIO INOPERAN_TE SEMAFOROS P TRENS E VEICLS APAGADOS_PSG TREM C SINAL DE BANDEIRA PELA…
-
7
votes7
answers12436
viewsA: Use semicolon or not at the end of the lines in Javascript?
Zuul’s answer is the correct one. I’m just going to leave a specific case here because no one has so far commented on: This: function foo () { return { name: "bar" } } Is equivalent to this:…
-
3
votes2
answers4850
viewsA: How to print a text (coupon) via javascript?
If you want to skip the preview and confirmation screens, you can’t cross-browser. This is from the browser implementation. Maybe is possible with IE if you set up a printer by default - although I…
-
4
votes5
answers910
viewsA: Operator "||" in Javascript variables
In Javascript, an expression like a || b is interpreted as follows:: Evaluate a; if not evaluated as one of the "false" logical values, return a; If not, come back b. The values that are considered…
javascriptanswered Oralista de Sistemas 23,115