Skip to main content

Posts

Right to Information Act, 2005

The Right to Information is an act of the Parliament of India which sets out the rules and procedures regarding citizens' right to information. It replaced the former Freedom of Information Act, 2002.  Assented to: 22-June-2005 Citation: Act No. 22 of 2005 Commenced: 12-October-2005 Territorial extent: India Download:          English Version Hindi Version Amendment 2020:     English Hindi
Recent posts

Facebook Account password mystery

In my previous post, I explained how we can play with Google account username. In this post, I will let you know something about Facebook account. As Google ignores periods in username, Facebook ignores the "CAPITAL CASE" letters in password. Means if your Facebook password is abcd, you can also use Abcd or ABcd or ABCD or any combination of small and capital letters. This is a bit surprising because in 99.99% cases, we think that passwords are case sensitive (& it should be due to the security reason). But Facebook has a different logic.When we use a desktop or Laptop, we can easily identify that our "CAPS" lock is ON or OFF & we always take care about it. But when we use our android device or iphone etc & try to enter any string then most of the time, by default First letter will be "CAPITAL CASE" letter & use may experience "Invalid Password" error. To get rid off this situation, Facebook has started to ignore ...

Google Account login mystery

1. If your username contains a dot (.), then you can also login to your google account by skipping that dot. E.g: abc.xyz can be accessible by abcxyz . (but account login will be displayed as abc.xyz) 2. If your username doesn't contains any dot (.), you can split your username by placing any number of dots (.) & try to login to your account. E.g: if my login id is abcxyz then I can use either abc.xyz or abc.x.y.z or abc...xyz etc. (whatever combination you want). This is because Google has started to ignore periods. So, you can take advantage by creating several Email Alias of your single Google Account & use them for different purpose. E.g: abcxyz for your personal use, abc.xyz for friends etc. I have tried all above test cases & works fine for me. There may be some exceptions E.g: If two different people created two different login as abcxyz & abc.xyz etc. I haven't tried this but I hope this will also work. This is (may be) just like th...

How to get current page URL in JavaScript/JQuery

Sometimes, we need to access the current URL in our JavaScript/JQuery code. We need to get any query string value or we need to check URL for any specific value/sub domain. There are a lot of situations when we want to fetch current URL in our code. There are several ways to do this. Here, I am discussing some of them. I will use the below URL to test the output. http://www.mysite.com/abc.aspx?qs1=test1&qs2=test2 Using classical JavaScript: Property            Result ================================================================================= window.location                     http://www.mysite.com/abc.aspx?qs1=test1&qs2=test2 window.location.href              http://www.mysite.com/abc.aspx?qs1=test1&qs2=test2 window.location.pathname   ...

Database Error while attaching a database file

There is a very common error wend going to attach database in SQL Server 2008R2. It generally gives the error: " CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file... (Microsoft SQL Server, Error 5123) " The problem is due to two different login do detach and attach. So the files, when detached, were owned by the first login, but attach failed because the login that was used was not the owner of the mdf and ldf files. We can detach the database by: EXEC sp_detach_db mydb; We can attach the database by: CREATE DATABASE mydb ON ( FILENAME = 'C:\MSSQL\mydb.mdf' ), ( FILENAME = 'C:\MSSQL\mydb.ldf' ) FOR ATTACH ; To solve this problem we have to give the full permission to both mdf and ldf file to attach login name by right clicking the file and selecting property and then security and then adding login name. 

What Is The Difference Between Set And Select

Here is The Combined answer that i have collected from various articles and experience. Here is the Difference. 1. SET is the ANSI standard for variable assignment, SELECT is not.   2. You can use SELECT to assign values to more than one variable at a time. SET allows you to assign data to only one variable at a time. Here's how: /* Declaring variables */ DECLARE @Variable1 AS int, @Variable2 AS int /* Initializing two variables at once */ SELECT @Variable1 = 1, @Variable2 = 2 /* The same can be done using SET, but two SET statements are needed */ SET @Variable1 = 1 SET @Variable2 = 2       3. When assigning from a query if there is no value returned then SET will assign NULL, where SELECT will not make the assignment at all (so the variable will not be changed from it's previous value) .   4. When using a query to populate a variable, SET will fail with an error, if the query returns more than one value. But SELECT will assign one of ...

SQL Server Import and Export Wizard

Yesterday, I was to Upload very large data. So I opened my Sql Server management studio & tried Import/Export wizard. & Surprise !!, I was not able to start Import/Export wizard. The SSIS Data Flow Task could not be created. Verify that DTSPipeline.dll is available and registered. The wizard cannot continue and it will terminate. ADDITIONAL INFORMATION: Cannot create a task with the name "STOCK:PipelineTask". Verify that the name is correct. ({1A768FBA-F8F7-4147-B1CD-2953FAC6781E}). I searched the  DTSPipeline.dll  in GAC (Shared Assembly folder). But there are both MSIL & x86 version. After that I searched Program Files SQL Server folder & found the above dll. I just registered this dll & my problem has been resolved. Regsvr32.exe "C:\Program Files\Microsoft SQL Server\90\DTS\Binn\dtspipeline.dll" Above command will register the required dll. Thanks, Anuj Rathi

string.IsNullOrWhiteSpace()

.NET 4 adds new method called string.IsNullOrWhiteSpace() which checks for spaces, empty or null. This is a nice time-saver for developers.. This static method returns true if a string is full of whitespace characters. Let us consider the below example . static void Main() { string strTest = "Simple Talk"; string strNull = null; string strEmpty = string.Empty; string strWhiteSpace = "\t\r\n\n "; Console.WriteLine("Is null or whitespace Exmaple!!"); Console.WriteLine("TestSting: " + string.IsNullOrWhiteSpace(strTest));//false Console.WriteLine("NullString: " + string.IsNullOrWhiteSpace(strNull)); //true Console.WriteLine("EmptyString: " + string.IsNullOrWhiteSpace(strEmpty)); //true Console.WriteLine("WhiteSpaceString: " + string.IsNullOrWhiteSpace(strWhiteSpace)); //true Console.ReadLine(); }

Stored Procedures vs. User Defined Functions in Microsoft SQL Server

                 SQL Server user-defined functions and stored procedures offer similar functionality. Both allow you to create bundles of SQL statements that are stored on the server for future use. This offers you a tremendous efficiency benefit, as you can save programming time by: Reusing code from one program to another, cutting down on program development time. Hiding the SQL details, allowing database developers to worry about SQL and application developers to deal only in higher-level languages Centralize maintenance, allowing you to make business logic changes in a single place that automatically affect all dependent applications           At first glance, functions and stored procedures seem identical. However, there are several subtle, yet important differences between the two: Stored procedures are called independently, using the EXEC command, while functions are called from within another SQL sta...

Benefits of SQL Server Stored Procedures

Microsoft SQL Server provides the stored procedure mechanism to simplify the database development process by grouping Transact-SQL statements into manageable blocks. Benefits of Stored Procedures Why should we use stored procedures? Let's take a look at the key benefits of this technology: Precompiled execution . SQL Server compiles each stored procedure once and then reutilizes the execution plan. This results in tremendous performance boosts when stored procedures are called repeatedly. Reduced client/server traffic . If network bandwidth is a concern in your environment, you'll be happy to learn that stored procedures can reduce long SQL queries to a single line that is transmitted over the wire. Efficient reuse of code and programming abstraction . Stored procedures can be used by multiple users and client programs. If you utilize them in a planned manner, you'll find the development cycle takes less time. Enhanced security controls . You can grant users permissi...