Posts by Skywalker • 3,151 points
126 posts
-
0
votes3
answers931
viewsA: Sql Help that queries 2 fields from the same table
Analyzing the expected result that you mentioned, I think that to solve using Queries in select, I could not see a way using Union, Join or from in the two tables as you tried to do. select x.id,…
-
-1
votes3
answers45
viewsA: Symfony Component Httpkernel Exception Methodnotallowedhttpexception The PUT method is not supported for this route. Supported methods: GET, HEAD, POS
The error is here if (!$users = users::find($id)) { return redirect('Afiliados'); } You didn’t define the $id in the update method, that way the error is released because the browser is trying to do…
-
2
votes1
answer72
viewsA: Failed to parse time no eloquent
This error seems to have nothing to do with the query, but the moment Laravel tries to instantiate the eloquent, it transforms the fields created_at and updated_at into a Carbon/Datetime type by…
-
0
votes0
answers141
viewsQ: How does Javascript competition work?
I have a possible problem in javascript. The problem is that an array can have concurrent access because the following script below can be called at the same time several times because I use…
-
1
votes2
answers420
viewsA: Create a PHP Array with values from months past the year Using the Carbon API
Solution: $quantitativo = []; // Com essa expressão no for é possível gerar datas do mês atual até o inicio do ano foreach(range(0, date('m') -1) as $i) { $data = Carbon::today()->subMonths($i);…
-
4
votes2
answers187
viewsQ: How to remove characters q, ç and g from the HTML <u> tag in Regex?
I am converting HTML to doc, and I came across a very specific problem. Words that contain the letters q, g and ç when underlined, are getting an unwanted result. I thought I’d settle this way:…
-
1
votes3
answers1207
viewsA: Pick selected radio button value and start IF, ELSE IF, ELSE
On terms instead of $(this).val() to get the values use $("input[name=situacao]:checked").val() About…
-
2
votes0
answers48
viewsQ: Deserialization of the wrong json on the date of the object on the java server
I have a User object and it contains the dataDeascimento attribute, I pass the user object to the server, the date I provide in the following format 2017-12-31, but the server changes to 2017-12-30,…
-
0
votes6
answers922
viewsA: Listview very long
The problem could be here android:layout_height="wrap_content" listview This snippet of code can cause your getView from Adapter to be called endlessly and also occur the problem that happens to…
-
1
votes2
answers530
views -
2
votes2
answers240
viewsA: INSERT CONCATENATE PHP MYSQL
if($categoria->id==2) $post->titulo='REDIO'.$_POST['form']['titulo']; UPDATE: //O seu post deve conter o id da categoria, logo $idCategoria = $_POST['form']['id_categoria']; //recupera do…
-
1
votes1
answer354
viewsQ: Creating cakephp route 3
Intent: access http://localhost/api/users/[action] created the route Router::scope('/api', function (RouteBuilder $routes) { $routes->extensions(['json']); $routes->resources('Usuarios'); });…
-
0
votes1
answer700
viewsA: Refresh in jframe automatically
This will depend on the component you use to display the information. Whenever there is a new request just update the component you are using, when removing the request then refresh again, you…
-
3
votes3
answers616
viewsA: How to hide the title bar? Crash when changing android:Theme="@style/Apptheme"
Do so. <style name="CustomBaseTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="windowActionBar">false</item> </style> Answering your question is that you are…
-
1
votes1
answer540
viewsA: Upload multiple photos with subtitles
To be clear, what happened is that if the user selects some files and closes the window select files. And then he then realizes that he forgot some files and clicks to select them next. What happens…
-
5
votes1
answer540
viewsQ: Upload multiple photos with subtitles
I’m having a relationship problem between the caption and the photo while uploading. I’m uploading multiple photos and each photo has a caption. The code goes something like this html <!-- form…
-
2
votes1
answer411
viewsQ: Singleton standard for database communication
In PHP when I do a Singleton is created an instance for each request that tries to open a connection to the database or instantiating a single time she "always" will stay in memory for all requests?…
-
0
votes1
answer20
viewsA: Child class does not recognize protected mother class variable
Silly mistake, forgot to reference with $this, must be $this->conn = Connect::getConnection(); inside the Model constructor. abstract class Model{ protected $conn; public function __construct(){…
-
0
votes1
answer20
viewsQ: Child class does not recognize protected mother class variable
I have a user class that does not see protected variable of the class that it inherits the code is as follows abstract class Model{ protected $conn; public function __construct(){ $conn =…
-
2
votes1
answer673
viewsA: Textview always position displayed text at the end
Trade in Edittext As you insert the text you implement the code below together //posiciona o cursor no final do EditText etReplicar.setSelection(etReplicar.getText().length()); In your xml your Edit…
-
5
votes1
answer11112
viewsA: Mostar / Hide Button and Textview
Put everything you want to hide inside a Linearlayout or some Layout of your preference and put an id for that Layout in xml. <LinearLayout ....Layout principal da activity> <Button…
-
2
votes2
answers1106
viewsQ: How do I work with a String with parameters?
The question seems to be simple and naive, but I never needed to use it, I own a String and inside I want to put parameters to be filled out later, as in php $string = "o meu nome é $nome"; or as in…
-
1
votes2
answers83
viewsA: how to capture what is printed on the console via a command into a vector in C language
Tell you what, I didn’t test it, but the solution that popped into my head was. We assume the command: man fprintf > saida.txt Saves terminal output in a text file somewhere on the pc. But how to…
-
1
votes1
answer114
viewsQ: Customer side image manipulation
A challenge has arisen, I need to know how/which tools can help me create an area that I can manipulate image on the client side. I need to develop a website that creates custom shirts, something…
-
1
votes1
answer38
views -
4
votes2
answers1419
viewsA: Is there any way to know when a record was added to the bank?
Create a column of type TIMESTAMP. In the Mysql, to save date and time automatically when adding some item just create the table as follows. CREATE TABLE t1 ( data_criado TIMESTAMP DEFAULT…
-
1
votes2
answers784
viewsA: What is the best way to create a mobile application that communicates with a Webserver?
HTTPS (Hyper Text Transfer Protocol Secure - secure hypertext transfer protocol) is an implementation of the HTTP protocol over an additional layer of security that uses the SSL/TLS protocol. This…
-
6
votes5
answers1643
viewsA: Difference between private and final methods
I’ll be direct, (although the subclass may declare a new method with the same signature of the private method in the superclass) I did not understand this last part in italics. Declaring a method…
-
0
votes0
answers34
viewsQ: Doubt with Generics in Java
I have a class that uses generic type public abstract class AbstractDAO <T extends Entidade>{ //corpo da classe } At some point I need to know the class of T, the compiler does not accept to…
-
2
votes1
answer83
viewsA: How to maintain the data of a variable, when starting an Actitivy, and when returning, load the value?
A solution would be. Use the button tag attribute to save its state. xml button start tag attribute with zero android:tag="0". Every time you change the status of the vc button you should update…
-
1
votes1
answer412
viewsA: How to set up Jersey 2.22 in the project?
I got. web xml. <servlet> <servlet-name>Jersey Web Application</servlet-name> <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>…
-
2
votes1
answer412
viewsQ: How to set up Jersey 2.22 in the project?
I’m having a hard time setting up Jersey 2.22.1 on my web project that is deployed on the server Tomcat 8, that I’m developing in Netbeans. Note: I use Maven. I have read and reread the…
-
1
votes3
answers1444
viewsA: List of questions, each question with a list of answers
Place a Linear Layout inside the cardView or some Layout that is suitable to your need. Don’t use a Recycler View inside Cardview, because the card_questoes are inside a Recycler view ja. Be careful…
-
2
votes1
answer2933
viewsQ: How to find the number of rows and columns of a dynamically created matrix?
Based on my knowledge, I created a function that returns an initialized matrix: int** initMatriz(int rows, int cols){ int i,j; int** matriz; //aloca memoria para todas as linhas matriz = (int**)…
-
2
votes2
answers577
viewsA: how to compare null/null value when type character in C
The function scanf returns an integer, being value 1 when the reading is no error. Common example. int res=0, in=0; res = scanf("%d",&in); if(res==1){ //seu codigo } else{ //tratar o erro } to…
-
1
votes2
answers1219
viewsQ: How to pass object list to Subreport?
I have the iReport plugin in netbeans. I’ve already set up the classpath to recognize my classes, I take the following steps: 1 - Send object list Boletim for the main report, each report has…
-
0
votes1
answer343
viewsA: How to clear Jtable’s cell when starting typing?
Here is the solution, not so obvious but that works. public class MyJTable extends JTable { boolean isSelectAll = true; @Override public boolean editCellAt(int row, int column, EventObject e) {…
-
1
votes1
answer343
viewsQ: How to clear Jtable’s cell when starting typing?
How can I clear the cell in Jtable by starting to type in an equal cell in excel. For example, I place the cursor in a cell and when starting to type the cell enters editing mode, at this precise…
-
2
votes2
answers588
viewsA: Pass Activity object id to another
You’re passing the id, a whole kind it.putExtra("usuario", modeloUsuario.getId()); And the error happens in this line below, because you are trying to recover an object of type user when in fact it…
-
0
votes1
answer92
viewsA: How to know if a session already exists on a system?
Create a socket between client and server , when the disconnect socket is that the client got off. On the client side just create a communication socket. On the server side, wait for new clients to…
-
9
votes1
answer4547
viewsA: How do I block the back button (that little arrow on the hardware)?
Just create the onBackPressed method and don’t charm the super of it, leaving only blank the body of the function. Ai every time the user presses the back button, nothing will happen. @Override…
-
3
votes1
answer975
viewsA: Get method values to have result in ANDROID calculator
You can dry up your code a lot more, come on. the methods num1,num2...num9,subtrai, etc can become one in the following way. In your xml you must be calling the methods via the attribute…
-
3
votes3
answers6345
viewsA: In PHP, what is the best way to print a variable through a function?
private function teste() { echo 'teste'; } This method just prints something does not return value, so the following line makes sense $variavel = $this->teste(); You must change the test method…
-
1
votes2
answers172
viewsA: Error in reading, strings and integers
After the scanf you always put the function fflush(stdin); to clear the keyboard buffer, and within the scanf remove the \n who should print them should be the function printf("\n"); Note: if it is…
-
0
votes1
answer68
viewsA: How can I tunnel tcp with java?
Create a class that keeps an eye on socket client events Create a class that implements Runnable, this class must have a Scanner created from the InputStream of the "socket client" that receives…
-
1
votes3
answers1265
viewsA: How to fill an array of another class in JAVA
cidades.add(rs.getInt("id_cidade")); is adding an integer within the city array, it is right to add a city. Cidade cidade = new Cidade(rs.getInt("id_cidade")); cidades.add(cidade); You must have a…
-
3
votes4
answers1206
viewsA: Java Class Scanner Loop Error
1st Mode: nomes[i][0]=lerString(); for (int y=0;y<=1;y++){ System.out.println("Entre com a "+(y+1)+"ª nota:"); notas[i][y]=entrada.nextFloat(); }//fim do for interno //[...] public static String…
-
0
votes2
answers462
viewsA: How to allocate dynamically when I don’t know how many positions I will use in C?
The @Maniero solution would solve. But I leave mine too. Starting from the beginning where sizeof(int) -> returns the number of bytes an integer type uses in memory, in which case it would return…
-
1
votes2
answers5462
viewsA: Error while compiling in Android Studio
Search in the xml of some layout the attributes: android:TextAppearance.Material.Widget.Button.Inverse android:Widget.Material.Button.Colored Remove them.
-
0
votes1
answer50
viewsA: How can I tell which viewpager this is when I try to take a print with a floating boot?
//retorna indice da pagina que está sendo exibida int indicePaginaAtual = mViewPager.getCurrentItem();