Tuesday, March 8, 2016

Stock Market Trading through BPI Trade Account

As of this writing I am almost complete to perform Stock Market trading using a BPI Trade Account. Below are the challenges that I have encountered:
  1. Reviewed the BPI Trade FAQ topic "How to Open an Account" (https://www.bpitrade.com/misc/faqs.asp#opening). I printed and filled up the application form, submitted it to my BPI Branch, i.e., the branch that issued my BPI Savings Deposit Account. Such Deposit account is prerequisite to apply for a BPI Trade account. I did not affix my signature to the form as I have to do it in the presence of a BPI Branch employee. Also, brought with me photocopies of my valid IDs. These IDs best bear my recent signature and picture.
  2. Waited for email confirmation that my BPI Trade account application is approved.
  3. Waited for email notification that my BPI Trade account is ready for activation, i.e., supply my own password.
  4. Updated my Profile.
  5. Enrolled my BPI Trade Settlement Account to my BPI ExpressOnline Account. Instructions are found at BPI Trade FAQ under the "The BPI Trade Settlement Account" topic (https://www.bpitrade.com/misc/faqs.asp#SETTLEMENT%20ACCOUNT) in the "How do I enroll my BPI Trade Settlement Account to BPI Express Online?" section.
Funding the BPI Trade Settlement Account is similar to online transfer of funds to your other BPI Bank Accounts _BUT_ as per instructions credit comes the next trading day. So there's much need for planning here.

Please shoot me with questions as I build my trading experience with BPI Trade so all of us could better understand the platform and how best all of us can benefit from it.

Sunday, November 17, 2013

Have “Appear Offline” Option in Office Communicator 2007 Status Menu

AppearOffline1

That “Appear Offline” menu option is _not_ there by default installation of Office Communicator 2007 _but_ you can have it by going through these steps:

1. Click Windows’ Start menu and type regedit in the run command box.

AppearOffline2

2. In the Registry Editor window, go to Computer > HKEY_LOCAL_MACHINE > SOFTWARE > Policies > Microsoft > Communicator

AppearOffline3

3. Right click in the right panel and select New > DWORD (32-bit) Value.

AppearOffline4

4. Key in “EnableAppearOffline” under name and press Enter key.

AppearOffline5

5. Double click the EnableAppearOffline row entry and update it’s value to 1.

AppearOffline6

6. Exit Office Communicator 2007 and launch it again to see the Appear Offline menu option among the available Status options.

Wednesday, April 3, 2013

What is the Serial Number of your computer?

Here’s how you can obtain it:

  1. fire up the command prompt
  2. tyep in “wmic bios get serialnumber” without the quotes :)

Voila!

Wednesday, March 6, 2013

Changing Delivery Address for your Bank’s Statement of Account

At least for Bank of the Philippine Islands, they required me a copy of any Billing Statement that is currently being delivered to me in the new address.

It’s quite logical. BPI wants to ensure the new delivery address can receive the SOAs they’ll be issuing me.

Wednesday, January 2, 2013

Request for Withdrawal of Funds

After hitting the profit objectives in stock market trading, it is now time to put this into reality, i.e., translate the figures seen at COL Financial website to actual money at my bank account.

COL Financial made is quite easy:

  1. Download the Withdrawal Fund form by navigating Home > Forms menu.
  2. Provide the required information in the form. Affix your signature.
  3. Scan and email to COL Financial.

Since this is my first time, I even called the Customer Service to confirm receipt of email but in the normal days you just have to send the request before 11AM and you’ll be able to pick up the check in the afternoon.

There is an option allowing COL Financial to make the deposit to your BPI, Metrobank or BDO account. However, I find my first time so special that I want a check as proof. Smile It’s just me!

Thursday, December 13, 2012

The VLOOKUP Function in MS Excel

Problem:

Given a Master List in “Sheet1” of an MS Excel workbook

A B C D E
1 Unit Price Unit Price Unit Price
2 UniqueID Commodity ABC Store Sari-Sari Store XYZ Store
3 201201 Apple 50.00 49.50 50.50
4 201202 Cherry 37.50 38.00 38.50
5 201203 Strawberry 26.75 26.00 26.25
6 201204 Mango 18.00 18.25 17.75
7 201205 Buko 30.00 29.00 28.00

You are requested to fill up the Commodity and Unit Price columns in “Sheet2” of the same workbook.

A B C D E F
1 ItemID Quantity Commodity ABC Store
Unit Price
Sari-Sari Store
Unit Price
XYZ Store
Unit Price
2 201205 1
3 201203 3
4 201201 2
5 201204 5
6 201202 7
7 201203 9
8 201205 3
9 201201 5
10 201202 1

Solution:

For C2, here is the formula

=IF(ISNA(VLOOKUP(A2,Sheet1!$A$3:Sheet1!$E$7,2,FALSE)),0,VLOOKUP(A2,Sheet1!$A$3:Sheet1!$E$7,2,FALSE))

For D2, the formula is

=IF(ISNA(VLOOKUP(A2,Sheet1!$A$3:Sheet1!$E$7,3,FALSE)),0,VLOOKUP(A2,Sheet1!$A$3:Sheet1!$E$7,3,FALSE))

Explanation:

VLOOKUP function has the following parameters:

lookup_value: this should be the ItemID which needs to be matched to the UniqueID in the Master List.

table_array: the range in the Master List where the matching and picking will be made

col_index_num: the column index of the table_array where the value will be picked.

For C2, since we are looking for the Commodity, 2 means the second column of the table_array. For D2 since we are looking for the unit price of ItemID for ABC Store, 3 means the third column of the table_array.

range_lookup: use FALSE when you need an ‘exact match’ of lookup_value and the UniqueID in Master List.

Friday, June 10, 2011

Restarting Tomcat6 Service

When you are using Tomcat 6 as the web service then restarting it is as follows:

sudo service tomcat6 restart

Simple eh?

Monday, May 16, 2011

Rounding Off to the “Nearest Five”

Problem:

Given a real number, write a JavaScript code to round it off to the “nearest five”. Examples:

  • 12.4 ==> 10
  • 12.6 ==> 15

Analysis:

The result would be an integer which is a multiple of 5.

Solution:

We will write the JavaScript code as part of an HTML file:

<html>

<head>

<script type=”text/javascript”>

// PART 2: the rounding off javascript code will be here

</script>

</head>

<body>

</body>

<!-- PART 1: this section will contain the HTML elements to visually display to user the transformation -->

</html>

Part 1:

We need three elements: a text box for the inputting of the number, a button to trigger the rounding off javascript code, and another text box to display the rounded off.

<input type="text" id="txtInput">

<input type="button" onClick="doRoundItOff();" value="Round It!">

<input type="text" id="txtOutput" >

Here the trigger is on the onClick event of the button which calls the doRoundItOff JavaScript function.

Part 2:

Here is the JavaScript code:

function doRoundItOff() {

var txtInput = document.getElementById("txtInput");

var txtInputValue = parseInt(txtInput.value,10);

var remainder = txtInputValue % 5;

var roundedValue = 0;

if (remainder == 2 ) {

var offsetDecimal = parseInt(txtInput.value*10,10) % 10;

if (offsetDecimal < 5)

{

roundedValue = txtInputValue - remainder;

}

else

{

roundedValue = txtInputValue - remainder + 5;

}

}

else if (remainder > 2)

{

roundedValue = txtInputValue - remainder + 5;

}

else

{

roundedValue = txtInputValue - remainder;

}

var txtOutput = document.getElementById("txtOutput");

txtOutput.value = roundedValue;

}

Explain! Explain! Explain!

We started the doRoundItOff function with identifying the txtInput HTML element. It is noteworthy to say that I usually make use as var in the JavaScript the id in the HTML element.

Next we take into account the remainder when the integer part of the input is divided by five. This remainder will determine which multiple of five we have to choose.

If the remainder is two then we take into consideration the decimal value of the input. If it is less than five then the input is closer to the largest multiple of five less than the input. Hence, we round down. Otherwise the input would be closer to the smallest multiple of five greater than the input and we round up.

If remainder is greater than two, the input is closer to the smallest multiple of five that is greater than the input. Thus, we round up. Otherwise, the input is closer to the largest multiple of five less than the input and we round down.

Tuesday, May 10, 2011

Any fix to SQL Server Management Studio timing out when Adding a New Column to a Table

A while back I posted the inquiry http://nullpointer.ph/questions/3204/any-fix-to-sql-server-management-studio-timing-out-when-adding-a-new-column-to-a-table

Thanks to Alistair sharing his knowledge. After some research got the following fix

tools-options-designers-tables-and-database-designers

that is, navigating Tools > Options then looking at Designers > Table and Database Designers node you will have Table Options. Override the default value of Transaction time-out after: [____] seconds with your desired length of time.

Saturday, May 7, 2011

Extracting Data from an XML file in MS SQL Server

 

Assuming you have an XML file structured as follows

<questionnaire>

<question>

<id>1</id>

<text>Which of the following is TRUE?</text>

<option1>6 is a perfect number.</option1>

<option2>All prime numbers are odd.</option2>

<option3>None of the Above</option3>

<answer>B</answer>

<explanation>B is FALSE because 2 is prime and even.

Perfect Numbers are such that the sum of their prime factors and 1 equals the number. Since the prime factors of 6 are 2 and 3 and 2+3+1 = 6, then 6 must be perfect.</explanation>

</question>

…

</questionnaire>

 

and there are a thousand more <question> … </question> set in it but you are interested only in retrieving the id and answer. Using SQL Server 2008, what SQL statements should you use?

Here it is:

-------------------------------------------------

DECLARE @FilePath AS VARCHAR(50)
DECLARE @Query AS NVARCHAR(MAX)
DECLARE @QuestionData XML

-- set the path to xml file

SET @FilePath = 'C:\Users\test\questions.xml'

SET @Query = N'SELECT @data = CAST(BulkColumn AS XML) FROM OPENROWSET(BULK N''' + @FilePath + ''', SINGLE_BLOB) AS XmlData'

EXEC sp_executesql @Query, N'@data AS XML OUTPUT', @QuestionData OUTPUT

DECLARE @hdoc int

EXEC sp_xml_preparedocument @hdoc OUTPUT, @QuestionData

SELECT
    *
FROM
    OPENXML (@hdoc, '/questionnaire/question', 10)
    WITH (
        id INT,
        answer CHAR(1)
    )

EXEC sp_xml_removedocument @hdoc

-------------------------------------------------

Simple eh?

Friday, April 22, 2011

Using a Different mahout Algorithm from the taste-getting-started Example

We were successful in running the taste-getting-started example as seen here: http://teachitshem.blogspot.com/2011/04/simple-java-wicket-using-mahout.html. However, mahout offers other recommendation algorithms which are so interesting to study. For instance, the PearsonCorrelationSimilarity whose parameters are similar to that EuclideanDistanceSimilarity used in the original taste-getting-started example.

How then can do this?

First, we duplicate the taste-getting-started folder say to tgs and we achieve this by issuing cp taste-getting-started tgs –R in the command line.

Second, we change the node <artifactId>taste-getting-started</artifactId> to <artifactId>tgs</artifactId> from the pom.xml file.

Third, open the recommeder-context.xml file at src/main/webapp/WEB-INF folder and replace euclideanDistanceRecommeder with pearsonCorrelationSimilarityRecommender, euclideanDistanceSimilarity with pearsonDistanceSimilarity, and similarity.EuclideanDistanceSimilarity with similarity.PearsonCorrelationSimilarity.

Fourth, run mvn package against tgs.

Fifth, in order to compare results with the original taste-getting-started we have run both the original taste-getting-started and the new tgs web applications using different ports. Thus for taste-getting-started we can use the usual mvn jetty:run-war that uses port 8080 but for tgs we must use something like mvn –Djetty.port=9090 jetty:run-war which uses the URL http://localhost:9090/tgs/movies.

Simple eh?

Monday, April 18, 2011

Simple Java Wicket using Mahout

While continuing the study of mahout, it is inevitable to write code that uses the various algorithms stored with it. So I asked a colleague to help out and one option was to start with a java wicket found here: http://blog.jteam.nl/wp-content/uploads/2010/04/taste-getting-started.zip

Using it is quite straightforward. Download the zip file. Unzip it to some folder (say taste-getting-started in the mahout machine). Using Ubuntu’s Terminal application, go to that folder and run mvn package. After packaging is complete, run mvn jetty:run-war. Once the jetty server is up, you can make use of the wicket by browsing http://localhost:8080/taste-getting-started/movies.

Although the above is the straightforward usage of the said wicket, setting it up requires some effort such as

  • downloading the MovieLens’ 100K Ratings Data Set: http://grouplens.org/system/files/ml-data_0.zip
  • Unzipping it to some other folder.
  • Copying u.data to taste-getting-started/src/main/resources/grouplens/100K/ratings
  • Copying u.item to taste-getting-started/src/main/resources/grouplens/100K/data
  • Executing the initialize_movielens_db.sql using the following command mysql --user=mysqluser --password=mysqlpassword < initialize_movielens_db.sql while at the taste-getting-started/src/main/resources/sql folder.

Oh and if you do not have MySQL yet, install it by issuing the following command sudo apt-get install mysql-server mysql-client.

Thursday, March 31, 2011

Journey to Mahout Land

 

Problem: Research about mahout.

Solution: Obtain a running mahout code but this would require an VirtualBox with Ubuntu instance on my Windows machine.

Here are the steps I underwent:

  1. Download Oracle VM VirtualBox for Windows host.
  2. Install VirtualBox to your Windows machine.
  3. Download ISO of Ubuntu.
  4. Burn ISO to CD/DVD.
  5. Before “Starting” the VirtualBox instance, click on Settings and choose the boot device to CD/DVD. Click OK to save the settings.
  6. Click the Devices menu, select the CD/DVD Devices of the Host.
  7. Click Start to turn on the VirtualBox instance and initiate Ubuntu installation.

 

After Ubuntu has been installed, run the Applications > Accessories >Terminal

  • type java and see the suggested <java-package>
  • type sudo apt-get install <java-package>
  • type javac and see the suggested <javac-package>
  • type sudo apt-get insatll <javac-package>
  • type mvn and see the suggested <maven-package>
  • type sudo apt-get install <maven-package>
  • type svn and see the suggested <subversion-package>
  • type sudo apt-get install <subversion-package>
  • type cd /etc
  • type sudo chmod 777 bash.bashrc
  • type vi bash.bashrc
  • at the end of the file append the path to your java installation

JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export $PATH

  • reboot the VirtualBox instance
  • type cd ~/Documents
  • type mkdir mahoutcode
  • type cd mahoutcode
  • type svn co http://svn.apache.org/repos/asf/mahout/trunk
  • type cd trunk
  • type mvn install
  • type cd core
  • type mvn compile (or mvn install)

 

Whew! I am just barely starting the journey… more to follow!

sudo apt-get install made my day

 

I just have installed Ubuntu 10.10 on an instance of an Oracle VM VirtualBox on my Windows 7 machine when I tried to install the prerequisites of mahout (http://mahout.apache.org/). So I opened the Terminal app, keyed in java and it suggests that I should use sudo apt-get install <package> to initiate the installation which I did.

Now in the next steps of mahout install procedure I saw the need for subversion. So I tried keying in svn and again Ubuntu suggests the use of sudo apt-get install <package>.

Very well indeed, this suggestion saved me time where to find the correct installers, time to download them, and fire up the installation.

Wednesday, February 16, 2011

iPhone Application Development 20110216

I’ve been reading http://www.amazon.com/Teach-Yourself-iPhone-Application-Development/dp/0672330849 and here’s what I’ve learned today

Xcode

  • Launching Xcode.
  • Choosing a Project Type
  • Adding Resources to a Project
  • Editing and Navigating Code
  • Jumping to Methods with the Symbol Menu
  • Code Completion
  • Configuring the Build Output
  • Building and Executing the Application
  • Correcting Errors and Warnings
  • Setting an Application Icon
  • Setting a Launch Image
  • Setting the Status Bar Display

iPhone Simulator

  • Generating Multitouch Events
  • Rotating the Simulated iPhone

My Gears

Tuesday, February 15, 2011

Cost of Becoming an iOS Developer

 

So you want to know the upfront cost of programming apps for Apple’s iOS?

That’s all you need: no more than Php 60K.

Wednesday, February 9, 2011

BPI Branch Locator

Sometimes you want to find the BPI Bank closest to your area and here’s a self-service URL:

http://info.bpiexpressonline.com/bpiprod/prodserv.nsf/Pop-Ups/BranchesSearch

 

Wednesday, February 2, 2011

Displaying Custom Error Messages / Enabling Detailed Errors on IIS 7

 

I was deploying an ASP.NET MVC 2 default application to one of my GoDaddy hosted sites when I encountered the below screen:

20110203-1524-Runtime Error

How can I know the underlying problem?

Simply edit the web.config file.

(1) Inside <system.webServer> node add

<httpErrors errorMode=”Detailed” />

<asp scriptErrorSentToBrowser=”true” />

(2) Inside <system.web> node add

<customErrors mode=”Off” />

<compilation debug=”true” />

 

Wasn’t that so easy?!

 

NOTE: Remove the said lines after you have found and applied the fix to your problem. You don’t want your regular website visitor know the internals of your application, right? Smile

Monday, January 31, 2011

ASP.NET MVC 3.0

 

Time flew so quick and I guess I was left out in the know. So to catch up I’ll get to review http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs and download the installer here: http://go.microsoft.com/fwlink/?LinkID=208140

Monday, January 24, 2011

Firing Up CodeIgniter over XAMPP

 

So you want to develop web sites/applications using CodeIgniter framework on XAMPP? Here are the initial steps to make your first page work:

We will assume (1) you have successfully installed XAMPP at C:\XAMPP\ folder on your Windows machine. Otherwise, you have to read about it. (2) you have downloaded (and extracted)CodeIgniter.

STEP 1: Copy the extracted CodeIgniter files to at C:\XAMPP\htdocs\somewebfolder\

image

At this point you can open your favorite browser and navigate http://localhost/somewebfolder/ and you’ll see something like the below:

image

I know you want to see your own work! Let’s move to the next step.

STEP 2: Open \somewebfolder\system\application\config\config.php and change as follows:

FROM:

   $config['base_url'] = http://example.com/;

TO:

   $config['base_url'] = http://localhost/somewebfolder/;

STEP 3: Open \somewebfolder\system\application\config\routes.php and do the following change:

FROM:

   $route['default_controller'] = "welcome";

TO:

   $route['default_controller'] = "home";

Now, if you try to navigate http://localhost/somewebfolder/ you’ll be seing a 404 Page Not Found message. That’s fine! We just need to add home.php at the controllers folder and add another home_view.php file at the views folder.

Initial content of home.php can be

<?php

class Home extends Controller {

    function Home()
    {
        parent::Controller();   
    }
   
    function index()
    {
        $this->load->view('home_view');
    }
}

/* End of file home.php */
/* Location: ./system/application/controllers/home.php */

 

While home_view.php can have as follows

<html>
<head>
    <title>Home Page</title>
</head>
<body>
<h1>This is the home page!</h1>
</body>
</html>

There you have it! You have successfully created a home page in CodeIgniter over XAMPP.