Posts

Donate

How To Limit Or Reduce RAM Usage Of Mozilla Firefox Browser

Image
Hello, I noticed that Firefox takes a lot of RAM space on my workstation. After googling around, I found a solution on how to limit it's memory consumption. 1. Open Mozilla firefox 2. type about:config in the url/address bar 3. just click i'll be careful i promise 4. filter "browser.cache." 5. change browser.cache.disk.capacity from original value in my pc it's 1059997. I changed it to 30000 since my RAM space is 2GB. 6. Choose OK 7. Close and restart Mozilla firefox (I noticed the memory usage of firefox lowered to a significant level) Cheers! :=)

ASP.NET MVC (Add,Edit,Delete,View/View All) Example in C#

Image
Original Source: Developer Resources Just this evening, i modified an ASP.NET MVC example from Visual Basic.Net to C#. I also completed the steps and added some basic functionalities of my own. The database used is MS SQL Server 2008 and the data source is an ADO.NET Entity object. Below are the screenshots: Here is the snippet for the validation side in C#. This is not sophisticated: protected void ValidateEmployee(Employee EmployeeToValidate) { if (EmployeeToValidate.EmployeeName == null ) { ModelState.AddModelError( "EmployeeName" , "Employee name is required field." ); } if (EmployeeToValidate.Department == null ) { ModelState.AddModelError( "Department" , "Employee Department is required field." ); } if (EmployeeToValidate.EmployeeSalary == null ) { ModelState.AddModelError( "EmployeeSalary"

The remote server returned an error: (500) Internal Server Error (WebCclient) In C#

In our case when we encountered this error using WebClient, the solution was to set the user agent and add it as header to the WebCclient object. newWebClient.Headers.Add( "user-agent" , "Mozilla/5.0 (Windows NT 6.1; rv:2.0) Gecko/20100101 Firefox/4.0" );

SET Variable (User Defined) In MySQL Returns NULL (MySQL Browser)

Source: MySQL bug Forum Steps 1. Open MySQL Browser 2. Click Tools menu 3. Click Options 4. Choose Browser 5. Check Show Advanced Toolbars 6. Click Apply 7. Click close 8. Transactions Toolbar appears on MySQL Browser 9. Click the Transaction button on the transaction toolbar everytime you execute the query Sample query: Set @ names = 'james' ; select @ names ;

How To Get Or Retrieve The Response URL From WebRequest Object Using C#

The solution is to get the ResponseUri from the response object. //domain url: http://www.htcatalogs.com.au //response url: http://www.htcatalogs.com.au/2012/dailylistings/ WebRequest request = WebRequest.Create( "http://www.rmwilliams.com.au" ); HttpWebResponse resp = HttpWebResponse)request.GetResponse(); string ur = resp.ResponseUri.ToString(); Console.Write(ur);

Add Reference To WPF Merged Resource Dictionary In Window.xaml

Good evening guys! Here's how to add reference to WPF Merged Dictionary in Window.xaml. <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <!--resource dictionary is placed in folder--> <ResourceDictionary Source= "/ResourceDictionaries/RoundedButton.xaml" /> <!--dictionary is inside WPF project--> <!--<ResourceDictionary Source="RoundedButton.xaml" /> --> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources>

Download File Using Webrequest With Credentials In C#

Here's a C# code that will download a file from source with credentials (password and username). This assumes that the source directory is password protected. HttpWebRequest request; HttpWebResponse response = null ; try { string username = "xxxuser" ; string password = "yyypass" ; NetworkCredential myCredentials = new NetworkCredential(username, password); request = (HttpWebRequest)WebRequest.Create(ListURL); request.Timeout = 900000000; request.Credentials = myCredentials; request.AllowWriteStreamBuffering = false ; response = (HttpWebResponse)request.GetResponse(); Stream s = response.GetResponseStream(); //Write to disk FileStream fs = new FileStream( "\\192.168.3.3\xmldata.xml" , FileMode.Create); byte []

Enable Saving Of Changes That Require Table To Be Re-Created

Source: SQL Server Central The solutions is: 1. Go to Tools on MS SQL IDE 2. Click Options 3. Then Designers 4. Then Table and Database Designers 5. Uncheck Prevent saving changes that require table re-creation.

Webbrowser Control Not Displaying Webpage (No Internet Connection Message)

In one of our codes, we used web browser to scrape data. Recently, the webbrowser control can't display the webpage. The error states that THERE IS NO INTERNET CONNECTION. The solution was to Clear History of Internet Explorer Browser..(cookies/passwords/forms/temporary internet files) Cheers!

Set JSON Response In Webrequest Class

To set the JSON response of a WebRequest class, assign the ContentType property of the WebRequest object to application/json; charset=utf-8 . req.ContentType = "application/json; charset=utf-8" ; Source: Stackoverflow

Donate