Web Dev Matters and Me

Web Development Matters - HTML, XML, C#, .NET, AJAX/Javascript(jQuery), CSS, XML-XSLT

ME - LIFE,Philippines, Tokyo, ECE, PhilNITS/JITSE,情報処理, 日本語

things about Philippines, gaming, C# development and web development, how to make money in stock trading

Web Dev Matters and Me

It always doesn't have to happen on the server side (^_^)

The task I had days ago got a bit more complicated. We're able to track cross-request for any files in the server, but what they want is to track "ALL" the links. And yes, including the bookmarks. (ouch).

Since it doesn't trigger a page request, I had to think of an idea to make it happen. Simply, by injecting javascrip
t on cross request, and have that javascript listen to the click event, I should be able to track which link. How? Thru AJAX. 

Then, I'm able to get thru with it. But then again, the hardest part is to get a portion of text, and have it recorded on the db as well. To make it worst, there is no specific formatting in it. I have a link that points to an anchor[name], but the code I need to isn't in there, it was on the next table row, on the first table field, wrapped in a font tag (yes, very old and doesn't even enclose attribute values in " ), wrapped in a b (bold) tag.

Ok, the fix was a hack... I don't have a choice, right? So with javascript, it happens like this.

1. Find all the a in the page with an attribute name
2. Need to iterate finding the parent until it hits a tr parent
3. Then, find the sibling of this tr parent.
4. On this element, check the first child
5. Find the child elements, and check if it contains the pattern I'm looking for
6. If it does, find all the a with href equal to # and the attribute name of the bookmark
7. Assign an attribute to the link, some attribute I can later get the value and post thru AJAX.

really complex, actually if I can just tell them "Go change the format, some other format like XML", I should have done it earlier...  

Oh well, on my trading life... I'm able to gain from OV for a profit. The loss I had handling JAP stocks are fully recovered by my trades in OV for only 2 days. Maybe I'm just lucky this time.

On Feb 20,2012 I'm able to buy OV for at 0.044 (1/5 of my total position acquired) and 0.043 (4/5 of my total position acquired.).

After 3 days, It was on the new HI of 0.057 and I set my cut-loss at 10% of this price (supposedly 0.049), but the situation at that time made me decide to sell it. I'm able to sell all at 0.053.

So on average, I gained:

(0.053-0.044) x 1/5 =0.18% x # of shares
(0.053-0.043) x 4/5 = 0.8% x # of shares

Quite a sum, so I took this time to share the blessing. (^_^)

The price had a slight correction at 0.045.

Then, I bought back 1/5 of the shares (OV) so I won't be left. I also bought PNB. As of the time of writing, I had PNB, OV, PNX, PGOLD and RLC. Now I don't have to be worried having a sudden drop in prices, just what like it happened to the JAP stocks (Ni, ORE) I hold few days ago.

At the time I realized my loss in NI and ORE, I thought of placing my money in a stock that can be less risky. Simply by checking the dividends, I'm able to pick RLC, OV and PNX. RLC and OV will share their blessings this march, while PNX gives me a promising dividend offer to  be announced soon.

With the exception of PGOLD and PNB, which doesn't have a consistent dividend pays, PNB's merger with Allied bank will take effect soon. The trade price is near 70 so, I don't have to wait any longer now. I think the 70/sh price will be higher in the coming days. A merger makes the surviving company bigger, so I think it should be a low risk, hi reward investment.

PGOLD too has a juicy merger with S&R cooking in progress (^_^).


FB Connect