Posts by Guilherme Agostinelli • 2,139 points
37 posts
-
17
votes7
answers11287
viewsA: Is it wrong to write byte of images into the database?
You can write bytes of image directly into the database when your concerns do not include: Bank space (due to high cost) Access speed However, saving the image path to the bank can cause certain…
-
4
votes1
answer1551
viewsA: Move image inside a picturebox with the mouse without using the scrollbar
A possible solution would be to use the event Mousemove of your Picturebox to apply the scrolling according to the change in position of your cursor: // Variáveis globais: int posXInicial; //…
-
4
votes1
answer8024
viewsA: How to determine permission to use tables?
One of the ways to do this is through GUI SQL Server Management Studio. Note: I will describe step by step using the reference 2008, but I believe they are similar if using another version. To deny…
-
4
votes1
answer429
viewsQ: Inappropriate behavior when stretching image
I have the following html code: <figure> <div id="test"> <a href="#"> <img class="wideStretch" src="caminhodaimagem/img1.jpg" alt="Img 1" /> </a> </div>…
-
3
votes1
answer755
viewsA: How to resolve "Array required, but (Class) found." error?
The error happens because you are using the property length directly into the object (teste) of your class Carta. Instead, you can access the array that belongs to your class (assuming it is public…
javaanswered Guilherme Agostinelli 2,139 -
3
votes2
answers1880
viewsA: Variables with Bigdecimal
This happens because the method add only returns a Bigdecimal. To correct, simply assign the sum to the total value: valorTotal = valorTotal.Add(newQtd2);…
javaanswered Guilherme Agostinelli 2,139 -
1
votes1
answer2398
viewsA: Problem when calculating average
Your code presents some problems: Media is already the name of the class, therefore it should not be used to designate the name of a method because in this way it is confused with a possible…
javaanswered Guilherme Agostinelli 2,139 -
6
votes1
answer731
viewsA: Incrementing the Assemblyversion
In that case, by * in your file AssemblyInfo.cs you are getting the amount of seconds passed since midnight (following the Coordinated Universal Time) divided by two. To make the increment with only…
-
2
votes3
answers4604
viewsA: Count characters without empty spaces
Alternatively, you could use a function where the entire string was traversed and the isspace was used to restrict counting of blank characters: #include <ctype.h> using namespace std; int…
-
8
votes2
answers338
viewsA: Handle price in stock control
As money manipulation needs care it is really not interesting to use floating points, because arithmetic operations with them result in certain inaccuracies. The data type recommended for this is…
javaanswered Guilherme Agostinelli 2,139 -
3
votes3
answers2284
viewsA: Doubts binary search
Well, the speed with which the processes needed to make binary search viable are performed is directly associated with number of times that they are executed. In this case, if the vector is not…
-
2
votes4
answers1506
viewsA: Direct method call in instance
This is not possible in versions prior to PHP 5.4 Unfortunately you need to use the second form, but in newer versions simply add parentheses around your instance: print (new…
-
12
votes5
answers20688
viewsA: How to verify similarity between strings?
I believe that the levenshtein’s algorithm be a solution that meets well what you are intending to do, since with it it is possible to know the number of modifications through which one word needs…
-
6
votes4
answers616
viewsA: Trouble finding prime numbers
The problem is that as you decrease the value of i, one hour it will be worth 1 and you will be dividing a by 0: b = a / (1-1); Simplifying your logic, you could create a function that checks…
canswered Guilherme Agostinelli 2,139 -
8
votes5
answers6123
viewsA: Physical Exclusion vs Logical Exclusion
Well, the advantage or disadvantage of the two types of exclusion depends very much on your system’s needs. Before deciding what is the best practice for your case, I recommend paying attention to…
sqlanswered Guilherme Agostinelli 2,139 -
2
votes2
answers5124
viewsA: Copy Strings in C
Just put the index, because then you specify the position of your 2D array you want to copy the value: strcpy(matriz[2], aux);
-
2
votes2
answers631
viewsA: Program "jumping" Variables
The problem is that you have changed the position format specifier. Instead of f%, trade them in for %f. Also, for the calculation to be done correctly, add a scanf to the height: scanf ("%f",…
-
1
votes4
answers1585
viewsA: How to make a "Generic Trigger" in SQL Server?
Unfortunately we can not create a Trigger generic for multiple tables. However, as the triggers will have the same purpose in all of them, you can generate them automatically, as pointed out by…
-
1
votes1
answer161
viewsA: Activex Axvlcplugin2 no event works
The most interesting in this case would be to use the Mediaplayerpositionchanged event itself to get the current position. In this case, simply assign the Event Handler…
-
13
votes3
answers3841
viewsA: Why use relics in C#?
It is irrefutable that the religions facilitate the organization, but one should take some care with what really you intend to organize. I recommend using them when considering the following…
c#answered Guilherme Agostinelli 2,139 -
3
votes2
answers351
viewsA: How to recover from an Exception and send data from it?
You can use the class System.Net.Mail to send an email. For this, include it in your archive Global.asax: using System.Net.Mail; And use the following code: void Application_Error(Object sender,…
-
7
votes2
answers2118
viewsA: How do I set a Radiobutton to default?
To leave a Radiobutton marked just change its Checked property to true. You can do this in the Properties window or via code, for example in the Load event of your form: private void…
-
1
votes2
answers3377
viewsA: How to count lines of code in a . NET Solution?
Just go to the Analyze menu -> Calculate Code Metrics An alternative would be to use Powershell, where you can count all the lines that are not blank from a Solution. To do this, simply specify…
-
6
votes2
answers4823
viewsA: How to access a specific RAM location by address?
As already pointed out, you cannot say explicitly where a variable will be stored in memory, not least because many things are done by the operating system with respect to the memory itself (which…
-
5
votes3
answers2384
viewsA: Media Player Classic libraries in my Windows Form project
You could use a Ffmpeg Wrapper to convert videos to some format supported by Windows Media Player at your discretion or try something with Vlcdotnet, since it also works together with Ffmpeg. In my…
-
0
votes3
answers1123
viewsA: Error in C# function to increment variable
The problem is that as the parameter pt becomes a copy of pt1 the moment you call the method incremento, only the value of pt (within the method) is modified, while pt1 (outside) remains the same.…
c#answered Guilherme Agostinelli 2,139 -
4
votes2
answers1874
viewsA: How to put buttons/titles with different design/style in C#?
For buttons or titles with different designs you could simply use a Picturebox and place a specific image. Now, if you want something a little more complex, you can create a class by inheriting the…
-
-1
votes2
answers16023
viewsA: How to Update PHP Version on Wampserver?
You can find several PHP Addons to download here, then just install the new version of PHP and ready. Now, if you prefer to do the whole process manually, I believe that discussion (in English) from…
-
8
votes5
answers1698
viewsA: How can I ask the user for confirmation in a bash file?
To request a confirmation you could also use the following: echo "Confirmacão... (sim/não)" read CONFIRMA case $CONFIRMA in "sim") # ... # ... ;; "não") # ... # ... ;; *) echo "Opção inválida." ;;…
-
0
votes8
answers1132
viewsA: Can you use a variable above when it is declared below?
Unfortunately it is not possible to include a file. php after the code that depends on it as already pointed out in the answers; in my view, it is even simpler to include the files that the code is…
phpanswered Guilherme Agostinelli 2,139 -
4
votes1
answer437
viewsA: Pointers with methods, where am I wrong?
Since the intention is to initialize the vector and then display it, you could simply pass the desired values to the class, not needing any parameters in the declaration of your method assign():…
-
20
votes1
answer6546
viewsA: Naming conventions for variables and functions in Python?
According to the own nomenclature conventions Python Enhancement Proposal 8, some concerns include: Avoid certain names Never use the characters 'l', 'O', or 'I' as variable names because in some…
-
3
votes1
answer2112
viewsA: Can a foreign key reference more than one table?
A foreign key cannot reference more than one table; in fact, this would go against the principles of data logic modeling itself. The most correct way to relate the tables in the mentioned example…
databaseanswered Guilherme Agostinelli 2,139 -
11
votes2
answers3085
viewsA: How to do a spell check in C#?
If you don’t mind the fact that the spell checker is under the GPL license, a good solution would be to use the Nhunspell. You can get one of its latest versions here. After adding Nhunspell.dll to…
c#answered Guilherme Agostinelli 2,139 -
2
votes1
answer79
viewsA: How to add "Buttons" to Tabbedpanel
To add a button to some component, you can use the method Add. In case, to add it to a Tabpage of a Tabcontrol, you could pass the first as parameter of your method: public void…
-
1
votes2
answers1634
viewsA: How to create reports in Cristal Report with data from 2 or more tables?
Something interesting would be to put in your project a Dataset and add to it the tables you will be working with, these being accompanied by an additional Tableadapter that is built from your query…
-
0
votes3
answers263
viewsA: Intellisense disappears when the list of arguments is large
An alternative would be to choose a different font or reduce its size through the menu Ferramentas-> Opções-> Ambiente-> Fontes e cores And choosing Dica de ferramenta do Editor on the menu…