Posts by Um Programador • 1,491 points
50 posts
-
3
votes2
answers66
viewsA: Doubt about filtering a Query in SQL
I think Joao’s method should work, but I don’t see why to make another inner join, I’d do it like this: SELECT C.IDCLIENTE , C.NOME , C.SEXO , E.BAIRRO , T.TIPO , T.NUMERO FROM CLIENTE C INNER JOIN…
sqlanswered Um Programador 1,491 -
1
votes1
answer82
viewsA: SQL to create fk int in TABLE
you can do so: create table filme ( COD int NOT NULL AUTO_INCREMENT, nome varchar(200) NOT NULL, nascimento datetime NOT NULL, obs tinyint NOT NULL, obs2 int NOT NULL PRIMARY KEY (COD), FOREIGN KEY…
-
1
votes2
answers95
viewsA: Doubts with the use of IF / ELSE in C
I have some points that I wanted to help you beyond the answer, well your age control does not control when the age is 20 or 40 and nor when it is negative ( because there is no negative age). I…
-
2
votes3
answers306
viewsA: Understanding the exercise of the book Use the Java Head
This is a very confusing code and as @Maneiro said it is questionable as code to be in a book, but I will try to explain what is happening on the basis that this is the only code of the project. It…
-
4
votes4
answers4102
viewsA: How to return the values of a List<> in C#
What happens is that when you ask to write the employee list on the console and since employees are not a simple type, but a composite object, the compiler can’t print it the way you want, I made a…
-
0
votes1
answer71
viewsA: Kruskal algorithm ordered with Selection Sort
Looking at your code I noticed some things that are irregular like the statement of the type struct.( How to declare a struct in C). The second point is that C and C++ do not support the comparison…
-
9
votes2
answers7494
viewsA: Handling of malloc() and realloc()
Definitions of malloc and realloc: malloc: This method allocates a space in the heap that has not been initialized, it returns a pointer to the allocated memory. The function’s signature is: void…
-
0
votes1
answer143
viewsA: What is the difference of a static and dynamic Hazard?
Definition Due to delays in electronic components, a circuit can lead to a Glitch. A Glitch is a short-term variation in the value of an output when no variation is expected. A Hazard when there is…
logicanswered Um Programador 1,491 -
2
votes1
answer183
viewsQ: Quicksort vs Radix-Sort
I’d like to know why Quicksort is more diffuse than Radix-Sort. Since the quicksort uses the comparison and Radix-Sort not the second can be faster than the(nlog(n)), and actually it’s O(Mn) where m…
-
0
votes1
answer24
viewsA: Turn decimal into timestamp
I found this solution to the problem but I do not know if it is the best, follow the code: select TIMESTAMP_FORMAT(substr(dt,1,4) || '-' || substr(dt,5,2) || '-' ||substr(dt,7,2) || '…
db2answered Um Programador 1,491 -
1
votes1
answer24
viewsQ: Turn decimal into timestamp
Ola, I’m doing a project where I should work with DB2. There is a table where two columns of the type were made DECIMAL.To be more exact follow the creation code: [DATA_VARIAZIONE] [decimal](8, 0)…
db2asked Um Programador 1,491 -
1
votes5
answers3081
viewsA: How to decide between using for or foreach?
The difference between them is very subtle, which I don’t think will change the performance of your code. But if this level of performance is important to you( we are talking about 2 times or 5…
-
1
votes1
answer37
viewsA: Doubt wordpress
Hello, From what I understand you have already picked up a theme that has as template the static page. In most of the themes you download comes along a manual/tutorial on how to use it and I advise…
-
-2
votes2
answers1797
viewsA: How to take data from 3 tables with INNER JOIN performatively
To catch all columns in a select Voce you must do so: SELECT * FROM ... but it is not advisable.…
-
0
votes2
answers2465
viewsA: 2 decimal places using double
Hi, I made some modifications to your code. The user can enter a number or more that will be made the calculation, I modified its condition not to do operation when the 3 entries are null( but if…
-
2
votes1
answer359
viewsA: What is the main difference between the Knuth-Morris-Pratt and Boyer-Moore algorithms
Functional example in English Knuth-Pratt-Morris Boyer-Moore In a coarse explanation The approach of Boyer-Moore is to try to match the last character of the pattern instead of the first with the…
-
1
votes2
answers3268
viewsA: Vector ascending order c#
Well the title of your question says you want to sort the vector. But the code posted prints the pairs and sums the odd marks. Following is an answer to what was asked, ordering a vector of int. If…
c#answered Um Programador 1,491 -
5
votes1
answer1351
viewsQ: Multiple inheritance and diamond problem
What’s wrong with the diamond? How do languages treat it? And they treat themselves differently because there is this difference?
-
-1
votes2
answers197
viewsQ: Is there a way to collapse all the blocks of code into an eclipse?
I have giant files with many blocks of code, currently know that when pressing +- expands or collapses the current block, someone knows how to expand or collapse all at once in Eclipse?
-
4
votes1
answer359
viewsQ: What is the main difference between the Knuth-Morris-Pratt and Boyer-Moore algorithms
I know that the KMP(Knuth-Morris-Pratt) is used to find a Y text in X, tries to define a pattern in Y, and then saves this pattern in an array. And I also know that the BM(Boyer-Moore) works best…
-
0
votes1
answer427
viewsQ: How to handle calendar in database
Hello, I am doing a personal project, to practice programming and I came across a situation that I am struggling to resolve. A user has a routine that repeats weekly, where each day of the week he…
-
2
votes1
answer196
viewsA: ASP.NET.MVC Basic doubt - Registration with "subform"?
A method to solve this problem is: In the View, inside the form, creates a div which contains all elements of allergy, and assigns a css to control when she should appear or not, this css can be a…
asp.net-mvcanswered Um Programador 1,491 -
2
votes1
answer405
viewsQ: What is a balanced tree and what are the advantages of using it?
Well the question is basically this, what is a balanced tree? What differs it from a normal tree, and what are the advantages of using it? A brief description and a use of it is already very…
-
0
votes1
answer143
viewsQ: What is the difference of a static and dynamic Hazard?
As far as I know a Hazard is an undesirable effect caused by the deficiency in the system or by external influences. An Hazard in a logical system occurs when there is a modification in the input…
logicasked Um Programador 1,491 -
19
votes1
answer13251
viewsQ: What is it and what is Karnaugh’s map for?
The question is just this: What is and what is this map of Karnaugh? I do not want to know everything about it, a short definition and a small example is enough.
-
0
votes1
answer45
viewsQ: Parallel Computing - Communication between threads
This is a question that arose to me when I was trying to solve a problem in a client, the problem turned out to be something else but the doubt continued. Imagine a situation where there are two…
-
4
votes1
answer275
viewsQ: What’s faster: Stack or Heap allocation?
This question may sound elementary but it has given me a good debate with a co-worker. I whenever I can make allocations on Stack because for me the growth of Stack is constant in time. And already…
-
3
votes0
answers48
viewsQ: Parallel Computing -how does the data dependency work?
I’m studying a little bit about parallel computing and I’m doubting how data dependency works?
parallelismasked Um Programador 1,491 -
5
votes2
answers114
viewsA: How to receive information in a View?
Hello, There are several ways to pass data to View one of them is this: ViewBag is a variable that loads information to the view, and Message is a key where you will put a value, IE, can create…
-
7
votes2
answers1021
viewsA: What is a decision problem?
Being brief and succinct a decision problem is a special type of computational problem that answer is yes or no, or alternatively 1 or 0. EDITED Less succinct answer: Anything you can represent as a…
-
0
votes2
answers335
viewsA: How to validate a wrong typed data?
You can cast an exception using a throw. For you to know your knowledge I advise you to give a read/researched how the exception treatment works a good start is here. For your problem you must…
-
0
votes4
answers1037
viewsA: Capture form data and transform to UPPERCASE
What you are looking for is the function toUpperCase JSON.stringify(obj).toUpperCase()
-
3
votes2
answers3578
viewsA: Is there a size limit for data transmitted via POST?
Depends on the server configuration. If you are working with PHP on a Linux or something similar you can control this by configuring the .htaccess #Set o tamanho maximo de um post php_value…
httpanswered Um Programador 1,491 -
1
votes2
answers482
viewsA: How to add another day using "new date()"
Add a line: d.setDate(d.getDate() + 1); the code will be: var myVar = setTimeout(function(){ myTimer() }); function myTimer() { var d = new Date(); d.setDate(d.getDate() + 1); var options =…
javascriptanswered Um Programador 1,491 -
0
votes1
answer299
viewsA: Problem with treeview menu
Hello, I don’t know if the code I wrote will work, but at least I can give you an idea of what you need: <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js">…
-
1
votes2
answers94
viewsA: How to omit char matrix size in the function?
Note well the name of the string represents a pointer to the first position and the c/c++ language considers everything you see in front as part of the string , or in the case of a char vector "char…
-
2
votes1
answer3225
viewsA: Count nodes in binary trees
This is a function recursive, so it iterates to the limit calling itself then comes back returning desired values to the higher calls. A recursive function is made up of 3 things: A conditional to…
-
1
votes3
answers1022
viewsA: You’re a builder, right?
Hello, What was done in the above code is called polymorphism. This is an overload of methods. Well let’s say in the code above you want to create an account, and this account can be either created…
-
0
votes1
answer30
viewsA: Selecting class with jquery
The way I see it, when you do var valor = $(".classe"); you are searching on the page for the object whose class corresponds to classe, when Voce uses this code. var valorAnime = 'classe'; you are…
jqueryanswered Um Programador 1,491 -
1
votes1
answer689
viewsA: Exchange point for comma in price
Just put the function replace to exchange the point for the comma. Try changing the code below and tell me later if it worked How are you : $("#total_compra").val(n); As it should be :…
javascriptanswered Um Programador 1,491 -
1
votes2
answers440
viewsA: Does any programming language use memory?
Every program needs memory to run. Without exception, follow a link with an example execution of a program in Portuguese here. And if you want to understand a little more about how it works, search…
-
-1
votes1
answer36
viewsA: A Rest api continues to run if it loses connection to the client
The request receives a "Connection Failure" response when trying to connect to the server when it is not working, so it will not complete the task
-
1
votes1
answer1154
viewsA: Vectors - Separate negative and positive
The problem is that it is inserting the vectors incorrectly, as it is using the same int to iterate the loop and to add to each vector. For example if the vector 1,-1,67 comes,... the vector vet1…
-
0
votes1
answer1207
viewsA: (Android Studio) Odd or even
Use the the operation % it returns you the rest of a division. In case divided by 2 %2and if the result is 0 it means that it is even, if it is not odd edited: String guessStr =…
-
0
votes2
answers45
viewsA: passing a complex object to MVC4 controller
I found a solution, I don’t know if it’s the best: $('.itemPedido').each(function () { i++; var prod = { codigo: $(this).find('.codigo').text(), descricao: $(this).find('.desc').text(), un:…
-
1
votes2
answers45
viewsQ: passing a complex object to MVC4 controller
I’m using MVC4 C#, I have a table that is generated dynamically according to the user’s decision, in this format: generated by js <tr class="itemPedido"> ' + '<td class="col-sm-1">' +…
-
0
votes2
answers1413
viewsQ: jQuery searches in a table
I am rendering values in a table and I have to filter through a field that calls razao, for that I use a script, query works but when deleting the query the previous values do not come back, ie when…
jqueryasked Um Programador 1,491 -
0
votes1
answer85
viewsQ: Filling a div using each Jquery
I have a modal rendering a partialView and I want to move from this modal to screen view main a dynamic list of listed objects that are selected by the user $(".corpoPedido",…
jqueryasked Um Programador 1,491 -
3
votes1
answer191
viewsA: Create tables in a mysql database hosted at Locaweb
You must enter the cPanel of the domain in question, click on the phpMyAdmin icon and in the top menu bar click on the SQL tab. Will open a text area where you type the command to add a table.…
-
2
votes2
answers100
viewsQ: SQL query for Linq mvc4 c#
I’m not very familiar with Linq and I’m having a hard time turning this SQL query into Linq, can someone help me. I do the join of 6 tables (it wasn’t me who made the database. I have to work with…