Posts by touchmx • 1,710 points
67 posts
-
1
votes1
answer20
viewsA: I hid a div, how do I get her back?
Just change the display style to the default that is block: document.getElementById('cal').style.display = "block";
javascriptanswered touchmx 1,710 -
2
votes1
answer101
viewsQ: How to consume Event-stream with nodejs
I have a nodejs application that needs to consume an endpoint that returns a text/event-stream. The application that issues these events is done with java and packages a data within an object…
-
2
votes1
answer26
viewsA: how to select php for a date search field
Considering your example, there are many problems in your code beyond the query. But focusing on your question and considering that column data is of the DATE type, there are two simple ways to do…
-
0
votes1
answer42
viewsA: How to scroll a <ul> list to my specific <li> after selecting an item that loads the page again?
To scroll to a specific element you can use: document.getElementById('selected').scrollIntoView(); Response based on: Scroll / Jump to id without jQuery…
-
2
votes1
answer80
viewsQ: Copy content only from the superclass in java
There is a way to copy only superclass content in another class of the same type through a subclass instance in Java, without accessing getters and setters one by one? Example: public class A {…
-
1
votes2
answers345
viewsA: Taking value from an attribute inside an input from a table column
With jQuery you initially make a DOM selection in the columns, something like: $("table.table tr td input[type=checkbox]").each(function(index, element){ var atributo = $(this).attr("VeiculoId");…
-
4
votes1
answer525
viewsA: (PHP) What variable do I put inside mysqli_affected_rows
According to the PHP documentation on http://php.net/manual/en/function.mysql-affected-rows.php: int mysql_affected_rows ([ resource $link_identifier = NULL ] ) It is a function that returns an…
-
3
votes1
answer770
viewsQ: Strategy Pattern with Spring Boot
I’ve been looking for solutions for Strategy Pattern with spring boot, but nothing I’ve found so far seems performatic or even functional. I have an interface like: public interface UserService {…
-
0
votes1
answer377
viewsQ: Access variable from within the scope of Promise
I have a Factory that must access two other services. Being the following structure: angular.module('my.module') .factory('ServiceMain', ServiceMain); ServiceMain.$inject = ['ServicePrimary',…
-
3
votes0
answers2186
viewsQ: Creating background services in Ionic with Cordova or java
I have an application that I started to do with Ionic. A priori will be compiled only for android. In this application the user will perform some registrations, which will be saved locally and every…
-
2
votes1
answer1172
viewsA: What it’s for and how to use include_path in php
In simple terms it allows you to use one of these functions: require, include, fopen(), file(), readfile() and file_get_contents(), you do not need to enter the full path, once you have entered the…
-
0
votes3
answers3702
viewsA: Notice : Array to String Conversion in
Yes, in fact you are trying to assign an array as value, where it should be string. This is because in this expression: $tipos = array("Pessoa Fisica","Pessoa Juridica"); $tipoSemEspaco =…
-
1
votes1
answer82
viewsA: Form for the registration of equipment with sequence of lot numbers
The range function returns to the variable $valores an array. Then the following can be done: //códido omitido $valores = range( $NInicial, $NFinal ); foreach($valores as $key => $valor){…
-
2
votes3
answers180
views -
2
votes1
answer270
viewsA: I cannot create dynamic array with Session
At the beginning of your code, an empty array is being created. Therefore, whenever the code is started the array is "reset". Just at the beginning declare as follows: session_start();…
-
0
votes1
answer191
views -
1
votes1
answer191
views -
1
votes2
answers2076
viewsA: Curl - Consuming webservice with PHP
I had the same problem and solved using the function http_build_query, which generates a string in URL format. As follows: $url_data =…
-
3
votes3
answers5861
viewsA: How to style an echo with CSS?
Puts the content to be printed under single quotes, so you can easily use double quotes in the content: echo '<div class="saldo">'.number_format($saldo, 2, ',', '.').'</div>'; Or still…
-
0
votes0
answers80
viewsQ: Query by table text using PDO
My seemingly simple problem has given me headaches. I have a table that contains three columns: id, idpergunta, resposta. When a reply is sent to be inserted in this table I check if it already…
-
5
votes2
answers604
viewsQ: Relationship on-to-one in auxiliary table using Laravel
In the application I am working the database is built on the part of users, as follows: user 1 -------> 1 user_address 1 <-------- 1 address In the user table there is no column referencing…
-
0
votes3
answers2915
viewsA: How to access a private attribute of a class in another class?
Your question was not very clear without the code, but I believe that putting a final static variable in your Server class would solve your problem. Note: I am counting on the idea that Server and…
-
2
votes1
answer38
viewsA: SQL checking data content
To perform a query for the content just use the joker "%". To better understand let’s take the example: If you want to search a record (e.g. the word sport) that exists at the beginning of some word…
-
0
votes2
answers100
viewsA: Insert record into bank by clicking div x
Your link: <a href="#" id="atualiza">Atualizar</a> And your Javascript (assuming you use Jquery) $.ajax({ method: "POST", url: "atualizar.php", data: { status: "on"} }) .done(function(…
-
3
votes1
answer500
viewsQ: Fluid/responsive layout at least 940px and at most 1170px with bootstrap
I’m a beginner with Bootstrap and responsive layouts and found a small obstacle in developing a responsive layout using Bootstrap. In the layout of the site, the content was created to be displayed…
-
5
votes1
answer56
viewsA: How to make a frequent update
For this you will need to use javascript to verify that the value of the fields is equal at the time the confirmation field is filled. The name of this event is onBlur. The implementation would be…
-
2
votes1
answer82
viewsA: htaccess rules for searches
Use the [QSA, L] flags to use to read URI requests via GET and also to rewrite. You can see more details on this question: https://stackoverflow.com/questions/16468098/what-is-l-in-qsa-l-in-htaccess…
-
2
votes2
answers325
viewsA: How to return all installments in this function in [PHP]?
Associate the values in the array, one in each Dice, then perform the calculation for each installment and insert into a new array: function parcelamento ($valor){ $taxa_intermediacao = 0.064; //…
-
-1
votes2
answers6972
viewsA: Leave two Divs always at the same height
In bootstrap you are not necessarily obliged to just use it. You can customize it. And one way to solve your problem is: Add a new class to both Divs and then create a style for such a class: IN…
-
1
votes4
answers454
viewsA: How to generate a summary or excerpt of each post?
You can use the function replace() (php sub string) to display a portion of the content. See examples of usage in the function link. An interesting observation is that if the content has html, it…
-
1
votes1
answer90
viewsA: Make Submit with <a> and appear JS dialog
If you want to do Ubmit and display the dialog, you will have to create a Js function to control the form’s Ubmit by clicking on the link. In this idea: function submeteForm(){ alert("Foi…
-
2
votes5
answers1659
viewsA: Default parameters
The best way to treat this type of situation is to use the function func_get_args(). The use is simple: You declare the function without any parameter and within the function use the func_get_args()…
-
1
votes1
answer50
viewsA: Doubt with the Tomcat
The conflict problem can be solved in two ways: the first is by identifying the other software that is already using port 8080 and the second way would be: Locate the Apache Tomcat installation. Log…
-
5
votes4
answers114
viewsA: Why is this SQL statement incorrect?
Understand your query as the following (explaining the bar conversation mode): You want to know if there are products of the category 'Dresses' and the color 'White' and if it is not that (OR) that…
-
3
votes1
answer76
viewsA: Replace if loop is empty
For this just check whether the result of the query is empty or not, if it is, print that there are no records: <?php } if(empty($data)){ echo 'SEM DADOS'; }else{ ?> <div…
-
12
votes2
answers1688
viewsQ: Design Patterns in C?
I’ve initiated the development of a system embedded in pure C. The project requires detailed documentation of software and hardware, as well as using the recommended design standards. It is known…
-
1
votes3
answers237
viewsA: Update the jquery title
I always used window.setInterval and it worked right. That way: <script type="text/javascript"> window.setInterval(function() { mudarTitulo(); }, 1000); function mudarTitulo() { document.title…
-
0
votes1
answer349
views -
8
votes2
answers3923
viewsQ: Run parallel process in PHP
I own a Web service that is consumed by some applications. On the Web service there must be the use of API of Amazon and perform a process whenever a record change is made via Web service. Initially…
-
3
votes3
answers9803
viewsA: Passing array as a function parameter
To use an array as a parameter, simply do the following in the function: function dobrar_array($parametro=array()){ foreach($parametro as $lista){ echo $lista*2 . "<br>"; } } $resposta =…
-
4
votes1
answer224
viewsQ: Keep connection open in php webservice
I am building a simple webservice and PHP + JSON where I have 2 tables and I intend to perform CRUD operations. It is possible that the webservice is in the medium term consumed by many devices at…
-
8
votes2
answers2937
viewsQ: Best Way to Use and Instantiate Entitymanagerfactory
My project has the following structure: Within the package br.mandacaru.DAO are the controllers. To instantiate an object JPAController I need an object EntityManagerFactory and for that reason I…
-
1
votes1
answer308
viewsA: How to "set" a Query in the @Entity annotation with Hibernate?
The annotation you need is a @Namedqueries. Add it above the class statement as follows: @Entity @NamedQueries({ @NamedQuery(name = "Aluno.NOME_DA_QUERY", query = "SELECT p.nome_pessoa,…
-
1
votes1
answer345
viewsA: How do I know how many pixels a div has height:100%? And how can I subtract a certain value from that total of pixels and apply what’s left to another div
By using pure javascript, which can give you better performance, just use the clientHeight function to pick the height of the div in pixels then apply the other div the subtraction result:…
-
1
votes1
answer5544
viewsQ: On(change) event on radio button
In the project I have a file that makes inquiries of freight prices and that at the same time returns two radio Buttons with the freight values. The return of the HTML is as follows: <p>…
-
0
votes2
answers2919
viewsQ: Sum of multidimensional array values in PHP
I am building a shopping cart and I am using Sessions to save the products from the cart. The array structure that saves items is as follows: $_SESSION['carrinho'][ID_DO_PRODUTO;TAMANHO_SE_HOUVER]…
-
1
votes1
answer149
viewsQ: Optimize SQL Query in three tables
I have a product table that has a foreign key that is the category and a table that stores the name of the product photos. I usually make two queries: one to retrieve the category name and some…
-
0
votes1
answer670
viewsQ: Using Dropbox as a repository for Netbeans 8 projects on Windows
I am using Netbeans 8 in my projects and would very much like to use Dropbox as a versioner. I set up the repository in Dropbox but with the project directory in another way. I may be confusing…
-
1
votes2
answers194
viewsA: Enhanced truncation of strings
A solution, but I don’t think it’s very efficient, but functional: function trucar($texto, $qtdCaracteres) { $string = strip_tags($texto); if (strlen($texto) > $qtdCaracteres) { while…
-
0
votes2
answers2925
viewsQ: Consultation in table with self-relationship
I have the following table containing self-relationship between the idcategoria and parent columns: idcategoria categoria pai 1 Camisetas 0 2 Regata 1 When an added category does not have a parent…