Posts by Marcelo Shiniti Uchimura • 3,302 points
208 posts
-
0
votes1
answer36
viewsA: Problems in reading and organizing a C matrix
In this passage: for(i=0;i<Lin;i++){ for(j=0;j<Col;j++){ if(partic1[i][j]==resultado[i][j]){ cont_pontos_regra_um++; Do so: for(i=0;i<Lin;i++){ int linhas_iguais = 1; // a principio sao…
canswered Marcelo Shiniti Uchimura 3,302 -
0
votes1
answer85
viewsA: Can I use a variable to set a path in Filestream?
Do the relative path, even, and add your . txt of each project in the Solution Explorer, in the respective csprojs. Imagine that Solution is the root and places your . txt in the same relative path…
-
0
votes1
answer89
viewsA: How to return an avinda list of the database using Asynctask, and then deliver it to the class that will manipulate it?
You didn’t show the statement of documentSnapshots. Do it like this: private final List<DocumentSnapshot> documentSnapshots = new ArrayList<DocumentSnapshot>(); Then on the line where…
-
2
votes2
answers327
viewsA: Exact number of times a given character must repeat Regex
I got it with the following regex: /^(0*10*){4}$/ https://regex101.com/r/sGa5mR/1 In formal languages, the use of 0s and 1s. Otherwise I would enjoy my regex too. Another way for you to do the same…
-
1
votes2
answers717
viewsA: How to separate vowel consonants into a matrix in C
You stated torto as char torto[6][3]; See what kind of torto is char. Then the mistake starts. To compare strings, use the function strcmp(), library string.h: int strcmp ( const char * str1, const…
-
1
votes1
answer505
viewsA: Transformed problem of Fourier
Your FFT is different from Wikipedia, see clicking here. Below, I rewrote the algorithm in C++, on the wiki above, to Python. Make a comparison. Your sample is too small, which is why you are not…
-
1
votes3
answers87
viewsA: How to do it when checking a checkbox it changes the background color of a td of a table and when unknowing it returns to its normal color
You can create a specific CSS class for when the checkbox is checked, too, and apply to HTML tags according to the checkbox state. $(function () { $('.checkbox-regularC').on('change', function() {…
-
0
votes2
answers107
viewsA: Python exercise
n = int(input('Introduza um número inteiro (negativo para sair): ')) maiorDeTodos = -1 while n > 0: if maiorDeTodos < n: maiorDeTodos = n n = int(input('Introduza…
pythonanswered Marcelo Shiniti Uchimura 3,302 -
1
votes5
answers7817
viewsA: Sum of each element of two lists
A = [ 1, 2, 3, 4 ] B = [ 2, 4, 5, 6 ] D = [ (a + b) for a, b in zip(A, B) ] print(D)
-
0
votes2
answers101
viewsA: Linq equivalent to the t-sql command
var query = context.Tablelas.GroupBy(g => g.Periodo); var resposta = new { Jan = query.FirstOrDefault(f => f.Key == 1)?.Sum(s => s.Valor ?? 0) ?? 0, Fev =…
-
1
votes2
answers2436
viewsA: How to Change H1 using Javascript?
See if this is what you need: <h2 id="meuh2">Produtos</h2> <p>Nonononononono nonono nonono.</p> <p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do…
-
0
votes1
answer327
viewsA: Uncaught Syntaxerror: Missing ) after argument list
Whole exchange description.replace(/"/g, '\'') for description.replace(/["']/g, '\\\'') that your hide will be safe and you can sleep the sleep of Morpheus.…
javascriptanswered Marcelo Shiniti Uchimura 3,302 -
2
votes2
answers50
viewsA: Organizing the response array
$stmt = getConn()->query("SELECT hash,id,quantidade FROM pergaminhos"); $resp = $stmt->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_COLUMN); $novaResp = array(); foreach ($resp…
-
3
votes1
answer748
viewsA: How to extract content from the Web (Web scraping) with C#?
Here is a web scraper that takes all references to other Uris, from a URI: public class WebScraper { public static void Main(string[] args) { string url = args[0]; foreach (string anotherUrl in…
-
-5
votes2
answers453
viewsA: Increment variable while holding a button
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="text" id="u" value="0"…
-
1
votes2
answers1389
viewsA: How to avoid invalid date error in a sub-shipment
Try it like this: SELECT D.DIA, D.MES_ANO, D.ULTIMO_DIA_MES FROM (SELECT CASE WHEN C.DIA < 10 THEN '0' ELSE '' END || TO_CHAR(C.DIA) || '/' || C.MES_ANO DIA, C.ANO_MES || CASE WHEN C.DIA < 10…
-
1
votes2
answers2076
viewsA: Curl - Consuming webservice with PHP
If your PHP is earlier than 5.2.0, you will have to use curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($parametros)) as @touchmx said. Otherwise it shall function normally. Source: here…
-
0
votes4
answers39
viewsA: Knowing which index of array values gives "match" with variable
Proposal: var cores = [ 'amarelo', 'amarelo', 'preto', 'azul' ]; var corProcurada = 'preto'; var indice; alert((indice = cores.indexOf(corProcurada)) > -1 ? indice + 1 : 'nao achei'); // 3…
-
1
votes2
answers1208
viewsA: cannot set Property 'innerHTML'
Included the acharLetra at the time when he ascertains that the letter exists, which is ... if((acharLetra = palavra.toUpperCase().indexOf(letra)) > -1){…
javascriptanswered Marcelo Shiniti Uchimura 3,302 -
0
votes2
answers636
viewsA: Error creating ASP.Net Core 2.0 database - Keyword not supported: 'initial Catalog
Change Initial Catalog= for Database=. Source: here
-
2
votes2
answers172
viewsQ: Does the garbage collector really exist? Why then is there a memory leak in runtimes that use it?
I’ve heard of memory leakage in Oracle.DataAccess.dll and in large applications developed for runtimes with garbage collector. If the garbage collector exists in those runtimes, why there is memory…
-
1
votes1
answer945
viewsA: How to print the balance in ascending order and calculate interest in python
Read the statement of your own problem, doing the greatest favor, import os principal = float ( input ("1. Informe o valor a ser financiado: ")) os.system("cls") n = int ( input ("2. Informe o prazo…
python-3.xanswered Marcelo Shiniti Uchimura 3,302 -
0
votes1
answer189
viewsA: How to Replace XML C#
Where you wrote element.InnerText.Replace("SolicitaLogon", "ConfirmaLogon"); write element.InnerText = element.InnerText.Replace("SolicitaLogon", "ConfirmaLogon");…
-
2
votes1
answer1175
viewsA: How to insert literal double quote without the string " becoming "?
The Visual Studio debugger, when it finds a quotation mark inside a string, escapes it because it is the usual representation of quotation marks inside strings, Only it actually exists inside the…
-
0
votes1
answer35
viewsA: Convert Tripledescryptoserviceprovider to javax.crypto.Cipher
In the method Encrypt() from VB.NET, you used TransformFinalBlock(), that’s why it’s going wrong. Do it like this: implement a method Transform(), Private Shared Function Transform(ByVal input() As…
-
0
votes2
answers133
viewsA: How to read the size of a mat file?
Inspect the variables saved within the . mat with whos -file Planilha.mat Then, to load the variable you need, do matriz = load('Planilha.mat','nomedavariavel') Source: here…
matlabanswered Marcelo Shiniti Uchimura 3,302 -
1
votes1
answer671
viewsA: Catch Delphi file size even though it is in use
function FileSize(const aFilename: String): Int64; var info: TWin32FileAttributeData; begin result := -1; if NOT GetFileAttributesEx(PWideChar(aFileName), GetFileExInfoStandard, @info) then EXIT;…
-
1
votes1
answer64
viewsA: How to use PHP variables in Javascript?
Do it like this: write exactly the following on a.php page, <html> <head> <title>Minha pagina</title> <script src="https://code.jquery.com/jquery-2.2.4.min.js"…
-
1
votes1
answer198
viewsA: Control time to return timeout
Do so: using (var c = SqlConnection(connstring)) { c.Open(); var p = new DynamicParameters(); c.Execute("minhaprocdanada", p, commandTimeout: 60 /*segundos*/, commandType:…
-
2
votes1
answer643
viewsA: Disable the "Close" button of a form
Put this into the codebehind of your form, Protected Overrides ReadOnly Property CreateParams() As CreateParams Get Dim param As CreateParams = MyBase.CreateParams param.ClassStyle =…
vb.netanswered Marcelo Shiniti Uchimura 3,302 -
0
votes2
answers94
viewsA: Creating a foreach as a result of an Entity query
I believe - you see, I I believe, because, by description, you can’t understand the problem - that what you want to do is the following: var tp = _context .TarifasPrecosItens .Where(w =>…
-
1
votes1
answer711
viewsA: Grid bootstrap containers side by side
May subdivide the $vetprodutos in smaller arrays, for example, of 3 elements each, and print 3 products per line, taking care that the <div class="col-lg-X"> has X between 1 and 12 (the…
-
-1
votes1
answer42
viewsA: Include Option/Select in search
Change this line var matcher = new RegExp($(this).val(), 'gi'); for var matcher = new RegExp(this.value, 'gi'); and the line var $search = $("#search").on('input, option',function(){ for…
-
1
votes2
answers742
viewsA: How to delete the last row from the table?
$(function () { $('#btnexcluirultima').on('click', function () { var trs = $('.table').find('tr'); if (trs.length >…
-
1
votes1
answer101
viewsA: Date and time format on xls/csv conversion
Before oBook.SaveAs dest_file, 3 do so: oBook.Worksheets(0) _ .Columns("letra da coluna que tem a data/hora a mudar") _ .NumberFormat = "dd-MM-yyyy hh:mm"…
-
0
votes5
answers1890
viewsA: Receive and read array coming by Ajax
In show_images.php, you can do so instead of print_r() of your example, <?php require "../../ligacao.php"; $array = array(); $query = mysqli_query($db, "SELECT * FROM publicidades_sponsors where…
-
4
votes3
answers343
viewsA: Regular Expressions: Lazy quantifier function "?"
Imagine you have a giant HTML page in a string s and you search the regex /<[^>]+>.*<\/[^>]+>/. What will you get? Yes, the html tag, the whole rest of the document and html closes…
regexanswered Marcelo Shiniti Uchimura 3,302 -
1
votes3
answers658
viewsA: Compare 2 field-to-field tables
The first query returns the lines that are different in current, SELECT codigo, CASE WHEN q.nome = a.nome THEN NULL ELSE q.nome END nome, CASE WHEN q.celular = a.celular THEN NULL ELSE q.celular END…
-
2
votes1
answer173
viewsA: How to insert 2 inputs into the same TD with duploclick?
Momesso, all right? Give Tortato a hug for me! I worked at BNE a few years ago! I even did Chemical Engineering with him, do you believe? We entered the college together :) The code is good, but I…
-
2
votes1
answer24
viewsA: *public class*, what is your role in the script action?
Imagine I have the following code, var meuBitmap:BitmapAsset = new §_-6Ze§(); I can only do this without having syntax error because: §_-6Ze§ is of the Bitmapasset type §_-6Ze§ is a public class…
actionscript-3answered Marcelo Shiniti Uchimura 3,302 -
1
votes1
answer105
viewsA: Why can’t nohup accept for loop?
Exchange the for ((i = 10001; i <= 1000001; i += 10000)); for i = 1 while [ $((i += 10000)) -le 1000001 ] do ... done; EDIT: This for loop format you used is not supported by all shell types,…
-
0
votes2
answers122
viewsA: Jquery - Dynamic form enumeration
Are you using the .each incorrectly; follows modification $('.conteudoA').each(function (i, e) { $(e /*ou this*/).prop('name', 'A-' + (i + 1)); }); https://api.jquery.com/each/ The .each() method is…
-
1
votes2
answers2093
viewsA: Validate if the string has a certain character [JQUERY]
You can use regular expressions, if (/_/.test(minhaStringAProcurar)) { alert(minhaStringAProcurar + ' contém _'); } that facilitate string handling (and understanding the code once you get used to…
-
0
votes3
answers718
viewsA: How to convert date to date in select query?
Tested with Mysql 5.7.12: SELECT CAST(ROUND(CAST(CAST('2018-06-15 17:22:00' AS DATETIME) AS UNSIGNED) / 1000000) AS DATE); In your case, it would be SELECT CAST(ROUND(CAST(dt_abertura AS UNSIGNED) /…
mysqlanswered Marcelo Shiniti Uchimura 3,302 -
1
votes2
answers660
viewsA: How to pick a value between brackets in the string?
Within a controller method, it does public string GetMinhaString() { string tuaString = @"{ ""time_zones"": [ ""teste"", ""zero"", ""um"" ] }"; var o =…
-
1
votes1
answer41
viewsA: Counter that every 20 images he prints a block
<?php $contador = 0; $abreTag = TRUE; // variável que define o diretório das imagens $dir = "imagens/galeria/"; $dh = opendir($dir); while (false !== ($filename…
phpanswered Marcelo Shiniti Uchimura 3,302 -
1
votes1
answer258
viewsA: Create Powerpoint presentation from Delphi (Oleobject)
https://msdn.microsoft.com/en-us/library/office/aa170976(v=office.11). aspx msoFalse is worth 0. https://msdn.microsoft.com/pt-br/vba/powerpoint-vba/articles/ppslidelayout-enumeration-powerpoint…
-
2
votes1
answer573
viewsA: Mysql SELECT with ORDER BY no GROUP BY
I don’t know if the table status has a field id; if you have, follows SELECT c.*, q.maxid FROM contato c LEFT JOIN (SELECT s.id_contato, MAX(s.id) as maxid FROM status s GROUP BY s.id_contato) q ON…
-
0
votes2
answers652
viewsA: Convert SQL query to Mongodb
db.match_table.find({$or: [ [ {"home_team_api_id": 9991}, {$where: "this.home_team_goal > this.away_team_goal"} ], [ {"away_team_api_id": 9991}, {$where: "this.away_team_goal >…
-
2
votes1
answer238
viewsA: Audio file conversion . Wav to . Mp3
Bit rate is wrong, use LamePreset.ABR_128 in place of 128, in using (var mp3Writer = new LameMP3FileWriter(wavFile.Replace(".wav", ".mp3"), wavRdr.WaveFormat, 128)) { ... } To return an MP3…
c#answered Marcelo Shiniti Uchimura 3,302