Posts by André LFS Bacci • 933 points
39 posts
-
3
votes2
answers92
viewsA: What term should I use in English for "dereference" a pointer
People are not very familiar with this because it is in fact a new knowledge for many people. It is a very strict and new concept in relation to the vocabularies of spoken languages, also. Which is…
-
-1
votes1
answer53
viewsA: Unwanted automatic insertion occurs every time the page is updated in PHP form
Are separate things: First, this page was created with an HTTP request of type POST. Giving Reload on a POST request triggers this browser alert. According to, this page makes an Insert in the…
-
-2
votes3
answers781
viewsA: Problem reading UTF-8 files in PHP and right in the browser
The solution Create the files without BOM, and configure your web server to serve UTF-8 files by default. What is happening is that it is configured for another encoding, or in case it is not…
-
0
votes2
answers107
viewsA: Problem with C#Threadstatic
Yes, that’s normal behavior You don’t control which thread runs your Controller. Each request can have a new thread, a repeated thread, and you have no way of knowing. How to solve To save a…
-
1
votes1
answer192
viewsA: Write ; in . CSV without separating the cell
According to RFC 4180, item 2.6, a field containing line breaks, quotation marks and the field separator MUST be printed with quotation marks around it. See: https://tools.ietf.org/html/rfc4180…
-
1
votes3
answers634
viewsA: How to make my program consume less CPU without disturbing its execution?
Not everything or anything A program that runs without stopping consumes more CPU. A program that sleeps always loses performance. How about then do both, but not always? while ( Vars.GlowActive ) {…
-
1
votes2
answers252
viewsA: Read files twice
The problem is in using Notice you’re doing two using on top of the same stream, yet indirectly: using (new BinaryReader(postedFile.InputStream)) { } // Dispose using (new…
c#answered André LFS Bacci 933 -
0
votes1
answer111
viewsA: Data comparison
There are some ways to solve this problem: Two tables, balance line Two tables. Gives SELECT in both tables, simultaneously ordering the records by the same fields. Compare the key of the two…
-
0
votes1
answer52
viewsA: What is this code possibly doing?
ui:repeat is a form of bond while, more specifically foreach. In this specific example, it can be interpreted as: For each item of listaProdutos, place the current item in the variable prod and…
-
1
votes1
answer242
viewsA: Replace text with srt_replace using double quotes
There’s probably some difference in $rodape which is causing the replacement to fail. Spaces, tabs, accents, something like that. I suggest rewriting all these snippets, where $rodape is created by…
phpanswered André LFS Bacci 933 -
3
votes3
answers1686
viewsA: Is saving the user ID in COOKIES safe?
No, it’s not safe The cookie is a clean text information that is stored in the user’s browser, where there is no control. Not only is it possible to see this data but also easy to change. If your…
-
1
votes2
answers932
viewsA: Best practices when working with Multithread
This is a question that would probably require a book to answer, but try to narrow the scope. async/await for the composition of methods You have a system full of small features and excerpts that…
-
1
votes4
answers8025
viewsA: Searching dates through BETWEEN AND
A stable solution for data selection between two dates consists in not using the final date, but rather the day following the end date. When you have a two-date filter on your system, you get the…
mysqlanswered André LFS Bacci 933 -
1
votes1
answer50
viewsA: Receive real-time count from a program
It is possible. The following C# code can be compiled for a file .exe, and does: forever (1), wait sixty seconds (2), make a request on a PHP page (3) and take what the page print to process (4).…
phpanswered André LFS Bacci 933 -
2
votes4
answers1903
viewsA: How to join two lines in SELECT?
It is possible to do this with SQL, but will end up facing problem of slowness. In code, the solution without performance problem is to collect the input and output data separately, raise all…
-
1
votes2
answers1208
viewsA: Foreach in Post PHP return
The fields numero, id_operadora, dt_cadastro, status and id_numero are arrays with increasing numeric keys, so you can process them in a foreach thus: $key = 0; while ( isset( $_POST['numero'][$key]…
phpanswered André LFS Bacci 933 -
1
votes3
answers1322
viewsA: Add "name" to a JSON object
It’s possible, but it’s weird What you are trying to do is a JSON object with repeated keys/properties. This is unusual as many JSON libraries will error when reading a JSON with repeated keys, and…
-
4
votes2
answers692
viewsA: Because "PHP and MYSQL"
Not that PHP is "so" database dependent, only that you can’t easily solve so many problems with just programming languages. To quote an example that appears a lot here in Stackoverflow: how to email…
phpanswered André LFS Bacci 933 -
1
votes1
answer391
viewsA: Process monitoring
Win32_Process has the property CreationDate, that despite the name is a Datetime. To know the idle time of a program, just discover the total time and subtract the user’s time (UserModeTime) and…
c#answered André LFS Bacci 933 -
1
votes3
answers993
viewsA: Error using $_SESSION[] with unserialize: "expects Parameter 1 to be string"
The error message is very clear. On line 19 of testaAdmin.php: $adminLogado = unserialize($_SESSION["admin"]); The parameter of unserialize() be it string, but there’s a object. That is to say,…
-
4
votes1
answer405
viewsA: Thread occupying a lot of memory
Overall To know where what is causing the unwanted increase in memory consumption, the best thing to do is to run a profile application. It may be that the leak is coming from this thread, it may be…
-
2
votes1
answer126
viewsA: Foreign key SQL SET NULL
Names to the oxen The table To has a foreign table key B. The solution Set the field of To as NULL. The explanation The CASCATE foreign keys are triggered when changes occur occur in the table…
-
1
votes1
answer316
viewsA: Empty string return - Oracle
If fields can be empty: SELECT rtrim(regexp_substr(strings,'[^|]*',1,1),'|') AS identificador, rtrim(regexp_substr(strings,'[^|]*',1,2),'|') AS id, rtrim(regexp_substr(strings,'[^|]*',1,3),'|') AS…
-
9
votes2
answers13385
viewsA: Android Studio - non-ASCII Characters
The error is warning you that in the project path there are letters outside of ASCII. It’s probably accented letters, cedilla, typographical hyphens, that sort of thing, and that it creates…
-
2
votes1
answer517
viewsA: Socket with C# and java
Substitute: networkStream.Read(bytesFrom, 0, (int)clientSocket.ReceiveBufferSize); For: int read = networkStream.Read(bytesFrom, 0, bytesFrom.Length); Substitute: dataFromClient =…
-
1
votes1
answer91
viewsA: Recombination algorithm
Looks like you’re dealing with a backpack problem, in English Knapsack problem. It’s an NP-complete problem, so it doesn’t even have a quick fix, and performance only gets worse with increasing…
algorithmanswered André LFS Bacci 933 -
0
votes2
answers360
viewsA: Replace CRON
The shortest interval that cron accepted is one minute, that is, you cannot use cron to run processes with seconds of difference, directly. However what you can do is schedule a "trigger" program…
-
0
votes1
answer64
viewsA: Omit beginTransaction commit PDO MYSQL
Yes In the case of databases that follow the ACID model, in the absence of transactions then each instruction ends up having an automatic implicit transaction. Basically is autocommit at every…
-
7
votes3
answers1360
viewsA: Faster way to access properties in a C#list
Pre-buy what you can Zero is a constant, so you don’t have to worry about it. But .Count will be re-evaluated in each interaction if the compiler fails to "prove" that minhaLista is a strictly local…
-
1
votes1
answer207
viewsA: I cannot enter the Datetime fields in the sql database
1. Use any data access library Entity Framework, Dapper, something, but do not write SQL in hand. Concatenating data in hand in the middle of SQL leaves you open security problems and makes its…
-
-1
votes2
answers117
viewsA: What’s wrong with this while? The || is not working
What you need to understand is that you have three commands nextInt() in that passage. So the program can call twice nextInt() before entering the ìf. I understand from your explanation that you…
javaanswered André LFS Bacci 933 -
0
votes1
answer78
viewsA: access a page via https loses session variables?
There could be three problems there. 1. Different domain or subdomain between HTTP and HTTPS Most likely the pages are in separate domains or subdomains. Hence it is not a matter of HTTP/HTTPS…
-
0
votes2
answers122
viewsA: Criteria for data synchronization
General algorithm Have a field versaoLocal and a field versaoRemota. Test if they are different. If different, need to update, if not, good are equal, nothing to do. The specific algorithm is: In a…
requirementsanswered André LFS Bacci 933 -
1
votes4
answers1989
viewsA: Updating data with Entity framework
Three alternatives. Use specific version instead of Object: zyon.Entry<TB_Cliente>( client ).State = System.Data.Entity.EntityState.Modified; Go straight to ChangeTracker make the change:…
-
1
votes2
answers1493
viewsA: Share the same Session on Different Domains on the same Server
Yes, it is possible But it involves a lot of code, and solution is not so simple. Two separate issues to solve: allowing session data to be accessible to different "servers", the session ID to reach…
-
6
votes4
answers1015
viewsA: Problem with pennies when using the Biginteger type
Problem response From what I understand, you want to format an "integer that internally has two decimals" as a monetary value. You handled money, the answer necessarily goes through Bigdecimal.…
-
2
votes2
answers2164
viewsA: Different session in browser tabs
Short answer In the login file, do something like this: <?php switch( $ambiente ) { case "Produção"; session_name( "SESSIDSistemaX"); break; case "Homologação": session_name( "SESSIDSistemaXHom"…
-
0
votes1
answer104
viewsA: My hosting does not connect the bank
Man, there are two different mistakes there. SQLSTATE[HY000] [2002] Connection timed out Tried to connect, and the connection took a while. It’s probably a network problem. Draw there how "locally"…
phpanswered André LFS Bacci 933 -
4
votes2
answers198
viewsA: How to create variable to contain a number with millions of digits?
To put a very large number in memory, simple: save the digits as a large string, or what is closer to the machine, the number in binary format as an array of byte. What you’re probably asking is how…