Posts by Lucas Caresia • 2,663 points
185 posts
-
0
votes0
answers24
viewsQ: How to pick up the microphone level using Javascript
What I would like is a way to get the level of the microphone I define in Windows. I use this code to catch the stream navigator.mediaDevices.getUserMedia() .then(function(stream) {…
-
4
votes0
answers83
viewsQ: What is the best way to do a very large and repetitive task?
I need to take the duration of 18000+ audios, using the library audioread for each audio it takes right 300ms, ie at least 25~30 minutes of processing. Using a system of Queue and Process, using all…
-
2
votes2
answers241
viewsQ: How to manipulate audio volume in real time
How can I manipulate the volume of this audio in real time ? import time, pydub, numpy as np, sounddevice as sd, random file_path = '/path/to/file.mp3' def read(f, normalized=False): a =…
-
0
votes2
answers64
viewsQ: How to create some kind of "dynamic index" in the database
I have a table with 10000 records, but here I will represent with only 10 of them. +-------+---------+------------------+ | index | posicao | nome | +-------+---------+------------------+ | 1 | 0 |…
-
2
votes2
answers196
viewsQ: How can I test if a Nodejs Response is still alive
I have a Response from Nodejs(Express), how can I test if he is still alive ? let responses = [] app.get('/', async function (req, res) { responses.push(res) }); setInterval(() => {…
-
-2
votes1
answer932
viewsQ: How to measure each individual element in a matrix
Hello, I have the following matrix: matriz = np.array([ [5, 5, 5], [5, 5, 5], [10, 10, 10] ]) and accurate the result with an array of their respective medias, thus: [6.66, 6.66, 6.66] Grateful…
-
1
votes0
answers24
viewsQ: Httpserver gets OPTIONS from Axios and Vue-Resource
When I send a request with Axios or Vue-Resource, with the http server I end up receiving an OPTIONS instead of DELETE, POST, or PUT. Requisitions: this.$axios.put('http://192.168.0.103:3389',…
-
6
votes2
answers2605
viewsQ: How to insert an HTML file with [innerHtml] and maintain Angular attributes
In my Componente i receive an HTML in the form of String and use [innerHtml] to insert this HTML in the Component View. Component: test(){ alert('Teste :D'); } html_string = '<input type="button"…
-
4
votes2
answers130
viewsQ: How to store an operator?
I wonder if you have any way to store an operator in a variable, for example a = < if 5 a 5: pass
-
1
votes1
answer83
viewsQ: How to load only one line and modify it
I want to modify just one line of a file, something like that with open('arquivo.txt', 'r+') as f: for line in f.readlines(): if line == algumacoisa: line.write('textoaqui'); break f.close() I saw…
-
0
votes0
answers54
viewsQ: How to increase the performance of a search with for
Basically the program I did does this same procedure, but with more data. I need to increase search performance, of course this can be done with libraries if it’s better. No matter how you improve…
-
2
votes2
answers552
viewsQ: How best to craft AI for a simple game
Based on this little game, I started the first generation completely Andom, storing in an array all sides that the bar moved (right - 1, left - 0) and finally (at the last position of the array) how…
-
3
votes1
answer1363
viewsA: Laravel and Front-End
I would recommend using a framework for the front end since as you said yourself, you need to pass a good experience to the user, and updating screens is not so cool. Besides that I believe it is…
-
3
votes1
answer121
viewsQ: How to create a Bitmap larger than 9999 pixels
When trying a create a Bitmap I realized I can’t create with the size I wanted, I need an image with 16581375 x 1. Bitmap image = new Bitmap(16581375, 1); image.Save("Path aqui"); When I try to…
-
3
votes2
answers62
viewsQ: How to perform a function N times in 1 second
I need to perform a function N times, but what I have done so far has not worked, remembering that N times has to be distributed equally by 1 second. async function sendImage() {…
javascriptasked Lucas Caresia 2,663 -
0
votes2
answers3792
viewsQ: Onunload methods and onbeforeunload do not work
Based on that reply i would like when the user closes the tab(or updates) to receive an Alert saying Tchau, but only when I enter the page he tells me Olá, when I upgrade or close the flap, it…
javascriptasked Lucas Caresia 2,663 -
0
votes1
answer221
viewsQ: How to send image to route from Laravel with AJAX
I have a common POST route on the Laravel, but in a separate project I would like to use AJAX to send an image to that route. I will use html2canvas to get the screenshot of the screen. var content…
-
0
votes1
answer310
viewsQ: How the PNG file works
I was looking at this picture and she has 8,21 KBs(8210 Bytes), its size is 100x100px, totalling 10.000 pixeis. So every (8210 / 10000) 0.821 Byte it can save position and color. How is it done ??…
imageasked Lucas Caresia 2,663 -
1
votes1
answer94
viewsQ: How to make a filter with a text field
I want to use the value of #search as a filter (only the field name from the JSON) to the v-for. The text inserted in #search and the way the filter is going to be is actually indifferent to me,…
-
2
votes2
answers48
viewsQ: How to do quicksort animation with canvas
I tried redesigning the canvas every time it swaps, but it first renders everything and then draws. I would like each Swap to redesign the canvas with the object information. <!DOCTYPE html>…
-
-3
votes2
answers286
viewsQ: How to avoid memory bursting with recursiveness
I have a function that is called recursively, how to avoid memory bursting ?? int cont = 0; public void recur() { recur(); cont ++; System.out.println("Chamado: " + cont); }…
javaasked Lucas Caresia 2,663 -
0
votes1
answer234
viewsQ: How to get all the href from another external page
I would like to access an external page(google for example), and inside it running a script to capture all hrefs, I read about the fact that browsers don’t allow using GET to get html, but I believe…
jqueryasked Lucas Caresia 2,663 -
3
votes1
answer403
viewsQ: How to make a grid with squares?
I would like to do something like this one, a grid based on an array (and that based on the value of the matrix, set a color to the corresponding cell), and I can manipulate it with the mouse.…
-
0
votes0
answers127
viewsQ: Error executing make command with repository plugin
When I execute the command php artisan make:entity User it returns the error [ReflectionException] Method Prettus\Repository\Generators\Commands\EntityCommand::handle() does not exist I did the…
-
2
votes2
answers44
viewsQ: Which way to change variables is more optimized?
I made two ways to change the value a and b, but which is more optimized, taking this example to other languages like desktop or web. No use auxiliary variable: $a = 10; $b = 5; $a = $b+$a; $b =…
-
0
votes2
answers51
viewsQ: I cannot place element inside JSON
I have this JSON ["{\"clube\":[\"Flamengo\"]}"], and when I execute that code: $clubes = '["{\"clube\":[\"Flamengo\"]}"]'; $clubes = json_decode($clubes, true); array_push($clubes->clube,…
-
0
votes1
answer124
viewsQ: Returning External Array when Retrieving Data with Laravel
I have a column called clube and in one line she has the following {"clube":["Santos"]}, using this form for the data $clubes = Socios::where('socio', $socio)->select('clube')->get(); He…
-
1
votes2
answers61
viewsQ: jQuery.get runs after all the rest of the function
Running this code the sequence of Alerts I have is begin, outside, final e inside, how to solve this ?? addLine(){ alert('begin') jQuery.get('database/addClube/'+this.clube);…
-
0
votes1
answer267
viewsQ: How to Get Answer from a Route with JS
The route is configured this way: Route::get('database/getClubes', 'DataBase@getClubes'); The Controller is like this: public function getClubes() { return ClubesDB::getClubes(); } The Model looks…
-
0
votes0
answers29
viewsQ: Error with when trying to enter information with routes
In api.php have that code: Route::group(['middleware' => 'api'], function() { Route::post('clube/addClube', function(Request $request) { return App\clubes::addClube(['name' => $request ->…
-
2
votes1
answer117
viewsQ: Vue JS always removing the first item
Regardless of which line I try to delete, it always deletes the first: Returns the following error: Property or method "$index" is not defined on the instance but referenced during render. Make sure…
vue.jsasked Lucas Caresia 2,663 -
1
votes3
answers1201
viewsQ: Accented characters are considered as two characters
Accented characters are considered as two (I imagine the number of bytes), how can I fix this ?? $t = "á"; if(strlen($t) == 1){ echo "UM CARACTER"; } if(strlen($t) == 2){ echo "DOIS CARACTER"; }…
phpasked Lucas Caresia 2,663 -
3
votes1
answer50
viewsQ: I get different results when I convert from Character to Decimal in PHP and Java
When I convert á to decimal I get the result 225 with this code in Java: public static int charToDec(String text){return (int) text.charAt(0);} When I convert á to decimal I get the result 195 with…
-
1
votes1
answer51
viewsQ: Scanner isn’t picking up all the lines
I have a file with 7 million lines, but my code takes at most 63000 and returns no error. Scanner sc2 = null; try { sc2 = new Scanner(new File("./assets/words.txt")); } catch (FileNotFoundException…
-
1
votes1
answer607
viewsQ: Bootstrap code does not work
Hello, I’ve been testing that Carousel, but it didn’t work in my project, I decided to test the Jsfiddle, and it didn’t work either. Jsfiddle: https://jsfiddle.net/Lxv5q5u9/ The problem is that it…
-
1
votes1
answer368
viewsQ: How to draw GIF with Image and drawImage
I need to draw a GIF, I have the following code: public BasicBlock(String path, String name, int id, boolean gif){ this.path = path; this.name = name; this.id = id; File img = new File(path); try {…
-
0
votes1
answer279
viewsQ: How to draw an image with Canvas?
I have this code and I want to draw an image: public void render(){ BufferStrategy bs = getBufferStrategy(); if(bs == null) { createBufferStrategy(3); return; } Graphics g = bs.getDrawGraphics();…
-
0
votes1
answer15
viewsQ: Does not set display to flex when you hover over
Even passing the mouse over the class name does not appear .img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); } .img:hover { filter: grayscale(0%); } .img:hover .name {…
-
3
votes1
answer90
viewsQ: 1st becomes 1 u00aa when I enter into json
When I insert 1ª in JSON with codeigniter, when turning into string it turns 1\u00aa. $t[0]["teste"] = "1ª"; $data[0]["algo"] = $t;
-
0
votes0
answers385
viewsQ: How to replace array value
That’s my code these days, I’d like to add the season (which I can already do) and then the episodes within this season (which I’m not getting to do). <?php $string =…
-
0
votes1
answer40
viewsQ: I need to get the children of an element
I need to get the value of inputs with ID nome and sobrenome, but when I use $_POST, it will return only the first, and I need all separately. <form method="POST"> <tr id = "0">…
-
-3
votes4
answers1595
viewsA: Leaving div height equal to width using css only
Hello, try this way and see if it solves your problem. <div style="width:100px; height: 400px; background: #4a4a4a"> <div style="width:25%; margin: 1px; padding-bottom: 25%; background:…
cssanswered Lucas Caresia 2,663 -
0
votes1
answer162
viewsQ: How to catch div’s son with contains
In that case I want to test the div with class name, but after testing I want the CSS changes to be made in div with class teste. <div class="teste"> <div class="name">um…
-
0
votes2
answers1575
viewsQ: How to run file . vbs on Windows Start
As I could run a file . vbs when windows start, I can make a file . bat run by regedit. I already put a . bat to open . vbs, I did so cscript "C:\teste.vbs" exit…
-
9
votes2
answers1680
viewsQ: Disconnect case sensitive in Postgres
When I make the command select * from tabela where name like '%teste%' the line with the name TesTe returns, but the same does not happen in postgres, I do not want to put lower(name) to work, how…
-
0
votes1
answer497
viewsQ: Direct link does not work with wget on ubuntu
I’m trying to download straight from this link https://punchsub.zlx.com.br/download-vip/6262326895623150684821353451533450406/shingeki-no-kyojin-2-7-mp4, even using the command wget --user=usuario…
-
0
votes0
answers21
viewsQ: Error 404 while accessing file with . htaccess
For now I’m with the following .htaccess: RewriteEngine On RewriteBase / RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME}\.php !-d RewriteRule ^index.php\/(.*)$ pages/$1.php…
-
1
votes2
answers356
viewsQ: How to use . htaccess with 2 arguments
I looked on the internet, I found some examples, but I did not understand very well, for example, I need that when it is accessed site.com/stream/nome he runs the file stream.php, inside the archive…
htaccessasked Lucas Caresia 2,663 -
0
votes0
answers29
viewsQ: Videojs ASS does not work on pages with Rewriterule
I use RewriteRule (.*) /index.php [QSA,L] and to manage the Urls use this code: <?php $url = ltrim( parse_url( $_SERVER['REQUEST_URI'] , PHP_URL_PATH ) , '/' ); $url = explode( '/' , $url );…
-
2
votes1
answer7860
viewsQ: How to align elements within a DIV to the left of it
I’d like it to stay this way: .episodesContainer { width: 90%; height: auto; background: rgba(105, 203, 115, 0.5); margin-top: 40px; margin: 0 auto; display: flex; align-items: center;…
cssasked Lucas Caresia 2,663