Posts by Bruno Warmling • 1,540 points
98 posts
-
0
votes0
answers15
viewsQ: What is the best way to structure a message for the background?
In a scenario where we have: Application A: developed using EntityFramework. This application knows the structure of the database and is responsible for maintaining it. Application B: will be…
-
1
votes1
answer28
viewsA: I can’t change backgroundcolor using javascript to generate random colors
Just return your color, without the quotes around it, see: // randomColor() funcionando perfeitamente, gerando codigos hex entre "" function randomColor() { const hex =…
-
1
votes1
answer76
viewsA: How to write two Readline in a single line?
Using the function Console.SetCursorPosition you change the position that the cursor, along with this, you can use the function Console.ReadKey() to read only one character. Based on this, I created…
-
0
votes1
answer139
viewsA: how to execute a powershell command inside a window started by a script
Something to that effect? powershell Start-Process powershell -Verb runAs {echo hello; Read-Host}
powershellanswered Bruno Warmling 1,540 -
1
votes2
answers84
viewsA: Union All specify select no order by
Include a column to carry out the order by select and sort so first, the rest is the same. SELECT NOME, DATA FROM (SELECT 'NOME_FUNCIONARIO' nome, 'DATA_FUNCIONARIO' DATA, 1 ordem UNION ALL SELECT…
-
0
votes1
answer54
viewsA: ORACLE displaying date field with 1 more day at the end of the months with 31 days
The documentation of the function itself ADD_MONTHS quote: if date is the last day of the Month or if the Resulting Month has Fewer days than the day Component of date, then the result is the last…
-
1
votes1
answer69
viewsA: Download via Powershell
This site does not initially load with the download links. What can be done is to emulate a browser and wait for the page to be fully loaded. After that, we take the link and proceed with…
-
1
votes2
answers168
viewsA: I need to compress several separate files with powershell
Why didn’t you compress the files using the native function Compress-Archive? Works the same way and there will be no dependency for an external tool. Behold: dir C:\Arquivos\Log\*.log | % {…
-
1
votes2
answers91
viewsA: How to hide thead when all tbody tr are hidden?
Do the following: After running your script to hide columns that do not enter your filter, run another script that will compute if there are any columns visible to that thead. How to do this? Search…
-
0
votes1
answer38
viewsA: Remove() method Does not work
In this code snippet, you ended up registering an event of click on your page. imgs.forEach(item => { addEventListener('click', () => iniciaModal('blocoModal')); }); That way, any click on…
-
0
votes1
answer27
viewsA: Move form control with Thread
You must use the method Invoke for your GUI update to occur on thread leading. Example: Public Sub InternalMoveWall(ByVal wall As Control, ByVal x As Int64, ByVal y As Int64) If wall.InvokeRequired…
-
0
votes1
answer29
viewsA: it is possible to join one or more columns that have the same id in mysql
You can use the function GROUP_CONCAT. See the example below: SELECT idvendas, data_da_venda, valortotal, clientes.nome AS cliente, colaboradores.nome AS vendedor, group_concat(produtos.nome) nomes…
-
1
votes1
answer133
viewsA: How to remove part of the name of all files in a folder via CMD/Powershell
You can do with the function Substring to fetch part of the file name and merge with its extension. Behold: Get-ChildItem * | % { Rename-Item $_ ($_.Name.Substring(0,8) + $_.Extension) }…
-
2
votes1
answer49
viewsA: Powershell Problems with Character [
The solution is to use the parameter -LiteralPath in place of -Path. Documentation can be found here. -Literalpath Specifies a path to one or more Locations. The value of Literalpath is used Exactly…
powershellanswered Bruno Warmling 1,540 -
-2
votes3
answers149
viewsA: What is data modeling (data Modeling)?
What is data modeling (data Modeling)? Basically it is to draw the table structure of your database. It can be done through tools made available by the companies themselves that develop the…
-
0
votes2
answers112
viewsA: Check which processes are connected to the internet
Da to do using WMI. Making a query in the table Msft_nettcpconnection. Take an example: public enum TcpState { Closed = 1, Listen = 2, SynSent = 3, SynReceived = 4, Established = 5, FinWait1 = 6,…
-
1
votes1
answer47
viewsA: Show value 0 when no data is available
Making a left outer join with a table fake must solve... WITH vazio as ( SELECT NOW() dt_data UNION ALL SELECT NOW() - INTERVAL '1 day' dt_data UNION ALL SELECT NOW() - INTERVAL '2 day' dt_data…
-
0
votes4
answers438
viewsA: "Clean" way to modify the "Visible" attribute of a Picturebox
Whereas control is being used RadioButton next to the event CheckedChanged, we could say that there is a problem even of logic with your code. If any other part of your system changes the state of…
-
0
votes2
answers538
viewsA: Update in year without changing the month, day and time
Convert to char searching the day and month, then add the year and convert to date again: TO_DATE(TO_CHAR(dta_encerramento ,'dd/mm') || '/2018','dd/mm/yyyy') To include the time together, use this:…
-
1
votes1
answer107
viewsA: Extract date in text column
Yes, it is possible. As long as you know which form the date is. See, first find the data that matches your pattern using a filter LIKE. campo LIKE '%__/__/____%' In this case we look for any value…
-
2
votes1
answer44
viewsQ: Is there a difference between Task.Fromresult and Task.Factory.Startnew?
Given a method in precise return a Task<T>. Example: public Task<MyResult> Handle(); I can make the following implementations: Thus: public Task<MyResult> Handle() { for (int i =…
-
1
votes3
answers137
viewsA: Using IF and UPDATE in a PROCEDURE to update a table
The most correct in your case would be to use the command MERGE. He treats exactly what you’re trying to do. Basically it works like this: You do JOIN of the main table with itself searching the key…
-
1
votes1
answer107
viewsA: Run a SELECT inside an IF in SQL?
You can use EXISTS together with other filters. Example: SELECT * FROM tb_ticker WHERE ((EXISTS (SELECT 1 FROM tb_ticker WHERE Ticker = '{$variavelPHP}') AND Ticker = '{$variavelPHP}') OR (NOT…
-
0
votes2
answers147
viewsA: Loop - SQL Server
You are assigning seconds/minutes to variables that are not used in your loop. See, in this code snippet you assign the result of the functions to the variables @Data10 and @Data5 and then I printed…
-
1
votes1
answer48
viewsA: How to look at the field that is being changed in a Procedure?
Can be done using the function Update. Example: if Update(VLRVENDA) BEGIN // Seu código END; More information on official documentation.…
-
1
votes1
answer61
viewsA: Oracle SQL Query with Group By starting and ending on different days
You can calculate the date using CASE to check whether the date is between the period 00:15 ~ 00:00. Doing something like that: CASE WHEN DT - TRUNC(DT) >= (1/24/60 * 15) THEN TRUNC(DT) +…
-
1
votes1
answer138
viewsA: How to evaluate whether a string is present in an array in Powershell?
Your script is small and simple, simply opening the Windows Powershell ISE and executing step by step would already have understood. To debug your script do as follows: Save your script locally. Add…
powershellanswered Bruno Warmling 1,540 -
0
votes1
answer1315
viewsA: Run oracle database in sql
You can call her as follows: DECLARE ww_saida saida_cursor; BEGIN pr_rel_saldo(p_codigocliente => 1, P_data_inicio => sysdate, p_data_fim => sysdate, p_saida => ww_saida); END; If this…
-
1
votes1
answer141
viewsA: How to make a Soap call on . Net Core
Here’s an example that works on both . net framework and . net core. string url = ""; string body = ""; string soapAction = ""; string soapXml = $@"<soap:Envelope…
-
1
votes0
answers15
viewsQ: How to correctly implement a System.Threading.Monitor in . net core
I have a piece of code that implements a Monitor. The purpose of this code is not to allow another thread to write in the log while one of them is running. This code works perfectly in . net…
-
1
votes1
answer136
viewsA: Extract part of text in a variable
Break the text into lines, search for its tag and then take the value by text position. $text = " ;=============================================================== ;--------------------AMBIENTE DE…
-
0
votes2
answers121
viewsA: SQL Update from another tab
With aggregation function will not achieve even... I suggest using sub-select with exists. Example: UPDATE dimproduto SET pm = (SELECT AVG(dimdocumento.vu) FROM dimdocumento WHERE dimproduto.prodid…
-
1
votes1
answer237
viewsA: Why don’t Sass and Less work on Powershell?
This issue is related to Powershell security policies. By default the execution policy is not defined(Undefined). When policy is not defined, powershell assumes restricted policy(Restricted). You…
-
1
votes1
answer311
viewsA: Validate Cpf’s from a query
The Boolean return can even be recognized by PL/SQL but not by SQL. For this reason when trying to execute the query: SELECT CPF_VALIDACAO(NUMR_CPF) FROM PESSOAS You will get the mistake: ORA-00902:…
-
0
votes1
answer94
viewsA: Save values from Combobox c#
Or this combobox cbLinha or this one cbPosto doesn’t have the property ValueMember defined. Thus its SelectedValue becomes a System.Data.DataRowView and therefore error in its conversion from value…
-
2
votes3
answers69
viewsA: Break query result in 2 lines
Make a UNION ALL with two consultations: SELECT b.* FROM portal_sega_user a -- perfil INNER JOIN portal_sega_user b -- secretaria secundaria ON b.usuario = a.secretariaprincipal INNER JOIN…
-
1
votes1
answer47
viewsA: How to concatenate columns identified by surname?
It’s not possible that way. Even if your columns with a nickname come before, that’s not how it works... This code snippet for example: case when datediff(...) > 0 then month(tblData.data1) when…
-
1
votes1
answer69
viewsA: Kill ORACLE session 12c
You can build an anonymous block that basically searches your sessions, mounts the command and executes. Behold: BEGIN FOR reg in (SELECT 'alter system kill session ''' || ses.sid || ',' ||…
-
1
votes1
answer154
viewsA: Select return result even if there is no NULL record, grouped by day
You could generate the month data in an auxiliary table. As an example, da para fazer isso usando "tables" do próprio Mysql: SELECT DATE_ADD('2020-04-01', INTERVAL rnk day) dia FROM (SELECT…
-
0
votes1
answer51
viewsA: Return Anniversary of Hiring Weekly in SQL Oracle
Just change the logic of yours where. Convert the date to the current year thus: TO_DATE(TO_CHAR(hire_date,'DD/MM'),'DD/MM') and then compare the dates using a between:…
-
4
votes1
answer57
viewsA: FORM C#: HOW TO NOT LEAVE TEXT BOX FIELD WITH DOUBLE VARIABLE VALUE IN BRACO
There are several logic problems in your algorithm. You are trying to convert the values even before validating them. You are converting the values of the fields in a way that is not safe. Is…
c#answered Bruno Warmling 1,540 -
0
votes1
answer47
viewsA: Procedure does not update table with NULL value
You can use the function ISNULL in SQL Server, basically it returns an alternative value, when the value passed to it is null: Example: ISNULL(WCoinC, 0) Use in your context: UPDATE CashShopData SET…
-
0
votes1
answer253
viewsA: How to know which select option was selected after opening the modal?
How you are making the modal work through the attributes data- it is not necessary to call the method to show the modal manually. $("#myModal").modal("show"); Just remove that chunk of code below…
-
0
votes1
answer43
viewsA: Problem in xml deserialization
You need to specify in your class which element is the root of your list with the XmlRoot. The rest follow the way it is. Behold: public class Records { [XmlElement("Categoria")] public Categoria[]…
-
1
votes2
answers241
viewsA: How to build a json in powershell
Da para fazer escape of the value of your variables using the function: [System.Security.SecurityElement]::Escape Before you ride your JSON, call this function to the values of its variables,…
powershellanswered Bruno Warmling 1,540 -
1
votes1
answer370
viewsA: Test date field in Oracle query
You can use a regular expression to validate if the typed text matches what you expect. The function regexp_like checks whether the reported value matches the expected standard. See how it looks:…
oracleanswered Bruno Warmling 1,540 -
3
votes1
answer212
viewsA: Add customizable SOAP Header
Create a class that identifies the object you want to send in the header. Example: [DataContract(Namespace = "")] public class autenticar { [DataMember] public string cnpj { get; set; } [DataMember]…
-
0
votes2
answers226
viewsA: Powershell file output. CSV after Foreach
To export the result directly to a text file, you can use the pipeline command Out-File Example of use: "$server $IP_TCP Conectado" | Out-File -FilePath "c:\\temp\\test.txt" -Append…
-
3
votes1
answer167
viewsQ: Capture and treatment of exceptions in a generic way
In general the most common is to capture the exceptions specific and do some treatment with it, right? Example: try { //Algum trecho de código } catch (MyException myException) { //Especifico para…
-
2
votes1
answer104
viewsA: AVG Oracle returning very broken value
You can use the functions trunc and round. The trunc cuts the number down to x digits. The round round the number to x digits. You can specify how many digits you want to cut/round in the second…
sqlanswered Bruno Warmling 1,540