Posts by rbz • 9,949 points
356 posts
-
0
votes2
answers477
viewsQ: Condition in Trigger
About the following Rigger: CREATE TRIGGER [dbo].[TG_TESTE] ON [MINHABASE].[dbo].[TB_DOCUMENTOS] AFTER UPDATE AS DECLARE @ID INT DECLARE @DOC INT DECLARE @QTD FLOAT SELECT TOP 1 @ID = ID, @DOC =…
-
1
votes1
answer1158
viewsQ: List tables that have Trigger
Is there any way to know which tables have at least 1 Trigger ? For example, I have a system with 10,000 tables, and I would like to know which one has Trigger.
-
1
votes2
answers664
viewsA: How to add value to an array without losing the previous value?
The advisable would be to represent the variable as an array $array[] and including the values: Simple: $array[] = 'aaa'; print_r($array); // resultado: Array ( [0] => aaa ) $array[] = 'bbb';…
-
2
votes1
answer137
viewsQ: Difference between Run App (Run App) and Apply changes (Apply changes)
In the toolbar of Android Studio, we have 2 buttons: Run App (Run App) Apply changes (Apply changes) What’s the difference between them? And when to use one or the other ? Update Does the IDE…
android-studioasked rbz 9,949 -
4
votes5
answers223
viewsA: Sum of hours greater than 24 hours
A form that I find simple: // Variáveis recebidas $hora1 = '09:15'; $hora2 = '19:30'; // Quebra horas de minutos $t1 = explode(':', $hora1); $t2 = explode(':', $hora2); // Converte para minutos e…
-
6
votes1
answer1060
viewsA: Select Float Mysql
The type of Float data in Mysql is inherently inaccurate. If you are planning to use a data type float for a column in your database, should reconsider, especially if you are planning to use it to…
-
0
votes1
answer46
viewsQ: Live video streaming multiuser
I have a camera, and I’d like to do the following: Insert a frame, div, or whatever, to leave this camera in real time (live) on a page of a website. They will simply play, and watch what is going…
-
1
votes1
answer89
viewsQ: Autofocus in Edittext does not work
I have a EditText that always needs to be in focus, and a Button whichever: <EditText android:id="@+id/edtCod" android:layout_width="match_parent" android:layout_height="wrap_content"…
-
2
votes2
answers532
viewsA: Button to display and/or hide keyboard
I used it as follows: Show/Hide in the same function (toggleSoftInput): InputMethodManager imm = (InputMethodManager) getSystemService(this.INPUT_METHOD_SERVICE); imm.toggleSoftInput(0, 0); Only…
-
1
votes1
answer790
viewsA: Run function with ENTER in Edittext
Working: this.edt = findViewById(R.id.editText); this.edt.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (event.getAction() ==…
-
1
votes1
answer790
viewsQ: Run function with ENTER in Edittext
I need to execute a function with the keyboard "Enter" on EditText. Did not work: android:maxLines="1": he jumps fields android:imeOptions="actionNext": it runs with the "next" button of the virtual…
-
20
votes1
answer1027
viewsQ: Galton’s Board - Central Limit Theorem
The reason for the question is study/learning. Know/apply programming techniques and concepts, transforming something "material" into "application". I received a video on Whatsapp, where mixed…
-
1
votes1
answer85
viewsQ: Programmatically create variables
There is the possibility to create variables programmatically? Example (this example does not work, it is only to understand the idea): I want to create the variables: $var0,$var1,$var2,$var3 and…
-
4
votes1
answer595
viewsA: Differences in Phpmailer functions
Username: is the user used for authentication (and complementing, the Password). SetFrom: would be to add another email in place of the one you are using for sending, but as everything today…
-
1
votes2
answers532
viewsQ: Button to display and/or hide keyboard
A EditText numeric will receive input by external keyboard, so display the default keyboard, should be optional. How do I make to: By clicking on EditText to position the cursor, the keyboard does…
-
7
votes5
answers6090
viewsQ: Autofocus: position the cursor at the end of the value
When I Gero a input having set value (value="teste") and define the autofocus="true", the autofocus back the cursor at the beginning of the content: <form> <div> <input type="text"…
-
3
votes1
answer118
viewsQ: Primary key return of an INSERT
I have the tabela_x, where the first field (campo1) is primary key and autoincrement. I make a simple INSERT: $ins = " INSERT INTO tabela_x (`campo2`,`campo3`,`campo4`) VALUES ($c2, $c3, $c4) ";…
-
1
votes2
answers120
viewsQ: Timeout for query execution
I have a simple function: $sql_em = " INSERT INTO tabela (`campo1`, `campo2`) VALUES ({$c1}, {$c2}) "; $em_obj = new Mysqli($this -> host, $this -> db_user, $this -> db_pass, $this ->…
-
4
votes1
answer62
viewsA: <br> Automatico
You have to treat that in your loop. Example: $c = 0; while($res = $precat->fetchObject()){ ... seu código aqui para <br> depois if ($c <= 4) { $c++; } else if ($c > 4) { echo…
-
1
votes3
answers77
viewsA: Problems when generating schedules dynamically
// Variáveis recebidas $inicio = '08:15'; $fim = '12:30'; // Quebra horas de minutos $t1 = explode(':', $inicio); $t2 = explode(':', $fim); // Converte para minutos $min_i = ($t1[0] * 60 + $t1[1]);…
-
6
votes1
answer1028
viewsQ: What are the differences between . bat and . cmd?
We rarely see file .cmd, but when opening it, we see that its content is very close to a .bat. What is the reason for this similarity ? What would be the main differences between them ?…
-
2
votes1
answer251
viewsA: How to read and sort this PHP json?
You must first pass JSON for array, and with a loop, get the information you want from the array. Examples: Declares the json in a variable: $json = '{ "groups": { "superadmin": true, "admin": true,…
-
3
votes1
answer60
viewsA: How to treat json in java
Thanks @RBZ I hadn’t tried, it worked here. - Emerson Barcellos Answer: JSONArray dados = json.getJSONArray(seu_json); I learned a golden rule, basically like this: [ = Jsonarray { = Jsonobject…
-
2
votes1
answer308
viewsA: How to transform this json into an array
That’s not a JSON and yes the format of a "request" which should be used to create a card: Create card Mutation to create a card, in case of Success a query is returned. Request Body In the…
-
2
votes2
answers569
viewsQ: Constructors in PHP 7
I was testing a class in PHP 7, and noticed that the constructor no longer works when it is created from the class name, working only when it is created with the name __construct. Example: <?php…
-
1
votes1
answer64
viewsA: Run query without foreach
Would that be: $var = $con->query($sql, PDO::FETCH_ASSOC); print_r($var); But if you have more than 1 record, will only bring the last. The repetition serves to read line by line, and go storing…
-
2
votes1
answer143
viewsQ: When to use UNIX_TIMESTAMP
Absolutely, we all work with dates, timestamp, among other forms and various formats. The UNIX_TIMESTAMP (the time in seconds from '1970-01-01 00:00:00' UTC to date) always ends up appearing…
-
3
votes1
answer2172
viewsA: Convert everything to mysql in hours or minutes
How to do You can use the TIME_TO_SEC, so it converts your hour into seconds, and you divide by 60 to minutes, and again by 60 to hours: Example: SELECT (TIME_TO_SEC(TIME_FORMAT('22:30','%H:%i')) -…
-
2
votes3
answers161
views -
-4
votes1
answer145
viewsQ: IF x SWITCH - Simulating
I believe that all of us always time to make some deals in conditions with few values. I made a test between the IF and the SWITCH. All content, was created to SIMULATE a more identical structure…
-
1
votes2
answers333
viewsA: PHP script scheduling in Windows
Complementing Otto’s and Otto’s response link How did you get the XAMPP: One must execute the php.exe, in this case I pulled from the XAMPP, and the argument would be caminho/script.php of the…
-
1
votes2
answers333
viewsQ: PHP script scheduling in Windows
I have a test environment VM with Windows Server + Xampp. I need to fire a file (script.php) scheduled every 5 minutes. What is the simplest and most agile way ? Update 1 By the Windows "Task…
-
1
votes1
answer25
viewsA: How to recover the nameservers provided by aws?
To get the name servers of a hosted zone using the Route 53 console Log in to the AWS Management Console and open the Route 53 console on https://console.aws.amazon.com/route53/. In the navigation…
-
26
votes2
answers727
viewsA: "OMG! A heisenbug!" - Explaining to a layman what a heisenbug is
From what I understand, you need a analogy, thus facilitate explain something complex, to a layman in programming (his boss). Then I’ll try to explain in my own words your problem, if my boss was a…
-
0
votes1
answer26
viewsA: Print bank contents with line break
Using the nl2br: echo nl2br($string); Official manual
-
0
votes1
answer26
viewsQ: Print bank contents with line break
I have a content in the bank, which has break and line: linha 1 linha 2 linha 3 When I print on a <textarea>, the breaks work perfectly. But I print it on a <td>, he doesn’t make the…
-
2
votes1
answer942
viewsA: Image in HTML e-mail in Phpmailer
Using the method $mail->AddEmbeddedImage: $mail->AddEmbeddedImage('img/logo.jpg', 'logo_ref'); Tag <img> inserts: src='cid:logo_ref'. This way, the image will be embedded in the email.…
-
0
votes1
answer942
viewsQ: Image in HTML e-mail in Phpmailer
I’m making a template for sending email marketing, which contains an image: <tr> <td style="padding: 10px 0 10px 0;" align="center" bgcolor="#1ac6ff"> <img…
-
0
votes2
answers2596
viewsA: PHP array_push in array within another array
Look for "matrix", sometimes it helps you... It would be more - like this: $array[0][0] = 10; $array[0][1] = 20; Watch this video In a repeat structure, you will need to know how to place each: $a =…
-
0
votes3
answers250
viewsA: How to select only the largest drive in Sql?
Test like this: SELECT produto.gtin, produto.descricao, (SELECT max(estoque.id) FROM estoque WHERE estoque.id_produto_empresa = produto.id) AS estoque_id, estoque.saldo_atual, estoque.loja FROM…
-
0
votes1
answer53
viewsA: Blank consultation
Try it this way: $result = $pdo->query($select); or $select = "SELECT * FROM FIN_TITULO WHERE EMPRESA = 1 AND REVENDA = 1 AND TITULO = 435376"; $statement = $pdo->prepare($select);…
-
2
votes1
answer73
viewsA: How to check if there was an error in the POST
whereas his AsyncTask is returning a value: // Instancia o obj SolicitaDados obj = new SolicitaDados(); // Executa a classe `AssyncTask` obj.execute(); // Puxa o retorno (se for int) int retorno =…
-
1
votes1
answer371
views -
0
votes1
answer89
viewsA: Create a php file
Use the fopen($file,'w') (even because you want to write to the file also correct !? ) (if only read, use the "a"): function lerFicheiro(){ $rec = array(); $file = './receitas.txt';…
-
2
votes1
answer64
viewsA: SQL search specifies
Are you using the LIKE incorrectly. Correct: SELECT * FROM `link` WHERE ds_url_orig LIKE '%https://www.frasesdobem.com.br/frases-incriveis%' AND ds_email_link_modo = '0' Also, if you only have…
-
0
votes1
answer65
viewsA: mysql random questions
One way to do it (not advisable in tables with many records): use the rand() and LIMIT: SELECT aulas.nomeaula, assuntos.nomeassunto, questoes.questao, respostas.resposta FROM aulas INNER JOIN…
-
1
votes1
answer100
viewsA: Failed to send email with phpmailer
Today are rare the servers that send without authentication. If your really accepted, would be port 25. If you do not accept, you will have to set the user and password. Example of structure and…
-
7
votes3
answers376
viewsA: NSA Challenge - "Thirteen men and a shipment"
For now my version improved based on the general, focusing on minimal variables and functions: for ($c = 1000; $c > 0; $c--) if (($c%11 == 0) && ($c%12 == 5) && ($c%13 == 3)) echo…
-
20
votes3
answers376
viewsQ: NSA Challenge - "Thirteen men and a shipment"
Browsing the internet looking for challenges (to be solved with programming), I found the "Thirteen men and a shipment", where said it is part of the random challenges of the NSA (link). The…
-
0
votes1
answer105
viewsA: Failed to read a file. php (lib Phpmailer)
In view of your script is correct. To debug the PHPMailer, add: $mail->SMTPDebug = 2; or $mail->SMTPDebug = SMTP::DEBUG_SERVER; Options: SMTP :: DEBUG_OFF (0): Disables debugging (you can also…