Posts by CypherPotato • 9,292 points
289 posts
-
3
votes2
answers255
viewsQ: How to make a horizontal line between two <td>?
I have a <table> divided into two columns, and I need that in the vertical middle of each column have a line starting from the <td> from the left to the <td> right, in this format:…
-
17
votes2
answers218
viewsQ: What is this !! operator in PHP?
I was analyzing a code in PHP and came across the following: $result = !! $row; return $result; What is this !! and what he does?
-
3
votes1
answer486
viewsA: Is it worth encrypting database?
This is not an answer that is given to a global scenario, because much influences the decision to be made, among them: The degree of confidentiality of the information stored in the bank; Machine…
-
2
votes1
answer44
viewsQ: config() does not return what was configured
I have a class Foobar.php that in it have a return [] with some items that are pointed out from .env, in this format: Foobar.php: function decode_ifnot_null() {} ... // método que auxilia na…
-
2
votes1
answer30
viewsA: Bug when using array_diff_key() function
You are comparing the two arrays using the keys as the middle between the two arrays. In your example, the keys are identical, so it will not produce the result you expect. The function you need is…
-
3
votes1
answer79
viewsQ: What are Widening and Narrowing conversions?
I’ve heard that term in type conversions on . NET, but I don’t know if that applies to other platforms and/or languages. I have no idea what these terms are, so what is a conversion Narrowing and a…
-
3
votes1
answer180
viewsA: Implement Save As and Save in C#
Once when you save the file, you will need to first specify where this file is from. When it is the first time that will save the file, it is indifferent to the action of the button Save and Save…
-
1
votes2
answers55
viewsA: Use Relative Form in Usercontrol
You are trying to instantiate a class that does not exist, so the compiler will indicate that it does not exist (obviously). When you try to invoke the new Formulario, he will search for the class…
-
3
votes1
answer515
viewsA: What differs an FPGA to a CPU?
The main difference between a CPU (Central Processing Unity) and a FPGA (Field Programmable Gate Array) is the flexibility in construction. A common processor (CPU) processes instructions at the…
-
5
votes2
answers189
viewsA: Are HTTP headers case sensitive or case insensitive?
No. HTTP headers are not case sensitive. Here in reference HTTP/1.1 in section 4.2 you are saying this. HTTP header Fields, which include general-header (Section 4.5), request-header (Section 5.3),…
-
2
votes1
answer105
viewsA: Creating an object with a random internal datum (Random)
It’s because you’re instantiating several Random in a super short time period (less than a millisecond), and there is no time for the Random alternate its seed, and consequently generate a random…
-
0
votes2
answers212
viewsA: C# How to make a string function execute active command?
Pass a Array parameters, or only the parameters, you want to instantiate your class Main right in the builder of the same: 1. Example using Array parameter public void Button1_Click(object sender,…
-
21
votes4
answers694
viewsQ: Why not comment on the code?
After reading a bit of Robert C. Martin’s Clean Code, he says that it is no use to "make up" a bad code with comments, in other words, try to explain a gambit made there. It is also quoted about…
-
-2
votes3
answers154
viewsA: How to "mount" a multiple variable?
It is not possible to do this, at least not in C#. However, you can use reflection for this, however, the variables will need to be public and static and outside the scope of void. public class…
-
1
votes1
answer82
viewsA: Pull a C# form in VB
If you want to include the file Loading.cs in its Visual Basic project, that is not possible. Compilers handle only one language type in the same project. You will have to rewrite the C# code in…
-
0
votes1
answer575
viewsA: File upload problems in Multipart/form-data. C#
Really need to use HttpWebRequest? You can reduce all this code by making a request POST on the server with this code snippet using WebClient: public string Upload(string filePath) {…
c#answered CypherPotato 9,292 -
4
votes1
answer85
viewsQ: Why use parameter modifiers?
While writing functions and subroutines, we use parameters to interact with the function algorithm. These parameters can have several purposes, such as passing a value, a reference, or leaving a…
-
4
votes2
answers2190
viewsA: Convert string to float on C#
The Float is called Single no . NET Framework. Use the class System.Single to perform conversions float. float numero = global::System.Single.Parse("2.5"); C# uses the default C language and has…
-
5
votes1
answer281
viewsA: Is Winforms dead now?
It’s exaggerated to think of the way Windows Forms is dead the way I thought .NET Framework was dead. Although both are being replaced by newer, innovative and modern technologies, they continue to…
-
3
votes2
answers306
viewsA: Find time within a range of hours
The expression is checking if the time is within the specific period, but you are not counting if the period is another day, so if it is past 24 hours, the result will not be within the field of the…
c#answered CypherPotato 9,292 -
1
votes2
answers176
viewsA: Doing a LINQ function that can be called in an EF query
I did some research and found snippets saying you should use List<> as a function of working with rotating objects. So try to add the method Tolist() before the .Where: public static…
-
23
votes1
answer1547
viewsQ: Is the . NET Framework dead?
In a small discussion with Maniero, in this answer, he said about the . NET Framework infrastructure: We’ll start talking about . NET or even BCL because the . NET Framework died. Why is . NET…
-
1
votes1
answer52
viewsA: iText - How to Use "For Each" in VB.NET
Make a For Each inside ListBox.SelectedItems: For Each listaItem In ListBox1.SelectedItems Dim listarNomes As String = ListBox1.GetItemText(listaItem) Dim data As String() = {listarNomes} For i As…
vb.netanswered CypherPotato 9,292 -
2
votes2
answers701
viewsA: Combobox read only
The Combobox there is a property called DropDownStyle, in it there is a value where you choose to DropDownList, thus, the user will not be able to type in its checkbox, nor copy its values.…
-
3
votes3
answers685
viewsA: Prevent the CMD command interpreter from using the operators passed via parameter/argument?
The native Windows Command Prompt will operate all characters that are not escaped or encrypted in "...". What’s left to do is: create your own CMD. I wrote a code that has the same function as the…
-
2
votes1
answer81
viewsA: Force Field Attribute C#
Mandatory by nature does not, but when assigning or declaring this class, you can make it mandatory to use parameters in the constructor: class TipoServicoAttrib : System.Attribute { public…
-
1
votes2
answers65
viewsQ: Vertically indent code in Visual Studio?
In addition to this question, I come here to ask: how do I do the same process in IDE of Visual Studio? (this does not hold for Code! ) Since, automatically it transforms from it: var small_var =…
visual-studioasked CypherPotato 9,292 -
0
votes2
answers1571
viewsA: Receive text typed in input text, put in variable and apply in link
In this code nothing will occur, since this action is totally wrong. action should call a POST API, but without passing parameters with PHP name on it. What you want to do would be more or less:…
-
0
votes3
answers75
viewsA: Definition of "arrows" in PHP
These arrows are the operators that associate indexes to values in arrays. It functions as a kind of dictionary, where 'chave' => 'valor'. Using the keys, they will work as indexes, and you will…
-
4
votes3
answers685
viewsA: Prevent the CMD command interpreter from using the operators passed via parameter/argument?
Pass the arguments chained with "". This way, the Console will not interpret what is inside the character set. echo olá >> mundo The above command will create a "world" file with the contents…
-
1
votes1
answer141
viewsA: Parent form superimposing child form C#
You could use the ShowDialog instead of Show. ShowDialog locks focus to invoked window: private void Button1_Click(object sender, EventArgs e) { frmlancar lancar_serv = new frmlancar(); // Define…
-
1
votes2
answers582
viewsA: Is it possible to run an . EXE application from a Windows Service?
That is not possible. Windows services cannot run executable applications or invoke them, unlike Windows applications like Winforms, Console or WPF. Your code will work in any application other than…
-
0
votes2
answers163
viewsQ: How to make an ASP.NET Core Post API without using MVC?
I don’t work with ASP.NET Core Apis until I need it for a project written in C#. So I created with a standard project, with the following controller: [Route("api/[controller]")] [ApiController]…
-
8
votes1
answer176
viewsQ: Deep, Machine Learning and AI. What are your differences?
About Deep Learning, Machine Learning and Artificial Intelligence, what are your main differences? What are your principles? They are all who can learn and solve problems of their own nature? How to…
-
9
votes3
answers559
viewsQ: What’s the best way to play a Loop in math?
I needed to represent and document an arithmetic algorithm in a mathematical notation, the problem is I can’t find the best way to represent a compound loop for that. Suppose we have the simple…
-
0
votes2
answers128
viewsQ: Which type is inherited from an . NET array?
If we declare a List, we are sure that your type is explicitly the System.Collections.Generic.List<T>. But when we declare one array? What is the generic type implemented behind it? Example:…
-
5
votes1
answer696
viewsA: condition to prevent textbox null
You can check whether a value is null in several ways. After all, what you consider null? We have to consider the difference between null and emptiness, or whitespace. Null is when a variable has no…
-
1
votes1
answer1137
viewsA: How to take an input value and manipulate in Behind
I think you just need to put one runat="server" in its input: <input type="text" id="dinheiro" name="dinheiro" runat="server"/> And so, you can get the content of the control here: string…
-
2
votes1
answer278
viewsA: How to change the function of my save button, to change
You can create a condition by specifying whether the object has already been saved, and if true, indicates that the button will make a change. bool informacoesSalvas = false; private void…
-
1
votes1
answer767
viewsA: Access methods from another Form
The method does not really exist in the context where it is being called, for it is being called as if it were a member of Cadastrar. It has not been specified where this method is or where you will…
-
2
votes1
answer259
viewsA: Check if it is a list in c#
You can check if the type implements the ICollection<>, since this interface is required in all collectible classes. Put this check above all other checks: if (valor is ICollection) { // vai…
c#answered CypherPotato 9,292 -
3
votes1
answer446
viewsA: C# - CPF Mask
The contrary method of Enter is the Leave. Leave is thrown when the control loses focus, Enter, is thrown when a control gains focus. You can associate this with this event without needing to create…
-
2
votes1
answer54
viewsQ: How to lock a method so that others do not call while it is used?
I have a simple method of log, which adds some lines to a special file. The problem is, the application is multi-threading, and in each Thread is called this method to log, and when one is called,…
-
0
votes2
answers68
viewsA: How to take what was returned from a Task
If you are trying to make this instruction work without interrupting the running code operation, I recommend using a TaskFactory. Observing: if it is a STA/Windows Forms application, put this line…
-
0
votes4
answers370
viewsA: I don’t know how to use the method of converting images in Xamarin.forms.
Let’s analyze this method. There are several defects in it, I will explain one by one. The parameters of the method culture, parameter and targetType were never used. Since you want to convert an…
-
3
votes1
answer80
viewsQ: Is it possible to include the necessary . NET to run a standalone application?
The title may be confusing, but the goal is to make an application written with . NET run without the . NET Framework. In practice this is almost impossible because the application depends on the .…
-
8
votes1
answer107
viewsQ: What does @ do in variable names?
In the response code of this question on Soen I found an unfamiliar statement line on C#. I tested this line and it works, but I didn’t understand the meaning of this character @ behind the member’s…
-
0
votes1
answer84
viewsA: View document in pdf using printdocument
You will need an external library to do this, called Pdfsharp. It is the one that receives the most praise on the .NET. After including the library in the project, you will have to convert Graphics…
c#answered CypherPotato 9,292 -
0
votes1
answer394
viewsA: How to make an event run only when the mouse is pressed
The fastest solution that can be done is with the function GetAsyncKeyState using a Timer. Option Explicit Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer '…
vb.netanswered CypherPotato 9,292 -
4
votes3
answers179
viewsA: How to remove character from a String and turn it into integer value with PHP?
If you are not calling decimals, commas and want to extract only numbers from text, do the following: $str = $_SESSION['valor']; preg_match_all('!\d+!', $str, $matches); echo $matches; The exit will…
phpanswered CypherPotato 9,292