Posts by Bruno Piovan • 724 points
22 posts
-
3
votes1
answer593
viewsA: How does seed influence the generation of random numbers?
According to the documentation: Pseudo-random numbers are chosen with equal probability from a finite set of numbers. The numbers chosen are not completely random because a mathematical algorithm is…
-
3
votes2
answers144
viewsA: Redudancia interface with Disposable
In your example, the recommended would be that your interface implementasse Idisposable: public interface IClassBase<TEntity> : IDisposable where TEntity : class { void Add(TEntity obj); }…
-
0
votes1
answer879
viewsA: Httpcontext.Current.Session is null in thread
Session is part of the request context. When the request ends, Session ceases to exist. In other words, you are trying to access an object that is dependent on the request (Session) in a method that…
-
2
votes4
answers343
viewsA: Why not always use Optimize Code?
Serves to compile code more efficiently. But there are cases (pinvoke for example) where optimized code does not work properly, so you can disable optimization in some methods. Just memorize the…
-
1
votes1
answer92
viewsA: Linq to SQL - Dynamic sort by column index
You can use the Predicatebuilder, more specifically the Orderhelper. Do something like: var ordenado = OrderHelper.GetOrderedQueryable<Entidade>(query, orders); Where orders is an array…
-
5
votes3
answers7644
viewsA: How to create a Datetime object that represents the last day of a given month?
how do I find out the last day of this month? var ultimoDia = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
-
2
votes2
answers1984
viewsA: C# - How to close the login form(initial program form) after calling another form?
Take a look at this post: https://stackoverflow.com/questions/5548746/c-sharp-open-a-new-form-then-close-the-current-form Basically this is what you do when you show your Form2: this.Hide(); var…
-
4
votes4
answers25519
viewsA: The input character string was not in an incorrect format. Operators
if you do not want to change your RAM(), you can use an TrimEnd which receives an array of char to take from the end, which would be your "MB" like this: var ram =…
-
1
votes1
answer68
viewsA: Jobject.Parse returning null
Try this: var jsonData = JObject.Parse(textoJson); var items = (JArray)jsonData["items"]; foreach (var item in items) { var snippet = item["snippet"]; var description =…
-
1
votes1
answer60
viewsA: Getdata VB.NET function
Try this: Private Sub GetData() Try con = New SqlConnection(cs) con.Open() cmd = New SqlCommand("SELECT nome, matricula, marca, [Licenca-emissao], [licenca-expira] from Clientes order by Nome", con)…
-
2
votes1
answer77
viewsA: Remove cloned DIV by clicking button
thus? function menos() { var destino = document.getElementById("aqui"); if (destino.lastChild) { destino.removeChild(destino.lastChild); } } http://jsfiddle.net/qf2Lf914/1/…
-
4
votes1
answer414
viewsA: How to connect to SQL Server with VB.NET?
Strip these 2 bars to separate the instance name. Moult .\\sqlexpress; for .\sqlexpress; in VB. In c# or you make "escape" from certain characters or use @before to indicate that everything inside…
-
0
votes1
answer564
viewsA: Comparison of Object Lists - C#
If the two guys were the same, you could use the Intersect, but as they are not, I think the code below does what you need: var list3 = from l1 in list1 join l2 in list2 on l1.RA equals l2.RA select…
-
2
votes2
answers108
viewsA: Memory Leak in Xmlserializer
There are basically 2 rules where the implementation of Idisposable is required: The object maintains unmanaged resources; The object maintains managed resources that implement Idisposable;…
-
0
votes4
answers3901
viewsA: Question about each() in Jquery
that’s it? $("#sortable li").each(function(){ console.log($(this).attr("id")); }); https://jsfiddle.net/Lqmf8g20/…
-
0
votes1
answer50
viewsA: Modify an Address with several Offset
As you marked the issue with the C#tag, I believe you are using pinvoke with some function definition Writeprocessmemory in . net that makes the marshal the best way for his need. However I believe…
c#answered Bruno Piovan 724 -
2
votes1
answer133
viewsA: C# How to get the duration of an MP3 that is in an HTTP address
I suggest you take a look at this page http://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header which deals with the MP3 header. Basically, what you can do is: Connect to the server and…
-
2
votes3
answers125
viewsA: Search List(Of String) - Case insensitive
No use for Exists? Dim v_list As New List(Of String)(New String() {"a", "b", "c"}) Dim v_contains As Boolean v_contains = v_list.Exists(Function(x) String.Compare(x, "A",…
-
1
votes1
answer124
viewsA: Display a button based on the action of another
I believe the best way would be for you to change the flow of your system so that the Associate button was only shown when the user was Editing a car. For example, create an Action called Add, in…
-
9
votes2
answers455
viewsA: String Interpolation performs better than string. Format?
There is no difference. The compiler will call string.Format() whenever you use the notation $. In other words, the generated IL will be the same. Therefore, there is no difference in performance.…
-
1
votes2
answers1257
viewsA: Error when configuring application in IIS Local (Integrated pool)
If you don’t use impersonate on your website, go to Authentication on IIS and disable. Or try changing the pipeline mode of the app pool to classic if your site is being migrated from iis 6.…
-
0
votes1
answer174
viewsA: Uncaught Error: [$injector:modulerr] - Asp.Net MVC
This error has nothing to do with MVC, see the detail of the error and you will see which module is not being injected at the angle. Try to change your code to something like: var app =…