Friday, February 14, 2014

The Journey Home

An Autobiography of a person (American Swamy) who travels to the east by hitchhiking to find his life's goal.A 19 year old boy travels with his friend from America to India with little money. His journey is full of mysteries unfolding at right time to him. He travels across multiple countries by hitchhiking learning various religions. The courage he shows to follow his heart despite many dangerous thwarts in his journey is amazing. Perseverance and passion to go forward inspite of many hinderances is the quality of this great person. One will be greatly thrilled by his experiences, adventures involved in finding his spiritual path.  BTW, i am speaking about Richard (alias Radhanath swamy)  :) 

Here's the link which speaks more about this book. 

Saturday, November 24, 2012

+++++Affirmation+++++

Positive Affirmation 

An Excerpt from Susan Jeffer's blog in my own words...


Positive (+ve) Affirmation is not simply a sentence; its represents a  a way of life... a way of acting, a way of feeling, a way of believing. It helps you to transform from weaker part of who we are to a stronger part of who we will be. 

If you are paranoid, always have a feeling that future is bleak, having a feeling that we are always in the control of situations or destiny or in any difficult situation or in quest for peace, love, happiness or freedom then these positive affirmations are so helpful. 

You should understand the deeper meaning of +ve affirmation and should make a habit of repeating it as many times as possible in a day and it consequentially helps in becoming more powerful, stronger, peaceful and helps you to embrace all situations with happiness. 

No dedicated time is required for repeating +ve affirmations. you can repeat it while you are on the way to work or college or school, while you are on morning walk or taking a bath or while having your supper etc. This continuous repetition or habit helps you to replace your negative thoughts with +ve thoughts and your productivity in life will enhance. 

Having said so much about +ve affirmations, lets start with this affirmation from Susan Jeffer's blog:

1) Whatever happens, I'll handle it. 


Deeper meaning: 

"Within me, I have the power to handle anything that ever happens to me. Instead of fear, I feel only faith. I know I have a huge amount of strength within me and I will always find the good that ultimately comes from all that happens in my life. I will learn from it all, grow from it all, and use it all as a means of reaching the best of who I am. Every situation in my life offers me the opportunity to become a more powerful and loving human being."

I believe that every person have unique strengths, unique weakness and simply unique style in everything. So you have to identify your favorite +ve affirmations that helps you, makes you powerful, loving, peaceful in every aspect of your life.

This is a small post to bring change and make you stronger :) :)
All comments are welcome!  

Thursday, October 7, 2010

Web Matrix

Hello friends,
                     I am introducing the web matrix in this post. Web matrix is a tool to build websites.It includes IIS( web development Web Server).ASP.NET (a Web Framework) and Microsoft SQL Server (Compact Edition). This is the era where every one prefers  DYNAMIC WebPages than STATIC WebPages and also ASYNCHRONOUS WebServices.To support all these,the best tool which i think is a Web Matrix.This tool also allows you to host it on some web server and also allows you to perform SEO(Search Engine Optimization) of your websites.This post tells you how to get started with Web Matrix and how to create websites


1) First download the Web matrix from the below link:
     

 http://www.microsoft.com/web/webmatrix/default.aspx?wt.mc_id=soc-in-wag-msp-srikiran 


 This link will direct you to run the Wpilauncher.Once you run it you will find the below screen.

  
 You can either customize to install even other Web Platform tools or simply click install which will install the Web Matix.

2) Once you install the Web Matrix open it from Start Menu and this screen will appear.
  
    The start screen will show four different choices.My Sites ---- It contains those sites which you have already created.Site From Gallery ---- This will direct you to Web Gallery(Open source webSite Templates).Site From Template ---- This allows u to create a website from scratch. Site From Folder ---- To choose the site from already existing folder.


3) Choose Site From Template to get started with it and click on EmptySite ,name it. After this you will see this screen.
4) In the screen you will find four different workspaces at the bottom left corner.Those are  Site,Files,Databases and Reports.
a) Site Workspace: This contains the Settings information about your websites such as URL,Port,SSL etc.
b) Files Workspace: In this you can code your websites using HTML,CSS,JavaScript,RazorCode Using ASP.Net.
c)Databases Workspace: In this you can create a database where you can store your Websites Data.You can also access this data from your website and can perform various operations on it.
d)Reports Workspace:This allows you to run SEO reports for your website.


5) After Knowing something about the webmatix lets now create a Sample Website . So now go the Files workspace and click on Add a file to your site and the following screen will appear.




Here you can add any type of file like HTML, Txt, Aspx etc.Lets add one CSHTML file.(A CSHTML page is a special type of page in WebMatrix that can contain the usual contents of a web page, such as HTML and JavaScript code, and that can also contain code for programming web pages.) to our website.


6) Now add the following code to your file: @Twitter.Profile("Sachin_rt"); (I will tell about this code little later in this post.)


    Now save this page and click on Run and you will be able to see the following page on your website.




   You will able to see my Twitterfeeds on the webpage.See how simple it is to see the twitter feeds using a single line of code. 

By the way i have to discuss about the code @Twitter.Profile("Your twitter username"); 
The above code is called Helpers.
Helpers allow you to accomplish complex tasks with a single line of code. ASP.NET has a whole collection of helpers. 
Helpers are present in Razor Syntax.Razor Syntax is used to Write a server code in your website.Razor syntax is built upon ASP.NET code which inturn based on .NET Framework.

To know more about the helpers and Razor Syntax see mypost


I have modified the above code like below so that it takes the username as input and gives the TwitterFeeds of a person.

                                                                                         
                                                                                       

Now I am Publishing this site using Publish button on the Ribbon.
So finally the site is http://20196gwbv4.adhostbeta.com/Demo/twitterfeeds.


This is end of this post.Try the Web Matrix if you are really passionate about Creating your websites.I will post some advanced things about web matrix some latter time.




Feel free to post a comment and questions. 


Byee,



Razor Syntax,ServerCode and ASP.Net

Razor syntax is a simple programming syntax for embedding server-based code in a web page. In a web page that uses the Razor syntax, there are two kinds of content: client content and server code. Client content is the stuff you're used to in web pages: HTML markup (elements), style information such as CSS, client script such as JavaScript, and plain text.
Razor syntax lets you add server code to this client content. If there's server code in the page, the server runs that code first, before it sends the page to the browser. By running on the server, the code can perform tasks that can be a lot more complex to do using client content alone, like accessing server-based databases. Most importantly, server code can dynamically create client content—it can generate HTML markup or other content on the fly and then send it to the browser along with any static HTML that the page might contain.
ASP.NET web pages that include the Razor syntax have a special file extension (.cshtml or .vbhtml). The server recognizes these extensions, runs the code that's marked with Razor syntax, and then sends the page to the browser.

 8 Programming Tips for Writing the Razor Syntax:
1) You add code to a page using the @ character 
               The @ character starts inline expressions, single statement blocks, and multi-statement blocks:
Example :
<!-- Inline expression -->
 <p>The value of your account is: @total </p>
<!-- Single statement block. --> 
@{ var myMessage = "Hello World"; }
 <p>The value of myMessage is: @myMessage</p>
<!-- Multi-statement block. --> 
@{
var weekDay = DateTime.Now.DayOfWeek;
var greetingMessage = "Welcome all "+ " Today is: " + weekDay;
}
 <p>The greeting is: @greetingMessage</p>


2) You enclose code blocks in braces
  Example:
  <!-- Multi-statement block. --> 
@{
var weekDay = DateTime.Now.DayOfWeek;
var greetingMessage = "Welcome all "+ " Today is: " + weekDay;
}

Observe the above code which is written in { } braces

3) Inside a block, you end each code statement with a semicolon.
  Example:    
     < !-- Multi-statement block. --> 
@{
var weekDay = DateTime.Now.DayOfWeek;
var greetingMessage = "Welcome all "+ " Today is: " + weekDay;
}
Observe the above code where each statement ended with Semicolon.
Note: Inline expressions do not end with a semicolon

4) You use variables to store values
You can store values in a variable, including strings, numbers, and dates, etc. You create a new variable using the var keyword. You can insert variable values directly in a page using @.
Example:
  <!-- Multi-statement block. --> 
@{
var weekDay = "Sunday";
var Date = "23/09/2010";
var greetingMessage = "Welcome all "+ " Today is: " + weekDay;
}

5) You enclose literal string values in double quotation marks

To specify a string, you enclose it in double quotation marks:
 @ { var myString = "This is a string literal"; }
If the string contains a backslash character (\) and double quotation marks, use a verbatim string literal that is prefixed with the @ operator.
<!-- Embedding a backslash in a string -->
 @{ var myFilePath = @"C:\MyFolder\"; }
<p>The path is: @myFilePath</p>
To embed double quotation marks, use a verbatim string literal and repeat the quotation marks:
<!-- Embedding double quotation marks in a string -->
@{ var string1 = @"The person said: ""Hello, today is Monday."""; }
<p>@string1</p>

6) Code is case sensitive
     The following lines of code create two different variables:
 @{ 
       var lastName = "sri";
      var LastName = "kiran";
    }

7) Much of your coding involves objects
           In today's Programming world everything is treated as object and then it is programmed.Even the Razor syntax follows the same.For example: a page is a object,textbox is a object ,Request is a object.Using the properties of Object we can access the objects data and using objects methods we can perform operations on it. 
Example:
        "Request" is a Object and we can access the properties of it such as URL,RequestType etc.
<p>@Request.Url</p>  Will print the Url of the Requested page

8) You can write code that makes decisions
A key feature of dynamic web pages is that you can determine what to do based on conditions. The most common way to do this is with the if statement (and optional else statement).
Example:
@{
var result = "";
 if(IsPost)
  {
     result  "This page was posted using the Submit button.";
  }
  else 
  {
     result = "This was the first request for this page."; 
   }
}


So these are the rules to write a code in Razor syntax.Once you know the above rules, you can write server code using Razor syntax and with the help of Helpers.

Hope You people liked the Content :)