Posts by rodorgas • 2,880 points
78 posts
-
1
votes2
answers739
viewsA: How to add +10 whole seconds to date in a loop in PHP
The numbers come out broken because the input has a value that is not multiple of ten. To fix this, you need to advance to the nearest time whose seconds is multiple of 10. We do it with the…
-
0
votes3
answers3504
viewsA: How to remove the last character from a field in Firebird SQL
Just make a UPDATE by dividing the value by 10. update minhaTabela set Campo = Campo/10 where [...]…
-
1
votes2
answers105
viewsA: checkbox in dynamic matrix field
The lines that create the cell are var texto=document.createTextNode(conteudo[i][o]); t.appendChild(texto); Note that the variable texto is assigned with the result of a call to the function…
-
2
votes2
answers398
viewsA: Selenium Python
This popup is not a real popup. It’s actually just a div with position: absolute. It’s a little complicated to access that input because it’s inside an iframe. The best thing to do in this case is…
-
2
votes2
answers119
viewsA: How to get the type of component clicked?
Suppose you have a variable _var which stores the event source, obtained from getSource(). You can get the type of this variable (and any other) with getClass(). The comparison can be made like…
-
3
votes2
answers15582
viewsA: Why does the background-image url search for the image inside the Content folder?
All paths beginning with / are absolute, all paths beginning without / are relative. It is searching in the Content folder because you specified a relative path (~/img/bg-img.jpg). That is, as your…
-
11
votes2
answers213
viewsA: What is the name of the operation when we make an ajax request to the internal server that in turn takes information from external?
Proxy in English means attorney, representative. In the context of computing, it’s any server that acts as an intermediary for clients asking for resources from other servers - and then you realize…
-
3
votes1
answer944
viewsA: Internet Explorer 11 does not show picture
This image has the wrong extension. It is a PNG (not JPEG) image, according to the command file. $ file logo_header.jpg logo_header.jpg: PNG image data, 903 x 167, 8-bit colormap, non-interlaced…
internet-exploreranswered rodorgas 2,880 -
7
votes4
answers489
viewsA: How does jQuery make parameters dynamic?
This is called Function overloading. Strictly speaking, there is no overloading in Javascript since it is allowed to pass any number of parameters of any kind to the functions. But this is often…
-
0
votes1
answer1029
viewsA: Iframe link opening in new tab?
If pages are in the same domain: Yes, it is possible. Just add the target="_blank" all links. Example with jQuery: $(document).ready(function () { $("iframe").load(function () { var iframe =…
-
5
votes1
answer5847
viewsA: How to play a youtube video in an iframe? Refused to display '' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'
Just open the video on Youtube and click Share, right above the description. A panel will open with the Embed option, click on it. You will be presented with an HTML code, just copy and paste it…
-
2
votes1
answer84
viewsA: Editing of python files
To insert this line, use the command sed: sed -i '2i-*- encoding: utf-8 -*-' arquivo.py -i saves the edits in the file itself 2i insere the string in the 2nd line To do this in all python files in…
-
2
votes1
answer1829
viewsA: Dropdown menu with Bootstrap
Your site is not using Bootstrap’s Navbar, it seems to depend on an external solution (I checked this in the custom.css file). Bootstrap’s Navbar was partially implemented on the site in a messy…
-
3
votes2
answers911
viewsA: Which plugin do I use to commit on Github using Pycharm?
No plugin needed, Pycharm offers built-in support for Git. Take a look at the documentation on Registering Github Credentials and How to Commit to a Git Repository.…
-
0
votes3
answers1239
views -
7
votes2
answers1314
viewsA: Encryption and its bits. How to explain?
Why each bit fits 0 and 1? In binary system, a bit (biNary Digit) can assume only two values. They’re being represented by 0 and 1, but this is just a convention. In some contexts they can be…
cryptographyanswered rodorgas 2,880 -
1
votes1
answer156
viewsA: Save data and insert into Checkbox
Save the services in a database table. To display all the options for the employee, the ideal is to use a Combobox, because the presentation mode is independent of the amount of services. Just make…
-
4
votes2
answers106
viewsA: How to not automatically sort IN(Mysql)
The result of a SELECT is sorted through the INDEX definitions in your table. For example, if your table has the column id as primary KEY, it will be an INDEX of your table automatically, although…
-
1
votes1
answer1394
viewsA: How to get the number of images in a folder with Javascript/Jquery
It is not possible to do with client-side Javascript, as the browser cannot have access to computer files (except in specific situations such as file uploads). If you need to count the files on…
-
1
votes1
answer495
viewsA: Request on a page with Guzzle
Several parameters are missing. Have you arrived at this list of parameters looking at the HTML form? This method is laborious and subject to failures. I recommend doing this by looking at the…
-
0
votes2
answers1771
viewsA: Python - take data from file . txt with regex
Just search for the sequence of digits after the keywords. In your example: >>> str = "PokerStars Hand #135235596385: Tournament #1228747530, $0.23+$0.02 USD Hold'em No Limit - Level I…
-
11
votes4
answers3804
viewsA: Lock CTRL key in All Browsers
Unable to protect your website text. These measurements are completely artificial, they’re just an ugly trick with Javascript. Anyone with Javascript disabled can do whatever they want. There are…
-
0
votes1
answer63
viewsA: Remote file upload with Javascript
Yes, it is possible to make POST requests by Javascript using Xmlhttprequest, alias AJAX. However, it is not possible to send an image to Tinypic that way, because it features Cross-Site Scripting…
-
2
votes3
answers5579
viewsA: Simple National Optional Consultation (by CNPJ)
When making the captcha request, you are not getting the image associated with the query. This is because the server differentiates different queries by the cookie - something you haven’t defined.…
-
4
votes1
answer1417
viewsA: Protect automated access web pages
Block access to search engine bots is very different from other cases. The first respects the rules you create, while the others try to circumvent any rules... is a game of cat and mouse. How…
-
9
votes1
answer2315
viewsA: Real time with PHP
Websocket is a bidirectional communication protocol compatible with all current browsers. It is ideal for persistent application-server communications, allowing notifications to be sent/received in…
-
6
votes2
answers1282
viewsA: Angular.js function to calculate age
You can implement a function: Controller $scope.calcularIdade = function calcularIdade(nascimento) { // Obtém a idade em milissegundos var idadeDifMs = Date.now() - nascimento.getTime(); // Converte…
-
8
votes6
answers15200
viewsA: What is and how does Bootstrap work?
Like any front-end framework, Bootstrap is a library that minimizes coding work in creating pages, with stylized and improved elements, as well as reusable components (icons, alerts, navigation).…