After it is unzipped, just start the setup file (setup.exe), it should work as if it is installed from a DVD. Certainly, this will not work if you need to boot the box from the iso file.
There are lots of helpful information available on internet, so just share some notes I found useful during application development, to contribute back to the community. Jonathan in Toronto
Monday, November 5, 2012
Install iso file on Windows 7 with WinRAR
The Virtual CD application provided by Microsoft no longer supports Windows 7, so it cannot by used to install iso file. If you do not want to burn the iso file into a real DVD, or using third party application to mount the iso file to a virtual driver, you can just unzipped the iso file using WinRAR, which is a well known safe application to install on Windows 7.
Sunday, November 4, 2012
MS SQL Server 2008 sa authentication failure
Just installed a sql server 2008 and try to login using sa account. The login failed and few issues have to be checked using Windows authentication account before making sa account work:
1. Login SQL server management studio with windows account, right click server property menu, select Security, and check "SQL Server and Windows Authentication mode" under Server authentication section.
2 Still in server management studio, select Security folder, select sa user and right click property, check status item, and be sure it is Granted and Enabled in settings page
1. Login SQL server management studio with windows account, right click server property menu, select Security, and check "SQL Server and Windows Authentication mode" under Server authentication section.
2 Still in server management studio, select Security folder, select sa user and right click property, check status item, and be sure it is Granted and Enabled in settings page
Monday, October 15, 2012
When do you need to send AutoRelease message to an object
If the object is created with convenience method, like [NSMutableArray arrayWithCapacity], then the convenience constructor already sends the AutoRelease message to the object when it is created, so when the auto release pool or block is ended, it will send the release message to the object.
If the object is created with the alloc or copy constructor, and the object is returned to caller as a method return value or output parameter, then you should call AutoRelease message on the object. The reason is the receiver does not create the object, so he is not the own of the object and is not responsible to release the object. While after the object is returned by the method, then the creator of the object lose the control of the object and cannot actively release the object. The only limited control the original creator has on the object is sending autorelease message to it before relinquishing the control of the object, and that will be sure the object gets released sometime when the autorelease pool is closed.
However, in both cases, if the autoreleased object is created on a long-living auto release pool, then the object will last for long time and that will cause the object dose not be released quickly.
If the object is created with the alloc or copy constructor, and the object is returned to caller as a method return value or output parameter, then you should call AutoRelease message on the object. The reason is the receiver does not create the object, so he is not the own of the object and is not responsible to release the object. While after the object is returned by the method, then the creator of the object lose the control of the object and cannot actively release the object. The only limited control the original creator has on the object is sending autorelease message to it before relinquishing the control of the object, and that will be sure the object gets released sometime when the autorelease pool is closed.
However, in both cases, if the autoreleased object is created on a long-living auto release pool, then the object will last for long time and that will cause the object dose not be released quickly.
Sunday, October 14, 2012
javascript function scope sample
Javascript scope is used to enclose the internal logic and only expose the necessary public information to external. Basically, within a object or function scope, only properties or function defined on the object are visible to external as public info through the object. Any local variables defined with var, or inner function are only available to internal logic.
var globalFunction = function () { // global, can be accessed anywhere.
alert('hello world');
}
var containerFunction = function () { // globale namespce, can be accessed anywhere.
var subFunction = function () { // private namespace method
alert("I'm Private");
globalFunction(); // We can access global Function here 2 levels deep.
}
containerFunction.test = function () { //public namespace method
alert("test");
}
callableFunc = function () { //global method, because variable is global
alert("callable");
}
function localFunc(){ //only visible to local
alert("local");
}
varible ="8"; //unlike function, new varibles without var gets added to global window object
globalFunction(); // We can access global Function here 1 level deep.
subFunction(); // We can access subFunction inside containerFunction.
localFunc();
alert(varible);
}
containerFunction();
containerFunction.test();
callableFunc();
alert(varible);
//failure cases
//test(); //test is not visible in global scope
//subFunction(); //namespace private method and only exists inside containerFunction
//containerFunction.callableFunc(); //callableFunc is not belonging to namespace, it is global
//localFunc() //not visible
Note, unlike
var globalFunction = function () { // global, can be accessed anywhere.
alert('hello world');
}
var containerFunction = function () { // globale namespce, can be accessed anywhere.
var subFunction = function () { // private namespace method
alert("I'm Private");
globalFunction(); // We can access global Function here 2 levels deep.
}
containerFunction.test = function () { //public namespace method
alert("test");
}
callableFunc = function () { //global method, because variable is global
alert("callable");
}
function localFunc(){ //only visible to local
alert("local");
}
varible ="8"; //unlike function, new varibles without var gets added to global window object
globalFunction(); // We can access global Function here 1 level deep.
subFunction(); // We can access subFunction inside containerFunction.
localFunc();
alert(varible);
}
containerFunction();
containerFunction.test();
callableFunc();
alert(varible);
//failure cases
//test(); //test is not visible in global scope
//subFunction(); //namespace private method and only exists inside containerFunction
//containerFunction.callableFunc(); //callableFunc is not belonging to namespace, it is global
//localFunc() //not visible
Note, unlike
javascript self invoking function parameter
The sample javascript self invoking function is defined as follows
(function(parmeter1){
alert(parameter1);
}("hello world");
Notice the data in the last parentices is the actual caller that will invoke the function, which passes the argument's value as "hello world".
Inside the function definition, the parameter1 is replaced by the string "hello world", and shows the alert.
(function(parmeter1){
alert(parameter1);
}("hello world");
Notice the data in the last parentices is the actual caller that will invoke the function, which passes the argument's value as "hello world".
Inside the function definition, the parameter1 is replaced by the string "hello world", and shows the alert.
Wednesday, October 10, 2012
addSubView and pushViewController difference
For ios project, addSubView and PushViewController can be used to display a new view. However, they are quite different.
addSubView is a instance method of View class, and it adds a view item into itself. If the subview occupies the whole screen, then it has the same effect of display a new view.
pushViewController is a instance method if UINavigationViewController, so it can only be used on UINavigationViewController object, it has a better isolation than previous method, as it does not add the new view as a subview in the parent view.
addSubView is a instance method of View class, and it adds a view item into itself. If the subview occupies the whole screen, then it has the same effect of display a new view.
pushViewController is a instance method if UINavigationViewController, so it can only be used on UINavigationViewController object, it has a better isolation than previous method, as it does not add the new view as a subview in the parent view.
Tuesday, October 9, 2012
Array returned from jQuery selector and html element
When using jquery id selector, it will only return a single object. However, similar to other jquery selector, the returned object is wrapped in a jquery object array. Note all jquery selector methods return an array, as it is always possible to match more than one elements for the selector.
If you call a jquey method to retrieve the attribute on the returned array, like val(), it actually returns the attribute of the first element. When the object is selected by id, it is perfectly fine, as there is only one element. However, if the array contains multiple elements, it does not have much sense to just return the first element's value when calling the method on the array. Although, in both cases, setting the value is fine, as it makes sense to set the same value for all elements or a single element.
In order to return a particular jquery element from a multiple element array, call jQuery('selector:eq(index)') method. Remember, the returned value from the method is still wrapped in a jquery array, the only difference is the array will only contain a single jquery object.
In order to return a particular htmlElement, call jQuery('selector').get(index). The returned object is a single html object, (not a array, not a jquery object), and it has all the applicable attribute defined for html element such as value attribute.
If you call a jquey method to retrieve the attribute on the returned array, like val(), it actually returns the attribute of the first element. When the object is selected by id, it is perfectly fine, as there is only one element. However, if the array contains multiple elements, it does not have much sense to just return the first element's value when calling the method on the array. Although, in both cases, setting the value is fine, as it makes sense to set the same value for all elements or a single element.
In order to return a particular jquery element from a multiple element array, call jQuery('selector:eq(index)') method. Remember, the returned value from the method is still wrapped in a jquery array, the only difference is the array will only contain a single jquery object.
In order to return a particular htmlElement, call jQuery('selector').get(index). The returned object is a single html object, (not a array, not a jquery object), and it has all the applicable attribute defined for html element such as value attribute.
Subscribe to:
Comments (Atom)