Posts by Bruno Costa • 5,878 points
147 posts
-
6
votes2
answers651
viewsA: Difference is between Backgroundworker and Task.Run()?
Let’s look at the interface of Backgroundworker (I put only the most relevant infomacao). Methods CancelAsync() - cancels an operation RunWorkerAsync() - the Woker starts working ReportProgress() -…
-
1
votes1
answer105
viewsA: I want to print a double strand of DNA on the python shell
There is no right answer to this question. Your output appears formatted this way because of the size of the window. If the window was large enough, you could see its output normally. Content Voce…
-
5
votes3
answers1008
viewsA: How is a class organized in memory?
What are the memory zones To answer this question I think it’s a good idea to go back to the old man assembly. In a program (which lately appears in instructions assembly), there are several memory…
-
1
votes1
answer140
viewsA: How to add controls created by me in Visual Studio Toolbox?
Do your control (minimum example): class BotaoTransparente : Button { public BotaoTransparente() { BackColor = Color.Transparent; } } In visual studio 2015 the controls are automatically added when…
-
-2
votes1
answer140
viewsQ: How to add controls created by me in Visual Studio Toolbox?
I created a control for WinForms. But I can’t find my control on Toolbox. How can I add my control to Toolbox?
-
2
votes2
answers690
viewsA: Change property of multiple Uttons simultaneously
Place your buttons in an array and scroll through the array. But you can only do this for properties with equal values: var botoes = new[]{button1, button2, button3, button4 /*...*/}; foreach(var…
-
1
votes1
answer1476
viewsQ: What is and what the Fabric service is for
In my view Microsoft has done an excellent job to support several platforms lately. It all started when they released the platform code. Net. It seems that once again they are investing in various…
-
1
votes1
answer1244
viewsQ: What are the advantages and disadvantages of publishing a web service on a server or as a Windows service?
My company often creates Windows services to publish services Web. This means that the service is not hosted on any server (such as IIS). One obvious disadvantage I see right away is that the…
-
5
votes2
answers288
viewsA: What is ARIA (Accessible Rich Internet Applications)?
O/A ARIA is a set of attributes in HTML that provides greater accessibility to people with disabilities (motor, blindness or deafness). You can see a list of attributes in the W3 You can see the…
-
2
votes1
answer61
viewsA: Model/View Programing - WPF and Mysql
The most common pattern in WPF is the MVVM (Model-View-Viewmodel) which is a standard of type MV*. This standard fits 3 components. The view (which has a set of controls organized in a certain way),…
-
1
votes1
answer94
viewsA: Using only knockoutJs and jQuery can replace the durandalJs?
Anything is possible, it doesn’t mean it’s easy. The knockout just does data-Binding as long as the durandal has Routes, management of dependencies, animations and management of views. So if you…
-
0
votes1
answer43
viewsA: How can I search for a property if I don’t know its name?
Looks like I’m gonna solve the problem by getting the properties byte[] in a different area of the document. This way I can make a simple projection to obtain only the non-binary properties. The…
-
0
votes1
answer43
viewsQ: How can I search for a property if I don’t know its name?
In my database mongodb I am saving a document with the following structure: { "_id": "A/B", "Properties": { "Abandoned": { "TypeName": "int", "Name": "A/B/Abandoned", "Value": 2 }, "Busy": {…
-
2
votes1
answer244
viewsA: Foreach without repeating the name
One way to solve the problem is by making a grouping by description. I will use the element table because the example becomes easier, you may have to make adjustments to your layout: <table>…
-
1
votes1
answer283
viewsA: How to use Radiobuttons in Xamarin Cross Platform?
The RadioButton is dependent on the platform. You will have to do yours, or use one already made by other programmers. If you choose to use this xaml would be the following: //No seu elemento do…
-
3
votes1
answer274
viewsA: When consuming an API that returns me serialized data in JSON, how do I know the data types of the properties?
Yes, the way it is currently used is correct and you have the problem pointed out. If the property type on the server is changed you have to change the property of your model to the right type.…
-
8
votes3
answers2680
viewsA: How to iterate over a dictionary?
Yes, there is. The dictionary and a data structure and like any data structure it can be iterated with any type of cycle. msdn has an iterated document about a data collection, by coincidence this…
-
1
votes2
answers581
viewsA: Difference and sum of DATETIME column
Another way to do this is by grouping the values by a common key and subtract the values taking into account whether it is start or not. Hence your table of chamado_processos should have a column…
-
0
votes4
answers354
viewsA: How to put Nextel mask in an <input> with Javascript?
I found another way to do this with the jquery input Mask. Unlike the plugin you mentioned, this allows you to click on the next field of the mask, from the moment the current one is valid.…
-
1
votes4
answers354
viewsA: How to put Nextel mask in an <input> with Javascript?
You can use the browser validator with the attribute pattern. This combined with a placeholder can be an elegant way to solve the problem. <form action="demo_form.asp"> Nextel: <input…
-
0
votes1
answer59
viewsA: How Can I Download a Report? Issue of Beliefs
My Ports server and the application server were not the same. (I think) that for this reason the IIS user was not allowed to read the report. The solution was to use a user common to both servers…
-
0
votes1
answer59
viewsQ: How Can I Download a Report? Issue of Beliefs
I am trying to download a report (SSRS). More specifically I want to keep it in a folder so I can print it out. Turns out in development I don’t have any problems downloading the report. But at…
-
0
votes1
answer288
viewsA: Map to Unity3d
It seems there are a few available: Simplemap Great Maps Sharp Map Arcgis Here is an example of how to use Great Maps, I chose this by having a higher number of downloads which is not indicative of…
-
2
votes1
answer826
viewsA: Vector and Classes, drawing and filling vector in Java
The truth is you haven’t given enough information to solve your problem, but it’s been almost a year since you posted this problem, and I’ll try to give you an answer. Indexing of arrays It is…
-
12
votes6
answers6260
viewsA: How to determine if a number is power 2?
The most efficient way is to verify that the number-1 ends in 1111... binary. In Javascript this is: function isPowOf2(v){ return v && !(v & (v - 1)); } var test = [0, 1, 2, 4, 6, 8];…
-
4
votes4
answers24580
viewsA: Is there a difference between Program, Thread and Process?
A program consists of a set of instructions that you elaborate to achieve a certain goal. In other words, the program essentially consists of the source code. A thread is a component responsible for…
-
1
votes1
answer65
viewsA: error in comparison using substring
The problem is that the second parameter (endIndex) de substring is exclusive. It also indicates the position where it should end, not the number of characters as it is done in other languages. This…
-
3
votes1
answer115
viewsA: What is the best way to make multiple requests to an API?
Utilizing Tasks The idea is to sign the orders and add them to a list of tasks with all requests. Then wait for the answers with Task.WaitAll: var tasks = new Task<string>[10]; var api =…
-
4
votes1
answer115
viewsQ: What is the best way to make multiple requests to an API?
I came to ask this question once again thinking that it would be beneficial for the community to have a canonical way of making several http requests to a particular API. More specifically this…
-
5
votes3
answers269
viewsA: How to format the name of an item in a listbox?
One of the ways to do this is by redefening the method ToString class. public override string ToString() { return "Meu texto aqui"; } Another hypothesis is to define a value for DisplayMember. This…
-
5
votes1
answer133
viewsA: How do I get a scrollbar to follow the last comment on a listbox in C#?
Select the last item in the list: listbox.SelectedIndex = listbox.Items.Count - 1;
c#answered Bruno Costa 5,878 -
3
votes4
answers2950
viewsA: Draw where the name cannot be drawn more than once
I’ve come to transcribe a more sophisticated algorithm to solve this problem. This algorithm has at least two advantages over Fisher-Yates: Do not change the original list (avoid a copy if…
-
1
votes4
answers3166
viewsA: Display error message when typing phone
I suggest using browser-supported validation. This only works if the browser supports HTML5 <form> <input type="tel" name="telefone" maxlength="8" minlength="8" pattern="[0-9]*"…
-
4
votes2
answers837
viewsA: Operator error cannot be applied to the method group
The problem is that Imprimir_Experiencias_Trabalho tries to make a concatenation with TempoTotal. TempoTotal is a method. For this reason you can call it as follows: TempoTotal(DataInicio,…
-
8
votes2
answers8548
viewsA: What is the asymchronism?
What is the asynchrony? Synchronous or asynchronous refers to the execution flow of a program. When an operation runs completely before passing control to the next, the execution is synchronous.…
asynchronousanswered Bruno Costa 5,878 -
15
votes2
answers8548
viewsQ: What is the asymchronism?
In a question about use or not use Node Js, I ended up having to give an explanation about what is the asynchronymism. And it seems that the community would benefit in a general way from a formal…
asynchronousasked Bruno Costa 5,878 -
14
votes1
answer3815
viewsA: What are the ideal use scenarios for Node.js?
I’m sorry, but to give a full answer I’m gonna have to get away a little bit from what’s being asked. Your question recently refers only to one of the problems that servers web have to answer. This…
-
2
votes1
answer488
viewsA: Extract . zip file
7zip can use compression algorithms different from those used by zip. Try to use the library Sevenzipsharp, available on nuget.…
c#answered Bruno Costa 5,878 -
6
votes2
answers932
viewsA: Best practices when working with Multithread
var tasks = new ConcurrentBag<Task>(); tasksdoesn’t have to be a ConcurrentBag for it is not being accessed by multiple threads. public async Task<int> Task2() { return await…
-
0
votes1
answer58
viewsA: Get responsible for error
One of the ways to do this is to pick up the exception and re-launch it with an element identifier that caused the error. <button id="btn" onclick="try{a(this);}catch(err){throw new…
-
0
votes1
answer89
viewsA: Can I see the implementation of the Java API codes?
As mentioned in the comments the JDK source (the java libraries) is available in src.zip, included with the SDK. Note that my SDK is in a different directory. It is usually found in C:\Program Files…
javaanswered Bruno Costa 5,878 -
1
votes2
answers286
viewsA: How to increment from 0 to 10 inside a Javascript setInterval
Another option is to use setTimeout to simulate the behaviour of setInterval and have a function that determines when it should end. function setIntervalDelayed(delay, interval, cb){…
javascriptanswered Bruno Costa 5,878 -
3
votes3
answers16275
viewsA: How to send a data to another PHP page by URL?
I know there are GET and POST methods but I don’t know how to apply them. Understanding the semantics of methods HTTP is essential for programming web applications. I will try to explain the…
-
1
votes1
answer551
viewsA: Load txt file through a list c#
Add a AppendLine in the end sb.AppendFormat("{0}{1}{2}", idRegistro = "1", numeroControle = " ", folhaRecebe ="uuuuu") .AppendLine();…
-
1
votes2
answers242
viewsA: Differentiate Datetime.Now and Datetime.Now.Date
Yes. First I would suggest using DateTime.Today today which is equivalent to DateTime.Now.Date. For this very reason it is sufficient to make the following comparison: if(data == data.Date) EDIT:…
c#answered Bruno Costa 5,878 -
21
votes5
answers7637
viewsA: Is Excel a programming language?
I believe that some concepts are being mixed up: Programming language Turing machine Excel Functions of Excel In my opinion the Wiki has a good definition of what a programming language is: A…
-
1
votes1
answer234
viewsA: Dynamic linq with C#
First of all I started by expressing better the intention of my code, making a grouping of sums per month: var query = g.GroupBy(x => x.Field<DateTime>("MTA_DTINIANO").Month, group =>…