Posts by Marcel • 586 points
27 posts
-
1
votes1
answer358
viewsA: Replace input file with icon/image with Image Preview
First off, your tag div was not closed properly, so the css applied in the class image-upload was not applied and the file select button was still in evidence. Second, the attribute of for tag label…
-
1
votes3
answers149
viewsA: (Python) How to prevent methods from being accessed from the value of some attribute
This is a good case where we use exceptions. Exceptions are when something unforeseen happens, they come from logic errors or access to unavailable resources. Whenever an exception occurs, the…
-
1
votes2
answers114
viewsA: Imageview Visible with onClick becoming invisible again?
You can use a Handler, which is a class that schedules tasks as per your need through a Thread according to the chosen time. btQuestions.setOnClickListener(new View.OnClickListener() { @Override…
-
1
votes1
answer88
viewsA: Load java file
You can use the public Apache POI for that reason Below is an example of how you can upload a file. xlsx with Apache POI library, later you can save it in a directory you find more convenient.…
-
5
votes2
answers53
viewsA: Changing page colors with name
This is because the function getElementsByName returns a list of DOM elements, while the function getElementById returns only one DOM element. This is also noticeable by the semantics of the method…
javascriptanswered Marcel 586 -
0
votes1
answer75
viewsA: Proxy problems with Okhttp
I chose to use the idea of environment variables as suggested by Statelessdev
-
0
votes1
answer29
viewsQ: Mongodb - Use . distinct in 2 properties of a document
I have the following data set in my database: { "_id": 1, "dept": "A", "item": { "format": "circle", "color": "red" }} { "_id": 2, "dept": "A", "item": { "format": "circle", "color": "blue" }} {…
-
0
votes2
answers75
viewsA: How to compare the CSS path of an element using JS?
You can use the property .parent to go up the component tree and get the parent classes and tags and so mount your query only once. window.document.addEventListener("click", function(e) { let…
javascriptanswered Marcel 586 -
0
votes1
answer75
viewsQ: Proxy problems with Okhttp
I’m using the library Okhttp to request my application to the facebook api, but I need to work on a proxy network, when instantiating OkHttpClient() and call OkHttpClient.newCall(request).execute()…
-
1
votes1
answer1059
viewsA: How to place image and text next to Flexbox?
You can use the property display : flex in his li involving the title h1 and the paragraph p in a div, how so: <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <meta…
-
1
votes3
answers144
viewsA: How to keep html data saved
You can save the value of your textarea in localStorage which is like a database of your nav. localStorage.setItem('textArea', y); So whenever you load the page you can fetch the value in…
-
2
votes2
answers745
viewsA: How to create an attribute for an HTML tag? Something similar to the existing "required"
You can change your DOCTYPE declaration, it would look like this: <!ATTLIST element-name attribute-name attribute-type attribute-value> DTD example: <!ATTLIST input obrigatorio CDATA…
-
1
votes2
answers82
viewsA: Positioning text when using -Webkit-Transition
I found the solution by researching a bit and the property flex-shrink solved my problem, it can disable the retraction of text by having the value 0 assigned. I made the following change in my CSS:…
-
0
votes2
answers51
viewsA: How to style css with javascript searching for classes
Try this: var elementos = document.querySelectorAll('.answerr'); elementos.forEach(function(x){ x.classList.add('newclass'); });
-
1
votes2
answers82
viewsQ: Positioning text when using -Webkit-Transition
I’m trying to make a bar with text and image appear when clicking a button (as if it were a notification), this bar will grow until it reaches maximum size and revealing the content, but while the…
-
2
votes1
answer271
viewsA: Can you create a rule in MYSQL to divide the value of one column by another?
Try this: SELECT IFNULL(AVG(valorm2), valortotal/area) valorm2 FROM tabela_terrenos
-
1
votes1
answer522
viewsA: How to check if the password fields are equal and larger than eight digits?
This can help you: <input name="senha_imob" type="password" class="imv-frm-campo"> <input name="rsenha_imob" type="password" class="imv-frm-campo"> <input type="submit"…
-
0
votes3
answers91
viewsA: Variables are automatically executed when declared?
This is because you have not declared the variable with the function, only the return of the function. Your code should be: let i = 0; let myInterval = function(){ setInterval(function(){…
javascriptanswered Marcel 586 -
0
votes2
answers118
viewsA: Many "if" in an old game for android
I think it’s cleaner this way: private boolean checkHorizontalWin() { if(isEqual(squareList.get(0), squareList.get(1), squareList.get(2))) return true; if(isEqual(squareList.get(3),…
-
1
votes1
answer575
viewsA: Calculation of Media with Javascript in Atom
You can use any text editor, but you must save the file with the . html extension You can insert the following script at the end of your code <script type="text/javascript"> //Pega todas as…
-
1
votes1
answer266
viewsA: Modal in separate Component
Create modal in Component-modal.html Use *ngIf in Component-parent.html <button (click)="adicioneComponentModal()">Adicione Component Modal</button> <component-modal *ngIf="modals !=…
-
1
votes3
answers121
viewsA: Select the first result of each conversation
Try this: SELECT m1.to_id, m1.message, m1.created_at, m1.from_id FROM messages m1 WHERE m1.to_id = 1 AND m1.created_at <= IFNULL( (SELECT m2.created_at FROM messages m2 WHERE (m2.from_id =…
-
3
votes3
answers1181
viewsA: Is GIT Staging Area useless?
Here is an example of when staging area is useful to me: In my day-to-day work development it is very common to receive a large demand, which needs many changes, so I open a Feature and start my…
-
1
votes1
answer89
viewsA: How to remove javascript cloned elements
Try this: document.querySelector('#saida #linha:last-child').remove();
-
1
votes2
answers42
viewsA: Block button if input’s of different names selected
Try this: <div id="lista"> <!-- grupo x--> <input name="x" class="caixa" type="checkbox"> X</br> <input name="x" class="caixa" type="checkbox"> X</br> <!--…
javascriptanswered Marcel 586 -
2
votes3
answers883
viewsA: Allow Select PDF only in JS
You can use valid Javascript for any browser for this. <html> <body> <h1>Selecione o arquivo PDF:</h1> <h3>Selecione o PDF:</h3> <form…
-
2
votes2
answers69
viewsA: Merge a Feature with multiple commits over time into another project
You can use the command Cherry-pick. You choose the commits you want and bring them to the branch you’re in. In the commit you want to replicate do - git log The answer will be something like this:…