Posts by Daniel Dutra • 2,283 points
55 posts
-
-1
votes1
answer39
viewsA: Robot to monitor prices
Fernando, I believe you can find programs that already do what you want for OLX. If you still want to build your own you will need to create a program that acts a little like a browser (Chrome,…
-
2
votes0
answers79
viewsQ: How to create a custom Authorizeattribute in ASP.NET Core?
I need only a few endpoints in my API to use a different token, because they will be called by a less secure application and I don’t want that other token to have access to every application equal…
-
2
votes1
answer2024
viewsQ: Problems executing commands in CMD with Python
I am unable to execute (or get the result) commands executed in Windows by Python. I picked up some code examples I saw on various websites and responses in the OS, but none worked well for me.…
-
3
votes1
answer1299
viewsA: How can I compile a simple program in Prolog?
According to the SWI-Prolog.com: For local use, you usually do not want to make an executable. Simply create a script as described in Prologscript, is easy and starts only a little slower in most…
prologanswered Daniel Dutra 2,283 -
0
votes1
answer14
viewsQ: View contents of the Azure Service queue
I would like to see the messages (and their content) that are in one of the queues of Servicebus. For Azure’s website i can see all the queues of Servicebus, how many items each one has, its size…
-
5
votes3
answers1514
viewsA: Search between dates with between
When you only use the date on BETWEEN, Mysql interprets it as if the time were 00:00:00. Therefore the date 2016-08-18 09:00:30 is not between the dates of your filter, it is larger than 2016-08-18…
sqlanswered Daniel Dutra 2,283 -
16
votes1
answer20057
viewsQ: What do these words mean in Git/Github: Fork, clone, track?
It’s not long since I started using Git and until this week I only used it through the Visual Studio interface. After a lot of problems with Git for the interface, I started solving some things on…
-
1
votes1
answer610
viewsA: REGEX password validation
As far as I know, it is not feasible to detect sequence of numbers with regex. It is possible to detect repeated characters easily, such as 000 or aaa, but a sequence 123, 987 or abc not. The regex…
-
4
votes2
answers842
viewsQ: Using Array.Foreach to modify the collection
I want to remove spaces from the beginning and end of the string (Trim) in all positions of array, but none of the ways below worked. What am I doing wrong? var optionArray = new string[] { "in the…
-
1
votes1
answer549
viewsA: Integration between R and Java
According to a response in the OS: The user who answered the question has already managed to successfully integrate using two alternatives. JRI: Upside: probably has better performance. Downside:…
-
1
votes1
answer350
viewsA: Regex for number format
Pattern to get numbers from 0 to 9.999.999.99: "((?:\d\.)?(?:\d{1,3}\.)?\d{1,3},\d{1,2})|(\d)" The Pattern above gets numbers in the following formats: 0 0,00 00,00 0,000,00 000,000.00 0.000.000,00…
-
2
votes1
answer209
viewsA: Filestream file directory and extension
Actually what you pass as the first parameter in builder of FileStream is not the name of the file, but the address (path) of the archive. Its address must contain the path, name and extension of…
c#answered Daniel Dutra 2,283 -
1
votes2
answers2966
viewsQ: Error starting IIS Express Web Server - Error 0x80070020
After leaving Visual Studio one night in mode debug stopped on a line, I could no longer run the web application locally because of an error in the IIS Express. I tried to stop the IIS Express and…
-
2
votes2
answers2966
viewsA: Error starting IIS Express Web Server - Error 0x80070020
In accordance with that post of a blog: The code error 0x80070020 means ERROR_SHARING_VIOLATION, that in the case of IIS Express (or IIS) means that the door IIS is trying to listen is being used by…
-
2
votes2
answers407
viewsA: Saving file path in Mysql
The cmd.CommandText of if (status == "novo") is concatenating the next line along with the query. The next line being cmd.ExecuteNonQuery();, that returns the Id of the Insert that she has just…
-
8
votes7
answers68940
viewsA: How to make SELECT with ORDER BY and different criteria?
I got the 100 always come first using two queries: select id, nome from CATEGORIA where id = 100 union (select id, nome from CATEGORIA where id != 100 ORDER BY nome ASC) ; Note that the second query…
mysqlanswered Daniel Dutra 2,283 -
2
votes1
answer187
viewsQ: Configurationmanager.Appsettings returning different values in different environments
I don’t know much to post to help the question, so if you want to know more just mention the comments. In the web.config, inside appSettings, has the tag <add key="apiManagerUrl"…
-
11
votes2
answers2457
viewsQ: How to exclude element from a list in R
I have this list: x = list(1, 3, 5, 8, 13) How do I delete the second element?
rasked Daniel Dutra 2,283 -
7
votes2
answers2457
viewsA: How to exclude element from a list in R
In accordance with the documentation of R, simply set null to the element you want to remove: x[[2]] <- NULL…
ranswered Daniel Dutra 2,283 -
4
votes1
answer288
viewsQ: Create unique attribute beyond Primary Key in code-first
I’m creating a table of Logradouro where the countryside CEP is not the primary key, but should be unique. How do I do it using code-first in the Entity 6.0? To create primary key I use the method…
-
5
votes1
answer1139
viewsA: Close console window in C
According to an OS question: The console (or shell) on which the program is running is completely independent of your program, it is only a user interface (I/O). Trying to close the console is not a…
-
1
votes1
answer204
viewsA: Separate items from a string using Regex
I recommend using the Split normal, is usually more efficient than Regex. If all values have to be separated, just give Split by both characters and use the option to ignore empty divisions:…
-
19
votes3
answers1511
viewsA: How can I replace a part of a string by itself plus the "~" character?
If the full number is always followed by a space, you can use the Pattern "([0-9]+?)" and replace by the match that occurred within the parentheses plus the ~ and a space (that gave match also):…
-
4
votes4
answers5492
viewsA: Difference between two dates, ignoring weekend - working days only
One more way to join @Merson-js' lean solution with the @Maniero solution that includes holidays: public static int CountDiasUteis(DateTime d1, DateTime d2, params DateTime[] bankHolidays) {…
-
2
votes2
answers1896
viewsA: How to make a record count for each day between a date and another?
Just group per day using day(data): select day(t.data) as 'Dia', count(*) as 'Quantidade' from tabela t where t.data between '2016-06-01' and '2016-06-14' group by Dia ; If you need the full date, I…
-
5
votes1
answer737
viewsA: Make Variable with multiple names and a single Value String
You can assign the same value to several variables at once as follows: var perfume = colonia = rollon = "Racco" But in the case above, if the variables colonia and rollon not yet declared, they will…
-
1
votes3
answers4851
viewsA: Cut string at last occurrence of a character in a string
The other answers do not remove the last occurrences as I needed. They removed the first occurrences and concatenated, so they didn’t work for the second case: Informacoes separadas - Por - Hifen. I…
mysqlanswered Daniel Dutra 2,283 -
5
votes2
answers2327
viewsA: Is there any way to make a "git pull" without conflicts?
If you always use git pull and make no changes to the repository, will not give conflict; for conflicts can only occur if the git can’t do merge automatic between your local repository and the…
gitanswered Daniel Dutra 2,283 -
6
votes2
answers1839
viewsQ: Switch Alternative Inside Switch
I’m making a decision structure that depends on more than one variable, but readability and maintenance using if or switch are terrible. What alternatives do I have for this case? Example of switch…
-
3
votes1
answer50
viewsA: Difficulty with Regex
I believe that a Split normal solves your problem: string stringSplit = "|1300|"; string[] arr1300 = conteudo.Split(new string[] { stringSplit }, StringSplitOptions.RemoveEmptyEntries); After the…
-
4
votes3
answers4851
viewsQ: Cut string at last occurrence of a character in a string
I have a text in a column that has information separated by "-"(hyphen) and I need to remove the last and second to last information. Examples: Transform "Informacoes - Separadas - Por - Hifen" in…
mysqlasked Daniel Dutra 2,283 -
2
votes2
answers594
viewsA: How to detect a bot
I think the only effective way is by using Captcha, other ways are easy to circumvent. There are good ways to estimate the number of visitors, an example is the view Count of OS, but even this…
-
3
votes1
answer100
viewsQ: What do Threads share when making Http calls?
The problem: I can’t login to a site more than once on Threads different. My application is a Console application. If I open several executable, can each do successfully login in one Thread, only…
-
1
votes1
answer2049
viewsQ: Foreach in Select and List
I recently discovered that there’s a big difference between doing some operations, like Select and Where, in Queryable and listed objects such as Enumerable and List. In this and in this question.…
-
3
votes1
answer1164
viewsA: Remove Git Binding in the ASP.NET MVC Project
As @pedro-camara-junior already commented, just delete the folder .git which is at the root of your repository. The folder is hidden, so be sure to enable the option to view Hidden Files and…
-
4
votes1
answer58
viewsQ: Error using Split inside Select
Why the exception below occurs when using Split within a Select in a IQueryable? The LINQ Expression Node type 'Arrayindex' is not supported in LINQ to Entities. I already managed to solve the…
-
3
votes1
answer3276
viewsA: C# - Separate/cut string by commas (but with monetary value included in the string)
For your case of your exeplo I recommend doing split comma with space: string[] colunas = linha.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries); If you prefer to use Regex, can…
c#answered Daniel Dutra 2,283 -
4
votes2
answers1328
viewsQ: Is it safe to use List with Parallel.Foreach?
I’m making one by making a style method Crawler which receives a string list, makes a call on a website, inserts the return into another list and returns. My method is working, but it’s too slow, so…
-
1
votes2
answers71
viewsA: Select from all companies that have catalogues
To verify the businesses who possess catalogue you need to make a join with catalogues, but as you do not need to display all the catalogues, only the businesses, you have two alternatives: select…
-
3
votes2
answers89
viewsA: Deleting items in List
To filter you can use the method Where. var matches = lista.Where(x => !x.Nome_Grupo.ToLower().Contains(txtFiltro.Text)).ToList(); To filter more than one value you can use one List and check if…
-
0
votes2
answers87
viewsA: C# Windows Forms Generic Object
According to the MSDN, you can get the content with SelectedIndex same and the text of the option with (SelectedItem as Object).ToString(). private void showSelectedButton_Click(object sender,…
-
0
votes1
answer39
viewsA: FRONT END - jBox?
There is more than one effect when minimizing a window on your Mac. Two common are the Genie Effect and Scale Effect. In the case of Scale Effect I did not find a good ready, but with the example…
-
1
votes2
answers525
viewsA: Where do I find ready-to-edit phonegap application projects?
When you want ready applications recommend look for open source. On the website mobilegap.net, which is the first result of the google query, already has 6 applications in Phonegap that has the code…
-
0
votes1
answer130
viewsQ: Native app performance is still far superior to html based app?
I am in doubt about which framework/language to use to start application development. From what I’ve read so far, I’m between using Ionic and Xamarin. Everywhere I read the great advantage of Ionic…
-
1
votes2
answers117
viewsA: take the input field value of a gridview with jquery
As the other answer says, the problem is really the comma in the numbers. According to the answer to another question, the method parseFloat only considers the part of the string where you find…
-
0
votes2
answers2262
viewsA: How recursion occurs in the following code
Basically what happens is that a method performs itself. Since the programming is object oriented, the execution of the code is not all linear and makes it possible to execute a single piece of code…
javaanswered Daniel Dutra 2,283 -
2
votes1
answer790
viewsA: Format file names using Regular Expression
I created another Pattern regex from scratch, because I found yours a little "disorganized." Pattern: (.*?) .*?\d?(\d{2}).*?(\w.*) Substituting: \1.S01E\2 - \3 If you prefer to use the same Pattern…
regexanswered Daniel Dutra 2,283 -
2
votes2
answers207
viewsA: How to create multiple vectors dynamically with Javascript?
One solution would be to create an Array of Arrays. This method of a @Matthew-Crumley could make a vector capable for a variable number of vectors. function createArray(length) { var arr = new…
-
1
votes1
answer1398
viewsA: Check that the file has been copied
Agree with the response of @dsfgsho to a question similar to yours: When a file is being used it becomes unavailable, so you can check its availability and wait until it becomes available for use.…
c#answered Daniel Dutra 2,283 -
2
votes1
answer46
viewsA: Ruby on Rails Routing
According to the documentation Ruby on Rails to create a route to the root just do your second example. May root to: 'static_pages#home' or root 'static_pages#home'. Remembering that in this example…
ruby-on-railsanswered Daniel Dutra 2,283