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

How to Install Keka on macOS

Download latest version from https://www.keka.io/en/ Copy the MD5 hash value from Keka website to compare later (MD5: 8729f9d08d10293fa1ee65...