Random Musings

December 4, 2010


Filed under: Uncategorized — haditeo @ 10:14 am

ISDA (International Swaps and Derivatives Association) and BBA (British Bankers’ Association) are organizations that developed standard documentation for OTC derivatives.

ATS is the acronym for Alternative Trading System.

ECN is the acronym for Electronic Communications Network. ECN is the ATS in the US.

ABS is the acronym for Automated Bond System. NYSE’s ABS is the example of the electronic platform which is used to trade bonds.

April 2, 2010

trouble processing “javax/crypto/SealedObject.class” error

Filed under: Uncategorized — haditeo @ 10:12 am

While building a simple Android application, i have encountered above error message.

After googling around, i found the solution for this issue

March 4, 2010

Hello World from Android Emulator

Filed under: Uncategorized — haditeo @ 12:41 am

Curious at how to test Android application through Android emulator, i started by reading through the Quick Start Page

Encountered two issues:

  1. Downloaded Eclipse Classis previously. When i tried to install the ADT Plugin for eclipse, i have encountered several error messages saying that some packages need to be downloaded. Eventually i downloaded the Java J2EE Version of Eclipse
  2. Since i used Microsoft Virtual PC for testing purposes, during the downloading of Android Platform, i encountered the issue that it needs to connect to internet to download the necessary Android Platform. No choice, i turned on “Shared Networking (NAT)”, so that the guest machine can connect to internet.

I noticed that at the first time, when the emulator is booted up, it took a while. Subsequently, i just recompiled my code and automatically the emulator loaded the new code

Notice that the application icon is shown at the 3rd row and 3rd column.

When it’s clicked, it shown the Hello World text

Screenshot of Youtube

Screenshot of Facebook

June 4, 2009

Query only ‘enabled’ users

Filed under: Uncategorized — haditeo @ 10:08 pm
Tags: ,

In order to search for all system users who are not disabled, these ConditionExpression needs to be used

// Create the ConditionExpression.
ConditionExpression statusCodeConditionExpression = new ConditionExpression();

// Set the condition for the retrieval
statusCodeConditionExpression.AttributeName = "isdisabled";
statusCodeConditionExpression.Operator = ConditionOperator.Equal;
statusCodeConditionExpression.Values = new object[] { false };

June 2, 2009

ASP.NET 2.0 Membership – Resetting password without using question and answer

Filed under: Uncategorized — haditeo @ 8:52 pm

By default the ASP.NET PasswordRecovery control utilizes user’s question and answer to send back the password.

The current best practice now is sending a reset password link to the user’s email address. User’s might forget what is the question and answer, he/she provided when he/she creates the user account.

To customize this PasswordRecovery control, i have created a table let’s called PasswordRequest table with these fields :
1) Id. The purpose of this id is the primary key of this table. In this field, i stores a unique GUID to identify each records
2) RequestDate. The purpose of this field is to store when the request is logged by the user. Because the link that i will send to user, will be expired after certain times, let’s say 10 minutes. After the link is expired, user must request another password request link again
3) UserId. The purpose of this field is to store who is the user that requests the password reset

Whenever the user requests a password reset, it will invoke these codes :

        protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
            string userName = PasswordRecovery1.UserName;
            MembershipUserCollection userColl = Membership.FindUsersByEmail(userName);

            foreach (MembershipUser user in userColl)
                ResetPasswordRepository repo = new ResetPasswordRepository(Utilities.Utilities.RetrieveSqlConnString());
                Guid recordId = repo.Create(user.ProviderUserKey.ToString(), DateTime.Now);

                e.Message.Body = e.Message.Body + "\r\n http://localhost:8012/ForgotPassword.aspx?action=reset&id=" + recordId.ToString();                

The above codes is invoked at the point before the mail is sent, so that we can alter the message body to include the record id.

These codes are utilized to insert a record into the PasswordRequest table

        public Guid Create(string userId, DateTime requestDate)
                using (TransactionScope tx = new TransactionScope())
                    using (connection)
                        Guid id = Guid.NewGuid();

                        string strCommand = "INSERT INTO PasswordRequest(Id, RequestDate, UserId, IsActive) VALUES('" + id.ToString() + "', '" + requestDate.ToString() + "', '" + userId.ToString() + "', '0')";

                        SqlCommand command = new SqlCommand(strCommand, connection);

                        int numberOfRecordCreated = command.ExecuteNonQuery();

                        if (numberOfRecordCreated != 1)
                            throw new NoPasswordRequestRecordIsCreatedException("Fail to create a password recovery request record");


                        return id;
            catch (TransactionAbortedException trxExc)
                throw trxExc;
            catch (Exception exc)

                throw exc;

After user’s click the link in the email and visit the page, we need to verify the request so that it’s indeed the actual user who requests the password reset and not somebody else

       protected void btnReset_Click(object sender, EventArgs e)
            string recordId = Request["id"];

            ResetPasswordRepository repo = new ResetPasswordRepository(Utilities.Utilities.RetrieveSqlConnString());
            ResetPassword record = repo.RetrieveByRecordId(recordId);

            if (record.Id == null)
                lblErrorMessage.Text = "The request has been expired. Please request another password reset email";
                string tempPassword = record.MembershipUser.ResetPassword();
                record.MembershipUser.ChangePassword(tempPassword, txtPassword.Text);

I performed a check first by checking whether the record is exist in the PasswordRequest table. After that i invoked ResetPassword() method to get the temporary password. Finally i invoked ChangePassword() method to change the old password, to new password.

June 1, 2009

File Property – Build Action To Compile

Filed under: Uncategorized — haditeo @ 8:53 pm


Today, i really scratched my head. The class file has been included properly into a dll, it has been given public so that it can be seen.

But when i browsed it from the dll browser, the public properties and methods are not seen, and then i carefully see that the build action is set to ‘content’ . No wonder it cannot be seen. It should be set to ‘compile’

April 28, 2009

Modify the fullname attribute of the contact entity

Filed under: Uncategorized — haditeo @ 5:45 pm

I have just realized that the fullname attribute can not be modified either through Dynamic Entity or Type Proxy. Fullname attribute is the system generated entity.

Alternatively use either firstname or lastname attribute

Blog at WordPress.com.