Posts by Wictor Chaves • 8,445 points
320 posts
-
1
votes2
answers454
viewsA: Inserting index and value into a two-dimensional array
From what I understand you just want to put a new column, so it’s pretty simple: foreach($dados as $indice => $d) { $dados[$indice]['nova_coluna'] = "Novo dado"; }…
-
2
votes2
answers805
viewsA: Place directory path in a php variable
Treat the link bar this way: $directory = 'C:/xampp/htdocs/placas'; $barras = array("/", "\\"); $directory = str_replace($barras, DIRECTORY_SEPARATOR, $directory); echo $directory; The variable…
phpanswered Wictor Chaves 8,445 -
2
votes4
answers707
viewsA: Function . click does not work on buttons that were dynamically generated by the . html function?
Don’t do it this way: $("button[name='btnAtender']").click(function(){ alert('teste'); }); And yes this way: $("button[name='btnAtender']").on('click', function(){ alert('teste'); }); "This is…
-
8
votes3
answers2531
viewsA: How to select all columns except one in particular?
This way you can: SET @sql = CONCAT('SELECT ', (SELECT REPLACE(GROUP_CONCAT(COLUMN_NAME), '<columns_to_omit>,', '') FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '<table>' AND…
-
0
votes1
answer52
viewsA: Error with loop for
The way you developed the code will really show all the information at once, only with php you will not be able to do this, because php works like this, it receives a request from the server and the…
phpanswered Wictor Chaves 8,445 -
0
votes3
answers1550
viewsA: Jquery - Color HTML element border
Try this way, you will not use the prop, but will solve: $("#teste").click(function(){ $(this).css('border', '1px solid #f00'); }); jquery css as its name says, it changes the element css.…
jqueryanswered Wictor Chaves 8,445 -
2
votes2
answers352
viewsA: When and why use :Hover and onMouserOver and onMouseOut?
This will depend on the effect you want to do, if you want it to simply change the image and nothing else, use the Hover in css, so the application will be lighter, if you want a custom Hover, the…
-
2
votes1
answer5140
viewsA: Display an ALERT and redirect the page
Try this way by placing the redirect in javascript as well: echo ("<SCRIPT LANGUAGE='JavaScript'> window.alert('Ocorreu um erro. A premissa não foi incluída')…
-
4
votes2
answers503
viewsA: Difference Location.href or Location.assign
When you use Location.assign it loads that content from the url, but when you use Location.href it works like a traditional link, so it’s better to do anchors with href: location.href = "#top"; And…
javascriptanswered Wictor Chaves 8,445 -
0
votes1
answer71
viewsA: Pycryptodomex installation error in osmc Raspberry pi
Missing install python-dev, try this: sudo apt-get update sudo apt-get install -t jessie python-dev
-
11
votes2
answers2509
viewsQ: What is the function of Function in jQuery and what is the right way or time to use?
Whenever I go to work with jQuery I just create: $(function() { }); Because it was the first way I learned, at first I thought it was a "int main()" pattern in C, but then I came across other forms…
-
0
votes2
answers43
viewsA: Hover is not being displayed correctly
Add z-index here: a.tooltips { z-index: 9999; ... Works this way:…
-
0
votes2
answers1008
viewsA: How to scroll in Javascript?
You take the screen size, and according to the scroll the progress bar walks: var body = document.body, html = document.documentElement; var height = body.scrollHeight - html.clientHeight; var valor…
-
3
votes2
answers362
viewsA: Error in isset PHP
It’s because of the expression, try to do it this way: <?php require './fb.php'; if (isset(filter_var("fb_access_token")) && !empty(filter_var("fb_access_token"))): echo "Ta logado!";…
phpanswered Wictor Chaves 8,445 -
1
votes1
answer2083
viewsQ: How to customize reCAPTCHA v2?
I put reCAPTCHA v2 on my website, but I have a problem like: I wanted to make him responsive, so he could track the size of the fields. I found a solution like: transform:scale(0.77);…
-
0
votes2
answers144
viewsA: Elements after the Hover Selector
When the mouse goes over the "element" the style will be applied in the "img", that is to say, let’s assume that the element is a div, when passing the mouse in the div the image inside the div will…
cssanswered Wictor Chaves 8,445 -
0
votes1
answer167
viewsA: How to configure xampp to accept the openssl_pkey_new command?
I wanted to use xampp because I liked its performance, I found it faster and easier to configure compared to wamp, but I gave up and went back to wamp, because throughout the project I used it and…
-
1
votes2
answers574
viewsA: How can I change the Edittext selection and pointer color?
You can change these things in the values/Colors.xml file <resources> <color name="primary">#3F51B5</color> <color name="primary_dark">#303F9F</color> <color…
-
0
votes1
answer167
viewsQ: How to configure xampp to accept the openssl_pkey_new command?
I’m trying to use the openssl_pkey_new command, it was working very well on wamp, but when using xampp it stopped. The code is like this: $sslConfig = array( "digest_alg" => "sha512",…
-
0
votes2
answers468
viewsA: HTML/CSS Element out of place
"I think I expressed myself badly. I want the footer at the bottom of the page following the flow, as in most pages. With the position Fixed it stays in the front of other elements on the page."…
-
0
votes2
answers885
viewsA: How to add an animation button to go back to the top of the page using the easings library?
I made this code is very simple to use: $(function () { var $doc = $('html, body'); $('.ancora').click(function () { $doc.animate({ scrollTop: $($(this).attr('href')).position().top }, 700); return…
-
0
votes4
answers635
viewsA: I want to subtract elements from an array in JS, but that returns several results
Do a go, and don’t forget to put up an index check: var arrayExemplo = [2, 5, 9, 10, 15]; var resultado = []; for (i = 0; i < arrayExemplo.length - 1; i++) { resultado[i] = arrayExemplo[i + 1]-…
javascriptanswered Wictor Chaves 8,445 -
1
votes2
answers451
viewsA: Get which div was clicked correctly
It is almost certain, but the problem is in the inside click, you click and then call the event click again inside: $j('.filter__filters').click(function(){ $j(this).click(); }); You have to define…
-
1
votes2
answers1081
viewsA: multiples Timezone php
You can change on the server, or this way in php itself: <?php date_default_timezone_set('America/Sao_Paulo'); echo date('d/m/Y H:i:s'); ?> If you need other regions:…
-
6
votes1
answer319
viewsA: PHP Sublime text 3 plugin
Gotodocumentation "Opens the keyword documentation the cursor is in." https://packagecontrol.io/packages/GotoDocumentation Sublimecodeintel https://github.com/SublimeCodeIntel/SublimeCodeIntel…
-
2
votes3
answers70
viewsA: Applying Hover to an article
To work, you must remove from tag article the attribute style and spend all that was in tag to the css: article.item{ margin: 5px; float:left; margin-left:10px; margin-top:15px; margin-bottom: 15px;…
cssanswered Wictor Chaves 8,445 -
1
votes2
answers613
viewsA: Arranging html and css table layout
If you want to always look like this and keep the scroll bar put like this on your body: body{ width: 1363px; } But if you want this to happen only on a specific page, create a class with the name…
-
0
votes4
answers320
viewsA: How to load a project in Laravel in an old version?
The problem is on the line: function event(...$args) { return app('events')->fire(...$args); } Make sure your php version is higher than 5.6.
-
0
votes3
answers2592
viewsA: Switch when hovering the CSS mouse
It is because element "a" does not have the display property as block by default, so it was only in a green part, it was with the inline display, so I put to change color element li. nav#menu ul{…
-
5
votes3
answers729
viewsA: Get font size in HTML
Likewise: var tamanho = $("html").css('font-size'); And if you want to remove the "px" to work with the integer: var tamanho = parseInt(tamanho.replace("px",""));…
-
2
votes1
answer131
viewsA: Return only part of the SQL field in the query
Testing in this way: Select SUBSTRING(F2,CHARINDEX('(',F2)+1 ,CHARINDEX(')',F2)-CHARINDEX('(',F2)-1) from [dbo].[Vestcasa_Ranking_Produtos_Custo_]
-
1
votes1
answer1643
viewsA: How to create Server in Postgresql with port other than 5432?
Change the file: /etc/init.d/postgresql-9.3 The line: PGPORT=5432 Then recharge the service: service postgresql-9.3 restart service postgresql-9.3 reload…
-
2
votes1
answer1042
viewsA: Transforming string in time in Javascript
Using the current date plus the time you need: var d = new Date(); var year = d.getFullYear(); var month = d.getMonth(); var day = d.getDay(); var hour = '12'; var min = '35'; var reserv = new…
-
1
votes3
answers861
viewsA: Simulate "ok" via command line
You can try creating a proxy.reg file: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] "ProxyEnable"=dword:00000001…
-
2
votes2
answers2868
viewsQ: How to know which libraries are being used in a python project?
I did an installation of an application made in Python, it works basically as follows, it installs Python, the program and at the end the installation copies the folder with the libraries for the…
-
4
votes1
answer442
viewsA: How to select multiple radios button in the same column of an html table?
For this not to happen you have to change their name, otherwise the browser interprets as if it were 1: <table id="tbl" class="table table-bordered table-hover dataTable"> <thead> <tr…
-
1
votes3
answers3914
viewsA: How to put the value of a PHP variable inside an input?
Use the isset also in the variable $crTot and identify the variable in the post as an example $_POST['ncr11'], I made the following code for help-Ló: <form method="post" action="calculos.php">…
-
0
votes2
answers330
viewsA: How do I work with the Javascript console?
I created this function to show anything in console.log, so far it is working perfectly, if anyone wants to improve thank you, I want to have a function that can show any variable, array or…
-
0
votes3
answers62
viewsA: $array exposing next result?
This part of the code is outside the php tag and there is also } more in the code. $orig = $array->dest; } $dest = $orig; }
phpanswered Wictor Chaves 8,445 -
0
votes2
answers1177
viewsQ: Saves browser status or cookies using Selenium
I’m doing tests using the web Whatsapp, so every time I run Selenium, read the qr code and start the tests, and I have to do this every time, I’d like to know if there’s a way to save the state of…
-
0
votes1
answer36
viewsA: Connection only works with manually set values
The problem was with Encode, of how it was caught the values of the port and ip.
-
1
votes1
answer235
viewsA: Error while trying to run android emulator without android studio
I was using two folders with sdk, while deleting one of them everything went back to normal.
-
0
votes2
answers47
viewsA: Difficulty with responsive
To scroll down the text when it reaches 600px resolution, you have to put the media screen at the bottom, so it is inherited. @media screen and (max-width: 600px){ Add: .a-right {float: none; width:…
-
10
votes2
answers1005
viewsQ: When finishing the script with "Ctrl+C" (Keyboardinterrupt) does not close Selenium Firefox
I am using Selenium to manipulate a page, while running the script it opens firefox, but what I wanted to do is this, if any problem in the script or if the user finishes, I want firefox to close as…
-
0
votes3
answers824
viewsA: Excel rounding value 7,256E+18
Put the value in this way ="7256001273850860168", as if it were a function, then yes it will identify as a string. Or format the field as text first to then insert the value, because as soon as you…
-
3
votes1
answer564
viewsA: How to copy attr from page to clipboard with Javascript?
You cannot set directly to the clipboard, first you have to create any hidden field, remembering that it will not work if it is of type Hidden, or with the display:None property, width:0 or…
-
5
votes2
answers575
viewsA: jQuery - How to get the first character of an input?
Take the input value and use the charAt function with the character position in case 0. var valor = $('#id_input').val(); alert(valor.charAt(0));
-
2
votes1
answer719
viewsA: How do I open a window, like windows explorer, from a website
You can use a simple file type input Take this example Html: <form id="post-form" class="post-form" method="post"> <label for="files">Select multiple files: </label> <input…
-
1
votes1
answer11
viewsA: Where did the _POST demo of the console end up in the new firefox?
If it’s "stop" this one: Network > You select the page that sent > next has the tab "Params"…
-
2
votes3
answers1528
viewsA: Format search field with CSS button
I made this css code: .busca{ margin-top: 50px; padding:0px; height: 48px; } #campo_busca{ padding-left: 10px; border: 1px solid; border-radius: 5px 0px 0px 5px; color:#C0C0C0; height: 48px; width:…