Posts by lazyFox • 3,227 points
103 posts
-
1
votes1
answer83
viewsA: How to assign an image that is on the screen as a canvas background
Just take the value stored in the attribute src of the image. Example: var canvas = document.querySelector("#canvas"); var context = canvas.getContext("2d"); var fundo =…
-
3
votes4
answers6855
viewsA: Execute function when losing focus of an input
As an add-on here goes the jQuery version: $( "#hLane1" ).blur(_ => { alert( "Hoje é sexta ^.^ " ); }); <script…
-
4
votes2
answers133
viewsA: How to move the cursor to the end of content with span of a contenteditable element after Focus
Here is a solution using the crease and the Selection : $(document).on('click', '.btn', function (e) { var el = document.querySelector(".formfield"); var range = document.createRange(); var sel =…
-
4
votes3
answers347
views -
2
votes2
answers40
viewsA: Print more than one value with json
Just concatenate the values you want to print. // Storing data: obj = {name: "John", age: 31, city: "New York"}; // document.body.innerHTML = obj.name + " " + obj.age + " " + obj.city;…
-
2
votes1
answer388
viewsA: Pick up music track information with JS
You can get this data through tags ID3 mp3 files, but to read this information you will need to use Apis Filereader and Dataview. Here is an example:…
-
0
votes1
answer26
viewsA: You are not accepting special characters via javascript
Change your file to use encoding utf-8. See this link how to change encoding in Visual Studio You can always use an external program to change the encoding such as Notepad++…
-
2
votes1
answer98
viewsQ: Proxy Object in javascript
I came across a type of object called proxy in javascript which is its real utility? And what would be the traps/traps?
javascriptasked lazyFox 3,227 -
7
votes2
answers813
viewsA: Draw circle in Html5
I basically reused your code to make another arc, only in the second arc we’ll start drawing the same from point 1*PI and in the opposite direction of the clock hands. The Arc function has the…
-
2
votes1
answer122
viewsA: Collision Fires Gameover on Unity
You can do two ways, check if the block collided with the floor or check if the floor collided with the block. Create a script with the name DetetaColisao and associate with the block Prefab, then…
-
1
votes1
answer56
viewsA: Get id of two html elements?
As the two ids are distinct variables you have to know which position you want to access. You can use the foreach but you have to create a variable in advance to store the current position and then…
-
1
votes1
answer180
viewsQ: Add Vuejs models with model.number
I was trying out vuejs and I ran into some difficulties, basically I was adding up 3 inputs and putting the result in a 4th. Problem, let’s assume I enter: t.value1 => 1 t.value1 => 0 ( need…
-
1
votes1
answer826
viewsA: How to convert variable from type number to string in typescript?
I’m not sure I quite understand your question, but I’ll give you the hint. Method toString var jogadorPontuacao = 1; var computacaoPontuacao = 2; console.log( `${ jogadorPontuacao.toString() } - ${…
typescriptanswered lazyFox 3,227 -
1
votes1
answer86
viewsA: Move a great Wordpress site own to Wordpress.com
If the website has a gender control panel Cpanel can make a backup through it. In this backup you will have BD, emails and everything included in the public_html folder. Then simply import the…
-
4
votes2
answers4704
viewsA: Complete decimal places ",00" Javascript
The simplest solution would be to use the function toFixed. Follow an example: var numero = 1; console.log(numero.toFixed(2)); Note that this function rounds the numbers in some cases. Take this…
-
5
votes4
answers13602
viewsA: Check that the array() is empty with PHP
I will leave this reply here as a complement to comrade @Rbz’s reply. Your count returns true because its array has 31 elements, although the content of each element is an empty array. You can check…
-
2
votes3
answers1210
viewsA: Select to bring the amount of certain records in related tables
You can easily get this result using group by, see this example: Select s.nome, count(s.id) as quantidade from setores s, colaboradores c where s.id = c.SETOR Group by s.id See the example working…
-
1
votes3
answers1953
viewsA: Batch script to rename file extension recursively
You can use the command for. See if this example meets your needs: CD D:\Downloads\ For /R %%G in (*.rar) do Echo REN "%%G" "%%~nG.cbr" The parameter /R will make it recursive, so it will go through…
-
3
votes1
answer206
viewsA: AJAX POST WITHOUT REFRESH
You are using the wrong event to place the order. Instead use the onclick should use onsubmit. The event onsubmit is called from the moment you submit the form through the mouse click. $(()=>{…
-
0
votes1
answer52
viewsA: Run function for multiple items in JS
The problem is that you are only accessing the first div with the cloud attribute document.getElementsByName("cloud")[0] In document.getElementsByName("cloud") you have a list of all the Divs, so…
-
0
votes3
answers60
viewsA: define div size according to svg in js
I understand you want to resize a div. So to make a div resizeable you must use the property resize of the CSS. Example of use: div{ border: 1px solid; height: 100px; resize: both; overflow:auto; }…
-
5
votes1
answer205
views -
2
votes2
answers188
viewsA: How to clone Divs from a past Select number?
Friend you were on a good path with the use of $("#grupo-lotes").html(''); only that your div lotes it must be outside the parent div in order to be used again in cloning, as it will be eliminated…
-
2
votes2
answers161
viewsA: Keep data in the PHP form textbox | HTML
You must fill in these fields with the request data POST / GET Assuming you’re using the method POST <input type="text" name="nome" value="<?php echo $_POST[nome]; ?>"/> Same…
-
1
votes2
answers100
viewsA: Install Composer in Windows 2012
Delete the php5 installation, there is a conflict in the php.ini call
-
7
votes3
answers690
viewsA: Check whether html form numeric field has a maximum of 6 numbers with PHP
You can check if a field is filled in several ways: if($campo != NULL ) if(!$campo) if(!$campo == "") if(isset($campo)) if(!empty($campo)) if(strlen($campo) > 0) if(!strlen($campo)) // porque…
-
0
votes1
answer90
viewsA: Questions with Playstore rules
According to Google Developer Policy Center Sexually explicit content Apps that have or promote explicit sexual content, such as pornography, are not allowed. In general, content or services are not…
google-playanswered lazyFox 3,227 -
2
votes0
answers54
viewsQ: Autoloading in PHP Classes
What would be the Autoloading of PHP Classes? I see people using __autoload and spl_autoload_register there is a difference? What association exists between the autoloader of commiserate and the…
-
2
votes1
answer37
viewsA: Jquery code shows different result depending on browser
You can always use the date and time separately: <input type="date"/><input type="time"> You can also play a little with css to manipulate the edges input { border: 1px solid; outline:…
-
4
votes2
answers1082
viewsA: Collision system for game in Html5!
What you’re doing is not right because basically you’re checking to see if one pixel collides with another. You should check the collision using areas/ranges. Here are the most common types of…
-
0
votes4
answers191
viewsA: Assign more than one value to a checkbox
You can use the Html5 date attribute to save "extra" date to your checkbox, or enter values delimited by some symbol. Examples: function imprimeValores(){ var el = document.getElementById("teste");…
-
0
votes1
answer18
viewsA: Proguard, how not to change a certain variable
According to the document there are several methods to preserve class names and their members. -keepnames nome_da_classe -keepclassmembernames nome_da_classe See the documentation proguard.…
-
1
votes1
answer1176
viewsA: Check if the user is connected to the internet
You can check the connection via the command Navigator. Example taken from MDN Web Docs website if (navigator.onLine) { console.log('online'); } else { console.log('offline'); } Another example via…
-
1
votes2
answers1875
viewsA: imagecreatefrompng() function does not exist - Undefined Function error
This function is part of the library php-gd. You need to install it on your machine to make use of it. yum install php-gd # CentOS apt-get install php7-gd # Ubuntu…
-
1
votes2
answers1067
viewsA: How to detect a certain sequence of numbers in javascript?
You can validate repetitions with the following expression: /([0-9]{2,3})\1/g It will evaluate whether there are groups of 2 or 3 digits repeated, ie : 1212 or 123123 Example: var cep =…
javascriptanswered lazyFox 3,227 -
3
votes1
answer5282
viewsA: Python - Sort string order by order of increasing number of letters
Right now you are making an alphabetical order ordering, and from what I understand you want to sort by the string size of each element, so: lista_nomes =['Manuel', 'Laura', 'Antonio', 'Jasmim',…
-
3
votes2
answers262
viewsA: Extract exploded results from a column
You have to "treat" that $result to determine how you want to handle the data. A widely used method is the fetch_assoc() which returns an associative array of the table. So let’s make a loop with…
-
1
votes4
answers302
viewsA: getElementById not working
In your situation it makes no sense to use the eval, moreover the Eval should be avoided. If you want to pass the "reference" of an element you can easily replace: info1 =…
javascriptanswered lazyFox 3,227 -
6
votes1
answer430
viewsQ: Use missing ids
After seeing this question I have remembered a problem I have encountered several times: Let’s assume that there is the following table: Fruta ----------- 1 | Maça 2 | Banana 3 | Pêra Should it…
-
1
votes1
answer86
viewsA: Open Asp.net web page
With a small search you easily discover how to solve your problem, yet here is an example: System.Diagnostics.Process.Start("http://omeusite.com")
-
0
votes2
answers74
viewsA: Get content in Javascript
Making a GET request using pure javascript: var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) {…
-
0
votes3
answers3219
viewsA: How to align image next to image
You can also make use of the property flex of css Following example: .conteudo { display: flex; justify-content: center; } .conteudo > img { height: 100px; } <div class="conteudo"> <img…
-
2
votes2
answers67
viewsA: Browse an array where the index is a Date
You can use the foreach Example: $array = array("2018-04-07" => array("conteudoid" => "a"), "2018-04-08" => array("conteudoid" => "b"), "2018-04-09" => array("conteudoid" => "c"));…
-
2
votes1
answer139
viewsA: Json - JAVA (Eclipse)
There are several libraries for this purpose, but I recommend GSON Example of JSON for JAVA: Gson json = new Gson(); String string_json= "{\"ID\":\"9\",\"pais\":\"Korea\"}"; Info info=…
-
1
votes1
answer126
viewsA: What good is this command?
This command returns the name of a layer, and takes as parameter a int, that is to say (retorna string) GetLayerName(int layerIndex); What you want best is to change the layer’s "Weight":…
-
0
votes2
answers110
viewsA: Use two functions in the same Javascript
From what I understand intends to create two identical functions by making only a "statement". A possible solution would be: var labelthumbs = labelthumbs2 = function(e){ document.write('<ul…
javascriptanswered lazyFox 3,227 -
2
votes4
answers3766
viewsA: How to create a clickable div?
A way to "create" a clickable div would be: #clicavel{ cursor: pointer; } #clicavel:hover{ color: red; } #clicavel:active{ color: blue; } <script> function executaAcao(){ alert("Eu vou para o…
-
0
votes1
answer64
viewsQ: Python, Game of Life Implementation
I noticed that there is already a question related to this issue, but my implementation will be different. The code I have at the moment is as follows:: import sys, pygame pygame.init() size =…
-
0
votes1
answer41
viewsA: I calculate hours discounted weekends
You can use the strtotime to subtract hours from a pre-established date: $data_final = strtotime('-1 day', strtotime($data_sem_descanso)); Edit, the code below returns the number of days of a month…
-
2
votes1
answer62
viewsQ: How to detect the source(file) of a function through the developer console?
I don’t know if this question fits the OS standards/scope, but here it goes: It is possible to detect the origin(file) of a javascript function through the developer console in the current browser?…
javascriptasked lazyFox 3,227