Category: "Q&A"
The fixes of Temporary Profile for WIndows 7
I built some new pcs during this week. After some pcs joined the domain and login with a domain user, the pc is rejecting to create a profile, gave me a temporary profile, therefore all user document folder and user setting will be deleted after a restart. I did some clean up under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList, I deleted all SID under that, such as "S-1-343432432-11112". And I restarted the PC. It won't works. The pc is still cleaning up the profile every times I restarted the pc.
I found the "hacked" solution. I open "regedit" and to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\Current Version, Find the SID with the value of ProfileImagePath has "C:\User\Temp" [ or any value for your temp profile path]. And then I changed the state value under that SID to 204.
Then after the restart, C:\User\Temp is become my user profile path.
SEO: Using Local Webhost
Source:Open Clip Art Using Under Public Domain Attribution
Recently, I moved my blog about Brisbane Life from a US hosting to a Aussie Hosting. There are a number of good reasons to use a local web host. Firstly, the most of readers are from Brisbane. The aussie local hosting can give me a better performance. Loading the pages from a local is much faster than over the pacific ocean. Secondly, that is for a SEO. If my users is using any local version search engines , such Yahoo Australia and Google Australia. They will list all pages from australia in the top. This will give me a better result. Thus, finally, we moved that blog into a local web host.
iOS: Print "%" in Label
'%' is a function word in Objective C, such as '%d" to print a number, How to print a '%' in a string? that is easy, just '%%'
Code
self.txtPercent.text= [NSString stringWithFormat:@"%d%%", (int)sender.value]; |
IOS: Check Core Data Object is null
Code
@property (nonatomic,retain) TipRecord*record; |
To check the object in the code above, that should check whether the object is nil.
Code
if(self.record == nil) |
Please note that, that is a pointer. If it has not initialized yet, it will be nil, not NSNull null.
Code
if([self.record isEqualToString [NSNull null]) |
null is a value for nothings, all pointer won't be null, unless you assign that is null object to there.
UIAlertView Button Click in IOS
if you only have an ok button for alert view, that is easy.
However, if you have more than an "OK" button, you need to implement your controller as UIAlertViewDelegate
For example:
@interface TipRecordListViewController : UITableViewController < uialertviewdelegate >
You need to implement clickedButtonAtIndex
E.g.
Code
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ |
The buttonIndex will tell you which button is clicked