Archive
Using the Charting Control in ASP.NET Webform
The following steps will give you a brief intro on how to use the chart control, from there you can easily extend and provide additional functionalities
The chart control has separate definition sections for data and chart type, with this, it is possible to create multiple chart types using the same data points.
- First create a blank asp.net webform
- Then using the design view, click on toolbox and search for the chart control under the data section
- You will now see the placeholder for the chart appear in your webform
- This is the default column chart, you can change the type simply by clicking on the chart and then the arrow that appears
- You can link the data source via standard data adapters like SQL, EF, XML etc. But this example will add the data via code.
Inside the page_load event of the page, add the following code
//Create 6 data points with x values from 1 to 5
for (var x = 1; x < 6; x++)
{
//set it such that the y value mirrors the x value
var y = x;
//add the following point to the chart
Chart1.Series[0].Points.AddXY(x, y);
} - Press F5 to run the website and view your chart
HTTP 400 Errors when using WCF
if you encounter the following weird errors
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:ClientPrintResult. The InnerException message was ‘There was an error deserializing the object of type System.String. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader
or
The remote server returned an unexpected response: (400) Bad Request
It usually means that you are sending more than 8192 bytes of data to the WCF service. if this is a legitimate case, you will need to update both the server’s web.config and your applications app.config.
The examples below are based on custom binding, but you can easily find the equivalent settings for the other bindings as well.
For this example, the maximum data that can be sent is 10MB (10485760). The maximum permissible value is 2147483647 (int.MaxValue = 2GB)
For web.config
modify the items in bold and blue, add in the section or properties if they do not exist, else just update the values
<binaryMessageEncoding maxReadPoolSize="10485760" maxSessionSize="10485760" maxWritePoolSize="10485760">
<readerQuotas maxDepth="32" maxStringContentLength="10485760" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binaryMessageEncoding>
<httpTransport maxReceivedMessageSize="10485760" maxBufferSize="10485760" />
For app.config
modify the items in bold and blue, add in the section or properties if they do not exist, else just update the values
<binaryMessageEncoding>
<readerQuotas maxDepth="32" maxStringContentLength="10485760" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binaryMessageEncoding>
<httpTransport maxReceivedMessageSize="10485760" maxBufferSize="10485760" />
Upgrading a jailbroken device to the latest and greatest iOS firmware
If you have a jailbroken device, chances are you will find it a headache to upgrade your iOS firmware. Below are the steps which you can take to minimize your headache.
Requirements
- Jailbroken iOS device
- Installous installed and with iTunes sync on
- PC with the latest iTunes
- new iOS firmware can be jailbroken
- Steps
- Connect the iOS device to your PC
- Start up iTunes
- Right click your device and click on Transfer Purchases

- Wait for the purchases to be transferred
- Right click your device and click on Back Up

- Wait for the backup to complete
- Upgrade to the latest iOS version via iTunes (Click on Check for Update or Shift + Click Restore to load a local copy of the ipsw)
- Jailbreak the device
- Run cydia on the device and install installous
- Install any other cydia apps that you need (so that restore will restore the apps location inside springboard properly)
- Enable iTunes Sync inside installous
- Inside iTunes, click on your device and select the Apps tab
- Check Sync Apps
- Click ok when prompted
- Make sure all the apps are selected then click on Apply
- Wait for the apps to be synchronized back to your phone
- Right click your device and select Restore from Backup
- Select the latest backup which was done before the upgrade and click ok
- Wait for iTunes to restore the files and application settings, your phone will reboot once complete
After all this, you should have your phone back in more or less the same order as before. Your springboard icon locations may be slightly off, but that should not be too much of a hassle