Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Saturday, April 16, 2011

Ubuntu Tip - "The password you use to login to your computer no longer matches that of your login keyring”

I've recently come  to use one of the applications in ubuntu that requires access to the keyring.
“Enter password to unlock your login keyring. The password you use to login to your computer no longer matches that of your login keyring”This issue can be solved in two ways:
- If you know the password he asks for:
You can change he asks to match the same password you use to login by making the following steps:
  1. Go to Applications -> Accessories -> Passwords and Encryption Keys.
  2. Right click Passwords:login
  3. Select "Change Password"
  4. Type in your old password and your new password twice to confirm (match it to your logon password of course) 
  5. Hit "OK".
- If you don't know the password he asks for:
The fix is to remove the file which store the password in. The file is located at “~/.gnome2/keyrings/default.keyring”. the "default" can have another name depends on which file is looking for.

What is the Keyring?
 Now let's take a look about the keyring. Keyring is like the password manager of firefox. It stores all the passwords for you without the need to remember & type the passwords each time you use it like the wireless password, mail accounts, FTP account .. etc

Thursday, October 28, 2010

Eclipse tips - Conditional Breakpoints

The traditional waydebug_educational_software_510925

Sometimes in debugging we want to trace the code at a breakpoint under certain conditions, so what we do is every time this breakpoint is hit we check manually if this the case we want to trace or not.
 

Eclipse way !

Eclipse has a neat feature called conditional breakpoint. This feature enables you to enable the breakpoint if certain conditions is met. Now each time the breakpoint is reached, the expression is evaluated in the context of the breakpoint execution, and the breakpoint is either ignored or honored.

Example

Suppose we have this sample code
   1:  public static void initialize() 
   2:  {
   3:      final List activities = getActivities();
   4:   
   5:     for (Iterator i = activities.iterator(); i.hasNext();) 
   6:     {
   7:        final NestedActivity nestedActivity=(NestedActivity) i.next();
   8:        final SmallActivities[] smallActivities=nestedActivity.
   9:                                getSmallActivities();
  10:   
  11:        doSomething(nestedActivity, smallActivities);
  12:     }
  13:  }



And we want to put a conditional breakpoint at line 11 before executing the doSomething(..) method to trace a nestedActivity called debugging, so here is what we do:

  • Create breakpoint at line
  • Right click at the breakpiont then breakpoint properties
  • The properties of the breakpoint window will open
image
  • Check Enable condition
  • Write In the Condition field the expression for the breakpoint condition (notice the code assistant)
  • Do one of the following:
    • If you want the breakpoint to stop every time the condition evaluates to true, select the condition is 'true' option.  The expression provided must be a Boolean expression.
    • If you want the breakpoint to stop only when the result of the condition changes, select the value of condition changes option.