Rss Feed Like Us on facebook Google Plus

April 26, 2013

Differences between Stored Procedures and Functions

DIFFERENCES
  • Procedure can return zero or n values whereas function can return one value which is
    mandatory.
  • Procedures can have input/output parameters for it whereas functions can have only input parameters.
  • Procedure allows select as well as DML statement in it whereas function allows only select statement in it.
  • Functions can be called from procedure whereas procedures cannot be called from function.
  • Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
  • We can go for transaction management in procedure whereas we can't go in function.
  • Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.
  • UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.
  • UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
  • Inline UDF's can be though of as views that take parameters and can be used in JOINs and other Rowset operations.

In depth

Stored Procedure

A Stored Procedure is a program (or procedure) which is physically stored within a database. They are usually written in a proprietary database language like PL/SQL for Oracle database or PL/PgSQL for PostgreSQL. The advantage of a stored procedure is that when it is run, in response to a user request, it is run directly by the database engine, which usually runs on a separate database server. As such, it has direct access to the data it needs to manipulate and only needs to send its results back to the user, doing away with the overhead of communicating large amounts of data back and forth.

User-defined Function

A user-defined function is a routine that encapsulates useful logic for use in other queries. While views are limited to a single SELECT statement, user-defined functions can have multiple SELECT statements and provide more powerful logic than is possible with views.
User defined functions have three main categories:
  1. Scalar-valued function - returns a scalar value such as an integer or a timestamp. Can be used as column name in queries.
  2. Inline function - can contain a single SELECT statement.
  3. Table-valued function - can contain any number of statements that populate the table variable to be returned. They become handy when you need to return a set of rows, but you can't enclose the logic for getting this rowset in a single SELECT statement.
Read More

April 25, 2013

Outlook Express - Account protocol pop3 port 110 secure(ssl) no error number 0x800c0133

Problem -- An unknown error has occurred. Account: '', Server: 'mail.google.com', Protocol:
Outlook Express - Error 0x800c0133
POP3, Port: 110, Secure(SSL): No, Error Number: 0x800C0133


Solution --

This is a corrupted Inbox...

Try this...

1. Create "New Folder" in your outlook express, specify a name for your new folder as "Temp".

2. If you are still able to access "Inbox", move all mails in "Inbox" to the new "Temp" folder.

3. Go to menu "Tools" -> "Options" -> "Maintenance" tab -> "Store Folder" button. It will show the location of your Inbox file, please remember this location.


or copy the folder location and paste it to run

4. Close Outlook Express, go to the location mentioned above, delete the file "inbox.dbx".

5. Restart Outlook Express, the "Inbox" folder should be auto recreated. 


6. Move back your mails to the new "Inbox", remove the "Temp" folder.
 
Read More

April 23, 2013

Const, Read Only, Static in C#

Within a class, const, static and readonly members are special in comparison to the other
modifiers.

const vs. readonly

const and readonly perform a similar function on data members, but they have a few important differences.


const

A constant member is defined at compile time and cannot be changed at runtime. Constants are declared as a field, using the const keyword and must be initialized as they are declared. For example;
public class MyClass
{
  public const double PI = 3.14159;
}
PI cannot be changed in the application anywhere else in the code as this will cause a compiler error.

Constants must be a value type (sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal, or bool), an enumeration, a string literal, or a reference to null.

Since classes or structures are initialized at run time with the new keyword, and not at compile time, you can't set a constant to a class or structure.

Constants can be marked as public, private, protected, internal, or protected internal.
Constants are accessed as if they were static fields, although they cannot use the static keyword.

To use a constant outside of the class that it is declared in, you must fully qualify it using the class name.

readonly

A read only member is like a constant in that it represents an unchanging value. The difference is that a readonly member can be initialized at runtime, in a constructor as well being able to be initialized as they are declared. For example:
public class MyClass
{
  public readonly double PI = 3.14159;
}
or
public class MyClass
{
  public readonly double PI;
 
  public MyClass()
  {
    PI = 3.14159;
  }
}
Because a readonly field can be initialized either at the declaration or in a constructor, readonly fields can have different values depending on the constructor used. Areadonly field can also be used for runtime constants as in the following example:
public static readonly uint l1 = (uint)DateTime.Now.Ticks;
Notes
  • readonly members are not implicitly static, and therefore the static keyword can be applied to a readonly field explicitly if required.
  • A readonly member can hold a complex object by using the new keyword at initialization.


static

Use of the static modifier to declare a static member, means that the member is no longer tied to a specific object. This means that the member can be accessed without creating an instance of the class. Only one copy of static fields and events exists, and static methods and properties can only access static fields andstatic events. For example:
public class Car
{
  public static int NumberOfWheels = 4;
}
The static modifier can be used with classes, fields, methods, properties, operators, events and constructors, but cannot be used with indexers, destructors, or types other than classes.

static members are initialized before the static member is accessed for the first time, and before the static constructor, if any is called. To access a static class member, use the name of the class instead of a variable name to specify the location of the member. For example:
int i = Car.NumberOfWheels;


MSDN references

Read More

April 13, 2013

Automatically Logon to Windows XP without username and password

If security isn't a big issue for you, configuring 
Windows XP to logon to your user account automatically can save you a little time and effort when your PC is starting up.
Just follow the easy steps outlined below to make Windows XP automatically logon to your user account. After completing these steps, Windows XP will stop prompting for a user name and password when your computer starts up!


To Automatically Logon to Windows XP without username and password follow these steps.

STEPS:

  1. Click on Start and then Run. In the Open: text box, type the following command:
    control userpasswords2
    
    Press the OK button.
    This command will load the Advanced User Accounts Control  Panel applet.
  2. In the Users tab, uncheck the box next to Users must enter a user name and password to use this computer.
  3. Click on the Apply button at the bottom of the User Accounts window.
  4. When the Automatically Log On dialog box appears, enter the user name you wish to automatically login with. Then enter your account password in the two fields where it's asked.
    Click the OK button.
  5. Click OK on the User Accounts window to complete the process.
    From now on, when your PC starts up, Windows XP will logon automatically.
Read More

Blogger Improves its Template HTML Editor

Whether you’re a web developer who builds blog templates for a living, or a web-savvy blog owner who prefers to make changes to your template using HTML, CSS or JavaScript, you may be interested in some enhancements that we made to Blogger’s Template HTML Editor.
Your blog’s HTML template is the source code that controls the appearance of your blog. This template can be customized to appear however you’d like. The improved HTML template editor now supports line numbering, syntax highlighting, auto-indentation and code folding to make editing your template much easier.

Suppose we wanted to move the date of a blog post underneath the post title, similar to the Blogger Buzz blog. To do this, follow these steps:



Click the “Template” tab on the Blogger dashboard, then the “Edit HTML” button, to see the new template HTML editor:
Locate the “Blog1” widget quickly using the new “Jump to widget” drop down:
This widget controls how your blog posts are displayed. The code inside the widget is folded by default. Clicking the new fold markers ‘►’ next to the line numbers expands the widget and reveals a set of “includable” tags:
Inside the “main” includable is the block of code that renders the post date:
Cut the post date code section and move it to where we want it, in this case, under the post title in the “post” includable:
To check our changes, click the new “Preview template” button to see the updates:

The post date is exactly where we want it, so tab back to “Edit template”, hit “Save template” and we’re done!
Finally, we’ve added a “Format template” button that automatically cleans up the indentation of the template, and made it possible to search for text by pressing “Ctrl+F” once you’ve clicked into the editor. To find and replace text occurrences one by one, use “Ctrl+Shift+F” or to find and replace all occurrences at once, use “Ctrl+Shift+R”.
Read More

April 12, 2013

Nokia 105 - Most Affordable Mobile for First Time Buyers

Mobile phone maker Nokia announced the launch of its most affordable handset 
- Nokia105 in the Indian market aimed at first time buyers.

Priced at 1,249, the phone is a colorful introduction to the Nokia range for first time buyers and is the lowest priced color screen entry phone available in the Indian market, a company release said here.

A successor to the highly successful Nokia 1280, which sold more than 100 million units in its lifetime, the Nokia 105 offers high quality handset design and everyday essentials like FM radio, a speaking clock and flashlight, making it ideal for first-time buyers, it added.

T S Sridhar, Regional General Manager (South), Nokia India, said the handset marks the end of black and white screen era in the domestic phone market.

"The very human and fresh design of Nokia 105 makes it distinct in this price range, and utterly modern despite a traditional form factor. Our most affordable device with some of the best category features is the ideal handset for first time buyers to enjoy the benefits and experiences of mobility," Sridhar said.
Read More

April 11, 2013

Soon Change Your Password with Your Thoughts

You may be spared from typing pesky passwords in the future! 


Instead of typing your password, you may only have to think about it, thanks to a new wireless headset device developed by researchers. 

Remembering passwords for all your sites can get annoying. There are only so many punctuation, number substitutes and uppercase variations you can recall, and writing them down for all to find is hardly an option. 

Researchers at the University of California Berkeley School of Information developed the device that explores the feasibility of brainwave-based computer authentication as a substitute for passwords. 

By measuring brain-waves with bio-sensor technology, researchers are able to replace passwords with "passthoughts" for computer authentication, website 'Mashable' reported. 

A USD 100 headset wireless connects to a computer via Bluetooth, and the device's sensor rests against the user's forehead, providing a electroencephalogram (EEG) signal from the brain. 

The NeuroSky Mindset looks just like any other Bluetooth set and is more user-friendly, researchers said. 

Brainwaves are also unique to each individual, so even if someone knew your passthought, their emitted EEG signals would be different. 

"Other than the EEG sensor, the headset is indistinguishable from a conventional Bluetooth headset for use with mobile phones, music players, and other computing devices," according to the researchers. 

Participants, in a series of tests, completed seven different mental tasks with the device, including imagining their finger moving up and down and choosing a personalized secret, the report said. 

Simple actions like focusing on breathing or on a thought for ten seconds resulted in successful authentication. 

"We find that brainwave signals, even those collected using low-cost non-intrusive EEG sensors in everyday settings, can be used to authenticate users with high degrees of accuracy," the researchers concluded.
Read More

April 10, 2013

Facebook Introduces Gifts in India

 
Facebook has unveiled Facebook Gifts for the Indian users, a service which allows users 
to send offline gifts to their friends and families in U.S. but it doesn’t allow sending gifts to users in India.  In order to use the service, the user should have a contact based in the US on Facebook, according to the reports of MediaNama.



The option “Give Gift” is located at the top of the Facebook profile. It offers various categories like food, wine, apartment, bar, flowers, baby/kids and the like. Once a category is chosen, a digital card should be selected where the sender can personalize it with a message which is then forwarded to the payment gateway. Currently, only credit cards work as a payment mode.



Once the gift is sent, the recipient will receive an email as well as a notification on Facebook. Clicking on the particular notification leads them to view the gift and read the card. The users have the option of posting the gift on the recipient’s profile. 



For this service, users don’t require the recipient’s address. Facebook asks the recipient for the address for the delivery of the gift. Shipping cost depends on the price of the gift and most gifts are shipped within a day and might take 3 to 5 business days. The service allows a preview of the gift for the recipient. Recipients are free to swap the gift for an item of equal or lesser value.







The service can turn out to be a boon to the Indian eCommerce sites and even competes with online gifting services. Recently, Flipkart started accepting International credit cards allowing international users to send gifts to friends and family in India.
Read More

March 21, 2013

Configure Outlook Express in Your Windows

E-mail configuration for outlook express --
To set up your Outlook Express client to work with G E-mail configuration for outlook Gmail:
    1. Enable POP in your email account. Don't forget to click Save Changes when you're done.
    2. Open Outlook or Outlook Express.
    3. Click the Tools menu, and select Accounts...
    4. Click Add, and then click Mail...
    5. Add mail account
    6. Enter your name in the Display name: field, and click Next.
    7. Enter your full Gmail email address (username@gmail.com) in the Email address: field, and clickNext. Google Apps users, enter your full address in the format 'username@your_domain.com.'
    8. Enter username
    9. Enter pop.gmail.com in the Incoming mail (POP3, IMAP or HTTP) server: field. Enter smtp.gmail.com in the Outgoing mail (SMTP) server: field. Google Apps users, enter the server names provided; don't add your domain name in this step.
    10. Enter server names
    11. Click Next.
    12. Enter your full email address (including '@gmail.com' or '@your_domain.com') in the Account name: field. Enter your email password in the Password: field, and click Next.
    13. Enter account name and password
    14. Click Finish.
    15. Highlight pop.gmail.com under Account, and click Properties.
    16. Highlight account
    17. Click the Advanced tab.
    18. Fill in the following information:*
      • Check the box next to This server requires a secure connection (SSL) underOutgoing Mail (SMTP).
      • Enter 465 in the Outgoing mail (SMTP): field.
      • Under Outgoing Mail (SMTP), check the box next to This server requires a secure connection (SSL).
      • Under Incoming mail (POP3), check the box next to This server requires a secure connection (SSL). The port will change to 995.
      • Highlight account
      *The order of Outgoing and Incoming mail server fields varies by version. Make sure you enter the correct information in each field.
    19. Return to the Servers tab, and check the box next to My server requires authentication.
    20. Highlight account
    21. Click OK.
    Congratulations! You're done configuring your client to send and retrieve Gmail messages.
Read More

March 20, 2013

10 Biggest Social Media Irritants

The 10 most annoying types of social media updates have been revealed in a new survey. The survey by Sweatband.com has found that diet and exercise boasters are the most annoying thing about social media.

The top 10 includes updates that most social media users will have published at some point. According to the Telegraph, the list of top 10 most annoying types of social media updates is as follows:

  1. * Diet and exercise boasters: Those who tell you how far they've cycled, how fast they ran and how many pounds they've shed.
  2. * People who tell you about every meal are boring enough.
  3.  * Cryptic status writers.
  4.  * At number four is game invitees. Those who bombard their friends with requests to play virtual farmers or digital mobsters or whatever game they are playing on Facebook.
  5.  * Proud parents. Of course your child is special and amazing. To you. The rest of us don't need to know about every step, sniffle or funny saying.
  6.  * People who share very personal details.
  7.  * Checker-inners.
  8.  * Event spammers. While it's great that you're hosting a hackathon to save badgers, you probably only need to tweet about it a couple of times.
  9.  * Constant engagers who like and comment. Liking a status update or commenting on a post can be supportive and engaging. It can also feel a bit like stalking if you do it too much.
  10. * Self-promoters. I would really like your business to succeed. I would like that almost as much as I would like you to stop talking about it.
Read More

© 2011-2016 Techimpulsion All Rights Reserved.


The content is copyrighted to Tech Impulsion and may not be reproduced on other websites.