Posts by Lucas Miranda • 1,314 points
78 posts
-
1
votes1
answer59
viewsA: Find document that originated the following
Assuming that each customer has only one doc_original you could do it like this: WITH q AS ( SELECT * FROM dados WHERE num_doc_anterior IS NULL -- this condition defines the ultimate ancestors in…
sql-serveranswered Lucas Miranda 1,314 -
0
votes2
answers57
viewsA: How to use a variable function several times without creating another variable? How to draw a number
What you are looking for is a repetition loop like while, i.e., a command that repeats a set of instructions while the conditions for it to continue are true, example from your code: import random…
python-3.xanswered Lucas Miranda 1,314 -
9
votes3
answers190
viewsA: How to get the index of the first positive element in a list?
A built-in function usable in your example would be the next. Given a rule, it then returns the next item in your iterator. Example of use: seq = [-10, -5, 3, 15] print(next((x for x in seq if x…
-
0
votes1
answer39
viewsA: Error entering data in Sqlite
In contentValues you need to pass the name of the column, you are passing empty, will look like this: ContentValues values = new ContentValues(); values.put("NOME_DA_COLUNA", product.getId());…
-
0
votes1
answer30
viewsA: String pick up sentence text
You can do it in several ways, one for example is the querySelector, following example: <div class="page-header"><h1>Abacaxi, pera, maçã</h1></div> <button…
-
1
votes1
answer37
viewsA: How do you move the first two characters of a word to the end of it?
As already commented, you can simply access the Index you want and rearrange them, for example with Ucas would look like this: ss = "LUCAS" print(ss[2:]+ss[0:2]) explaining, the ss[2:] means I’m…
-
1
votes1
answer32
viewsA: Diagonal Difference Hacker Rank Kotlin My solution approves in some but fails in the rest
I opened here the hackerrank and I believe you missed a detail, the question asks to be returned a numero absoluto, that is, a number always positive, but depending on the input, its result can…
-
2
votes2
answers81
viewsA: How do I replace characters from a string, right to left, cumulatively?
If you take a look at the description of replace you will see that it has a return. However in your code you are never assigning it. What you should do is this: public String test = "12345678";…
-
1
votes2
answers437
viewsA: How to clear what has already been written on the moon terminal?
You can use the command os.execute(). On Windows: os.execute("cls") On Unix: os.execute("clear") Response translated from stackoverflow in English, source:…
luaanswered Lucas Miranda 1,314 -
1
votes1
answer70
viewsA: How to remove a Where from @Query in Spring Jparepository
The simplest form of change without the use of hql as already quoted would be to place the conditional OR in your select contemplating the null case, ex: @Query("select p from Product p where p.name…
-
1
votes1
answer166
viewsA: Problem when saving date in mysql database with spring
As commented, the date is depreciated. To manipulate dates without the time use Localdate If you need the hours use Localdatetime. Documentation.…
-
0
votes1
answer37
viewsA: take the values of an xml array
Assuming you are using windows Forms. Your problem is in the logic of your for. You are adding an item to your list and then trying to parse it fully for your combobox. Another thing is not with .…
-
0
votes1
answer65
viewsA: Spring command not found
As discussed, the inclusion of the environment variable in the global scope in /etc/Nvironment was suggested. For more details on the functioning of environment variables: Environment variables.…
-
1
votes1
answer63
viewsA: New machine and eclipse installation, Maven and all java project
Your settings.xml is pointing to http repositories, this protocol is no longer accepted by the central Maven, only https for security reasons, probably was only working before because you had…
-
2
votes1
answer36
viewsA: Command "find" eclipse
As commented, some Ubuntu themes give this effect Blur in the background, not being directly linked to Eclipse, it is only necessary alter it.…
-
1
votes1
answer39
viewsA: Problem sending image to database
Note that you are trying to convert your Base64 into a stream to then convert it to bytes byte[] images = null; FileStream Streem = new FileStream(user.UserImage, FileMode.Open, FileAccess.Read);…
-
0
votes1
answer419
viewsA: .Net c# Webrequest Post
I believe that you have confused with the order of the requests made by the page and that is why you are not emulating it correctly. Analyzing realized that she first makes a request on another page…
-
1
votes1
answer44
viewsA: In the Google Crhome debugger for Javascript, can you Skip some files? Like "Angular.js"
In the upper right corner, next to close there is one more options (3 dots), when clicking on it will appear an option called Settings, as picture: In Settings there is an option called Blackboxing,…
-
4
votes2
answers62
viewsA: Optimization in SQL
It was not very clear if by optimization you refer to writing or efficiency, but if written, I believe that the ideal would be to replace this with an IN, example: SELECT products.name,…
-
0
votes2
answers245
viewsA: I cannot declare a cursor in Mysql
Your mistake is already warning you why, you can’t use one declare without a begin before. Example: begin DECLARE teste CHAR(16); --Updating-- Cursors can only be used if they are inside a…
-
1
votes1
answer125
viewsA: How to map a relationship using EF Core
as commented, the first thing to be done is to render Personal public class Pessoa : Entity { public int PessoaId { get; private set; } public int? PessoaFuncionarioId { get; private set; } public…
entity-framework-coreanswered Lucas Miranda 1,314 -
3
votes1
answer44
viewsA: Problem in LINQ Query
Looking at the documentation: https://docs.microsoft.com/pt-br/dotnet/api/system.linq.enumerable.tolist?view=netframework-4.8 Pay attention to that detail: Returns List A List containing elements of…
-
2
votes1
answer456
viewsA: Apply a regex to the result of a select
If your id is this fixed amount, I don’t see the need for regex, just give an integer cast that the zeroes on the left will disappear after the substring, example: select cast…
-
0
votes1
answer59
viewsA: JSOUP does not take unordered list (ul > li)
jsoup uses the css selector syntax as its selection form. Based on this, we can do the following: Elements lis = doc.select("#js-rodadas-jogos > li") Being '#' a questou score picking up ul by…
-
0
votes1
answer75
viewsA: How to map the returns of a Store Procedure to the properties of a class?
The answer is more or less what you tried, but the display is used in the Forms view. What you are looking for is the JsonProperty , example [JsonProperty(PropertyName = "intParc_Cod")] public int…
-
0
votes1
answer41
viewsA: Database parameter insertion error (with files that have the same code)
Arthur, good evening, notice that in your code you’re encrypting with MD5 your password, however in your bank, the 'password' column is int, if this encryption has letters it will never save, I…
-
2
votes1
answer57
viewsA: Why does spring data persist when I use a set?
I believe it’s because of your note @Transactional, it opens the transaction at the beginning and if all goes well it performs the commit at the end, it has a very interesting explanation about this…
-
0
votes1
answer51
viewsA: Why can’t I give getTransaction(). Begin() were from a Main?
You are stumbling on a java syntactic rule, it is not possible to make this kind of statement out of a method. A simple fix would be: public class ExemploMovimentacaoDao { EntityManager em = new…
javaanswered Lucas Miranda 1,314 -
0
votes1
answer64
viewsA: How to return the numeric value of a Selectlistitem C#
As commented, just use the command getHashCode, example: var teste = (Enum.GetValues(typeof(T)).Cast<T>().Select( e => new SelectListItem() { Text = (tipoCase == null ?…
-
0
votes1
answer27
viewsA: Jenkins setup with Nunit error
nunit console is not yet compatible with . net core 2.1 Follows source: https://github.com/nunit/nunit-console/issues/392…
-
0
votes1
answer101
viewsA: Threads in Java
In my view it’s not that she’s finishing, it’s that you’re not having time to see her finish, even if you seven running it to false, it’s not automatic, the thread is already there inside the while…
-
1
votes3
answers333
viewsA: Return text between keys, without returning the keys themselves
I believe this one solves your problem (?<=\{).+?(?=\}) Testing: http://refiddle.com/refiddles/5d12729475622d756b0a0000…
-
1
votes1
answer155
viewsA: Json does not exist in the namespace *using System.Runtime.Serialization.Json*
Most likely you don’t have the reference added. For this go in the references > right button > add reference and select the dll below:…
-
0
votes1
answer72
viewsA: How to create a method that does not wait to finish to return OK
The way it is at the moment I believe the simplest is just to put it into a task like the way below: [WebMethod] //WebServiceMethod public string ImportaDadosPosLeilaoValores(string fileName) { //a…
-
1
votes2
answers674
viewsA: How to send WS XML file from Safe Harbour (made in PHP) using Restsharp C#
Instead of doing all this process you can simply use the method addFile ex: if (login.StatusCode == HttpStatusCode.OK) { // continua var cookies = login.Cookies; var restResponseCookie = new…
-
1
votes1
answer180
viewsA: Make Distinct Entity Framework
I just found out, actually by comparing the objects the distinct does not evaluate them as being equal. Some alternatives are: Group by: List<Phones> teste =…
-
0
votes1
answer867
viewsA: How to have more than one GET request?
just name the different path, ex: [HttpGet("Buscar/{name}")] // seu get vai controller/buscar/name public ActionResult<List<Item>> Buscar(string name) { var item =…
-
4
votes4
answers620
viewsA: How to round off this number: 3084.08 SQL SERVER?
You can use the CAST command, example select CAST(3084.087522295 as numeric (36,2))
-
1
votes2
answers174
viewsA: Combine TIFF files in C#
What you’re forgetting is that the merge() method and the combine() return an image, and you’re not assigning anywhere, would be that image you should write to get the combined result, below: public…
-
0
votes2
answers32
viewsA: Change the name shown in javascript graph column
Series also has the name property, just put it. Ex: var chart = new Highcharts.Chart({ chart: { renderTo: 'container', type: 'column', options3d: { enabled: true, alpha: 6, beta: 16, depth: 100,…
-
3
votes3
answers1668
viewsA: Event onmouseover random colors
You are not setting the new color anywhere, you can hit simply by changing the style in the function instead of trying to give the Return function getRandomColor() { var letters =…
javascriptanswered Lucas Miranda 1,314 -
0
votes2
answers110
viewsA: Error listing table directly from Sqlite
I think it’s pretty clear your problem, on the line of your stacktrace: Caused by: android.database.sqlite.SQLiteException: no such table: produtos In other words, the products table does not exist…
-
3
votes1
answer66
viewsA: Use lambda expressions to sophisticate the parameters of a for in c#
First, a hint, you are testing text for null but before it is giving a text. Count no up, if it’s null he’ll break there already, not later. But as for your question, I believe this could be solved…
-
0
votes1
answer34
viewsA: How do I relocate the selected item from a Category List to the first position
Using linq Voce can use the command insert passing the index and the item. Example: Given your list Health and Beauty | Footwear | Supermarkets | Restaurants Imagine you want to put shoes on first,…
-
1
votes2
answers43
viewsA: Object attributes coming null in Query
If you are sure that color exists maybe it is something related to Lazy loading, you can try to force this loading using include, example: var Cores = db.ProdutoDb .Where(x => x.CodProduto ==…
-
1
votes1
answer108
viewsA: Read user input via Javascriptexecutor or promt in Selenium Webdriver C#
You can call the command prompt Example: prompt("Digite o ambiente", ""); But then you will need to somehow capture this return in Jsexecutor, I imagine you can do something more or less like this:…
-
0
votes1
answer42
viewsA: Chrome notification does not appear
Have you tried to make his call using requestPermission? Notification.requestPermission()
-
1
votes1
answer89
viewsA: Connect Informix . NET via DSN
You can try a connection using odbconnection : OdbcConnection conn = new OdbcConnection(@"DSN=suaconexaoodbc;UID={usuario};PWD={senha};"); More information:…
-
1
votes1
answer81
viewsA: Search within MYSQL search results
His select is almost correct, but without the parentheses he ends up doing the following ( I’ll show parentheses for you to understand ) select * from CARROS where concessionaria= 'VW' or…
-
1
votes3
answers800
viewsA: Spring Data JPA does not recognize the SQL 'Limit' command?
Another option if you are using jpa 1.7+ is to change the method nomenclature using top or first, example: @Query("SELECT detail FROM Quote ORDER BY RANDOM(") Quote findTop1ByQuote(); @Query("SELECT…