Most voted "logic" questions
Use this tag when the question primarily involves logical sense in the development or processing of an information-based application that, related to each other, imply an objective within an established rule.
Learn more…376 questions
Sort by count of
-
1
votes2
answers76
viewsWhat is wrong with the logic of this code that sums bands of numbers?
My algorithm needs to sum all the values between a and b, for example if I type a=3 e b=6 the program needs to speak 3 7 12 18 (3+4= 7/ 7+5=12 / 12+6=18) only he only makes the first two then starts…
-
1
votes1
answer291
viewsEndlessly map
I’m developing a game and I just found a difficulty somewhat boring, it’s a logic problem... Next: Imagine the scene of the game Where, the black square in which the "Player" is, is the camera view…
-
1
votes1
answer7108
viewsConvert decimal to binary in Scratch
Isn’t displaying the result on the screen? I tried to convert decimal number to binary in Scratch, but it’s not working. Can anyone see what the error is?…
-
1
votes1
answer155
viewsFunction to return levels of an object in Javascript
I am creating an app with Angularjs where I need to do a "mapping" of the system folder structure, so when it is necessary to make some change in the structure I just change this file and not the…
-
1
votes0
answers82
viewsWays to inform address
Good afternoon people, I have a question not very technical, but ways to get information. Here at the company we have a form for our users to inform service addresses. This form has the automatic…
-
1
votes0
answers75
viewsHow to render the contents of an array
In the application, there is a menu that is represented in PHP in the form of an array: $menu = [ ["title" => "Home", "path" => "/home", "children" => []], ["title" => "Secção", "path"…
-
1
votes1
answer156
viewsRelationship of Tables - how to do
I’m having trouble figuring out how to relate to tables. My scenario is below: A parceiro may have several usuários, however a usuário may only be attached to one parceiro. A usuário can register…
-
1
votes0
answers23
viewsCondition with 4 values
Oops, good morning, good morning! The thing is, I need to know how I make the following comparison: I have two values, dial in and out, if the time is marked, the user does not select time that are…
-
1
votes1
answer53
viewsLogic - Given 2 strings, how to know how many moves I make when turning the first string into the second
Hi, are you okay? I have 2 strings , and I need you to calculate the total of moves to become the first string in the second string string palavra1 = "gato" string palavra2 = "pato" replacing the…
-
1
votes3
answers512
viewsHow to make a simple CRUD using Temp-table
I’m starting at Progress 4gl, and would like to learn how to make a simple customer registration or anything related to a CRUD. I would like to do using temp-Tables. I’ve been researching and I’ve…
-
1
votes1
answer294
viewsHow to validate a wmsAuthSign hash in php?
I have the following code that creates a hash security for authentication on media servers, would like to know how it could be validated in php itself, media servers should use some logic for this,…
-
1
votes1
answer74
viewsStock Control Grouping Products of the same type
I am producing a stock control system, but the stock needs to have a product grouping system with the same SKU, example, I have a product called "T-shirt A", but there are several types of "T-shirts…
-
1
votes1
answer44
viewsCarousel shows no photo
Well, I have a carousel where I pick up the "images" (actually it’s just the names of the images) in the database and I do a foreach on the carousel but the images don’t appear. When I display the…
-
1
votes1
answer100
viewsDoes redirection not interrupt script interpretation?
I may be missing something, but there’s no way I can see what. I have a simple login code that is behaving (at least it seems to me) in a strange way. index php.: session_start();…
-
1
votes1
answer369
viewsManual authentication of a table field in the Laravel Framework 5.3
I’m starting now with the Framewok Laravel 5.3., however quado crio with artisan o make:auth it automatically creates the views, model, and controllers concerning Login. Only I added a field to…
-
1
votes1
answer374
viewsHow to create nested array from information received via POST
Given the array below: $aDup = array( array('35342-1','2016-06-20','300.00'), array('35342-2','2016-07-20','300.00'), array('35342-3','2016-08-20','300.00'), array('35342-4','2016-09-20','300.00')…
-
1
votes2
answers2001
viewsAdd object inside an object
is the following, I have 3 tables. Cities, Organs and Motives. 1 City can have several organs, and 1 organ several motives. My problem is that in a single page it has to appear all the organs of the…
-
1
votes1
answer68
viewsLogic of function loop
I’m starting study of functions in Javascript and analyzing the loop below came to me the question about the logic of the result. function foo(i) { if (i < 0) return; document.writeln('begin:' +…
-
1
votes2
answers48
views -
1
votes1
answer692
views -
1
votes2
answers457
viewsCount and compare number of keys and values between objects
I am using Javascript objects to transcribe the interface of an app, however, I would like to create a tool for collaborative transcription but do not know how to proceed. Simplistically the object…
-
1
votes2
answers110
viewsPHP logic problem
I have the following structure in PHP: <?php header('Content-Type: application/json; charset=utf-8'); error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_STRICT);…
-
1
votes2
answers117
viewsPHP - If (condition) in wordpress
Next, I have 4 posts on a post type services. Brides, Day Spa, Aesthetic Medicine and Salon <div class="service-content <?php if( $post_title == 'Noivas' ) echo "qwp-content"; ?>">…
-
1
votes1
answer80
viewsLogic to display data - Slice days
Good night. Using PHP, I search data with Mysql. The table has the following structure: ID | dataHoraInicio | dataHoraTermino | 1 | 2017-05-08 11:28:40 | 2017-05-08 17:52:12 | 2 | 2017-05-08…
-
1
votes0
answers49
viewsQuestions about continuation in C# studies and suggestions to get an internship
Hello, I’m in 2° SI course period, but I’ve been studying C# on my own through the Caleum: C# and Object Orientation booklet. I’m really enjoying the language and I intend to go deeper into the…
-
1
votes1
answer59
views -
1
votes1
answer209
viewsCategory modeling logic in an e-commerce
I am with a project to create an e-commerce, in which my doubt refers to the modeling of tables: Category(ROOT)>sub-categories>sub-categories of sub-category. As should be these tables, and a…
-
1
votes1
answer64
viewsHelps in the logic of conditions and repetition in C++
I have the following verification code to know if a certain number belongs to a vector. I couldn’t think of a more precise way to get the program to say that the number DOES NOT belong to the…
-
1
votes2
answers65
viewsWhat is the behavior of a method that returns integer within the if?
I have the following test code (Java language): public class Teste { static int n = 10; static int[] vB = new int[10]; public static void exibir(){ for (int i = 0; i < n; i++) {…
-
1
votes1
answer133
viewsDefine function result return or method
Editing: A previous function generates a list like this: ['Responsável atual', 'Número do processo', 'Foro de tramitação', 'Data da intimação 05/10/2017', 'Data da ação 15/08/2011'] This is the…
-
1
votes1
answer136
viewsLogic Promisses or callback with Sweetalert and Vuejs
I’m trying to make a callback to perform some functions, I don’t know if I should use Promisses, callbacks or something more advanced. This problem is more about logic I own a Mixin that triggers…
-
1
votes1
answer264
viewsLogic expression and corresponding circuit
I have the logical function : I need to simplify it as much as I can. That said, I created your truth table and built the Karnaugh map. Truth table: Map of Karnaugh [I don’t know if it is correctly…
-
1
votes1
answer69
viewsForm sending null values
I have this small form that should send the data filled in it to the page "cad_real_qm.php". However, I have a javascript function that checks if some fields are null and if so, will issue an alert.…
-
1
votes1
answer121
viewsSelect within for
Next, my doubt is more about logic anyway.. I have a python script in which I use psycopg2 to perform database searches. But I need to do this within a for. I have full notion that doing a search…
-
1
votes2
answers806
viewsMathematical logic betting on the lottery
I can’t think of the mathematical logic of the following issue: Three friends played the lottery. In case they win, the prize must be apportioned in proportion to the amount each gave for the…
-
1
votes1
answer92
viewsLogic of a neural network implementation
Hello, Good Morning I implemented a network, and it has the following matrix, where f(x) is an input vector (Matrix 1,139), the Phi matrix that has dimension 1,20 (20 due to the number of signals I…
-
1
votes1
answer18
viewsLogic problem with Progress Circle
I have a Circle preview in my wpf project, I’m using a class to convert the value 360 to 100, to look like it’s 100%, but I have a problem, I get an X time, and the 100% of the circle has to be…
-
1
votes3
answers306
viewsUnderstanding the exercise of the book Use the Java Head
I did not understand the functioning of the code below, maybe later in the book have better explanations or missed something even in the review. I will detail the points in the code itself in which…
-
1
votes0
answers187
viewsProgram does not run both For links within if - C
I have 2 ties for within a if, as shown below: if (grid[j][k] == words[i][0]){ int el = j, col = k; //Metodo direita, baixo for(l=0;l < wordlen(search_word);l++){ if(l%2 != 0 ){ // Procura à…
-
1
votes2
answers926
viewsRecursive function to calculate the number of lowercase letters in a character string
I was able to do a function to return a given character at an X position of a string: public static char funcao (String texto, int indice){ if (indice == 0){ return texto.charAt(indice); } else {…
-
1
votes0
answers62
viewsHow to classify the multidimensional array by value?
How can I classify this array for the value of the key level, even though the values are currently sequential, they will not always be? array:67 [▼ 0 => array:3 [▼ 0 => array:8 [▼ "idPai"…
-
1
votes1
answer64
viewsHelp with Array and operations
Array[1] previously set. The logic is to take the last array number, do the operation with the display value and return as the last array number. Example: Type 2 and press X, 2 * the last item of…
-
1
votes3
answers203
viewssort array by date
I created a function that makes the selectt in the database and returns the data in array and now I want to sort its answer by date example Response returned from function Array ( [dados-0] =>…
-
1
votes1
answer170
viewsAlgorithm to traverse an array
So I’m having a simple logic problem but I can’t find a good solution. Problem: I’m looking to go through a registry file (a .csv whose I have to solve a RMS - Root Mean Square calculation). But I…
-
1
votes0
answers54
viewsCalculating working days to a date!
I’m doing a product withdrawal system, for example: Certain product category has X working days to be removed. Category | Business days 1 | 1 2 | 3 3 | 4 4 | 3 5 | 3 6 | 3 7 | 4 For example, today…
-
1
votes1
answer120
viewsMove aquifers by extension, PYTHON
Good afternoon, I want to fine tune my skills in PY, and I’m in a small script to move files from one place to another, but I would like to do this and not be guided by the name of the file, but…
-
1
votes1
answer847
viewsloop For, R - Include function in For and save result to object
install.packages("xlsx") install.packages("stringr") library(xlsx) #pacote para ler os arquivos do excel library(stringr) library(e1071) #pacote para calcular a curotse e o skewness #Função que…
-
1
votes0
answers32
views -
1
votes2
answers92
viewsAttribution Doubt via Destructuring - Javascript
I couldn’t understand the following code: //Esse array vai modificar o DOM com o seu conteúdo const elementos = [ { tag: 'p', texto: 'Frase 1' }, // indice 0 { tag: 'div', texto: 'Frase 2' }, //…
-
1
votes1
answer24
views(Java) Error while continuing to traverse TXT lines
good night! I need that even if it reaches the condition total_min < 720 He keeps going through the lines. The 720 are the total minutes before lunch, when reached should separates the activities…