Posts by rbz • 9,949 points
356 posts
-
4
votes4
answers2561
viewsA: What’s wrong with gluttonous philosophers?
Answer 2 (new) Complementing the general responses, I put an addendum, which in my view is considerable, and also practically reinforcing my first response: As stated in the reply of Bruno Costa,…
-
1
votes3
answers336
viewsA: Repeat loop json php mysql
Avoid using "nome0", "nome1", "nome2",..., if not you will have infinite properties, and would have to do a "gambiarra" to stay treating your string. The "nome" would already be a property, so there…
-
3
votes4
answers27603
viewsA: SQL - Calculate percentage in the same select
Using sub-query, ie a query that queries another query: In Sql Server: (if the fields are not decimal, you need to do the CAST at least in 1 field, in which case the Passed and the Total will be…
-
2
votes2
answers1931
viewsA: Error: "Column Count doesn’t match value Count at Row 1" when inserting value in table with Trigger
You can’t set the null to the country IDPRODUTO because it cannot be null, as its structure shows, and also already is auto_increment, then it automatically generates the sequence by the internal…
-
0
votes2
answers224
viewsA: Loading the web version of a website and not the mobile version into a Webview
[assembly:ExportRenderer(typeof(WebView), typeof(DesktopWebViewRenderer))] public class DesktopWebViewRenderer : WebViewRenderer { protected override void…
-
0
votes2
answers114
viewsA: Search with null value, mysql
Try it this way: SELECT * FROM clientes WHERE ( (categoria_id = '$id_categoria' AND subcategoria_id = '$id_sub_categoria') OR (categoria_id = '$id_categoria' AND subcategoria_id =…
-
1
votes1
answer143
views -
1
votes1
answer1534
viewsA: How to unzip a folder in PHP?
<?php $arquivo = getcwd().'/arquivo-teste.zip'; $destino = getcwd().'/'; $zip = new ZipArchive; $zip->open($arquivo); if($zip->extractTo($destino) == TRUE) { echo 'Arquivo descompactado com…
-
3
votes4
answers132
viewsA: Assign a value to a variable when the search return is NULL
A little more lean, no redundancy: if (is_null($IdSetor)) $IdSetor = 0;
-
4
votes2
answers35301
viewsA: IF WITHIN A SELECT
Simple: SELECT CASE WHEN @VL_RET_IRRF > 10 THEN 10 ELSE @VL_RET_IRRF END AS Result FROM Tabela Multiples: SELECT (CASE WHEN @VL_RET_IRRF >= 10 THEN 10 ELSE (CASE WHEN @VL_RET_IRRF >= 20…
-
5
votes1
answer71
viewsQ: Constantly increasing slowness in emulator and IDE loading
Since the installation of the Android Studio, the emulator constantly gets slower with the course of use, and it is not for lack of delete test apps, etc., also the IDE itself begins to slow down…
android-studioasked rbz 9,949 -
0
votes2
answers88
viewsA: Run Service with a Broadcastreceiver
With the service running and already creating the note Thread: public class MyService extends Service { @Override public IBinder onBind(Intent intent) { return null; } @Override public void…
-
0
votes2
answers88
viewsQ: Run Service with a Broadcastreceiver
I need to run a Service through a BroadcastReceiver, but error occurs: android.os.NetworkOnMainThreadException. To "deviate" from the error, I’m using the code below, but I want to do it the right…
-
0
votes0
answers34
viewsQ: Long task on Broadcastreceiver, error: android.os.Networkonmainthreadexception
When I perform a task (which usually requires a AsyncTask) in the BroadcastReceiver, he accuses me of error: erro: android.os.NetworkOnMainThreadException I saw that it is not a good practice a…
-
2
votes1
answer82
viewsQ: Alarmmanager does not run on configured interval
In a method that records a AlarmManager to run every 30 seconds BroadcastReceiver: public void play(View view) { Log.i("lgg", "Botão: broadPlay"); Calendar calendar = Calendar.getInstance();…
-
3
votes2
answers324
viewsQ: When to call super.nameAll when override(override) a method?
In one class we have several methods superimposed with the @Override, and in some, for example onPreExecute of an extended class of AsyncTask, comes with the super.onPreExecute(). @Override…
-
1
votes1
answer245
viewsQ: Search for values in the page source code
There’s this one website, which generates a table of reserved and available tables without login: On inspection, you can see the style of the div (e.g..: class="day closed"): But the source code…
-
0
votes1
answer254
viewsQ: Sending email with multiple senders and recipients
I have records on MySql, basically with columns: usuario, emailusuario, descricao, responsavel, emailresponsavel. I need, when a new registration is made, send an email to the user himself…
-
0
votes3
answers152
viewsA: Use Session or use database?
It depends on how much you access and need this data, and "where" would be interesting to store it. Because there are many accesses, the more client-side you play, the more free your server, and…
-
1
votes1
answer107
viewsQ: Asynctask with one or more methods
I would like to know the advantages and disadvantages of using an extended class of AsyncTask, which contains only one or more methods. Example: I create a AsyncTask for each background processing…
-
3
votes1
answer291
viewsA: How to display message that the app is processing
Answering your question: The correct is to use an extended class of AsyncTask to display a progress bar or an image, or whatever, and process in background. Also, because of the running time, as…
-
1
votes1
answer104
viewsQ: Pull back from Asynctask class
I have a class Main that performs a method receberSolicitantes() with a task in background. While it is executed, it updates a progressBar. Everything is working perfectly with the method as…
-
0
votes1
answer211
viewsA: publishProgress() updates onProgressUpdate() only at the end of theInBackground()
I found out why: In class Sincronizar, the command retorno = asyncCadastros.get() that blocks the onProgressUpdate. Probably because he expects a return.…
-
5
votes1
answer2843
viewsA: Zoom in the Android Studio interface
On the main menu: File > Settings In the "Settings window": Editor > General Check option: Change font size (Zoom) with Ctrl+Mouse Wheel…
android-studioanswered rbz 9,949 -
1
votes1
answer2843
viewsQ: Zoom in the Android Studio interface
In Windows we hold the ctrl and use the scroll mouse to increase or decrease the source (approach or disproxify). In linux I did not find this function. How to zoom in the interface of android…
android-studioasked rbz 9,949 -
0
votes1
answer211
viewsQ: publishProgress() updates onProgressUpdate() only at the end of theInBackground()
I have an app that updates the progress bar, the same way I’m doing in another app, but in this new app, the onProgressUpdate() only executes at the end of doInBackground(). It is called the method…
-
1
votes1
answer130
viewsQ: Asynctask task execution timeout
How do I limit the running time of a Asynctask and return a warning when the limit is reached ? The method searches a json of a webservice, but the same may be out of the air, and when this happens…
-
0
votes2
answers105
viewsA: Background Edittext Alpha (transparency)
The only way it worked was to replace the shape by a gradient <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"…
-
1
votes1
answer840
viewsA: Calculate difference between timestamp field with specific timestamp
As in chat, your problem is that you don’t have a reference to the start date of the questions, so you can’t calculate the difference between the dates. Having this table with the dates and…
-
2
votes1
answer126
viewsQ: Fixed background, no resizing on keyboard
I have the following layout for color, set in background of LinearLayout: background.xml <?xml version="1.0" encoding="utf-8"?> <shape…
-
0
votes2
answers105
viewsQ: Background Edittext Alpha (transparency)
I would like to know how to make the Edittext fund transparent, in this way: I tried in the following ways, but without success: edt.xml <?xml version="1.0" encoding="utf-8"?> <shape…
-
1
votes2
answers55
viewsA: Select with wrong result
In view of the problem is that you are using WHERE to list the tables, and if case 1 of them has no match, the value is not returned. Use JOINS to make that union. Basically you have to understand…
postgresqlanswered rbz 9,949 -
1
votes2
answers211
viewsA: Select only tuples from a table with JOIN
Solution In your case in question, probably the RIGHT JOIN which is what you need, because you only search for the correlated values that are in your "right table", that is, in your Join RIGHT.…
sql-serveranswered rbz 9,949 -
0
votes1
answer35
viewsA: Search for custom Listview values
Solved. My fault. I’m pulling the item.get_Id() but the Activity I was pulling didn’t have the associating field id. I made the association and it worked. Sometimes just going over the steps to…
-
0
votes1
answer35
viewsQ: Search for custom Listview values
I got the following ListView that was generated with a Customized Adapter: I would like to know how to find the values (date, time, history, id, etc) of the item with the setOnItemLongClickListener,…
-
0
votes2
answers717
viewsQ: Call method with View parameter in another method
Examples of a method that requires a View public void lista(View v) { Toast.makeText(this, "Ok", Toast.LENGTH_SHORT).show(); } public void botaoAbrir (View view) { Intent i = new Intent(this,…
-
1
votes2
answers794
viewsQ: Access the emulator’s Sqlite database (and other storage types)
I’m developing an app that uses SQLite, SharedPreferences, etc. On my device with access root i can access all this information with some app’s specific to it (which require root access), mainly the…
-
1
votes3
answers370
viewsQ: Listview with different layouts per line, according to filtered value
I have a unique table in BD, which contains the records with fields like: tipo, data, hora, cliente, historico According to the value of tipo, the field cliente is or is not mandatory, that is to…
-
1
votes2
answers89
viewsQ: Standard value in Spinner+ generated from the database
I have a spinner that pulls the bank values, but I would like to leave it with nothing selected or default value: public void spinnerClientes() { ControllerClientes ctClientes = new…
-
1
votes2
answers149
viewsA: PHP how to let select set
Let’s go in pieces. You will have 2 querys for that reason: To fetch the value you saved; To generate input of the kind select with due option. Here you search for the record that was previously…
-
0
votes1
answer271
viewsA: Array returning error "Can’t use Function Return value in write context in"
Motive As already said, the error was when calling the array, where you are using parentheses instead of square brackets: $array($x) = $genero01; $array($x) = $genero02; Correcting if ($genero01 !=…
-
0
votes1
answer110
viewsA: Doubt - UPDATE MYSQL with PHP
From what I understand it would be as follows: You take the number and search, as passed: $string_sql = "SELECT * FROM mentor WHERE CPF='$cpf'"; Then you generate your form here: while ($aluno =…
-
0
votes2
answers44
viewsA: Query in mysql does not work
How are you using clauses like COUNT e SUM, necessarily need to define a group for this. For your consultation, I believe you’d like to see USUARIO, then I’d be out of this: SELECT f.nome,…
-
1
votes1
answer51
views -
2
votes1
answer101
viewsQ: Method does not accept passing from null to parameter
I have the following method: public String insereRegistro(int tipo, String data, String horario, String historico, int veiculo, double km, int cliente, int solicitante, String finalizado) { ... }…
-
1
votes1
answer163
viewsQ: Create a Spinner from a fixed list with more than 1 field
How do I add the values in this Spinner ? I need to create a Spinner containing 2 "fields" (Cod, option). Default values will be added, but later the codes cannot be changed, so I need the field cod…
-
1
votes1
answer161
viewsQ: Spinner - Line break in list
When opening the Spinner, has some options that are great, so by default he puts ".." points at the end of the item. Is there any opção padrão do Spinner for the automatic break or would have to be…
-
0
votes1
answer148
viewsQ: Load Empty Spinner
By generating a Spinner, it brings the first value of ArrayList generated already selected. How do I bring it "empty" ? The best option would be to populate it with a function onClick instead of…
-
1
votes2
answers376
viewsA: Query does not return fetch_array
PDO $dt = $sql->fetch(PDO::FETCH_ASSOC); Handbook: http://php.net/manual/en/pdostatement.fetch.php No PDO $dt = $sql->fetch_assoc(); Screen printing: echo "<pre>"; print_r($dt);…
-
1
votes1
answer42
viewsQ: How to get other values from the selected Spinner item than shown?
Doubt: How do I find the value of the field handle concerning the nome that was selected in the Spinner ? Setting: Table clientes Campos _id, handle, nome The ArrayList of Spinner is established as…