by http://webgeektutorials.blogspot.com

Friday, September 30, 2011

LightSwitch Tutorial

Microsoft Visual Studio LightSwitch is a simplified self-service development tool that enables you to build business applications quickly and easily for the desktop and cloud. What can your business do with LightSwitch? Watch this brief introduction to find out.



Step-by-step video series is focused on teaching you how to build data-centric business applications using Visual Studio LightSwitch will be available shortly ( videos/downloadable ).

What is Google wallet?


An app that makes your phone your wallet—with Citi, MasterCard, Sprint and First Data. With Google Wallet, you can tap, pay and save using your phone.
We’ve been testing it extensively, and today we’re releasing the first version of the app to sprint. That means we’re beginning to roll out Google Wallet to all Sprint Nexus S 4G phones through an over-the-air update—just look for the “Wallet” app. Here’s a demo of Google Wallet in action:




Google Wallet enables you to pay with your Citi MasterCard credit card and the Google Prepaid Card, which can be funded with any of your existing plastic credit cards.Google adding a $10 free bonus to the Google Prepaid Card if you set it up in Google Wallet before the end of the year 2011.

You can get more information on Google wallet by following this link : Click Here

Source : Google

Friday, September 23, 2011

ER Diagram for a College System

The ER diagram refined to have an 'is-a' relationship. The simple conceptual tables can now be designed in such case as:

STUDENT (st-id, dob)
FULL-TIMEPROG (p-code, duration)
PART-TIMEPROG (p-code, duration)
REGISTERS (p-code, st-id)


Please note that the design above is not complete; a complete design would require all types defined and constraints identified. All such information is made available by the detailed analysis document.Any how some points can be considered...

In an educational institute, there are several departments and students belong to one of them. Each department has a unique department number, a name, a location, phone number and is headed by a professor.
  •  Professors have a unique employee Id, name, phone number. We like to keep track of the following details 
  • regarding students: name, unique roll number, sex,phone number, date of birth, age and one or more email addresses. 
  •  Students have a local address consisting of the hostel name and the room number. They also have home address consisting of house number, street, city and PIN. It is assumed that all students reside in the hostels. 
  • A course taught in a semester of the year is called a section. There can be several sections of the same course in a semester; these are identified by the section number. Each section is taught by a different professor and has its own timings and a room to meet. 
  •  Students enroll for several sections in a semester. Each course has a name, number of credits and the department that offers it. A course may have other courses as prerequisites i.e, courses to be completed before it can be enrolled in. 
  •  Professors also undertake research projects. These are sponsored by funding agencies and have a specific start date, end date and amount of money given. More than one professor can be involved in a project. Also a professor may be simultaneously working on several projects. A project has a unique projectId. 

Wednesday, September 21, 2011

Google APIs Client Library for Java developers


Google APIs Client Libraries & Tools team making available a Beta version of the open source Google HTTP Client Library for Java. This is the common HTTP client library. It features a pluggable HTTP transport abstraction that allows it to work seamlessly on any of the supported Java platforms, support for efficient JSON and XML data models for parsing and serialization, and a pluggable JSON and XML parser so you can use whatever works best for you.

Here is an example of how easy it is to use the OAuth 2.0 library to make a request using the library for the Google+ API:

// Set up the HTTP transport and JSON factory
HttpTransport httpTransport = new NetHttpTransport();
JsonFactory jsonFactory = new JacksonFactory();

// Set up OAuth 2.0 access of protected resources 
// using the refresh and access tokens, automatically 
// refreshing the access token when it expires
GoogleAccessProtectedResource requestInitializer =
    new GoogleAccessProtectedResource(accessToken, httpTransport,
    jsonFactory, clientId, clientSecret, refreshToken);

// Set up the main Google+ class
Plus plus = new Plus(httpTransport, requestInitializer, jsonFactory);

// Make a request to access your profile and display it to console
Person profile = plus.people().get("me").execute();
System.out.println("ID: " + profile.getId());
System.out.println("Name: " + profile.getDisplayName());
System.out.println("Image URL: " + profile.getImage().getUrl());
System.out.println("Profile URL: " + profile.getUrl());

Source: Google code

Monday, September 19, 2011

Sql Server : How to Point in time recovery

SQL Server offers the ability to do point in time restores of your data in order to restore your database back to the point right before that detrimental command was issued. 
Point in time recovery option which helped us to restore our database without losing a single record to a specific time.Process we followed was :
  • Must be in FULL RECOVERY MODEL
  • Must have a valid FULL BACKUP
Check current recovery model of your database :

SELECT name,recovery_model_desc
FROM sys.databases
1.You can change recovery model from SSMS by right click on your desired database.
2.click properties, on left, select options and change recovery model.
Or
you can do it with following tsql.
USE [master]
GO
ALTER DATABASE [MYDB] SET RECOVERY FULL WITH NO_WAIT

SQL Server Backup History Checkup

DECLARE @db_name VARCHAR(100)
SELECT @db_name = DB_NAME()

SELECT TOP (50)
s.database_name,
m.physical_device_name,
cast(CAST(s.backup_size / 1000000 AS INT) as varchar(14))
+ ' ' + 'MB' as bkSize,
CAST(DATEDIFF(second, s.backup_start_date,
s.backup_finish_date) AS VARCHAR(4)) + ' '
+ 'Seconds' TimeTaken,
s.backup_start_date,
CAST(s.first_lsn AS varchar(50)) AS first_lsn,
CAST(s.last_lsn AS varchar(50)) AS last_lsn,
CASE s.[type]
WHEN 'D' THEN 'Full'
WHEN 'I' THEN 'Differential'
WHEN 'L' THEN 'Transaction Log'
END as BackupType,
s.server_name,
s.recovery_model
FROM msdb.dbo.backupset s
inner join msdb.dbo.backupmediafamily m ON s.media_set_id = m.media_set_id
WHERE s.database_name = @db_name
ORDER BY backup_start_date desc,
backup_finish_date

Pakyow : Web framework for Ruby

Web framework Pakyow follows the MVC design pattern, but the flow is a bit different than what you might be used to. When a request is received the views are assembled first (based on the URL). If a route matches the appropriate business logic is invoked. The business logic can then manipulate the view and bind data to it.

Some Advantages :
  • In Pakyow, views define what the application will present. They are 100% HTML and no template language or special tags are needed to construct the view layer.
  • View construction begins with a root view, which usually defines the general view structure. Containers are created in the root view, which define the parts of the structure that are generated dynamically. Creating a container is as easy as adding an "id" attribute to any tag.
  • Pakyow provides several ways for the business logic of an application to easily interact with the views. In most frameworks the view logic is contained in the view itself, but Pakyow separates views and view logic. This keeps the roles for design and developer clearly defined and minimizes conflicts.
  • View construction happens before the business logic is invoked. The views can then be manipulated even easier than using a template language.
  • Data can easily be bound to its view.

Friday, September 9, 2011

VI Editor : helpful command reference


VI is text editors which share certain characteristics, such as methods of invocation from the operating system command interpreter, and characteristic user interface features. 
vi is a modal editor: it operates in either insert mode (where typed text becomes part of the document) or normal mode (where keystrokes are interpreted as commands that control the edit session). For example, typing i while in normal mode switches the editor to insert mode, but typing i again at this point places an "i" character in the document. From insert mode, pressing the escape key switches the editor back to normal mode.

vi Modes
vi has two modes:
  1. command mode
  2. insert mode
In command mode, the letters of the keyboard perform editing functions (like moving the cursor, deleting text, etc.). To enter command mode, press the escape <Esc> key.
In insert mode, the letters you type form words and sentences. Unlike many word processors, vi starts up in command mode. In order to begin entering text in this empty file, you must change from command mode to insert mode. To do this, type i .

Some helpful commands in Insert mode

i at the same cursor position
Capital A
To the end of the line.
Capital I
Begin of the line.
Small a
Next to the cursor position.