Month: August 2015

HTML5 − SVG Rectangle


Following is the HTML5 version of an SVG example which would draw a rectangle using tag −

<!DOCTYPE html>
<html>
   <head>

<style>
         #svgelem{
            position: relative;
            left: 50%;
            -webkit-transform: translateX(-50%);
            -ms-transform: translateX(-50%);
            transform: translateX(-50%);
         }
      </style>

      <title>SVG</title>
      <meta charset="utf-8" />
   </head>
   <body>

<h2 align="center">HTML5 SVG Rectangle</h2>

      <svg id="svgelem" height="200" xmlns="http://www.w3.org/2000/svg">
         <rect id="redrect" width="300" height="100" fill="red" />
      </svg>
   </body>
</html>

This would produce following result in HTML5 enabled latest version of Firefox.

svgrectangle

HTML5 – SVG


SVG stands for Scalable Vector Graphics and it is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer.

SVG is mostly useful for vector type diagrams like Pie charts, Two-dimensional graphs in an X,Y coordinate system etc.

SVG became a W3C Recommendation 14. January 2003 and you can check latest version of SVG specification at SVG Specification

Viewing SVG Files

Most of the web browsers can display SVG just like they can display PNG, GIF, and JPG. Internet Explorer users may have to install the Adobe SVG Viewer to be able to view SVG in the browser.

Embeding SVG in HTML5

HTML5 allows embeding SVG directly using <svg>…</svg> tag which has following simple syntax −

<svg xmlns="http://www.w3.org/2000/svg">
   ...    
</svg>

Firefox 3.7 has also introduced a configuration option (“about:config”) where you can enable HTML5 using the following steps −

  • Type about:config in your Firefox address bar.
  • Click the “I’ll be careful, I promise!” button on the warning message that appears (and make sure you adhere to it!).
  • Type html5.enable into the filter bar at the top of the page.
  • Currently it would be disabled, so click it to toggle the value to true.

Now your Firefox HTML5 parser should now be enabled and you should be able to experiment with the following examples.

HTML5 − SVG Circle


Following is the HTML5 version of an SVG example which would draw a circle using <circle> tag

<!DOCTYPE html>
<html>
   <head>
      <style>
         #svgelem {
            position: relative;
            left: 50%;
            -webkit-transform: translateX(-20%);
            -ms-transform: translateX(-20%);
            transform: translateX(-20%);
         }
      </style>
      <title>SVG</title>
      <meta charset="utf-8" />
   </head>
   <body>
      <h2 align="center">HTML5 SVG Circle</h2>
      <svg id="svgelem" height="200" xmlns="http://www.w3.org/2000/svg">
         <circle id="redcircle" cx="50" cy="50" r="50" fill="red" />
      </svg>
   </body>
</html>

This would produce following result in HTML5 enabled latest version of Firefox.

It will produce the following result −svgcircle

Hide Contents on Click Event


In this article we will see how to hide html page contents on click event using jQuery.

<html>
<head>
<title>Hide Content Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js" />
</head>
<body>
<p>If you click on me, I will disappear.</p>
<p>Click me away!</p>
<p>Click me too!</p>
<script>
$(document).ready(function() {
    $("p").click(function(){
        $(this).hide();
    });
});
</script>
</body>
</html>  

Check live demo here : Hide Contents on Click Event

What’s new in Microsoft .NET Framework 4.6?


When you install .NET 4.6 Preview it will actually be installed as .NET, partly to maintain (in-place) compatibility with previous versions (4, 4.5, 4.5.1 and 4.5.2). This means that if you have one of the above mentioned frameworks installed on your computer, this installer will upgrade them to 4.6 while if you have older frameworks installed like 3.5, 2.0, 1.1 etc., then it will run alongside them.

There are three key areas to look at :

  1. Open Source .Net Framework Packages
  2. Support for Code page encodings
  3. Improvements to event tracing

1. Open Source .Net Framework Packages

.NET Core 5 is a modern, componentized framework that ships via NuGet. That means you can ship a private version of the .NET Core Framework with your app. Other apps’ versions can’t change your app’s behavior.

.NET Core CLR is built for Windows, Mac and Linux and it will be both open source and it will be supported by Microsoft. Some of the .NET packages like Immutable collections and SIMD APIs are available on GitHub. All these packages are licensed under the MIT license. Microsoft are also open sourcing RyuJit and .NET GC, and making them both cross-platform. (more…)

How to connect with different types of DataBase


Introduction

While developing Ado.Net Applicaions most of the errors comes because of the wrong format of Connection String used to connect the application with the DataBase. I am publishing some Connection String formats to connect with different types of DataBase.

Connection String Formats

To connect with the Ms-Access 2003 DataBase Connection String Format:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Full Path of the DataBase File with Extension (".Mdb");Persist Security Info=True;Jet OLEDB:Database Password=********

To connect with the Ms-Access 2007 DataBase Connection String Format:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Full Path of the DataBase File with Extension (".accdb");Persist Security Info=True;Jet OLEDB:Database Password=********

To connect with the SQL Server DataBase Connection String Format:

DataSource=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DataBaseName.mdf;
Integrated Security=True;User Instance=True

To connect with the MYSQL DataBase Connection String Format:

DataSource=Sever Name;DataBaseName=DataBase File Name;
UserName="Name";Password=*******

To connect with the Oracle DataBase Connection String Format:

Data Source=MyOracleDB;User Id=myUsername;Password=********;
Integrated Security=no;

I hope this will help New developers in ADO.Net Programming.

Read more about connection strings : http://www.connectionstrings.com/

Glass Style Button With Dropdown MenuList


MBGlassButton_Demo.JPG

Introduction

Why another Button? The standard Button is too limited in functionality and I couldn’t find a custom control written that did all that I wanted. This is a User Control with lots of properties and versatility. It is simple to use, just drop it on the form, adjust the design time properties, and use it like the normal Button.

Background

MBGlassButton is a Button which inherits all the properties of a simple Button control. I added some extra functionalities in MBGlassButton like Glow, Split, Highlight, etc. The language used is VB.NET.

Control Properties

Here is the list of properties available in MBGlassButton:

  • Arrow: This property is used to set the arrow on MBGlassButton.
  • BaseColor: This property is used to set the Base Color of MBGlassButton.
  • BaseStrokeColor: This property is used to set the Base Stroke color of MBGlassButton.
  • OnColor: This property is used to set the on color of MBGlassButton.
  • OnStrokeColor: This property is used to set the On Stroke color of MBGlassButton.
  • PressColor: This property is used to set the Press Color of MBGlassButton.
  • PressStrokeColor: This property is used to set the Press Stroke Color of MBGlassButton.
  • ShowBase: This property is used to Show the Glow on MBGlassButton.
  • Radius: This property is used to set the corner Radius of MBGlassButton.
  • SplitButton: This property is used to Split MBGlassButton into two parts.
  • SplitDistance: This property is used to set the Split Distance of MBGlassButton.
  • SplitLocation: This property is used to Split MBGlassButton at a specific location.

(more…)