Posts by Maniero • 444,682 points
6,921 posts
-
11
votes2
answers869
viewsA: What is Finally for in PHP 5.5?
Essentially it is to ensure that the flow of that block always runs. Even if an exception occurs in the block started by try, the block of finally will run before exiting the function and start to…
-
2
votes1
answer1315
viewsA: Error while exporting to Excel (Corrupted file)
I don’t know this library and I don’t know if there’s any specific problem using it but this code is weird. I imagine the first parameter of xlWorkBook.SaveAs be the file name. Then pass the file…
-
11
votes2
answers2240
viewsA: How does C99 work in relation to C90 for declaring variables in the middle of the code?
Not quite so, has several wrong assumptions in the question. What hasn’t changed This is an issue that has not changed the implementation of the programme at all. This change is purely a new way for…
-
2
votes2
answers660
viewsA: Print associative array element inside string without concatenation
Interpolation of string only works when you use double quotes. But it has the drawback of having to use single quotes elsewhere. You can also use Nowdoc. See the examples below: $video =…
-
2
votes2
answers822
viewsA: How to return more than one database Entity in a LIST?
In fact it is a problem. As I have never used anything so I do not know if you have a better solution than the below. You can create a class to receive this new type created by this query, then you…
-
8
votes4
answers10421
viewsA: How can I get a date (day, month, year, time, minute, and second) converted into milliseconds in Java?
It depends on how you want to use it has several ways, one of them can be: import java.util.*; import java.lang.*; import java.io.*; import java.text.*; class Ideone { public static void main…
-
1
votes1
answer5171
viewsA: Check if field is empty using custom C reading function
I had to make some changes to compile. The code didn’t even compile in my compiler with the settings I use. I put a if within the while because the reallocation and addition of character to the…
-
4
votes1
answer255
viewsA: Directly manipulate $_GET and $_POST variables
There is nothing to stop you from manipulating this variable. I don’t know anything that indicates that it will create a problem. There is nothing in the documentation that says you should avoid.…
-
1
votes1
answer399
viewsA: How to open a packaged executable in the project?
Use: File home = new File(System.getProperty("user.dir")); File file2 = new File(home, "files/meuprograma.exe"); Runtime.getRuntime().exec(file2.getPath()); I put in the Github for future reference.…
-
18
votes4
answers53244
viewsA: Different ways to count record numbers in Mysql
The basic technique for counting records is: SELECT COUNT(*) FROM tabela Has two reasons: This will only run the count (a very short single line) and not all table data. This makes a huge…
-
11
votes5
answers2024
views -
2
votes1
answer537
viewsA: Internationalization, Localization and Globalization
I do not know if there is a solution ready that meets you and give you a really would be a very broad response. I can give you a solution in general terms, something I’ve already used in my…
-
17
votes1
answer3430
viewsA: In the new browsers now there will be no more synchronous requests?
Yeah, that’s the idea. Look at specification: Synchronous Xmlhttprequest Outside of Workers is in the process of being Removed from the web Platform as it has detrimental effects to the end user’s…
-
3
votes2
answers153
viewsA: Alternative to the use of new when implementing methods that return this in child classes
I will say that I do not know if it solves the problem but at least it helps to have ideas: using System.Console; public class Program { public static void Main() { var pai = new Pai();…
-
6
votes5
answers1879
viewsA: What is the difference between an explicit cast and the operator as?
Cast classic private void textBox1_Leave(object sender, EventArgs e) { TextBox textBoxTemp = (TextBox)sender; MessageBox.Show("Você digitou: " + textBoxTemp.Text); } Are you absolutely sure sender…
-
4
votes2
answers1201
viewsA: Identify USB stick
It is not a trivial task so it is difficult to put a complete solution here on website. The way is to use the Windows API to build a detection engine. I found some examples on the internet. What…
-
2
votes1
answer235
views -
2
votes2
answers196
viewsA: Error closing Forms
It makes perfect sense for this to happen since the Application.Exit() as demonstrated the documentation triggers the event that will run your frmAgent_FormClosing. When you arrive at this method…
-
7
votes2
answers1760
viewsA: What is the difference between "!=" and "<>" in PHP? What to use?
None, they are exact synonyms. They are just different ways to write. Choose which one to find more comfortable. I see that it is more common to use the != to be symmetrical with the == ("equal"),…
-
8
votes4
answers37758
viewsA: What is the difference between "&&" and "||" and "and" and "or" in PHP? What to use?
This is logical operators always result in a boolean value (true or false) and are often used where a conditional expression is expected. && results in true if his two operands are true,…
-
14
votes1
answer2407
viewsA: How to update my Mysql code to Mysqli?
In most cases just change everything that starts with mysql for mysqli :) Of course not only that. There are some differences of parameters and some different functions. Have you seen the…
-
106
votes6
answers66144
viewsA: Type of the CPF or CNPJ field in the VARCHAR or INT database?
Optimization should only be done if it is really very necessary. I doubt that this optimization is worth in any scenario. The basic rule for selecting the type when they can be confused is what you…
-
12
votes3
answers13619
viewsA: How to split a string into an array in Javascript?
Yes, there is, it’s using the split(). var x = "FAT* FAT32*"; var array = x.split(" "); console.log(array[0]); console.log(array[1]); I put in the Github for future reference.…
-
16
votes3
answers4364
viewsA: What are decimal, hexadecimal, and octal notation numbers?
This is known as positional notation. It’s the way we represent numbers. Decimal To decimal representation Everybody knows it, it goes from 0 to 9 and as far as I know it’s like this because of the…
-
2
votes1
answer785
viewsA: Create a shortcut through the Navigator
Is not possible. The browser is a sandbox. This is necessary because it allows you to execute arbitrary codes created by strangers on the user’s computer. It takes a lot of restraint to keep this…
-
14
votes3
answers1593
viewsA: Function as parameter in jQuery functions
Your attitude is commendable I wish more programmers were like this. These functions are called callback. They are created precisely to respond with an action to something that the environment where…
-
2
votes2
answers86
viewsA: How to develop for Windows Phone 8 using Visual Studio 2013
This is irrelevant today. To official recommendation is to use VS 2012 if you really need it. But it talks about installing the 8 SDK optionally in VS 2013. In fact in that reply in the SO shows…
-
5
votes3
answers325
viewsA: Prevent the system from locking during a batch e-mail
The basic code for sending email messages asynchronously is this: public async Task EnviarAsync(string Destinatario, string Assunto, string Texto) { string Usuario = usuario; string Senha = senha;…
-
4
votes2
answers4158
viewsA: How to get the host name in Urls?
Maybe what you want is this: <?php $url = 'https://mega.co.nz/#!4090kJrY!LZiZBgsOo_Gg1sLnykZLHsUThAC9oaPRG3---0gD92Y'; $array_url = parse_url($url); print_r($array_url); echo parse_url($url,…
-
4
votes2
answers509
viewsA: How to read the width and height of a physical image file?
Can for some supported formats: var imagem = Image.FromFile("teste.jpg"); var largura = imagem.Width; var altura = imagem.Height; In accordance with the documentation it is possible to open BMP,…
-
49
votes2
answers1582
viewsQ: How can -1 be greater than 4?
How this code can execute in this way? #include <stdio.h> int main(void) { printf("tamanho de um inteiro: %d\n", sizeof(int)); if(sizeof(int) > -1) { printf("4 é maior que -1"); } else {…
-
58
votes2
answers1582
viewsA: How can -1 be greater than 4?
Even though my mother and some programmers think that the computer makes its own decisions, it’s only capable of doing what humans determine. Of course, a computer can produce wrong results without…
-
6
votes2
answers1652
viewsA: 2 different tables from each other
In the answer on the edge I gave an example that solves your problem. The point is that using style in table you apply to all tables. Applying styles in one id, you decide which tables you want to…
-
4
votes3
answers517
viewsA: Create table without border
It’s quite simple, there is an attribute for this (you need to search for documentation to see everything that exists in each element) although it is recommended not to use it anymore. I will use an…
-
6
votes3
answers17316
viewsA: Run external application with Javascript
It is not possible, the best you can do is to explicitly ask the user by their own will to send the file to your server and you do something with it on the server. It’s a security issue. People…
-
4
votes2
answers9275
views -
2
votes1
answer570
viewsA: Conversion of string to datetime with specific format
It had a basic format error, missing a letter d on the day and day of the week. It’s right: DateTime.ParseExact("16Mar2009(mon)", "ddMMMyyyy(ddd)", CultureInfo.InvariantCulture) Behold working in…
-
9
votes4
answers24064
viewsA: Send HTML form without the Submit button
It is possible with Javascript. Quite simply: <form name="formulario" action="form.php"> Digite algo: <input type="text" name="campo"> <a href="javascript:…
-
3
votes2
answers7907
viewsA: Convert XML to PHP array
I would not advise doing this gambit with JSON. At simplexml documentation has an example of how to create a array from the XML. function XML2Array($xmlContent, $out = array()){ $xmlObject =…
-
2
votes1
answer91
viewsA: Where can I find the Microsoft.WindowsMobile.Forms library?
Maybe your problem just put a reference to the Assembly in the project. Basic instructions for Visual Studio: Open the Solution Explorer. Right click on the mouse click on your project and choose…
-
2
votes1
answer81
viewsA: UPDATE, field with "placeholder query" failed execution
This is consistent with how the prepared queries work. They may have placeholders for values but not for all query syntax, otherwise it would not make sense to use a resource that just tries to…
-
4
votes2
answers584
views -
2
votes2
answers170
views -
10
votes2
answers1493
views -
1
votes1
answer400
viewsA: Problem uploading files
I took a test and it worked: $_UP['extensoes'] = array('docx', 'xlsx', 'pdf', 'jpg', 'png', 'gif', 'jpeg' ); $extensao = @strtolower(end(explode('.', "nome.doc"))); if (array_search($extensao,…
-
4
votes1
answer283
viewsA: Intercept methods
What you want is a software Profiling. You will not be able to do something directly in the code that works properly and does not bring other problems. Some examples: jmap. Visualvm. Java Mission…
-
62
votes3
answers5311
viewsA: When to use var in C#?
There are situations where one of the two forms is "required" and others which, anticipating the long answer, is a matter of taste. And just to make it clear that we are talking about local…
-
3
votes2
answers255
viewsA: Can the webservice set a limit memory usage for who queries it?
The basic question is quite easy to answer: yes, of course, it can. Any program can set limits as it wishes. Ideally, especially webservices has limitations to prevent abuse. But by link posted it…
-
1
votes1
answer110
views -
6
votes1
answer148
viewsA: Import is not working
You will have to add a reference to the project. The fact that you put it in the code you want to import does not indicate where the Assembly containing this namespace. Has documentation that talks…