Skip to main content

Posts

Showing posts from 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.

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: Visit this page https://plus.google.com/settings/endorsements?hl=en Uncheck the box next to Based upon my activity, Google may show my name and profile photo in shared endorsements that appear in ads.  Click the Save button.  Click the Continue button on the next dialog.

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 ca

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.

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.

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?

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

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/

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

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.

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

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.

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

Scan a whole drive for virus in Windows 8

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

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 u

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 persis

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: 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' Select Manage Nuget Packagse under Project menu to install jQuery. The /Scripts folders will create under MvcMusicStore folder. Add folder Shared to /View folder 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 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

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.

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.NE

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: 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 implemente

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 func

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.

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 yo

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,

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

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 h

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_normalizat

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 lang

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!