Posts by thxmxx • 530 points
33 posts
-
1
votes2
answers264
viewsA: convert minutes to : hours and minutes
$minutos = 150; $horas = floor($minutos / 60); $minutos = $minutos % 60; $exibe = $horas."h ".$minutos."m"; $hora_final = $exibe;
-
-2
votes2
answers549
viewsA: IP condition of the user via Javascript?
First, you should remove this line: <script type="application/javascript" src="https://api.ipify.org?format=jsonp&callback=getIP"></script>, because the use of this API is already…
-
1
votes1
answer543
viewsA: How to merge images and text to turn into a single photo?
As you can see on the console, it has to do with cors, tries to put the images in the same address as you are running the page. $(document).ready(function() { $('.nickname').click(function() { var…
-
2
votes2
answers672
viewsA: How to make a reflected text with CSS ? (like a mirrored text)
I think that would be so. Still have to make other more trivial adjustments. h1 { font-size: 3rem; font-family: sans-serif; text-align: center; } h1.flip { margin-top: -3.2rem; -moz-transform:…
-
3
votes2
answers4543
viewsA: What is an upsert?
It is a term used in a database to talk about a command, query or api, which will run a INSERT or a UPDATE, according to a probation. Examples: INSERT...ON DUPLICATE KEY UPDATE INSERT ... ON…
-
1
votes2
answers36
viewsA: Problem with running CSS animation
#loading { background-color: #0e5077; height: 100%; width: 100%; position: fixed; z-index: 99; margin-top:…
-
1
votes2
answers122
viewsA: What is it for { } inside the main
It has no programmatic functionality other than separating the scopes (being able to declare variables of the same name with different types) and probably the author used to organize the code in the…
-
1
votes1
answer581
viewsA: Is it possible to obtain the SIM number in firemonkey(Delphi)?
If it’s android: uses Androidapi.JNI.Telephony; var tMgr: JTelephonyManager; PhoneNumber: String; begin tMgr :=…
-
3
votes1
answer176
viewsA: Concatenation with Comma and Plus Sign
This is not concatenation, the function log(...) is multiple arguments. When you do console.log('Memoria Livre: ' + os.freemem()); you are calling the function with 1 argument, which is a string…
-
-1
votes2
answers78
viewsA: In Java would a variable receive a function like in Javascript?
No... the nearest would be: metodoTeste(new Runnable() { @Override public void run() { System.out.println("Hello"); } }); or metodoTeste(() -> System.out.println("Hello"));…
-
4
votes3
answers736
viewsA: jQuery - Field with maximum 4 digits and complete with 0 left
You have to set the option autoclear: false. And your if should be: if (num == '0___' || num == '00__' || num == '000_' || num == '0000') jQuery(function($){ $("#numero").mask("9999", { autoclear:…
-
1
votes2
answers676
viewsA: Delete last entered digit
Use the method substring, input.value = inputText.substring(0,inputText.length-1); <input id="input" type="text"/> <button onclick="apagar()">Apagar</button> <script>…
-
0
votes2
answers770
viewsA: Cannot read Property 'setAttribute' of null com ngFor
Try to do the querySelector by an id. document.querySelector('#idteste').setAttribute('class','cor'); console.log('document.querySelector(\'#idteste\')', document.querySelector('#idteste'))…
-
-3
votes3
answers94
viewsA: Change given inside date attribute
Create this script in tampermonkey and exchange #test for the id you will use and the respective value on the line $('#teste').attr("data-delay-duration","400");. // ==UserScript== // @name New…
javascriptanswered thxmxx 530 -
1
votes1
answer49
viewsA: How do I accept only letters in the Ruby entry?
class String def pega_maiusculas self.scan /\p{Upper}/ end def pega_minusculas self.scan /\p{Lower}/ end end str = "Teste TeStE tEsTe" maiusculas =…
-
0
votes1
answer19
viewsA: Function on of openlayers in Typescript
Try the following this.imagery.on('postcompose', function(event: ol.events.Event){ console.log("postcompose"); var ctx = event.context; ctx.restore(); return true; });…
-
0
votes1
answer27
viewsA: How to select a child in JS and use the value you assign it in a function?
Well, I didn’t really understand your question, but just set the click of the div, because the click of the child runs first... $(function() { let appid; $('#dsmenu').click(function() {…
-
1
votes1
answer77
viewsA: Detecting URL in Textarea with Regex
See if I got it right.... Run there. // Add your javascript here $(function(){ function changeColor(parent) { var text = parent.text().replace(/\r/g, ''); var newHTML = "";…
-
2
votes3
answers48
viewsA: Object for a javascript array
let sel = { "1": { "id_turma": 485, "codigo_turma": "1112A - 41", "ano_ciclo": 14 }, "2": { "id_turma":…
javascriptanswered thxmxx 530 -
0
votes2
answers522
viewsA: Dynamic allocation of vectors
Following your style... #include <stdio.h> #include <stdlib.h> int main(){ int *vet, c=0, c2=0, *vet1, aux, N=1; vet =(int*) calloc(10, sizeof(int)); do { scanf("%d", &aux); if(!aux)…
-
1
votes1
answer1259
viewsA: How to decrease TAB size in Sublime Text 3
To set the default, go to Preferences -> Settings - Default/User and use the following configuration: { "tab_size": 2, "translate_tabs_to_spaces": true, "detect_indentation": false } Edit: After…
-
1
votes1
answer386
viewsA: How to make Tyscript read a JSON file that is on disk?
You cannot simply import a JSON file without the proper Exports. Do the following: Myfile.json export const orderPayload = {...} And then you can do import { orderPayload } from…
-
1
votes1
answer32
viewsA: Problem implementing update method in Angular 2+
I believe that the only purpose is to consider "const codigoLancamento" as a variable of scope of ngOnInit. This variable had to be from the scope of the Component, for you to access it in Submit.…
-
0
votes1
answer103
viewsA: How to enable a button after validation?
... success: function(data){ $("#resultados").html(data); if(data.search("Nao existe") != -1) $("#registrar" ).prop( "disabled", false ); }, ... …
-
1
votes1
answer467
viewsA: Iteration of arrays and objects
Your JSON is not in the format for you to run ngFor in this way. As the error itself says: "Cannot find a differ supporting Object '[Object Object]' of type 'Object'. Ngfor only Supports Binding to…
-
0
votes2
answers51
viewsA: "i" turn an HTML button
Plunker <i data-toggle="modal" data-target="#facebookModal" class="btn btn-primary"> <span class="fab fa-facebook"></span> </i>…
-
0
votes2
answers60
viewsA: Help with searching for information in an html with js/Node
I modified the code for you. const url = 'http://www.ppg-educacao.uff.br/novo/index.php/corpo-docente' const axios = require('axios') const cheerio = require('cheerio') let objs = [] let nomes = []…
-
1
votes1
answer379
viewsA: Mobile Numeric Angular Keyboard
Just modify the type attribute in the input. <input type="number"/> or <input type="tel"/> EDIT: <!DOCTYPE html> <html> <head> <link rel="stylesheet"…
-
1
votes2
answers1197
viewsA: Angular 404 (Not Found)
Change(or create) the file .htaccess, at the root of the site. RewriteEngine on RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d…
-
0
votes1
answer328
viewsA: How do I put next/Prev Buttons and Dots Controls on my css/javascript slideshow?
I made an example for you, based on your code. Plunkr index.html <head> <link rel="stylesheet" href="style.css" /> <script src="script.js"></script> </head>…
-
0
votes2
answers114
viewsA: How to format html tags with javascipt
It is possible to do this by the attribute contenteditable="true" in a div, for example. Plunkr…
-
0
votes2
answers396
viewsA: Get next record on a grouped foreach
You can use a counter to be the iteration index and use the value i+1 to access your list. @{int i = 0;} @foreach(...) { <span>@i+1</span> i++; } Edit: var lista = Model.Lista.GroupBy(d…
-
1
votes3
answers35
viewsA: Ajax not sending request
Probably the return of some call to querySelector() is null. Try debugging the value of these variables: var a = document.querySelector('input[name="rdEspecieArquivo"]:checked'); var b =…