Posts by CypherPotato • 9,292 points
289 posts
-
4
votes2
answers114
viewsQ: What is a daemon?
I know that "demon" comes from Latin daemon, but I believe that word has another meaning in the technological environment. What is a daemon? What do you eat? What’s the point?
nomenclatureasked CypherPotato 9,292 -
0
votes2
answers42
viewsA: combobox C#, Selectedtext vs Selecteditem.Tostring()
The first quoted, ComboBox.SelectedItem returns a Object text if you have a selected item there, or null if there is no item selected in the control. Already the ComboBox.SelectedText will return a…
-
1
votes3
answers90
viewsA: (C#) How can I replace a specific character "x" with "y" in a String?
How you specified the tag regex in your question, to do the same thing using regular expression would be the equivalent of: using System.Text.RegularExpressions; string s = "@@bbb@"; string S =…
-
0
votes2
answers21
viewsA: Laravel , how to display image through class
Blade shortcodes in Laravel do not work on files .css, view files only (.blade.php). In this case, to put variables in CSS, you will have to pass using the tag style object in Blade view. Styles.css…
-
2
votes1
answer37
viewsA: Remove part of data entered by the user
You can extract the ID from Youtube links using PHP’s URL manipulation tools. $url = $_POST['link_video']; parse_str( parse_url( $url, PHP_URL_QUERY ), $saida_de_variaveis); echo…
-
5
votes2
answers1125
viewsA: What current languages are used for Windows application development?
Officially are maintained four technologies by Microsoft: Windows Universal - which is Microsoft’s latest technology made essentially for devices that work on Windows 10. These applications can be…
-
1
votes1
answer141
viewsA: C# Array number next
You can use Linq to get this number, and even briefly the index in the Array where it is. Don’t forget to import the library System.Linq at the beginning of the code. double[] arr = new double[] {…
-
1
votes1
answer155
viewsA: file_get_contents() error!
You are not replacing the $formCEP in your String. When you use single quote strings, interpolation does not work. To resolve, use double quotes. <?php $formCEP = "15047200"; $formCEP =…
-
6
votes3
answers167
viewsA: Why when rounding the sum of two numbers, the result is Nan?
When you declare numero1 = '1,10', you specify that numero1 is originally a String, and therefore the result of parseFloat return a float briefly converted to String, which does not make the object…
javascriptanswered CypherPotato 9,292 -
0
votes2
answers53
viewsA: Change picture box by clicking on a label
You can make a global response variable that the user selected and save in it the value of Label clicked. And whenever calling the Limpa(), the value of this variable is reset. After having the…
c#answered CypherPotato 9,292 -
5
votes2
answers180
viewsA: Exchanging last letter of a word using the 'replace() method
This is happening because the letter the is repeated twice. One at position 2 and the other at position 6. This way replace the first occurrence only, not the second or third. You will not succeed…
javascriptanswered CypherPotato 9,292 -
11
votes2
answers291
viewsA: Cmd text box functionality for Git
You can use the set /p to request the entry of information and associate to a variable. The syntax is: set /p nome_da_variavel="Texto de solicitação: " In its code, it would be the equivalent of:…
-
2
votes2
answers168
viewsA: Delete/Destroy html table via javascript
First you need to declare a method to remove the element by its ID: Element.prototype.remove = function() { this.parentElement.removeChild(this); } NodeList.prototype.remove =…
-
7
votes1
answer197
viewsA: What is a Pentester?
There is difference between the four professions yes, and answering your question, Pentester It is also known as Penetrator, Evaluator de Invasão. As your name already says, a Pentester is…
-
0
votes2
answers613
viewsA: Align icons and text in a list
You can define a width fixed to icons, as in this example: .fa-spacing { width: 1.25em; text-align: center; } <html> <link…
-
1
votes1
answer802
viewsA: Expand and Collect div
You can use the Collapse Bootstrap to create a container that opens and closes. <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"…
-
5
votes1
answer3160
viewsA: Except Print Screen C#
You won’t make it without understanding how Directx works before. Games have an isolated rendering environment of the operating system, and in their code is using the Windows API to capture the…
-
2
votes1
answer75
viewsA: Replace chunk of code C#
You want to make login and password variable and stop being literal, but to do that, you need to take these variables from somewhere. If you want to take from another form, you will have to…
-
1
votes1
answer55
viewsA: Catch all words between 2 characters
The method Regex.Match will only return the first occurrence of what you found in the entry. To get all the results, use the method Regex.Matches, in which returns all occurrences. public class…
-
3
votes1
answer315
viewsA: Cannot implicitly convert void to string in abstract classes
The structure is wrong for what you are trying to do, if, what you are trying to do is print the class functions in the Console. You currently have the class structure: class DevilHunter { public…
-
0
votes2
answers717
viewsA: Run command as Admin c#
Try to do alternatively, calling the prompt already with the command to run: Process myProcess = new Process(); myProcess.StartInfo.FileName = "cmd.exe"; myProcess.StartInfo.UseShellExecute = false;…
c#answered CypherPotato 9,292 -
4
votes2
answers327
viewsA: I’m having trouble picking a value between two strings in PHP using REGEX
That’s right, but with a little addition: \{#(.*?)\} The character ? right after a * means "the least amount possible", contrary to * alone, which is "as much as possible". After this group he looks…
-
9
votes1
answer443
viewsQ: Is Laravel’s Blade a programming language?
After a brief discussion of why the HTML is not a programming language, characterize that not because it is not able to perform calculations, make decisions, change information contained in some…
-
1
votes1
answer49
viewsQ: Why use local functions?
Recently it was introduced in the C# 7.0 local functions, where you can create unsigned functions or methods within other nested form methods/functions. int MinhaFormula(int x, int y) { int y = x +…
-
6
votes3
answers170
viewsA: How to change property access level in an inheritance?
You can’t do this. In C#, when a method has a public signature, public use of it is required, regardless of its redeclaration. You can redeclare a method with the same name in the child class using…
-
14
votes1
answer226
viewsA: What is a Vaporware?
There is no specific rule to qualify a product as Vaporware, and I will explain why. Let’s start with your definition: vaporware is that never released release. Normally you never associate an…
-
4
votes2
answers1661
viewsQ: Laravel: Cannot add Foreign key Constraint
I have two tables, the table users and empresas, with Model User and Empresa respectively. A user registration can manage a company, and for that, I need to define which id the user will access in…
-
12
votes2
answers143
viewsQ: Why does CSS have so many units of measurement?
After the window appeared auto-complete, I came across the following: and then I wondered: why the CSS has so many different units of measures?…
-
10
votes4
answers94
viewsQ: How do I make the CSS class not affect anyone who has a particular class?
I have a ul where it is a menu in which items that are not inside a ul son have the tag dropdown-toggle. The items that are in ul son doesn’t have that tag. The class .navbar-solid is applied to…
-
1
votes1
answer69
viewsQ: How to manipulate an empty filter?
I need a logic that displays a <Text> saying that there are no items when the produtosArr.filter() is empty (or when the filter does not return anything to me).…
-
1
votes2
answers322
viewsA: What does a semicolon mean after an "if"?
Ali is just saying that there is nothing. Put a ; without any expression before it’s like there’s nothing on that line. Therefore, if( cb < 30 ) { ; } // é a mesma coisa de if( cb < 30 ) { }…
-
1
votes2
answers102
viewsA: Bitdefender false positive when compiling using Debug Visual Studio 2019 mode
The use of obfuscator makes your application suspicious because you are intentionally hiding your source code. There is no other purpose for an obfuscator than to hide the construction of a binary…
-
1
votes1
answer129
viewsA: Change name and surname in a string
It seems that you want to put the first word at the end of what is returned. So, you can: public static string NomeAutor(string autor) { if(autor.Trim() == "") return ""; string…
-
1
votes1
answer47
viewsA: Start button / pause
I do not recommend using the Timer for this operation, since the Timer is an event repeater after a certain period, not a chronometer. But the . NET has a chronometer class, called…
c#answered CypherPotato 9,292 -
0
votes1
answer598
viewsA: MVC architecture - Windows Forms
Windows Forms does not follow any MVC concept, but you can implement as you wish. Also, it makes no sense to want to use MVC in Winforms. In contrast, Windows Forms is highly scalable. Views can be…
-
20
votes3
answers296
viewsQ: What are God Objects?
I was reading the documentation of Woocommerce, and I came across the following line: Avoid God Objects God Objects are Objects that know or do Too Much. The point of Object-oriented Programming is…
-
7
votes1
answer88
viewsQ: Can qubit be represented in Boolean?
A bit can have only two states: true and false. In quantum computing, the qubit, or quantum bit, in which you can assume true and false simultaneously. How this is represented in boolean form? Or…
-
7
votes1
answer116
viewsQ: Are the new self-contained . NET executables really native?
In that question here, was discussed about whether there is a need to install . NET 5 (or .NET Core 3) on the machine to run compiled executables, and the answer is: No, the . NET 5 is not…
-
5
votes1
answer116
viewsQ: How to find the intersection between a line and a mathematical function?
I have a problem where I need to find the intersection of two mathematical functions. I have the formula of the first function and two coordinates, where ab and cd are my points. To pass these…
-
0
votes3
answers588
viewsA: Return of request status code
If you cannot have a null value there, associate it to some number using the ternary operator ?:. ... var httpResponse = (HttpWebResponse)request.GetResponse(); status = (httpResponse != null ?…
-
2
votes1
answer20
viewsA: Change Array Structure in PHP
You can use the array_values to create a array where you have only the values, and therefore the keys will be indexes and not keys: $array = [ "aaa" => 12581, "bbb" => 182, "ccc" => "valor"…
phpanswered CypherPotato 9,292 -
14
votes1
answer335
viewsQ: Why don’t we have a 128-bit Integer?
We have 16, 32 and 64 bit integer values. short, int and long, respectively. But why don’t we have 128 integers? Or 256 integers? I ask this in case we need to keep an extremely large number that…
-
2
votes2
answers47
viewsA: How to access the data in a variable of type double[ , ] in C#
Complementing what Ladynoob explained, you can iterate the dimensions of a vector matrix and briefly its elements. On the basis of language, you end up having a matrix interpolated positions. int[,]…
-
2
votes2
answers312
viewsA: Asterisk tree algorithm *
I made one simpler yet, which only uses four lines of code. const int linhas = 5; for(int i = 0; i <= linhas*2; i++) if(i % 2 != 0) Console.WriteLine(new string(' ', (linhas*2 - i) /2 ) + new…
-
5
votes2
answers557
viewsA: Divide in equal parts c#
If you want to divide a vector X for Xn items, and store in a vector where t = Xn / l(t), assuming that l be the item count in t, and then you can go through them and modulating your index for each…
c#answered CypherPotato 9,292 -
2
votes1
answer44
viewsA: File link in a directory in the email
You can use the protocol file to open a local archive in a path absolute: string link = @"file:\\C:\caminho\para\o\arquivo.txt"; MailMessage msg = new MailMessage( "[email protected]",…
-
2
votes1
answer686
viewsA: How to mount foreach to pick array values
You don’t need the foreach for that reason. $data = $row_rs["dataBoleto"]["data"]; $barcode = $data["barcode"]; $link = $data["link"]; $charge = $data["pdf"]["charge"]; If you need to go through…
-
0
votes4
answers75
viewsA: Find item in array
Your code is full of problems, but I’ll try to show you one by one here. I understand you’re making a call by curl and who wants to manipulate the answer, so let’s go: // $url está sendo declarado…
phpanswered CypherPotato 9,292 -
6
votes2
answers89
viewsQ: Backslashes on the way: do they influence anything?
I never understood why some systems use the \ and others use the / for the same purpose: to divide paths and addresses. There is no pattern from which to use, or at least couldn’t find a. While…
-
3
votes1
answer101
viewsA: MPDF mounting with php foreach , bootstrap and html
You are concatenating a foreach, and that’s a syntax error. foreach is not an expression or method to be concatenated. The ideal in this scenario is to dispose the contents of the foreach directly…