Posts by BrunoLM • 5,198 points
81 posts
-
0
votes1
answer149
viewsQ: How can I create a control that has subcontrols without explicitly adding a template?
I want to create a control exactly like a Panel. <asp:Panel runat="server"> Conteúdo <div>Content</div> </asp:Panel> I want to be able to put controls inside it without…
-
2
votes1
answer149
viewsA: How can I create a control that has subcontrols without explicitly adding a template?
It is not necessary to use the template, just add these attributes to your control: [ParseChildren(false)] [PersistChildren(true)] ParseChildrenAttribute.ChildrenAsProperties sets whether tags…
-
3
votes1
answer447
viewsQ: How can I write values in the memory of another process?
I have the memory address, the process and the value. // Processo var p = Process.GetProcessesByName("ePSXe").FirstOrDefault(); // Endereço IntPtr addr = new IntPtr(0x00A66E11); // Valor var val =…
-
3
votes1
answer447
viewsA: How can I write values in the memory of another process?
Add these methods: [DllImport("kernel32.dll")] static extern IntPtr OpenProcess(ProcessAccessFlags dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, int dwProcessId);…
-
3
votes0
answers582
viewsQ: Is there a tool that manages documentation similar to MSDN?
Is there a program that transforms the documentation of my code (I can generate .xml) into MSDN-style pages? Or a wiki format?
-
13
votes1
answer865
viewsQ: How do I increase the brightness of an element with Javascript/jQuery?
On my page I have several elements with different background colors. I wonder how I could do to when clicking a button increase the brightness of the color, make it lighter. It is possible to do…
-
16
votes1
answer865
viewsA: How do I increase the brightness of an element with Javascript/jQuery?
Yes, it is possible. To do this you need to convert the color to HSV to change the brightness. See the jsFiddle example Converting to HSV (to change the brightness) HSV means Hue (tone), Saturation…
-
2
votes1
answer324
viewsQ: How do I get access_token when I log in with Facebook on MVC5?
When I create a project MVC5 the Visual Studio automatically creates a website for me with option to login by Facebook, Google... Just need to enable in the file "Startup.Auth.cs". But he does the…
-
2
votes1
answer324
viewsA: How do I get access_token when I log in with Facebook on MVC5?
You need to create an instance of FacebookAuthenticationOptions and configure the Provider. The Provider contains an event called OnAuthenticated which occurs when you are authenticated. var…
-
12
votes3
answers16084
views -
13
votes3
answers16084
views -
7
votes4
answers1385
viewsQ: How to replace {vars} in a string?
I have a string string str = "Bem vindo {Usuario}. Agora são: {Horas}"; I want to replace {Usuario} by a name and {Horas} by the current time, how can I do this?…
-
7
votes4
answers1385
viewsA: How to replace {vars} in a string?
C# already has a function for this, it is called String.Format see the documentation. String.Format("Bem vindo {0}. Agora são: {1}", usuario, hora); However if you want to implement something…
-
1
votes2
answers1709
viewsA: How do I implement the Groupby method in Typescript?
I implemented it as follows: I have a class class Linq<T> And in it I have the field a that contains the array. And I have the Groupby method: // keySelector: extrai o valor chave do elemento…
-
4
votes2
answers830
viewsQ: What is the most efficient way to calculate the Hashcode of an object in Javascript?
I’m currently using Object.prototype.GetHashCode = function () { var s = this instanceof Object ? JSON.stringify(this) : this.toString(); var hash = 0; if (s.length === 0) return hash; for (var i =…
-
0
votes2
answers228
viewsA: What is the most efficient way to implement Groupby in Javascript?
I managed to implement this way: First I need a way to get the Hashcode of the objects. Object.prototype.GetHashCode = function () { var s = this instanceof Object ? JSON.stringify(this) :…
-
6
votes2
answers228
viewsQ: What is the most efficient way to implement Groupby in Javascript?
I’m trying to implement a GroupBy with these parameters function GroupBy(keySelector, elementSelector, comparer) { // keySelector = function(e) { return e.ID } // elementSelector = function(e) {…
-
7
votes1
answer244
viewsA: How can I detect and alert that a particular user is sending many messages in a row?
I suggest you save in the session the date the message was sent and a message counter. If the user sends another message, compare the date with the one stored in the session, if the time difference…
-
16
votes9
answers27569
viewsQ: How do I read Javascript URL values (Querystring)?
When accessing a page, for example /item?tipo=1&nome=po%C3%A7%C3%A3o%20de%20cura How do I get these URL values, decoding appropriately?
-
4
votes9
answers27569
viewsA: How do I read Javascript URL values (Querystring)?
You can use the following method: // parametro `a` opcional, ex: `tipo=1&nome=espada#custo=0` // o valor padrão é da URL atual function GetQueryString(a) { a = a ||…
-
6
votes2
answers2592
viewsQ: How to optimize an image for web?
On my website someone uploads an image (e.g., 800x600). I would like to save this image in a folder but reducing the disk size as much as possible without losing much quality. How can I do that?…
-
5
votes2
answers1709
viewsQ: How do I implement the Groupby method in Typescript?
I have an array: interface IFoo { IDCidade: number; Nome: string } var arr = [ { IDCidade: 10, Nome: "Foo" }, { IDCidade: 10, Nome: "Bar" }, { IDCidade: 20, Nome: "Foo" }, { IDCidade: 20, Nome:…
-
2
votes1
answer672
viewsQ: How do I make Html.Labelfor() display an asterisk in required fields?
I want the required fields (properties with the attribute Required) render with an asterisk indicating that it is a required field. public class Foo { [Required] public string Name { get; set; } }…
-
2
votes3
answers7413
viewsA: How to customize error pages on an ASP.NET MVC system?
On my website I modified Global.asax.Cs and includes protected void Application_Error(object sender, EventArgs e) { var app = (MvcApplication)sender; var context = app.Context; var ex =…
-
3
votes2
answers578
viewsQ: How do I always keep my Urls in lower case?
I want all Urls on my site to be lowercase to help with SEO and to make link sharing consistent. How can I do that?
-
7
votes2
answers578
viewsA: How do I always keep my Urls in lower case?
You can use the IIS URL Rewrite. To use on a server just download and install. Shared hosts usually include this module. With this module installed just configure rules. To convert everything to…
-
6
votes1
answer1452
viewsQ: How do I copy an image to the clipboard (Clipboard)?
I’m using this command to capture the screen. chrome.tabs.captureVisibleTab(null, {}, function (image) { // image = base64;string }); And now I would like to copy the captured image to clipboard…
-
5
votes2
answers961
viewsQ: How to redirect from non-www to www?
I want my website visitors to always access with www. I want to somehow redirect in case the user tries to enter without www or Ubdomain. If you try to access exemplo.com I want to redirect to…
-
4
votes2
answers961
viewsA: How to redirect from non-www to www?
You can use the IIS URL Rewrite. To use on a server just download and install. Shared hosts usually include this module. With this module installed just configure rules. To redirect permanently…
-
31
votes4
answers28968
viewsQ: What is the most appropriate way to concatenate strings?
There are different methods for concatenating strings, such as Concatenating with the operator "abc" + str Formatting String.Format("abc{0}", str); Using the Stringbuilder new…
-
71
votes8
answers49747
viewsQ: How do I remove accents in a string?
I have a string áéíóú That I want to convert to aeiou How do I remove accents? Need to save to database as a URL.