Posts by Naldson • 1,287 points
56 posts
-
2
votes3
answers5865
viewsQ: How to pass a function to another component through props?
I’m trying to do a todolist with React and at the moment I have two components: Todolistapp and Todoform. In Todolistapp I have a function that adds a value in a list that is in the state, but this…
-
1
votes0
answers40
viewsQ: How to authenticate with Cakephp 3?
I’m trying to authenticate with Cakephp, according to what I saw in the framework documentation. What is currently happening is that my first user, with id 1 enters normally in the application, but…
-
1
votes0
answers86
viewsQ: Webpack does not use Babel to sweat
Whenever I build my project, the output is always the file generated by the webpack, with no signals that have passed through Babel. My settings are like this: package.json { "name": "webpack-test",…
-
1
votes0
answers407
viewsQ: req.body returning Undefined when using consign in the application
I am familiar with express, so I created a simple form with two fields, I have a JS file where I receive the data of the form and send them through the xmlHttpRequest and on the server side, I’m…
-
1
votes1
answer41
viewsQ: Div disappearing while taking content
I have a simple div: <div class="quadrant"> <h1>X</h1> </div> //CSS .quadrant { background-color: #E7E7E7; margin: auto; height: 40%; width: 20%; } When I have some element…
-
0
votes0
answers49
viewsQ: setInterval does not work
I’m doing a project that’s a calculator. When loading the page, I would like to show the current date and time. I added the setInterval to update the time every second (I am showing hh-mm-ss) and…
javascriptasked Naldson 1,287 -
1
votes2
answers113
viewsQ: How to center a form without affecting the Abels?
I have a form like this: The form is within a class called container which has the following attributes: ` .container { width: 80%; margin: auto; padding: 30px; } If I add one text-align:center in…
-
1
votes1
answer242
viewsQ: How to get the last selected option in a select Multiple?
I have a select where I can select more than one option(Multiple): <select class="produtos form-control input-lg" multiple="multiple" onchange="adicionaALista();" id="selectDeProdutos">…
-
2
votes0
answers545
viewsQ: @Managedproperty in a Managed Bean class returning null
I am trying to inject a Managed Property in my class, but whenever I try to access it in a method annotated with @PostConstruct it returns me null thus generating an Exception. Follow down my class:…
-
0
votes2
answers644
viewsQ: Line break in data from a list
I have a dialog that shows on the screen the data received from a list: <p:dialog header="#{zona.nome}" widgetVar="vendedores" minHeight="40"> <h:outputText…
-
0
votes1
answer57
viewsQ: Searching for data in another database Schema using createQuery
In postgres, we can search for data in various schemas through sql itself. Doing so: SELECT * FROM meu_schema.minha_tabela It is possible to do this using the createQuery? By default, my application…
-
0
votes1
answer33
viewsQ: Prevent the page from being displayed only when all elements of the page are loaded
I have a page in html, in which I list data, this part is like this: <table class="table table-responsive"> <thead> <tr> <th>Item 1</th> <th>item 2</th>…
-
8
votes4
answers9085
viewsQ: NOT operator in python
In java we have the operator not, we can use it like this: if (!metodo()) { //código } I’m just meeting python now, and I’m having a little trouble: I have a function that adds names to a list: def…
-
1
votes0
answers116
viewsQ: Making a data filter
I have a page where I list data from a table in my database. In it, a field and a form, to filter data from the table. Follow the code that has been used to make the filter: <p:panel…
-
1
votes1
answer374
viewsQ: Improve search performance when there is no record
I have a database with 9551011 lines. It contains addresses from all over the country. When I make an appointment for a certain place, and that address exists in the bank, I can get a return within…
-
2
votes2
answers4175
viewsA: By clicking the site menu, move the scroll bar to a specific point slowly
Knows the Animate Scroll? He does exactly what you want. With him you could do so: Index.html <html> <head> <script…
-
2
votes2
answers2043
viewsQ: Reading String until you find a certain character
I can receive data like: 232321 or dwd But sometimes a "+" can appear between the Strings. How do I extract only what comes BEFORE this character? If so, I have an entry like "432d+321" would stay:…
-
3
votes1
answer2071
viewsQ: Making a select in all tables of a schema
It is possible to search for a certain value in columns of other tables? Example: I have a number: 23028908 I want to search in my bank, all columns that have this value. Is that possible? How it…
-
1
votes1
answer1242
viewsQ: How do I make Jquery Mask not accept numbers?
I am receiving a data that would be the first three digits alphabetic characters and the other 4 numeric (A vehicle plate). I saw on a site that to receive only letters in Jquey Mask, just use the…
-
1
votes1
answer34
viewsQ: Problems when saving image
I’m trying to save an image I get through form. I’m using move_uploaded_file() for that reason. At the moment, my code is this way: class Image { public function save($image) { $name = time();…
-
0
votes1
answer118
viewsQ: Mysql event to delete lines with expired date
I’m trying to create an event to delete lines, that column date is expired, or is less than the current date. I was trying with the following command: create event e on schedule every 1 day do…
-
2
votes2
answers76
viewsQ: Determining when it will be executed
Example: var horaAtual = new Date(); var horaInicio = new Date("Fri Apr 01 2016 23:30:00"); //Quando(horaAtual == horaInicio) //execute algo... I want a function to be executed when it reaches a…
-
1
votes1
answer73
viewsQ: Accessing data from an array
I’m having a problem up to half "beast" here. I have the following array array(1) { [0]=> array(7) { ["id"]=> string(1) "6" ["produto"]=> string(1) "7" ["peso"]=> string(1) "1"…
-
0
votes1
answer1400
views -
2
votes1
answer634
viewsQ: Tomcat does not update files
The problem is this, every time I change a file (index for example), restart the tomcat(v7) and F5 tightening in the browser, it stays the same, does not update anything, ie end up staying in the…
-
5
votes1
answer95
viewsQ: Refresh page information without refreesh
I’ve looked and I haven’t found exactly what I want. My problem is this: I have a comments page that I wanted to update every change in the bank (this for everyone who is connected at that time). I…
-
4
votes3
answers1573
viewsQ: Avoiding line breaks in text areas
I have a normal textarea <textarea placeholder=" Digite aqui" class="form-control"></textarea> I wanted that when the user pressed enter, it did not break line and already send the…
-
0
votes1
answer53
viewsQ: Returning the number of spaces in a String
Not only spaces, but any other letter, for example. Is there any function that will return this to me? I’ve tried to : public function verifica_nome() { return substr_count($this->name, " "); }…
-
1
votes0
answers31
viewsQ: Can we avoid Sqlinjection with mysqli_real_scape_string only?
Example: $conexao = mysqli_connect("localhost", "user", "password", "my_db"); $pegaNome = $_POST['nome']; function insere($conexao, $pegaNome) { $nome = mysqli_real_scape_string($conexao, $nome);…
-
7
votes2
answers2815
viewsQ: Deleting data automatically after certain time
Example: I have a table with three fields: id int pk, varchar name, int category. The category field can receive 2 values: 1 and 2; By default always when a data is entered it will have a category…
-
2
votes1
answer22
viewsQ: Accessing an array that is inside another
I have the following array array(2) { [0]=> array(1) { ["data"]=> string(19) "2015-11-20 00:33:53" } [1]=> array(1) { ["data"]=> string(19) "2015-11-20 08:24:50" } } How do I access both…
-
1
votes1
answer209
viewsQ: Listing data by date
I have the following structure: I want to list all products by date. Like, date such products are in a table, already another date is in another table, and so on... All this on the same page.…
-
6
votes2
answers2271
viewsQ: Is working with Session safe?
Example, if I create a session session_start(); $_SESSION['nome'] = $nome; #valor pegado anteriormente. The end user can view and(or) edit the data contained in it?…
-
5
votes1
answer254
viewsQ: Sending an object through Session
I have the following object $compra = new Compra($usuario, $produto_comprado, $cep['cep'], $soma_produtos); When I try to add it into one $_SESSION[] and I try to get it on another page, it returns…
-
2
votes2
answers410
viewsQ: Variable value changing according to a select
I got the following problem, guys: I have a variable $soma_produtos = 0 (Picks up bank values through a foreach) Picking up the foreach data would look something like this: $soma_produtos +=…
-
15
votes8
answers5012
viewsQ: Printing a String until a space is found
I receive a String through an input and enter it into the database. When I list, I only want the person’s first name, that is, until the first space is found. Is there any function that does this?…
-
1
votes1
answer1776
viewsQ: Importing a very large . sql file
I have a file about 192.2 MB in size. I tried to import it through Phpmyadmin, but he complains that the file is too big. I searched the internet for a possible solution to the case, and I saw that…
-
1
votes3
answers1130
viewsQ: Storing array values in a single variable
I could do so $array = array(12, 14, 121, 123); $var = $array[0].", ".$array[1].", "....... echo $var But how to do it if I don’t know the exact size of the array? 'Cause I’m getting her through a…
-
2
votes1
answer3918
viewsQ: Causing an input to appear only when an option(select) is chosen
I have a registration form, with a Selected, but one of the options of this Selected when selected should appear an input. Example: <select> <option>value1</option>…
-
2
votes1
answer409
viewsQ: HTML input that can store multiple values?
How can I input similar to the one in this forum? /questions/ask in the tag area, when we insert an example tag: "PHP", and give enter it already saves that value and expects another user.…
-
0
votes1
answer904
viewsQ: Printing values with foreach in three different html <td> values
Good, guys. I want to list my database data in an HTML table, but this in three columns <td>, when I maxed this value, it would create one more line <tr>. Example: <?php…
-
2
votes1
answer371
viewsQ: Fixed footer at the bottom of the page
Well, I’ve searched a lot of sites how can I do this most of the time says it’s for me to body, html{height:100%;} footer{width:100%; bottom:0; position:absolute;} But when I do it, it’s at the…
-
0
votes0
answers41
viewsQ: Accent problems in PHP and Mysql
I inserted accented data in the database and when I will list with php it returns me the items as follows How can I resolve this? Thank you :) Ah, I’m using the latin1_swedish_ci collation in the…
-
0
votes1
answer169
viewsQ: Appbar overlapping the content of the rest of Activity
I’m doing some exercises but when it comes to executing, the bar is always on top of the content of Activity. Print of how you are for now Below goes my file content_formulario.xml : <?xml…
-
5
votes1
answer4635
viewsQ: How to resolve a "Catchable fatal error" error
I’m doing some object orientation exercises in PHP and when changing the database data, I come across the following error Catchable fatal error: Object of class mysqli_result could not be converted…
-
0
votes2
answers1460
views -
0
votes1
answer21
viewsQ: Is there any way that I can change data from different columns but leave it in one variable?
Summarizing.... Use multiple updates in one variable Type: $query = 'update..... ; update.........' Is there any way?
-
0
votes1
answer46
viewsQ: Can Union (mysql) also be used in Updates?
Example : $query = "update tabela set coluna1 = 1 where id = {$id_m} union update tabela set coluna2 = 1 where id = {$id_v}";
-
0
votes2
answers5249
viewsA: Apache error on Windows 10
I asked a question that looked like yours and I got an answer that solves this problem: What happens is that there is a service probably connected to IIS(express I believe) which is also a web…
-
16
votes3
answers48471
viewsQ: Apache does not start the service in windows 10
I’m using XAMPP and since I switched to windows 10 it comes with this, before it didn’t activate apache, then I looked for some tutorials on the internet and found this. It solved one of the…