Saturday 31 January 2015

HTML5 JavaScript Charts

"An easy to use HTML5 JavaScript Charting library built on Canvas element. Charts can render across devices including iPhone, iPad, Android, Windows Phone, Desktops, etc. Graphs include several good looking themes and are 10x faster than conventional Flash / SVG based Libraries – resulting in lightweight, beautiful and responsive dashboards". more...

Here is my little ASP.NET program to draw a dynamic chart:

(These codes explains how to access JavaScripts function from codebehind and call codebehind functions from JavaScript)

Codebehind:
  1. protected void Button1_Click(object sender, EventArgs e)
  2. {
  3.     // Call JavaScript function in aspx
  4.     ScriptManager.RegisterStartupScript(this, GetType(), "draw", "draw();", true);           
  5. }
  6. [WebMethod]
  7. public static string chartType()
  8. {
  9.     return "bar";
  10. }
  11. [WebMethod]
  12. public static string labels()
  13. {
  14.     return "apple,orange,banana,mango,grape";
  15. }
  16. [WebMethod]
  17. public static string values()
  18. {
  19.     return "10,20,30,40,50";
  20. }
ASPX Page:
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head runat="server">
  3.     <title></title>
  4.     <script type="text/javascript" src="scripts/canvasjs.min.js"></script>
  5.     <script type="text/javascript">
  6.         function draw() {
  7.             var t = '<%=labels()%>'; // get the values from codebhind method
  8.             var l = new Array();
  9.             l = t.split(",");
  10.             var t = '<%=values()%>';
  11.             var v = new Array();
  12.             v = t.split(",");
  13.             var data = [];
  14.             for (var x = 0; x < v.length; x++) {
  15.                 data.push({
  16.                     label: l[x],
  17.                     y: parseInt(v[x]),
  18.                 });
  19.             }
  20.             var chart = new CanvasJS.Chart("chartContainer", {
  21.                 theme: "theme1",//theme1
  22.                 title: {
  23.                     text: "Basic Column Chart - CanvasJS"
  24.                 },
  25.                 animationEnabled: false,   // change to true
  26.                 data: [
  27.                 {
  28.                     // Change type to "bar", "splineArea", "area", "spline", "pie",etc.
  29.                     type: '<%=chartType()%>',
  30.                     dataPoints: data
  31.                 }
  32.                 ]
  33.             });
  34.             chart.render();
  35.         }
  36.     </script>
  37.     <script type="text/javascript" src="/assets/script/canvasjs.min.js"></script>
  38. </head>
  39. <body>
  40.     <form id="form1" runat="server">
  41.     <div>
  42.         <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" EnablePartialRendering="true" runat="server" />
  43.         <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
  44.     </div>
  45.         <div id="chartContainer" style="height: 300px; width: 100%;"></div>
  46.     </form>
  47. </body>
  48. </html>

Wednesday 28 January 2015

Windows 7 Slow Boot and Long Delay Time on Startup After Installing SSD

After installing the Windows 7 x64 on a machine with new Solid State Disk, Windows works slower than usual and has long delay on login screen. To overcome this problem, install the following update:


Monday 26 January 2015

Limited WiFi Connection Problem in Windows 8.1

After installing the Windows 8.1, wireless connection keep dropping saying "Limited Connectivity". To resolve this issue:

Open "Command Prompt" as administrator and issue the following commands in sequence:

    1. netsh int tcp set heuristics disabled
    2. netsh int tcp set global autotuninglevel=disabled
    3. netsh int tcp set global rss=enabled
    4. netsh int tcp show global
    5. Restart the computer

Thursday 22 January 2015

Enable Remote Connections for SQL Server Express 2012

  1. Run SQL Server Configuration Manager.
  2. Go to SQL Server Network Configuration > Protocols for SQLEXPRESS.
  3. Make sure TCP/IP is enabled.
Then,
  1. Right-click on TCP/IP and select Properties.
  2. Verify that, under IP2, the IP Address is set to the computer's IP address on the local subnet.
  3. Scroll down to IPAll.
  4. Make sure that TCP Dynamic Ports is blank. (Mine was set to some 5-digit port number.)
  5. Make sure that TCP Port is set to 1433. (Mine was blank.)
If follow these steps, it's not necessary to enable SQL Server Browser, and only need to allow port 1433, not 1434

After all, go to Windows Service Manager and RESTART the SQL SERVER service to apply the changes.



Wednesday 21 January 2015

Soild State Hard Disk Performs Very Slow in Windows 8.1

To fix this problem, execute the following command and restart the computer:

Start > Run > Winsat Format


Sunday 18 January 2015

Opening Excel File using Task Scheduler

It might be the DCOM permissions issue. One solution is to set Excel to run as a specific user through DCOM permissions.
  1. Open Component Services: Start > Run > DComcnfg
  2. Drill down to: Component Services > Computers > My Computer > DCOM Config
  3. Right-click on 'Microsoft Excel Application' and choose Properties
  4. In the 'Identity Tab', select 'This User' and enter the username and password of an interactive user account (domain or local) and then click Ok
Keeping it as the interactive user or the launching doesn't work with the task scheduler, even when setting the task to run under an account that has admin rights to the machine.


Tuesday 13 January 2015

React

A JavaScript library for building user interfaces. more...


Bootstrap

Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web. more...


Upgrade Windows 11 Home to Windows 11 Pro

Disable internet connection (Wi-Fi, Internet, etc.) Change the product key using the following Generic product key:                     VK7J...