Posts by Diego Souza • 16,524 points
642 posts
-
0
votes1
answer50
viewsQ: How to create a test for a function with a service inside?
I have the code below and managed to create a test for it, when it enters error 400 and 200. However, I can’t get the test to enter the catch. I’m using Mocha and Chai. myController.approve =…
-
0
votes0
answers44
viewsQ: How to create a group of routes in Blazor with parameters?
I’m trying to create a structure in my Blazor Client-Side like this: Pages Users Index.Razor Show. On my page Index is like this at the beginning: @page "/users/" And on my page Show is like this:…
-
0
votes2
answers1100
viewsQ: How does the Laravel Model Save method work?
Saving: var $newOs = new OS; $newOs->date = date; $newOs->name = name; $newOs->Area = area; $newOs->save(); Note that on the last line is the $newOS->save, in which no parameters are…
-
2
votes3
answers102
viewsA: How to call tab
For this to work, you also need ul and li to have the tabs and tab classes respectively. However, this will break your layout. So, I suggest you create a jQuery function for each item of this and…
materializeanswered Diego Souza 16,524 -
4
votes2
answers122
viewsQ: How to create regular expression to search for numbers in parentheses?
I’m trying to create a Regex to get numbers that are in parentheses. So: 1) Pergunta 1 2) Pergunta 2 3) Pergunta 3 4) Pergunta 4 . . 10) Pergunta 10 So far I’ve managed to reach that: (^[0-9].* )…
regexasked Diego Souza 16,524 -
0
votes0
answers67
viewsQ: App Crash When Receiving Push Notification
The app is crashing, stopping, when I get a push notification. This is happening on Android 8.0 (Oreo) or higher. I see you’ve changed a policy, but I’m not getting it right in my code. I’m using…
-
0
votes1
answer94
viewsQ: How to Compile Android API 19 App?
I have an app here that’s a little old and I need to build it with API 19. But when I tried to climb Google Play, I was warned that my app should be at least API 26 (Android 8.0). But I need to…
-
1
votes2
answers1709
viewsA: Modulenotfounderror: No module named 'wordcloud'
First, on the root page of your project, where your Python script is Terminal right-hand. Then type ls. As in the image below, some versions may appear Anaconda. Choose the one you are using and in…
-
0
votes2
answers1286
viewsA: Take variable parameter Javascript/React function
In your case you can do it like this: class Home extends React.Component { constructor() { super(); this.state = { name: "João", age: 18 }; } handleName = e => { this.setState({ name:…
-
5
votes1
answer239
viewsA: Syntax error near limit
Mysql - Using the LIMIT. SELECT coluna1, coluna2, coluna3 FROM tabela WHERE coluna2 > 0 ORDER BY coluna3 DESC LIMIT 10 SQL Server - Using TOP. SELECT TOP 10 coluna1, coluna2, coluna3 FROM tabela…
-
8
votes3
answers229
viewsQ: Why is an anonymous function seen as an object in PHP?
$f = function() { echo "OK"; }; echo gettype($f); Returns Object when theoretically looking was to return function. - In JS: var f = function() {}; typeof f; Returns function.…
-
0
votes0
answers137
viewsQ: To use the Google Maps API, do you need to enable billing?
I’m trying to put a map on the site, but Google says in the browser console that you need to enable billing. That’s right? window.initMap = function(){ if(document.getElementById('mapa')){ map = new…
-
0
votes1
answer110
viewsA: onKeyUp on input Date
Does it have to block typing in the text box with Html5? Yes. With the attribute readonly. <input type='date' id='data' name='data' max="<?php echo date('Y-m-d'); ?>" readonly />…
html5answered Diego Souza 16,524 -
0
votes2
answers353
viewsA: Div block of size proportional to itself
Can you do with percentage using the padding. .content { width: 100%; height: 0; padding-bottom: 30%; background-color: #000; } <div class="content"></div> Click on EXECUTE, then in…
-
1
votes1
answer218
viewsA: Jquery Clear array when making new request
Use the function beforeSend: function() before the success to carry out this action. function getQuestions(){ $.ajax({ type: "GET", data: {id: $('#questionnaire_id').val()}, url:…
-
0
votes2
answers127
viewsA: Image is not loaded as background
In the image path, you do not need the quotation marks. In this case also no, but you must concatenate with the image name. <style> #backgroundImage{ background-image:…
-
0
votes4
answers2055
viewsA: SSL: no Alternative Certificate Subject name Matches target host name 'xxx'
Add on that option: curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
-
3
votes1
answer149
viewsQ: What is concatenative programming language?
I could not understand the definition made by Wikipedia. Concatenative programming language is a programming language in which all valid constructs, or terms, correspond to a function and the…
-
5
votes1
answer330
viewsQ: How to save bank data in the database?
When making a virtual store what is the best way to save the user’s bank data in the database? Credit card number, security number and expiry date. For example, using Laravel. It would use a type of…
-
1
votes2
answers284
viewsA: Select with two conditions
SELECT * FROM TABELA WHERE CODIGO <> 0 AND CODIGO <> 573
mysqlanswered Diego Souza 16,524 -
3
votes3
answers490
viewsA: How to use foreach in Javascript associative array
Only with Object is it possible to associate. let myArray = {}; myArray.zero = 0; myArray.um = 1; myArray.dois = 2; console.log(Object.keys(myArray ).length); Or let myArray = {}; let myArray = {…
-
0
votes2
answers28
viewsA: Seleção Elementos
$('button').on('click', function() { el = $(this).closest('tr').children('td.descricao'); el.css('background-color', 'lightgreen'); …
-
1
votes1
answer165
viewsA: Set responsive table size
The syntax is wrong. Said declare the class . <table class="bordered striped centered highlight responsive-table" style="width: 90%; max-width: 500px;">…
htmlanswered Diego Souza 16,524 -
5
votes2
answers240
viewsA: How to make a sequence of boxes with the triangular border on the right, on top of the other, box with CSS?
.wrapper { margin-top: 30px; } ul.menu { width: 100%; margin: 0; padding: 0; list-style:…
-
3
votes2
answers6999
viewsA: Link href to id div
I only know one way to do it with Javascript. I’m using jQuery below for ease. $('.anchor').on('click', function(event){ event.preventDefault(); var section = $(this).attr('href'); var top =…
-
1
votes2
answers41
viewsA: Format result of time
So it turns out that there’s no way to convert into time that way you did, since the function TIMEDIFF returns already in format H:i:s. Hence when you use the + operator to add up, it is no longer a…
mysqlanswered Diego Souza 16,524 -
1
votes0
answers77
viewsQ: How to simulate an ob_flush() in Laravel?
I have a form on which I upload. And sometimes the upload file is large. My site is on AWS using Load Balancer. Load Balancer expects a response from the request at a given time. However, the…
laravelasked Diego Souza 16,524 -
1
votes3
answers163
viewsA: How to draw a ribbon(gift loop or label) on a div?
body{ background-color: #C7C7C7; } .wrapper{ width: 100%; max-width: 600px; margin: auto; font-size:…
-
1
votes4
answers389
viewsA: media querie does not work
To leave a color on mobile, do not need to declare a max-width. Let’s just say as standard with a color. Then when it is 1001 or higher, will exchange for the image. Something important was missing.…
-
2
votes3
answers1597
viewsA: How to open a. php file that is in a subdirectory?
To access files from another folder has no secret: You’re in: index php. <a href="posts/meuArquivo.php">Página 1 </a> Now you’re in: posts/myFile.php and wants to return to index or…
-
3
votes2
answers37
viewsA: Navbar does not hide the div title when item is clicked
I don’t think there’s a Bootstrap class that would do that for you. I would create a: .has-header-fixed{ padding-top: 70px; } And would put in the body, on the pages you want. <body…
-
2
votes2
answers1415
viewsA: Error using whereRaw in Laravel
When using the whereRaw need not separate the operator as an argument, as if it were the where. $nota = DB::table('clima.tbl_resposta_super') ->selectRaw('sum(nota_original) as nota_original ')…
-
0
votes0
answers55
viewsQ: Model Relationship with Column Name Alias
I’m making an appointment with union in Laravel. $first = Friendship::selectRaw('id, userid, friendid, friendid as friend') ->where('userid', '=', $idUser) ->where('confirmed_friendship', '=',…
-
1
votes1
answer190
viewsA: How can I remove an array value by clicking on the typescript checkbox
When I want to remove a particular item from an object I do so: Object var array = ['A', 'B', 'F', 1, 2, 3, 5]; Look for 'F' inside the object. It will return your index. var index =…
-
0
votes1
answer38
viewsA: Error with relationship - Laravel
The second term of the function belongsTo() is the name of the key has that in the table users which will serve as a comparison with the table permissions. public function permission() { return…
-
0
votes1
answer876
viewsA: Close modal by clicking outside
I would do so depending on the version of Bootstrap. $(document).click(function (e) { if ($(e.target).is('#openModal')) { $('#exampleModal').fadeOut(500); } });…
-
4
votes2
answers213
viewsA: Laravel - Use OR inside the Where
Use orWhere to make or and another where just to make and. $numrow1=DB::table('teste') ->where('IdDesafiante', '=', 15) ->orWhere('IdDesafiante', '=', 16) ->count(); Use the || in this case…
-
2
votes1
answer27
viewsA: Image occupying the entire monitor
By default the tag body comes with margin. It’s good to use the good old: body{ margin: 0px; padding: 0px; } Search for CSS Reset, Normalize. You will find plenty useful content.…
cssanswered Diego Souza 16,524 -
1
votes1
answer31
viewsA: Sum null value Laravel
You can use the Coalesce, which will 0 when the value is null. DB::raw(" COALESCE(estudantes_carga_horaria.dias_letivos_oferecidos, 0) +…
-
2
votes1
answer120
viewsA: How to call php on a radio button
You have to initialize it before: $Result_sexoM = ''; $Result_sexoF = ''; if($result['sx_sexo'] == "Masculino") { $Result_sexoM = "checked"; } else { $Result_sexoF = "checked"; }…
-
2
votes3
answers28
viewsA: How to access the data-opened property of each div that is inside an array ? Jquery/Javascript
You need this FOR really? Only with the each you get what you want. var bares = new Array(); $('.bares').each(function(){ var opened = $(this).data('opened'); alert(opened); }); If you really need…
-
0
votes1
answer162
viewsA: How to convert /Date(1533524400000-0300)/ to PHP
Use this function I found on Soen: echo parseJsonDate('/Date(1533524400000-0300)/', 'date'); function parseJsonDate($date, $type = 'date') { preg_match( '/\/Date\((\d+)([+-]\d{4})\)/', $date,…
-
0
votes1
answer46
viewsA: Group values in a Mysql PHP query
You need to do group by by date: SELECT * FROM reporte_producao WHERE data_reporte BETWEEN '$data_ida' AND '$data_volta' AND turno = '$turno' AND grupo = '$v' GROUP BY date_format(data_reporte,…
-
2
votes1
answer93
viewsA: How to work with CSS visibility?
You can use the concept of Mobile First. .topo_branco{ visibility: hidden; height: 200px; margin: 20px 0; padding: 10px; } @media screen and (min-width: 576px){ .topo_branco{ visibility: visible; }…
cssanswered Diego Souza 16,524 -
1
votes1
answer534
viewsQ: How to remove list item within loop?
I’m trying to delete an item within a loop. I’ve heard it’s not possible. I’m seeing how to implement a comprehensive list. But I still don’t understand how it works. I tried to do so: result = [x…
pythonasked Diego Souza 16,524 -
3
votes1
answer33
viewsA: Change text when entering Amazon C2 host
Access the files: /etc/issue /etc/motd Change them (mainly the motd) with the nano or vim. A website that generates:…
-
0
votes1
answer29
viewsA: Problem loading video file
I managed to solve that problem. I installed the plugin Cordova-plugin-Whitelist and put in the config.xml the configuration: <allow-navigation href="*" />…
-
2
votes1
answer360
viewsA: Separate Array within Object
pedido = { id_pedido: "17", id_usuario: "34", nome_servico: "Servico 01,Servico 02,Servico 03", valor_servico: "250,200,380", total_servico: "830" }; let arrSer = pedido.nome_servico.split(','); let…
-
11
votes2
answers12801
viewsA: Serialize with pure Javascript
Using the FormData: var form = document.querySelector('form'); var data = new FormData(form); console.log(data);
-
0
votes1
answer29
viewsQ: Problem loading video file
I’m creating an app to watch a 360 video. I’m using this plugin: https://cordovavrview.tangodev.it/ This plugin uses Google VR View as a base. In this case it has a function called playVideo() which…