Posts by Maniero • 444,682 points
6,921 posts
-
9
votes1
answer410
viewsA: Matrix parameter passing error
The problem is in the parameter declaration in the function teste1. If you are passing a two-dimensional * array* (4X2) of the type float, then the function should receive the same type in the…
-
6
votes1
answer112
viewsA: Updating data in SQL
You haven’t given a lot of details of what you’re using, or shown what you tried so I’ll give you a generic answer to increment the value of one for the field in Mysql that I think is the likely DB…
-
37
votes2
answers7574
viewsQ: Does Clipper still exist?
Clipper was a widely used language in the 80’s and even most of the 90’s. Especially in some countries like Brazil. In fact many administrative systems still used today were made in it. But it is…
-
26
votes2
answers7574
viewsA: Does Clipper still exist?
Fatal fate The Clipper, that product created by Nantucket and purchased by Computer Associates was discontinued in development around 1996. It was still marketed for a long time and until recently…
-
36
votes3
answers2113
viewsQ: Why use Git for individual development?
In 2008 I asked an OS question about version control for solo developer and received an excellent response from Jon Skeet indicating the use of SVN. Unfortunately it was recently closed and removed.…
-
51
votes3
answers25811
viewsA: What are the differences between Git, SVN and CVS?
A bit of history Beginnings The version control systems are very old. Some of the first known were the CA Software Change Manager, the Panvalet and the SCCS 1972. Only a decade later one emerged…
-
28
votes2
answers1963
viewsA: What is the purpose of the free() function?
What is It is the function to dislocate memory allocated in heap (there explains why the heap is necessary). It is usually used in pairs (not necessarily directly) with malloc(). Recommending In…
-
7
votes1
answer183
viewsA: Hello World in C++ does not compile
If it really is like this the book is very bad, throw it away and look for a better. There are some problems in this code In C++ include files do not carry the suffix .h as in C. Therein lies the…
-
1
votes2
answers2734
viewsA: Regular expression to retrieve strings starting with colons (:)
Answer without using Regex: import java.util.*; class Program { public static void main (String[] args) { String texto = "(:TEXTOQUALQUER NADA DO FOI :TEXTOQQDENOVO SERÁ DE NOVO :TEXTOQQMAIS DO…
-
2
votes1
answer557
viewsA: How do I insert any file extension into an SQL database?
Safe way to do what you want: public static int databaseFilePut(MemoryStream fileToPut) { int varID = 0; byte[] file = fileToPut.ToArray(); const string preparedCommand = @" INSERT INTO…
-
3
votes2
answers846
viewsA: Count line in the matrix that have repeated numbers
The line count is really all wrong. It doesn’t make sense the code used. You have to compare item by item to know if a row is all made up of 0 or all of 1. This way I created a counter to accumulate…
-
7
votes3
answers254
viewsA: Why validate even with a default value
A definitive answer is not possible. There are controversies about what is best. I will repeat what I always say and the AP knows it. The most important thing is to standardize what the team does…
-
4
votes4
answers1914
viewsA: Take accent from a string
You need to decode first: if (isset($_POST['txtnome'])) { $txtnome= htmlentities($_POST['txtnome']); } $aa = strtr(utf8_decode($txtnome), utf8_decode('…
-
12
votes3
answers4910
viewsA: Split result equals zero in decimals
Because the code is dividing an integer by an integer. You used a literal number which is an integer value. When you consider only integers, the division of 1 by 3 gives 0 the same. After the…
-
3
votes1
answer254
views -
29
votes4
answers5144
viewsA: What does the "@" sign on C" mean?
I have two complements on the subject. Reserved word The @ can be used for something else in language. When you need to use an identifier that conflicts with a reserved word, this symbol can be used…
-
8
votes4
answers1385
viewsA: How to replace {vars} in a string?
In C# 6 there is a new resource string where, depending on the goal, it is possible to set all this aside and leave the language/framework take care of it for you, so not the other answers no longer…
-
8
votes3
answers30960
viewsA: How to query in Mysql with two different conditions in WHERE
I didn’t check all the query but if that’s what you’re saying I think it solves: SELECT b.idBanca AS idB, b.DataHora AS dataHora, b.Sala AS sala, t.idTrabalho AS idT, p.Nome AS orientador, a.Nome AS…
-
13
votes1
answer369
viewsA: What tags can I use to document my code?
You can get a list of major tags of Javadoc on Wikipedia or may obtain in the official documentation. Tag Description Where to use @Author Designer the author of the code Class, Interface, Enum…
-
16
votes3
answers10939
viewsA: How does the C#lock work?
To complement, the lock It’s a kind of traffic light. In fact through it it is possible to deploy a data structure capable of controlling the processing traffic that is called traffic light. The…
-
12
votes2
answers1238
viewsA: What is a "0" field in the SQL SELECT?
You didn’t put all the code in, so it might be something different than it looks. Contrary to what many imagine SELECT can select any valid information in SQL. Then the 0 is valid information, is a…
-
8
votes1
answer144
viewsA: Program does not compile with miscellaneous errors
There are three mistakes: The main function should call main and not Main. This function must return a int and not void. Some compilers accept this form but this does not mean it is correct to use…
-
75
votes1
answer32104
viewsQ: What is the difference between URL and URI?
What is URL? What is URI? Are they synonymous? In general people almost always use URL, are they the same thing? Is there anything else related?
-
81
votes1
answer32104
viewsA: What is the difference between URL and URI?
URI or Uniform Identifier of Resources or Uniform Resource Identifier (in English) is a compact character string used to identify or name a resource on the Internet. The main purpose of this…
-
3
votes3
answers272
viewsA: Incompatible types?
Only with this excerpt may not be indicating well where the problem is. The problem may be in the function call, may be in the statement of this array. It is not possible to know only with the…
-
3
votes1
answer236
viewsA: How to create a modular function whose parameter is an operator?
There really isn’t much to do the way you’re planning. There are a few options: Some programmers have the culture to create two functions as you did. Others create a passing parameter that indicates…
-
2
votes1
answer353
viewsA: Undeclared variable
Your code has several problems and as this is a very simple problem I imagine you are not understanding half of the code that is there. Solving this problem, you still won’t have the code working…
-
2
votes1
answer201
viewsA: How do I limit sending data from a form?
Yes, it is possible to do this, it is not the most appropriate but it works. The simplest way to do this is to use the function file_put_contents() file_put_contents($arquivo, $contador); Then you…
-
3
votes1
answer130
views -
3
votes1
answer218
viewsA: Error comparing two strings
The code is full of problems. I will point out some: The main visible is memory corruption. Variables info and anterior were declared but memory was not allocated to them. When you tried to write…
-
7
votes1
answer1801
viewsA: Picking specific amount of characters from a textbox
You need to take the lower value of the two. Either the 48 or the size of the string. If you try to take 48 characters and a string is less than this will give an index error. Will it be so:…
-
5
votes2
answers1017
viewsA: Prevent DROP TABLE
Basically you can’t. Any attempt will fail. You have not given context to what you want to do so it may be that your problem is another. Prevent access to the archive If you want to prevent a user…
-
3
votes1
answer691
views -
20
votes2
answers3148
viewsA: Why does everyone hate multiple inheritance in C++ and what’s your difference to mixins?
Wrong premise I don’t know why everyone hates multiple inheritance in C++. I don’t even know if that’s true. I know a lot of people who don’t. Even people who point out problems in this resource…
-
29
votes1
answer12710
viewsA: How to read from stdin in C?
It depends on the purpose, whether you want to read a character, a sequence or want a specific format. Some today depends more on taste. getchar() Read only one character, nothing more. It doesn’t…
-
3
votes2
answers103
viewsA: How to capture Assembly from classes that inherit from a single class
Using LINQ you can do this: var lista = (from arquivo in AppDomain.CurrentDomain.GetAssemblies() from tipo in arquivo.GetTypes() where typeof(ClasseBase).IsAssignableFrom(tipo) select…
-
4
votes1
answer8622
views -
7
votes1
answer523
viewsA: Is it possible to use pointers in VB.NET?
No, directly you can’t. Alternative The most you can use is IntPtr available in .NET. It is a more limited form, although it allows a reference for a memory point to be created in VB.NET. Internally…
-
1
votes2
answers98
viewsA: Can I put an array as a parameter for another array?
This syntax used doesn’t make much sense of the form presented and the terminology you are using doesn’t either. What you call the parameter is the index? What is this string. Is it a variable? What…
-
5
votes4
answers714
viewsA: Trying to condense conditional with three possibilities
Only an implementation alternative if using PHP 5.5: $html = [' (nenhum)', ' (1 item)', ' ('.$ni.' itens)'][($ni > 1) ? 2 : $ni]; I find it simpler this way. I don’t like double conditional on…
-
13
votes1
answer5489
viewsA: How to create directory with a path that works for any OS?
To get the user’s "home" just use: System.getProperty("user.home") For the creation and use of directories no matter the platform you do the same: File arquivo = new File("/dir/arquivo.ext"); Path…
-
19
votes3
answers660
viewsA: Should we validate function parameters?
It depends on what you want. Want to have an organized code or just "work"? You can let the error happen at its end point. Or you can show earlier where the error actually occurred. Polluted code I…
-
4
votes2
answers303
viewsA: Hexadecimal numbers in reverse
Essentially you can use the same solution for both. int numero = 0x101c4701; int invertido swapped = ((numero >> 24) & 0xff) | // move byte 3 p/ byte 0 ((numero << 8) & 0xff0000)…
-
2
votes1
answer542
viewsA: Stop accepting data to queue dynamically
I will risk answering what I understood that you want punctually (I am analyzing others posts yours, which should not be necessary). Then you see the other problems. If it is not this, the question…
-
4
votes2
answers6555
viewsA: How do I check if two strings are anagrams of each other?
I found that response in the OS which is what you need: public static boolean isAnagram(String s1, String s2) { //se as duas strings não tem o mesmo tamanho, não é anagrama if ( s1.length() !=…
-
8
votes2
answers360
viewsA: Put method return before a "Finally" block
The intention of finally is to ensure that this block is executed under any circumstances (unless every platform has some catastrophic behavior, of course, or by a System.exit()). So no matter what…
-
13
votes4
answers15696
viewsA: How to extract digits from a Python string and add them together?
According to that response in the OS could use functions ready for this: def sum_digits(digit): return sum(int(x) for x in digit if x.isdigit()) Behold working in the ideone. And in the repl it..…
-
2
votes1
answer502
viewsA: Windows Immediate Window is gone
Since this is a window available when using the debug, how about taking a look at this menu? It wouldn’t make sense to be in the Edit menu. See menu: Debug > Windows > Immediate Or you can use…
-
4
votes1
answer2884
viewsA: How to disable automatic Java update?
Although this is highly inadvisable (Java often has discovered vulnerabilities frequently and can compromise every computer) you can turn off updates by Windows utility msconfig.exe. Response from…
-
6
votes3
answers17342
views