Saturday, December 28, 2013

Recent Activity

It’s fun to check my email account recent activity. Here is the fun.
Someone attempted to log in to my account from other countries. It is good to check activity log in your Gmail, Hotmail, Yahoo, Facebook, and other accounts frequently.

Saturday, October 12, 2013

How to opt out Google Shared Endorsements

Google updated their Terms of Service on Oct. 11, 2013. Your Profile name and photo might appear in Google products (including in reviews, advertising and other commercial contexts). If you don’t want your name and photo appear, you must opt out. To opt out Google Shared Endorsements:
  1. Visit this page https://plus.google.com/settings/endorsements?hl=en
  2. Uncheck the box next to Based upon my activity, Google may show my name and profile photo in shared endorsements that appear in ads. 
  3. Click the Save button. 
  4. Click the Continue button on the next dialog.

    Monday, September 16, 2013

    ASP.NET Questions and Answers – Part 5

    What is differences between an ADO.NET Dataset and an ADO Recordset?

    • ADO RecordSet looks like a single table. ADO.Net DataSet is collection of single or more tables.
    • ADO RecordSet can hold data from a single data source. ADO.Net DataSet can hold data from any data sources.
    • ADO RecordSet is a connected environment. ADO.NET DataSet is a collected of tables and it is a disconnected environment i.e., there is no constant connection with database.

    What is the parent class of the Web server control?

    The System.Web.Ul.Control class is the parent class for all Web server controls.

    What are the various ways of authentication techniques in ASP.NET?

    • Windows Authentication - This is the default authentication technique. It can work with any form of Microsoft Internet Information Services (IIS) authentication, such as Basic, Integrated Windows authentication (NTLM/Kerberos), Digest, and certificates. The syntax of Windows authentication mode is given as follows:
    • Forms Authentication - You can specify this mode as a default authentication mode by using the following code snippet:
    • Passport - This mode works with Microsoft Passport authentication, as shown in the following code snippet:

    Related posts:

    Wednesday, September 11, 2013

    Connect to Windows Share from Ubuntu

    When I attempted to connect to Windows Share from Ubuntu 12.04, I got this error message: "Failed to retrieve share list from server"

    Found solution from UbuntuForums.org (http://ubuntuforums.org/showthread.php?t=1082148&page=12&p=9762937#post9762937). Enter "smb://192.168.123.123" where 192.168.123.123 is the IP address of Windows Share, it bring up the list of shared folders on Windows machine.
    Now, I just entered the user name and password to get in.

    Friday, September 6, 2013

    Using ODBC 32-bit on 64-bit Operating System

    Which ODBC driver should we install on 64-bit machine using Windows Server 2008 R2, Windows Server 2012, Windows 7, or Windows 8? It would depend. When I installed MySQL ODBC 64-bit driver on Windows 8.1 Preview, it worked when I added a new DSN. But, it did not work when Microsoft Access 2007 application made ODBC call to MySQL server.

    What wrong? It took me couple hours to figure out. Microsoft Access 2007 may not work with other 64-bit driver or program yet. Installed MySQL ODBC 32-bit solve the problem.

    On Windows 8.1, there are two ODBC Administrors under Control Panel – Administrative Tools. One for ODBC Datasources 32-bit and one for ODBC Datasources 64-bit. On Windows Server 2008 R2, there is only one reference to ODBC Administrator. This is 64-bit. Where is 32-bit? To add or manage DSN for ODBC 32-bit, you need to call program odbcad32.exe in C:\Windows\SysWOW64\

    Hope this help.

    Thursday, August 22, 2013

    How to access Wamp Server running on Windows 2008 from other computer?

    The firewall rules on Windows 7 or Windows 2008 or later version may not allow you access to your web site running by WampServer from other computer. To fix this problem:

    Step 1: Update httpd.conf to add this line
    Allow from 192.168.1.0/255.255.255.0 # for LAN
    #or
    Allow from all # for any computer in the world
    Remember to restart Apache server after change the httpd.conf

    Step 2: Check Windows Firewall.
    • Is the port 80 open?
    • Is the Apache Web Server (\wamp\bin\apache\Apache2.4.4\bin\httpd.exe allow to receive the request from other?

    Saturday, August 17, 2013

    WAMP

    WAMP stands for Microsoft Windows operating system, Apache web server, MySQL database, and PHP general-purpose scripting language for server side Web development. Among WAMP server packages, I like WampServer since it easy to instal, have latest version from Apache, MySQL and PHP and it's free. Before you install the WampServer, you need to make sure your computer have:

    • Microsoft Visual C++ 2010 run-time. Without Microsoft Visual C++ 2010 run-time, you will see the error message "vcr100.dll missing" when install.
    • Microsoft .NET Framework 3.5.1. This fixed the problem 'aestan tray menu has stopped' when you start the WampServer

    To install Microsoft Visual C++ 2010 Redistributable Package (x64) ( http://www.microsoft.com/en-us/download/details.aspx?id=14632 )

    On Windows 2008R2 server, make sure .NET Framework 3.5.1 enable. It disable by default. ( http://social.technet.microsoft.com/Forums/windowsserver/en-US/ac1bf719-0a88-4b5d-be98-395f2623e805/what-version-of-net-framework-comes-with-windows-2008-r2 )

    Friday, July 12, 2013

    Failed to load libGL.so

    Here is the solution for error message 'Failed to load libGL.so' when launch Android Virtual Device (AVD) from Android Studio 0.2 on Ubuntu 13.04 32 bit:

    Install 'Free Implementation of the OpenGL API-GLX development files' (libgl1-mesa-dev) package from Ubuntu Software Center


    or type this command at terminal
    sudo apt-get install libgl1-mesa-dev

    Credit: http://learnedstuffs.wordpress.com/2012/07/17/fixing-ubuntu-error-failed-to-load-libgl-so/

    Tuesday, July 9, 2013

    C# Questions and Answers – Part 3

    What is an anonymous class?
    An anonymous class is a class that does not have a name. An anonymous class created by using the new keyword and and a pair of brace defining the fields and values.

    How to prevent a calculation overflowed in C#?
    Use checked keyword. For example: checked (operand1 + operand2); checked and unchecked keyworks are for integer arithmetic such as int and long

    What is a partial class?
    When we split a number of methods, fields, and constructors of a class into many files, we can use partial keyword.

    Previous posts:
    C# Questions and Answers
    C# Questions and Answers – Part 2
    C# Questions and Answers – Part 3

    Sunday, June 30, 2013

    Install Windows 8.1 Preview on VirtualBox

    When I installed Windows 8.1 Preview on VirtualBox 4.2.14 hosted on Mac OS/X machine, I got this error:
    “Your PC need to restart, Please hold down the power button Error Code : 0x000000C4”.

    Here is a solution I found at https://www.virtualbox.org/ticket/10792:
    Open terminal windows and execute this command:
    VBoxManage setextradata [vmname] VBoxInternal/CPUM/CMPXCHG16B 1
    where [vmname] is your Windows 8.1 virtual machine name.

    Here is my screenshot: Install Visual Studio 2013 Preview on Windows 8.1 Preview

    Update on July 10: You need to the Oracle VirtualBox 4.2.16 or later to install VirtualBox Addition in order to make the full screen, shared folder and other features.

    Monday, June 24, 2013

    Notes on MVC Music Part 7 Tutorial

    When using Visual Studio 2012 and MVC 3 to practice the MVC Music Store tutorial, you may get this error on part 7:
    ‘CompareAttribute’ is an ambiguous reference between ‘System.ComponentModel.DataAnnotations.CompareAttribute’ and ‘System.Web.Mvc.CompareAttribute’

    Here is the solution:
    Remove the reference using System.Web.Mvc;
    from MvcMusicStore\Models\AccountModels.cs

    Friday, June 21, 2013

    Change Privacy Settings on Flickr

    Recently Flickr increased the capacity of free plan to 1 terabyte. It’s great. Flickr is one of the best photos hosting web site. However, you need to review and change its default settings.

    The default settings before change

    Only myself can access to original file


    Default settings for upload

    Change it to myself

    After the change of default upload.

    Tuesday, June 11, 2013

    C# Questions and Answers – Part 2

    What is a constructor?
    A constructor is a special method with the same name as the class. It is executed when an instance of the class is created and can contain code to initialize the instance.
    What is the difference between public, static and void?
    All these are access modifiers in C#. Public declared variables or methods are accessible anywhere in the application. Static declared variables or methods are globally accessible without creating an instance of the class. Void specifies that the method does not return a value.
    What is an interface?
    An interface contains only the signatures of methods, delegates or events. The implementation of the methods is done in the class that implements the interface. Read more http://msdn.microsoft.com/en-us/library/87d83y5b(v=VS.80).aspx
    What is a delegate?
    Delegate is a reference type that can be used to encapsulate a named or an anonymous method. Delegates are similar to function pointers in C++; however, delegates are type-safe and secure. Read more http://msdn.microsoft.com/en-US/library/900fyy8e(v=vs.80).aspx

    Previous posts:
    C# Questions and Answers
    C# Questions and Answers – Part 2
    C# Questions and Answers – Part 3

    Monday, June 10, 2013

    Scan a whole drive for virus in Windows 8

    1. Go to desktop screen to using Windows Explorer or open command prompt windows.
    2. Change to folder C:\Program Files\Windows Defender
    3. Execute program c:msascui.exe

    Friday, May 17, 2013

    Android Studio

    On Google IO 2013, Google introduced Android Studio, based on IntelliJ IDEA, a new tool for Android developers. I liked it. Since it was a preview version, Google noted:
    Caution: Android Studio is currently available as an early access preview. Several features are either incomplete or not yet implemented and you may encounter bugs. If you are not comfortable using an unfinished product, you may want to instead download (or continue to use) the ADT Bundle (Eclipse with the ADT Plugin).
    As soon it posted on developer.android.com, I downloaded and installed on three platforms: Ubuntu 13.04, Mac OS/X Lion 10.7.5 and Windows Vista. On Ubuntu 13.04 with OpenJDK 1.7, I got this error message:
    'tool.jar' is not in Android Studio class path. Please ensure JAVA_HOME points to JDK rather than JRE.
    I have no problem using Eclipse Juno (4.2.2) for Android development on this machine. Ran android-studio/bin/studio.sh at a terminal, there was a warning:
    WARNING: You are launching the IDE using OpenJDK Java runtime. ITS KNOWN TO HAVE PERFORMANCE AND GRAPHICS ISSUES! SWITCH TO THE ORACLE(SUN) JDK BEFORE REPORTING PROBLEMS!
    Downloaded and switched to Oracle (Sun) JDK from OpenJDK on Ubuntu 13.04 according to Hendré's blog, problem solved.

    On Mac OS/X with Java 1.6.0_45, I got Android Studio ran immediately without hicup. After I made a new simple project to test, I could not load any Android Virtual Device. To work around, I opened Android Virtual Device Manager from Eclipse Juno to load the Android Application launched from Android Studio.

    On Windows Vista with JRE 7 installed only, Nothing running after executed Android Studio (c:\android-studio\studio,exe) application. Tried to replaced Oracle JRE 7 with Oracle JDK 7, no luck. Solution: Added environment variable JAVA_HOME with value "C:\Program Files\Java\jdk1.7.0_21) to system variables. Further reading:

    Monday, May 13, 2013

    ASP.NET Questions and Answers – Part 4

    Why we should using HttpUtility.HtmlEncode?
    We should using HttpUtility.HtmlEncode method to sanitize the user input.This prevents users from injecting Javascrip into web application.

    What is the difference between ASP.NET MVC 3 Web Application template and ASP.NET MVC 3 Empty Web Application?
    One difference between the full ASP.NET MVC 3 Web Application template and the ASP.NET MVC 3 Empty Web Application template is that the empty template doesn’t include an Account Controller.

    What is the difference between Session State and View State?
    Both Session State and View State used to keep track data between the post back. Session State is server based. View State is a client based. (ASP.NET State Management Overview)

    ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. ASP.NET session state identifies requests from the same browser during a limited time window as a session, and provides a way to persist variable values for the duration of that session. (ASP.NET Session State Overview)

    View state is the method that the ASP.NET page framework uses to preserve page and control values between round trips. When the HTML markup for the page is rendered, the current state of the page and values that must be retained during postback are serialized into base64-encoded strings. This information is then put into the view state hidden field or fields. (ASP.NET View State Overview).

    Related posts:

    Saturday, May 11, 2013

    Notes on MVC Music Part 3 Tutorial

    MVC Music Store is a great tutorial written by Jon Galloway. Using Visual Studio 2012 with MVC 4 Web Application Empty template, the following folders are note available:
    • /View/Shared
    • /Content/
    • /Scripts
    Here are solutions:
    1. Drag /Content folder from MVCMusicStore-Assets.zip into MvcMusicStore solution folder in Visual Studio 2012. If you just drag and drop in Windows Explorer, make sure it 'included in the project'
    2. Select Manage Nuget Packagse under Project menu to install jQuery. The /Scripts folders will create under MvcMusicStore folder.
    3. Add folder Shared to /View folder
    4. Right click on /View/ folder to add MVC 4 Layout page (Razor) and named it _Layout.cshtml. Copy the code in tutorial into this file. Also correct version of installed jQuery script. Here, I used jquery-2.0.0.min.js instead of jquery-1.5.1.min.js
    5. Right click on /View/Shared folder to add MVC 4 Layout page (Razor) and named it _ViewStart.cshtml. Added the following codes to this file:
      @{
      Layout = "~/Views/Shared/_Layout.cshtml";
      }

    Saturday, April 27, 2013

    Antivirus on Microsoft Windows 8

    Microsoft Windows 8 has built-in antivirus software called Windows Defender so we don’t need to install Microsoft Security Essential as in Microsoft Windows 7 or previous Windows version. If you need to install other third party antivirus software such as Norton Antivirus or McAfee, etc… you need to disable Windows Defender first. You cannot more than one antivirus software run at the same time. It will slowdown your machine and make it easy to crash.

    I am much happy to use the Windows Defender on Microsoft Windows 8. It saves me at least fifty bucks per year on antivirus software.

    Monday, March 11, 2013

    ASP.NET Questions and Answers – Part 3

    What is a master page?
    A master page is a template for other web pages in your web application with shared layout and functionality. The master page defines placeholder for the content which can overridden by content pages.

    What is the Global.asax file?
    The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level events raised by ASP.NET or by HttpModules. The Global.asax file resides in the root of an ASP.NET based application. At run time, Global.asax is parsed and compiled into a dynamically generated .NET Framework class derived from the HttpApplication base class. The Global.asax itself is configured so that any direct URL request for it is automatically rejected; external users cannot download or view the code written within it. Read more at msdn.microsoft.com

    What is the difference between ASP and ASP.NET?
    • ASP is interpreted. ASP.NET is compiled.
    • ASP uses VBScript. However, ASP.NET uses C# and VB.NET which are compiled to Microsoft Intermediate Language (MSIL).

    Related posts:

    Thursday, March 7, 2013

    SQL Questions and Answers - Part 3

    What is a view?
    A view can be thought of as either a virtual table or a stored query. The data accessible through a view is not stored in the database as a distinct object. What is stored in the database is a SELECT statement. The result set of the SELECT statement forms the virtual table returned by the view. ( msdn.microsoft.com )

    What is an Index?
    A Microsoft® SQL Server™ index is a structure associated with a table or view that speeds retrieval of rows from the table or view. An index contains keys built from one or more columns in the table or view. These keys are stored in a structure that allows SQL Server to find the row or rows associated with the key values quickly and efficiently. ( msdn.microsoft.com )

    What are all the different types of indexes?These are different types of indexes in Microsoft SQL Server 2008R2:
    1. Clustered: A clustered index sorts and stores the data rows of the table or view in order based on the clustered index key. The clustered index is implemented as a B-tree index structure that supports fast retrieval of the rows, based on their clustered index key values.
    2. Nonclustered: A nonclustered index can be defined on a table or view with a clustered index or on a heap. Each index row in the nonclustered index contains the nonclustered key value and a row locator. This locator points to the data row in the clustered index or heap having the key value. The rows in the index are stored in the order of the index key values, but the data rows are not guaranteed to be in any particular order unless a clustered index is created on the table.
    3. Unique: A unique index ensures that the index key contains no duplicate values and therefore every row in the table or view is in some way unique. Both clustered and nonclustered indexes can be unique.
    4. Index with included columns: A nonclustered index that is extended to include nonkey columns in addition to the key columns.
    5. Full-text: A special type of token-based functional index that is built and maintained by the Microsoft Full-Text Engine for SQL Server. It provides efficient support for sophisticated word searches in character string data.
    6. Spatial: A spatial index provides the ability to perform certain operations more efficiently on spatial objects (spatial data) in a column of the geometry data type. The spatial index reduces the number of objects on which relatively costly spatial operations need to be applied.
    7. Filtered: An optimized nonclustered index, especially suited to cover queries that select from a well-defined subset of data. It uses a filter predicate to index a portion of rows in the table. A well-designed filtered index can improve query performance, reduce index maintenance costs, and reduce index storage costs compared with full-table indexes.
    8. XML: A shredded, and persisted, representation of the XML binary large objects (BLOBs) in the xml data type column.
    Read more at msdn.microsoft.com

    Related posts:
    SQL Questions and Answers – Part 3
    SQL Questions and Answers – Part 2
    SQL Questions and Answers – Part 1

    Wednesday, March 6, 2013

    JavaScript Questions and Answers - Part 2

    Continue random JavaScript Questions and Answers from previous post.

    What are difference between global and local variables? 
    A variable that is declare outside of a function is a global variable, and its value is accessible and modifiable throughout your program. A variable that is declared inside a function is local. It is created and destroyed every time the function is executed, and it cannot be accessed by any code outside the function. ( msdn.microsoft.com )

    How we define a class in JavaScript?
    JavaScript does not have a class definition separate from the constructor. Instead, you define a constructor function to create objects with a particular initial set of properties and values. Any JavaScript function can be used as a constructor. You used the new operator with a constructor function to create a new object. ( developer.mozilla.org )

    What is a JavaScript function?
    JavaScript function is a block of code that will be executed when it was called by external code. A function begin with the function keyword, followed by the name, list of parameters if any, and a block of codes inside a curly braces. Function can return a value. Arguments are passed to function by a value.

    What is a function expression?
    A function expression is a function defined inside an expression. A function name in function expression can be omitted, in which case the function is anonymous. Example: var foo = function () { return 5; }
    Related posts:
    JavaScript Questions and Answers – Part 2
    JavaScript Questions and Answers

    Sunday, February 24, 2013

    MySQL error #1045 on GoDaddy phpMyAdmin

    After I made a new MySQL databases, I logged in to phpMyAdmin to test and got this message:

    #1045 – Access denied for user ‘myusername’@’10.10.10.10’ (using password: YES)

    What???

    After couple attempts for a few hours, I decided to use a new difference password. Now it worked. It seem to me, there is a character in my initial password did not carry to or accepted by MySQL database.

    Friday, February 22, 2013

    Verdana, Aria fonts on Ubuntu

    Install Microsoft core fonts package by running this command in terminal: 

    sudo apt-get install ttf-mscorefonts-installer

    Thursday, February 7, 2013

    SQL Questions and Answers - Part 2

    Continue from previous part.

    What is a constraint?
    Constraints let you define the way the Database Engine automatically enforces the integrity of a database. Constraints define rules regarding the values allowed in columns and are the standard mechanism for enforcing integrity. SQL Server supports the following classes of constraints:
    NOT NULL specifies that the column does not accept NULL values.
    CHECK constraints enforce domain integrity by limiting the values that can be put in a column.
    UNIQUE constraints enforce the uniqueness of the values in a set of columns.
    PRIMARY KEY constraints identify the column or set of columns that have values that uniquely identify a row in a table.
    FOREIGN KEY constraints identify and enforce the relationships between tables.
    Read more at http://msdn.microsoft.com/

    What is a unique constraint?
    A Unique constraint uniquely identified each record in a table. This provides uniqueness for the column or set of columns. Use a Unique constraint when you want to enforce the uniqueness of a column, or combination of columns, that is not the primary key. Unique constraint creates a non-clustered index on the column. Unique Key allows only one NULL Value.

    What is a Foreign Key (FK)?
    A foreign key (FK) is a column or combination of columns that is used to establish and enforce a link between the data in two tables. You can create a foreign key by defining a FOREIGN KEY constraint when you create or modify a table.
    Read more at http://msdn.microsoft.com/

    What is the difference between Primary Key (PK) and Unique Key (UK)?
    A Primary Key (PK) can not have a Null value. A Unique Key can have one Null value.
    Primary Key creates a clustered index on the column. Unique Key creates a non-clustered index on the column.
    Each table may have only one PK but many unique constraints.

    What is a join?
    An SQL join clause combines records from two or more tables in a database. A JOIN is a means for combining fields from two tables by using values common to each. ANSI standard SQL specifies four types of JOIN: INNER, OUTER, LEFT, and RIGHT. As a special case, a table (base table, view, or joined table) can JOIN to itself in a self-join.

    What are the types of join?
    Inner Join: Inner join returns only the rows that have a match in both joined tables.
    Right Outer Join: Right join returns all the rows from the right hand side table even though there are no matches in the left hand side table.
    Left Outer Join: Left join returns all the rows from left hand side table even though there are no matches in the right hand side table.
    Full Outer Join: Full join returns all rows in all joined tables are included, whether they are matched or not. Cross Join: Cross join return all rows from the left table. Each row from the left table is combined with all rows from the right table. Cross joins are also called Cartesian products.
    Read more at http://msdn.microsoft.com/


    Related posts:
    SQL Questions and Answers – Part 3
    SQL Questions and Answers – Part 2
    SQL Questions and Answers – Part 1

    Wednesday, February 6, 2013

    JavaScript Questions and Answers

    What is JavaScript?
    JavaScript is the object oriented scripting language developed by Brendan Eich, an engineer at Netscape, in 1995. It is also known as Mocha, LiveScript, JScript, ECMAScript, and it is one of the world's most popular programming languages.

    Is JavaScript subset of Java?
    No. Although Javascript's syntax came from Java and C, they are difference. JavaScript developed by Netscape. Java developed by Sun.
    • Java is an OOP programming language while Java Script is an OOP scripting language.
    • Java creates applications that run in a virtual machine or browser while JavaScript code is run on a browser only.
    • Java code needs to be compiled while JavaScript code are all in text.

    What are JavaScript types?
    • Number.
    • String.
    • Boolean.
    • Object: Function, Array, Date, RegExp
    • Null.
    • Undefined.
    What is the difference between undefined value and null value?
    undefined means a variable has been declared but has not yet been assigned a value. undefined is a property of the global object, i.e. it is a variable in global scope.

    null is an assignment value. It is a JavaScript keyword that indicates a variable has a no value. null is a literal (not a property of the global object like undefined can be).

    What is jQuery?
    jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensbility, jQuery has changed the way that millions of people write JavaScript.
    Source: Jquery.com

    Reference:
    JavaScript | MDN
    A re-introduction to JavaScript


    Related posts:
    JavaScript Questions and Answers – Part 2
    JavaScript Questions and Answers

    Tuesday, January 29, 2013

    C# Questions and Answers

    What are namespaces?

    Namespaces are heavily used in C# programming in two ways. First, the .NET Framework uses namespaces to organize its many classes. Second, declaring your own namespaces can help you control the scope of class and method names in larger programming projects. Use the namespace keyword to declare a namespace

    Namespaces have the following properties:
    • They organize large code projects.
    • They are delimited by using the . operator.
    • The using directive obviates the requirement to specify the name of the namespace for every class.
    • The global namespace is the "root" namespace: global::System will always refer to the .NET Framework namespace System.
    Read more at MSDN: Namespaces (C# Programming Guide)

    Namespaces are a way of grouping type names and reducing the chance of name collisions. A namespace provides a fundamental unit of logical code grouping.
    ( Understanding and Using Assemblies and Namespaces in .NET )

    What is the GAC?

    GAC stands for global assembly cache. It is a machine-wide common language runtime code cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer.

    Read more at MSDN: Global Assembly Cache

    What is a class?

    A class is a construct that enables you to create your own custom types by grouping together variables of other types, methods and events. A class is like a blueprint. It defines the data and behavior of a type.

    For more information, see MSDN: Classes (C# Programming Guide).
    Previous posts:
    C# Questions and Answers
    C# Questions and Answers – Part 2
    C# Questions and Answers – Part 3

    Monday, January 28, 2013

    ASP.NET Questions and Answers - Part 2

    How can we prevent browser from caching an ASPX page? 
    Use the SetNoStore method of the HttpCachePolicy class to direct the client not to store the responses in its history. See http://msdn.microsoft.com/en-us/library/system.web.httpcachepolicy.setnostore.aspx

    In which event are the controls fully loaded?
    On Load event. (http://msdn.microsoft.com/en-us/library/system.web.ui.page(v=vs.100).aspx
    The Page object calls the OnLoad method on the Page object, and then recursively does the same for each child control until the page and all controls are loaded. The Load event of individual controls occurs after the Load event of the page.
    Use the OnLoad event method to set properties in controls and to establish database connections.
    (http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx)

    How we can force all the validation controls to run?
    Using Page.Validate() method to instructs any validation controls included on the page to validate their assigned information.
    Read more at http://msdn.microsoft.com/en-us/library/0ke7bxeh.aspx

    What is .ASCX file?
    .ascx file is a user control file.
    Read more at http://msdn.microsoft.com/en-us/library/26db8ysc(v=vs.71).aspx

    Related posts:

    Saturday, January 26, 2013

    SQL Questions and Answers

    What is SQL?
    SQL stands for Structured Query Language. It is a special-purpose programming language designed for managing data in relational database management systems (RDBMS). Most popular SQL commands are "Select", "Insert", "Update", and "Delete".

    What is RDBMS?
    RDBMS stands for Relational Database Management System. It is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd, of IBM's San Jose Research Laboratory. Many popular databases such as IBM DB2, MySQL, Microsoft SQL, Oracle currently in use are based on the relational database model.

    What is database normalization?
    Database normalization is the process of organizing the fields and tables of a relational database to minimize redundancy and dependency. Normalization usually involves dividing large tables into smaller (and less redundant) tables and defining relationships between them. (http://en.wikipedia.org/wiki/Database_normalization)

    What is a primary key?  
    A primary key is a single field or combination of fields that uniquely defines a record. Primary key can not contain a null value. A table can have only one primary key.

    What is a stored procedure?
    A stored procedure is a group of Transact-SQL statements compiled into a single execution plan.

    What is a trigger? 
    A database trigger is a special stored procedure that is automatically executed in response to certain events on a particular table or view in a database. The trigger is mostly used for maintaining the integrity of the information on the database.
    Related posts:
    SQL Questions and Answers – Part 3
    SQL Questions and Answers – Part 2
    SQL Questions and Answers – Part 1

    Wednesday, January 9, 2013

    ASP.NET Questions and Answers

    What is ASP.NET?
    ASP.NET is a Web platform that provides all the services that you require to build enterprise-class server-based Web applications. ASP.NET is built on the .NET Framework, so all .NET Framework features are available to ASP.NET applications. Your applications can be written in any language that is compatible with the common language runtime (CLR), including Visual Basic and C#.
    Source:  http://msdn.microsoft.com/en-us/library/dd566231%28v=vs.100%29.aspx

    ASP.NET is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. ASP.NET is part of the .NET Framework, and when coding ASP.NET applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic and C#. These languages enable you to develop ASP.NET applications that benefit from the common language runtime, type safety, inheritance, and so on.
    Source: http://msdn.microsoft.com/en-us/library/4w3ex9c2%28v=vs.100%29.aspx

    What is a Cookie?
    A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is usually a small piece of data sent from a website and stored in a user's web browser while a user is browsing a website. When the user browses the same website in the future, the data stored in the cookie can be retrieved by the website to notify the website of the user's previous activity. Cookies were designed to be a reliable mechanism for websites to remember the state of the website or activity the user had taken in the past.
    Source: http://en.wikipedia.org/wiki/HTTP_cookie

    Describe the complete ASP.NET page lifecycle.
    1. Page request: The page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page.
    2. Start: In the start stage, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostBack property. The page also sets the UICulture property.
    3. Initialization: During page initialization, controls on the page are available and each control's UniqueID property is set. A master page and themes are also applied to the page if applicable. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.
    4. Load: During load, if the current request is a postback, control properties are loaded with information recovered from view state and control state.
    5. Postback event handling: If the request is a postback, control event handlers are called. After that, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page. (There is an exception to this sequence: the handler for the event that caused validation is called after validation.)
    6. Rendering: Before rendering, view state is saved for the page and all controls. During the rendering stage, the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream object of the page's Response property.
    7. Unload: The Unload event is raised after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and cleanup is performed.

    Related posts:

    Tuesday, January 1, 2013

    New Year New Password

    Your password should change frequently. If you cannot change every month, every quarter, then at least once a year.

    When you change the password, it should NOT in "The 25 worst passwords of 2012". You should NOT using the same password for all accounts. Use the KeePass or a password protected LibreOffice document to keep track your password. Read "The guide to password security (and why you should care)" for more info.

    Happy New Year!

    How to recognize a fake Geek Squad renewal scam | Consumer Advice

    Except from  https://consumer.ftc.gov/consumer-alerts/2022/10/how-recognize-fake-geek-squad-renewal-scam Scammers are at it ag...