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

Week Ending November 30, December 1

It is no doubt that Philippines economy is slowly climbing up. Thanks to the effort of current administration that corruption is slowly being dealt properly. The growth of economy can be attributed to the government and people. It is a reflection of everyone's hope to reclaim Philippines as one of Asia's wealthy country. So, Philippines should speak slowly and carry a big stick on island disputes...

That said, this week has lots of events too.

XSLT and SEO - an actual result

...few months ago, we deployed an XML-XSLT website that contains rich data content. There are rumors that it doesn't do much in SEO. Since we can't just accept something unless we tried it ourselves, we decided to deploy a version of a blog website....


Commotion with BHI and SMC???

For those who might be wondering where in BHI disclosure is it, it was on the map... You cant find it because not even an airport is included in the PDF disclosure. it was an image after all...

...market portfolio

bought yesterday
FOOD (1.99)
bought today
GREEN 0.024
APM 0.128
OV 0.04





there seems to be a good news for APM....alcorn gold resources to be changed to Cosco?


Doesnt really interest me... Could this be a SELL on news?? whatever it is, i follow a trading discipline...

I will sell when it hits my target, be it gaining or losing

Sick Days: October 21, 2012

....My chronic recurring illness :( I rarely get seriously ill, but every year, I do get at least once bedridden experience while dealing with tonsillitis. I had many losses for this. Because of this sickness, I am unable to join the market craze on APM (Alcorn) and EG (E-games). 







Status for Week Ending October 5 2012

There is no more stressing than analyzing CDRs field by field... it was like a nightmare recurring over and over again, just like stressful days I had in Tokyo, that nobody can explain the business rules...














Problem with XSLT- blank referrer

It seems there is a problem with XSLT. Actually, it worked really nice and the loading speed of the site is greatly optimized but for one thing... this prevented the page from checking the origin of the request...


I think it works like this.... A page gets a request, XML is rendered to client with the XSLT, then XSLT is requested and after that process how the data should be displayed on the client side. Then, since the file is on the client side, all request made to it will have blank referrer, since it is on the client side... Of course, the browser will not forward your IP address as a referring page...

End of September

A lot have happened this month. I was too busy even to stay online because of recurring issues I had at work. This start of month has been unfortunate for us because my dad suffered stroke.


It just happened just after he woke up, and his left-arm and leg is paralyzed. Later, I learned it was a brain illness, caused by lack of oxygen supply (by the blood) to it. I had a situation like this before, first in Tokyo where I was staying alone. I just felt numbness in my arm, then next to it I can't move anymore. I thought it is just because of the weather because it happened on a winter. Then, when I returned in the Philippines, I had this just as I woke up. I can't move and just shouted for help, but I guess nobody was able to hear it. I tried to pull my numb arm up using my movable arm, and tried to move but didn't worked. Hopeless, I just resolved with a sleep. Fortunately, I recovered after a nap. Maybe a vein got clogged? Not sure what really happened, but it was scary.

We have to stay at the hospital for four days. I recalled the doctor saying my dad needs to be monitored for 48 hours. The experience is just horrible, and even made things stressful.



HIVES?

I'm taking a Ketosis-based diet that I avoid much carbohydrates in food. It is making me lose weight easily, but not much on the body mass. Things seems OK until I woke up and greeted by this...




It was terribly itchy. It would take a good patience not to scratch it. I took down a list of things I have consumed for the last 5 hours because allergic reaction can occur as early as an hour. I visited Medical City in Ortigas and have a dermatologist look at it. Again, I explained I was on Ketosis-diet, we don't have pets at home, I don't have allergies with Crabs or Shrimps nor I have taken those things for the past 24 hours at least, the doctor is clueless too, but she agree that those are allergic reactions. She gave me a prescription for Aerius (Desloratadine) 5mg. I used to take Alerta 10mg, but this is too strong and always makes me drowsy in an untimely situation, even a Venti Americano laced with White mocha can't make me alert. Aerius claims it doesn't make one sleepy, but actually it does. So, take anti-histamine tablets only when it is safe for you to sleep because ANTI-HISTAMINES WILL MAKE YOU FEEL SLEEPY. 


By searching, I'm able to find many disgruntled netizens who also is in Ketosis-mode and developed hives like this. I'm starting to think Ketosis has a factor in that hives for the folllowing reasons:

1. I remembered a time during my college days, it is my first time to take a high-alcoholic drink that hives appeared just after few minutes of taking it. 

2. Taking alcohol will make anyone lose water in them. When there is insufficient water in our body, gluconeogenesis (GNG) will not happen because water is required to make that happen. At this time, instead of taking energy from glucose, the body takes energy from our fats, producing ketones.
So, I think it is an educated guess. So, I decided to eat carbohydrates again as suggested by some netizens. Unfortunately,the hives is still sprouting like wild mushrooms. LOL


Then, I realized I was taking this drink the whole time. actually, I bought a dozen.









When I stopped taking it, the hives stops. It must be the culprit.(AHA!). I suppose those people who started to take carbohydrates back recovered from their hives because they are not using their low-carb artificial sweetener, which is also the reason why their body is reacting to it.


BULLIED SENATOR?

After a blogged accused Sen. Tito Sotto of plagiarism, instead of an apology, Sen. Sotto even provoked the owner of the blog to sue him. Instead of an apology, this is what netizens get.









The turn of events led to Senate President to approve an anti-blogger law (Anti-CyberCrime). This is approved by the President too. It can make anyone in the internet charged by criminal case and be sent to prison in an instant. How was that! :( Are we still living in a democratic country? Maybe we just need an internet censorship and we are a copy of China in terms of freedom-of-expression. I hope we get better government in the coming years.


ANTI ISLAM MOVIE?

Because of a stupid movie, the whole world went in a small chaos. US Ambassador in Libya was killed. 


Their prophet is portrayed as a bad person, to make it short. Read it here. [Anti-Islam Movie]





GLOBE IS DOING SOMETHING WITHOUT TELLING SUBSCRIBERS?

So could it be the reason why I only have almost 10% of my data rate and my connection dropping everytime a rain is about to pour? 


SCARY GAME?




 Had my hopes on this game, and disappointed me in the end. The game claims it is not a surprise game because of a good story, but it is the opposite. It is a surprise game without any story... BOOO!






STOCKS = > MONEY
Of course, if I will have free time from developments, I take time to analyze stocks. 


E-games has been on a downtrend for a long time. I'm just eyeing it, but would not dare to buy this. 




I was able to grab 20k shares of MPI at 4.14, which I disposed on 4.23 . I dont have any news after that.


PX is still red, and people at the forum are fighting other members. Scary talks again? I guess MVP is right about the government being unruly. "ANG GULO GULO NYO!" LOL














With the news, I feel like drooling to add more positions on OIL stocks. OV, OPM, PXP, APO. China doesn't seem to have dispute with Philippines anymore, but the Panatag Shoal remains roped.... 



Trillanes: A hero or a traitor?


The tension between Philippines and China cooled off a bit. Although, some Filipinos distrust Chinese anymore and continuously call to everyone for a mass-boycott of all Chinese related businesses, the standoff between Philippines and China is really one of the worst thing that happened. As a Filipino, I believe that the West-Philippines Sea deserves a recognition to neighboring countries and the exclusive economic zone as well. 

Then, Senator Trillanes began criticizing DFA Sec Del Rosario for his alleged failed negotiation with China that almost had the country on war with the China. Sen. Trillanes claimed to be a "back-channel" envoy to China.  


But on one of the Senate meeting, Senate President Enrile was accused by Sen. Trillanes of rail-roading a way to divide Cam-Sur, that would favor GMA. Instead, SP Enrile asked to Sen. Trillanes about the reports in Amb. Brady's notes where Sen.Trillanes asked the Ambassador not to take notes of their conversation and also have written there that Sen. Trillanes seems to be working in favor of the Chinese government. He simply walked out without answering the senate president's question....



Sen. Trillanes also said MVP is involved there, that fumes Mr. MVP and said... Trillanes is a liar.


I would agree with Mr. MVP.. "Ang gulo gulo nyo (govt)".


Here's an interview with Senate President Enrile..



http://www.juanponceenrile.com/view/245



WEB-DEV


Few things I like to discuss is about facebook comment plugin. If you are a developer having problems with the scrollbar, then simply check if you are floating it. It should go easily as a block element, but if there is a need for you to float it, wrapping it instead should do. Comments will appear below and should not need to scroll, provided that no height attribute is provided for the containing element.



Was asked to modify the site layout again... I might require more holidays for it... :(



...Wonder how long would it take for me to start-up my own company? :(


..good luck to our investments.


End of Ghost month?

Ghost month seems to have ended and stocks are starting to move north making new highs. I think stock price will continue this movement up to next year.

I'm still holding on to OIL stock that I'm keeping even on the dips. I took that opportunity to add consistently every month, regardless of the hearsay, the scary rumors on forums, and the consistent bragging of co-traders who gained significantly high just by day trading.

I friend suggested to me a tool for day trading called the Pivot Analysis Tool. I think this is a good starting point for those who don't have much time to look on the chart like me. Last week, I added some of RFM using this tool and I was surprised to see huge volume of unserved bid on closing, buying at the same price that I have. 

Also, another thing worth reading about investment is this article on inquirer's website.

business.inquirer.net/79214/know-thy-investment-but-know-thyself-too-2


although, it did not mention stocks, I think there are many stocks out there that can offer big gains with less risk, considering your investment period would be from medium-long term. 



The XML page cannot be displayed - Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. Access is denied. Error processing resource

The XML page cannot be displayed - 
Cannot view XML input using XSL style sheet.
 Please correct the error and then click the Refresh button, or try again later.


 Access is denied. Error processing resource




On my continued experiment on dynamic XSLT website. It seems that the browsers WILL NOT PROCESS XSL stylesheets if the URL in the href attribute is different to the current document's URL because of cross-domain issue. Although I understand that if they don't do this, every pages might end up X-Domain attacked, but having it denied even on same DOMAIN is just absurd...




So, if you got an XML laced with 


< ?xml-stylesheet type="text/xsl" href="http://sitename.com/index.xsl"?>






on any xml documents in http://sitename.com/myxmlfile.xml




the referenced stylesheet will be processed, but if your site does something like SEO optimization and handles specific file by subdomain...




< ?xml-stylesheet type="text/xsl" href="http://internal.sitename.com/index.xsl"?>






this will display for any xml documents under internal.sitename.com/myxmldoc.xml ... 






So, the browsers got a narrow understanding of cross-domains, treating it as cross-URL. It should be called Cross URL instead of cross domain protection.












 

C# - Windows form Combobox displays System.Data.DataRowView Instead of Display Member

I'm getting a query result, in terms of a DataTable/DataSet. Now, the problem here is that, on my ComboBox object, I already specified the display member and the value member. I'm also sure that the datatable/dataset has that column in the result.
 
Although I set all of these properties I still get "System.Data.DataRowView" displayed on all items.

Once an Item is displayed for the first time the value is OK but when I choose another item and the selected Item become inactive, its displayed text would show  "System.Data.DataRowView". 

I tried all the bindings, reset the selected index... but alas, to no avail.


Then, I realized that the part making it display all those System.Data.DataRowView is from the SelectedIndexChanged event. An exception there is preventing the binding to work properly. Correcting the code there fixed it.

FMAP(Fund Managers Association Meeting) sponsored by Macquarie pumped OV up?

OV moved bullish from 0.052 to 0.055(it even reached 0.056 at some point). This gaved me about 16.67% gain in my portfolio although that gain is just eaten by my position in PXP .... Oh well, there is no room for regrets.



The gloomy days seems to have ended. With the outlook rating given to philippines, foreign funds are flowing in the market. Most bluechips went UP really fast so we can expect a very happy trading days for daytraders.


There is more to come next week, so I might think up of some plan entering stocks that I'm keeping my eye on, other than OIL stocks. But just like what macquarie says. Investing in Oil exploration is a very profitable investment.

Oil stocks gaining, except for PXP?

i had good gains with OV, and probably pxp...but now, my supposedly gain in portfolio is balanced by my loss in pxp. if only i didn't listen to some forums and blogs of technical chartist...


..lesson? believe no one even they are reputed to be a super technical financial analyst.. because your loss will be 100% yours..

FTP Upload using C# The remote server returned an error: (550) File unavailable (e.g., file not found, no access).

This error just bumped into me while working with 2 web hosting company. I had almost identical deployment setup for two website. Then, I have a main FTP account that I use to transfer all the files in the server. But I really don't want to use this FTP account as it has a right to the root folder, so I created another FTP account that only has access to a certain folder. This way, I am setting up a little security on the website.

But when I am test deploying my website, I get errors whenever the GetRequestStream method of the FtpWebRequest object.


The remote server returned an error: (550) File unavailable (e.g., file not found, no access).

Which was weird, because I have done this before on the website with my main FTP account. Whenever I will access the ftp site with explorer, I also can't connect. 

After googling a lot of failed solutions, I decided to try few things on my own. I tried to add folder similar to the folder structure in the root (so it looks like MainFolder/SubFolder/MainFolder/SubFolder) .


Then I tried to run my application again and I'm able to add the file smoothly.
I don't like the workaround because I simply tells me to update the already built code and perform another round of testing..

I hope the web hosting company can still find a way... Workaround is OK, but it is a lame excuse.

Gloomy weather, gloomy news, only OIL is moving UP

The movement of oil price is so fascinating that it affected the whole world's trading market. I'm really pleased with my gains in Philodrill Corp (OV), but somehow my gains is countered by my loss in Philex Petroleum Corp (PXP). They are even making bad news just to make the stock price lower, but I'm planning to cut my losses here and move on. I might be regretting to have bought OV instead, but again... regrets in stock market is a SIN.

The Philippines is barraged by different low pressure areas, sometimes getting stronger to be declared as typhoon. It was all rainy day, and my Globe internet connection eventually disconnect whenever a strong pouring of rain would suddenly drop. I get tired explaining this to the CS of globe. I hope they would try their own product to know it well and seek for improvement.


RFM getting pumped again at the closing. 2M worth of shares, WOW! It might be a trap too, but I might put a little here, so I might plan my exit on my losing PXP :(


I really wanted to finish up my Blogmanager app. A window application that will help me post on the website I'm working on at the moment. Others may think it was like inventing a wheel when developing a CMS, but I think sometimes re-making the wheel is what exactly developers need to have a better understanding of something :). Better knowing how to make one, than just knowing how to use one.


And the negative news about West Philippines sea? I think these market traders are just threading stories and hitting where it would "hurt", so scared traders will unload their stocks and they would wait to initiate an ambush buy. The oil price might move exactly as Macquarie forecasted, and these market traders won't miss every chance they can make to make the trades favorable to them. So why I'm planning to sell? I don't believe there would be a war in the west philippines. but I won't like myself getting left out when everyone is selling. OIL stocks has good fundamentals especially with the recent events. but sitting down and wait for it to recover is bad. My plan is to re-enter when it is near the bottom.


Setting Datagridview TexboxCell into multiline mode like a Textbox control

Once again, I'm having my sleepless afterwork stress... so I decided to open my computer and do some dev work to lessen the remaining task before deployment and content writing.

Fortunately, we can also set the texbox like column in datagridview control to be a multiline textbox, without adding codes to cast our controls.. All with the use of designer view. On the datagridview control, we have to locate the Collection property and choose the desired datagridviewtextboxcolumn. From there, we navigate on the DefaultCellStyle property and set the WrapMode to true.

Also, we have to set the AutoSizeRowsMode of the datagridview control to AllCells. 

After this, when we add or type contents to the cell, it will expand automatically. Sweet, isn't it?

SQL XML query escapes HTML tags

     just after the big show stopper, I'm now dealing with another one..

Lets say for now, I have something like this

SELECT 'and i'd give up forever to touch ' 'line'
UNION
SELECT 'you cause i know that you feel me so love, your the closest to heaven that i've ever been ' 'line'
UNION
SELECT 'and i don't want to go home right  ' 'line'

UNION
SELECT 'now  and all i can taste is your sweetness ' 'line'
UNION
SELECT 'and all i can breath is your life ' 'line'

FOR XML PATH('test'),TYPE


and, I run it... I'll get those angle brackets escaped (< and >)




fortunately, there is a way to still make those angle brackets, but will lose the XML thing by using value


SELECT 'and i'd give up forever to touch ' 'line'

UNION
SELECT 'you cause i know that you feel me so love, your the closest to heaven that i've ever been ' 'line'
UNION
SELECT 'and i don't want to go home right  ' 'line'

UNION
SELECT 'now  and all i can taste is your sweetness ' 'line'
UNION
SELECT 'and all i can breath is your life ' 'line'

FOR XML PATH('test'),TYPE).value('(/test)[1]','NVARCHAR(MAX)')

will keep the angle brackets, but it is once again, an NVARVCHAR field...

much of an interest, but doesn't help me because I have a large nested XML PATH query.. :(


XSLT8690: XSLT processing failed and all HTML are displayed as mere text

You checked for the encoding, you checked for the xsl output set to html, and even removed all the comments before the xsl template but still you are getting. All the contents displayed as plain text and when you checked your developer tool,

XSLT8690: XSLT processing failed

And frustrated to take hit on google to find the solution? well, relax because I encountered this once and even wasted almost a week worth of things to do because it works in Chrome, it works in Firefox, it works in Safari, but NOT IE...(8 or 9 too).


If I've done it right, then how come it is displaying properly in other browsers and NOT IT... I understand how you feel..


But the real reason is, you "might" have screwed it a little and those non-IE friends just wouldn't mind about it. Too bad that it will not tell you where did you get wrong (even if you sing out loud.. LOL).


We don't know where it got penalized by IE,so we're asking .NET side where. Using XslCompiledTransform.


It is simple, just instantiate XslCompiledTransform object and pass true in the constructor like this.

XslCompiledTransform sparemyxsl = new XslCompiledTransform(true);
sparemyxsl.Load(pathToYourStyleSheet);


Even if this stylesheet is using include or import, once you invoked the Load method, it will process all related XSL stylesheets, merge it and check what's going on. It will throw an exception when it finds something bad.


On my experience, I accidentally added an extra line of include that also refers to the same xsl file. It is a good start. (^_^). I hope you can find the fault part. 

Happy Coding.



and don't forget the namespace for XslCompiledTransform

System.Xml;
System.Xml.Xsl;

Adding stylesheet to XML document.

I am currently working on a web enhancement where XML datas are passed on the response object. It seems that the website will serve as a service point for some request. Since it is in XML format, it can be consumed by some applications with minimal parsing. Even with javascripts and XSLT too, which makes it really flexible.

Right after it is fetched from the database, the result is in Scalar form XML, thanks to SQL's XML PATH, which removes XML parsing from data resultset.

Doing this with XML LINQ is pretty easy.

XDocument xml = XDocument.Parse(stringFromDataBaseScalarResult);
var pi = new XProcessingInstruction("xml-stylesheet","type=\"text/xsl\" href=\"yourxslfile.xsl\"");
xml.Root.AddBeforeSelf(pi);
doc.Save(Response.Output);




or without LINQ




XmlDocument xml = new XmlDocument();
xml.LoadXml(stringFromDataBaseScalarResult);
XmlProcessingInstruction pi = xml.CreateProcessingInstruction("xml-stylesheet","type=\"text/xsl\" href=\"yourxslfile.xsl\"");
xml.InsertBefore(pi,xml.DocumentElement);
xml.Save(Response.Output);


I have to find some better clean way on the second one, because my initial attempt using Append method placed the processing instruction at the bottom of the xml document, although the stylesheet is still applied. It is an eyesore to some. (including me... hehe).

 



 

Why traders are still buying Calata Corp stocks (CAL)

It seems that the market (PSE) is trading at sideways, probably waiting for the results of Greece elections. While most of the stocks too are trading sideways, it is a completely different story for Calata Corp (CAL).

We rarely see stocks as active as this one, which almost had 5k trading transactions in one day. The price too went up to as Hi as x3 of the IPO price down to 9.+ nowadays. Very scary, but still there are many people buying the stocks with the hopes that it will still get high.


Calata Corp is the biggest distributor of chemicals, feeds and fertilizers used in agriculture here in Philippines. It has very sound fundamentals and many are expecting to see more growths in the business, but with the rumors of stock price manipulation, some are having doubts to invest on it. Just imagine having a price down at least 30% and we are not talking about a day, just half of it. The last decline even happened between 4 minutes trade selldown. (Almost 15, to 9).


So why is everyone still buying it? because of sound fundamentals? or they just don't feel like walking to a casino.

Market broke 5k resistance, investors into selling frenzy due to eurozone crisis

Most of the PSE stocks, if not all went down as selling frenzy occurred since May 2 and ended after almost 3 weeks of red days. The fall was simply fascinating that I almost lose all my shares in OV (majority in my portfolio).


I'm able to sold all at 0.06, then observed a little drop in OV to buyback, which gave me more shares than I originally have. But as I have observed it, I bought too early and should have gained at least additional 3-4 million shares. That's quite a sum.. :(

This might be my biggest trading loss since I started trading. I never expected that the price could drop by almost 35%. I'm still holding and in fact added some more when the price is still cheap.

Actually, I can't think of any good reason why the price should drop. Although the company just released a disclosure that didn't seem to be a bad news, OIL price went down in global market and the greeks are again in turmoil over the crisis that isn't new at all... Well, people really do live in their conviction and the big broker already went out, after hearing JP morgan's big trading loss..(which in anyway not related to PH market..).

Good thing MACQ has been hoarding stocks and rarely sell. But my gut tells me, macq has been selling thru other brokers... hopefully I'm wrong..





One of the things that might be a good thing when trading stocks is to diversify the portfolio. So, let's say I have my portfolio distributed to selected bluechip stocks, one on utilities, one on food and one on oil exploration. When a sector gets a bad trading season (usually by news, etc), chances are, your loss in one stock could be balanced by your gain from another stock.




But of course, having too many stocks means you have to watch for them x times. Also, the above won't be true if the market is really down, just like what we just have this May. I'm starting to believe the foolish saying (just a bit), sell in May and go away.





It is also important to do a research first. Never rely on few alpha-male's recommendation, like a stock will go up by X%. The stock market has UPs and Downs. What goes up, goes down and vice versa. Actually, I asked a manager of one of the leading investment house in the Philippines about a stock he promotes months ago. The answer? Not even a reply. I won't be surprised if he tweeted that he doesn't have any position on it.One thing is for sure, he would entice everyone to buy a stock when he bought at cheaper price then later, ask everyone to sell after he sold, so he can buy back at cheaper price.




So,what's the lesson here? Investing to blue chips is a low risk and high reward investment tool if you are planning to go for medium to long term. So that's why I've been also adding more and more to my portfolio. Hehehe.


I hope I can upload my new site soon. It took me a while to finish it, especially the optimization part.

Global.asax events are not triggered for static files

One of the great thing to handle dynamic website is to manipulate the output of the page by request. From writing handlers, modules or simply handling the Global.asax events. But just when you had that idea, something will discourage you to prevent using that idea and consider doing an even more tiring (and probably messy) way of doing.

To be able to handle static files in global.asax, we have to change something in the IIS. For 6 and below, it can be done on the server by checking the property of your website. On the application configuration (under home directory tab, click configuration button and the handler tab should be displayed), select a specific static file and click insert. Confirm that the "Verify that file exists" checkbox is NOT checked.


For IIS 7, this is a bit easier. Just be sure to have your application pool to be configured under "Integrated" pipeline and have these in the config file.

<system.webServer>
  <modules runAllManagedModulesForAllRequests="true" />
system.webServer>
 
After this, IIS  should really handle all the request.

IIS doesn't serve unknown MIME types

Ever experienced working on a web project that works perfectly on dev and stage servers then shows up 404 in production? I experienced this as was troubled for some time. Usually, production servers have limited access and configuring it might is probably out of option. 

good thing, it can be configured on your config file.

(lets assume a non-standard extension and treat it like an XML)


for IIS 7 and above versions.

   
                        
   



As for IIS 6, I think it is not possible to configure in config. You will really 
have to kneel down server admins, so deal with them even if they are stubborn.

Few basic things to speed up transition learning in XSLT

Holiday sure is short (although it was a 3 day holiday), especially if we can just realize that we got lots of things to do...

I was able to work on my XSLT templates, and saw how I wrote them few months ago.  I even laughed when I saw that I did a horrible for-each block, that can be solved by  using the concat function, or even simpler than enlosing things between a curly brace (in case of attributes).


It improved a lot, way cleaner than it was before and more "straight-to-the-point", if you know what I mean. we can just directly write the templates as if we're writing HTMLs, without having to nest xsl:elements and attributes..



easter sunday..

Mall was probably crowded after having long holidays (including the mall operations).

I was busy updating my site templates.. and have myself review all the xslt templates I've done. I almost re-write some of the templates, and good thing I'm able to see the old templates location which had all the formatting I had in mind. *grins*

UI should have been easier if I would be writing the code directly, but unfortunately this is just for a short term. If I decide to change the layout again in the future, I might end up messing the site up and adding the site offline html for long periods... not to mention the site's domain renewal is flooding me for reminders... 


 Is it me or time runs faster? I remember that I slept at 4AM and left bed around 10AM. I took a meal at 3PM and realized I just ate my dinner at 8PM. I'm updating the UI/XSLT templates all day? Looking at the layout gives me a bit of satisfaction, but also tells me that there are many things to be done :( .... guess the people who said they are interested to participate on my web development project forgot to do what they committed to me :( too bad, they don't know what experience they are missing...




I better get something to eat and probably call it a day now.. body seems tired.


Long holiday break

We just enjoyed a long holiday break here in Philippines. While I enjoyed sleeping a bit longer than normal days, it also means a boring day since the stock market is also closed on holidays, but still this helped me devote my time to web development again.


I had a bit of problem deploying in IIS 7.0 . Well, I've been using IIS 7.0 in my personal site for almost 2 (maybe turning 3) years and I'm pretty sure that ASP.NET should be able to see all requests when the application pool is configured to run on Integrated Pipeline Mode. One of advantage of IIS 7.0 is that, it saves you some time configuring all the file paths handlers. Unlike the old days in IIS 6 below, you have to manually add the type of file and browse it (ISAPI). Either-way should work fine, but of course technology is there so use it.

 Juggling should be left done by acrobats. Juggling tasks often leads to mistakes. I can't believe I even made mistakes not to grant access to an SP a SSRS report uses and even had the SP overwritten when a new column was asked to be added there.. *sigh* And the hell week doesn't end there, I also had an SSIS task that was 100% working on the test server, but failed in the live server where it is scheduled as a sql job. Weird thing is that, the first day it had an error, it was complaining about a file it cannot delete... it again had some error and to my surprise, a different one.


reading here somehow gave me an idea,


social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/0c245265-79fc-406c-8ec6-6019eebc4f68/

but it was solved by someone... but glad it was fixed, although I really want to fix it myself :(


Now, I'm just thinking of UI ideas and was modifying my xslt templates. It was quite some time when I updated these templates. 




As for stock market, the I requested for some GT Capital stocks for reservation. The stock price was 455/share, so I assume it is at 10 board lot. I hope I can get some stocks for this. I'm also eyeing for EastWest bank.



It was really hot now, and sometimes I can't just get enough focus... so sometimes I resolve to playing shadow era on my phone.. 




2 more days to finish my templates....





a sudden change of heart?

Whew, after a super-busy week I'm am now able to write some post here. All the dev task at hand with almost impossible requirements gets done, thanks to the power of coffee, I'm able to hack myself and complete it.


Still related to the previous task I've done, the client side solution I provided was completely dumped, so I have to find another solution, which leaves me either to manually alter all the html pages and add some identifier there, like the rch group of attributes (ROFL), or to parse it dynamically thru code, so it will be the time when it runs on the nightly process..


I won't like to manually alter the pages, not only that it will take some time, but it is also not practical to do... Everytime a new file comes in, you have to alter it manually. I'm not a zombie that caters to all their request too, and just say "...yes, I will do it...".. we're living in a world of interactions.

So, what are my options? read each line, and put up a good regex there? might be.. but I would prefer if I can just select those things, just like I did in the jQuery plugin I developed.. Fortunately, there are some talks about some HTMLAgility pack... Took some reading into it, selectors worked wonders, but when I alter the code, duh.... it doesn't work... (-_-;)... that's why it is an unfinished project... 


I almost gave up.. I've drank coffee as if, it is my daily water intake.. and then, figured out to just use the pack's selectors and perform the old school replace (though in code), and have it overwrite the file.. Fortunately, it works.. but just a few minutes of deployment, I was asked if I can do something about the boxes? 

Boxes!????  I checked the deployed app to see small boxes that doesn't appear like boxes in IE Dev tool or in firebug... Aha, so it is the encoding!  somewhere in the html, there's a meta that declares windows-1250, have altered it, still no good.. so maybe it is on the file format itself... added few lines, and things got better.  Until the BA saw a page and asked me, can we trim the first column a little bit, puhleassee? 


Uh oh, sounds like trouble.... I injected another set of stylesheets , but to no avail.. i even traced almost each element by border... didn't helped me.. Then, I checked it (the file), only to see a malformed part that closes the parent tag prematurely... this week was really stressful, especially when someone talks to you, claims to be listening but actually hearing my words in on left-ear, out on right-ear... 




so much for my web-dev life, and almost none for my trading life.... oh, actually I've added more OV stocks..  PNX was a shocker... after closing the day at 14.62, it opened at 9.74, that's almost 30% decline. This is the aftermath of 50% stocks dividend. I still have my PNX stocks at hand, and probably leave it like that. 


I also got myself some Ionic's Inc (ION) stocks. They declared a 100% stock dividend. I think it might goes like what happened to PNX, but still I won't be needing that money at the moment, so I'll just leave it there and forget it. ION is on semi-conductor industry btw.


I also got myself some ATS( Aboitiz Transport System Corp.) 2GO ( 2GO GROUP, INC) stocks. I have a feeling that some broker house is manipulating it though *cough* COL *cough* (whoops! *caveat*). 




I might add some OV again, given on it's current price and the GALOC achievements, this would most likely go up in coming months.



I might have my trench-coat, suits dry-cleaned soon, buy some casual clothing, and prepare a list of to bring back. I hope my teikiken is still active after 2 years.










Hot summer for Philippines in coming days

Lately, it was getting a bit hot from the cozy weather here in Philippines, and in almost everywhere people are enjoying their Magnum ice-cream, to the point that it is almost sold out in any groceries.

I don't have much trade these days as I'm busy working on a web application I've designed in a Model-View-Presenter (MVP) approach. I did a honest estimate there, but the budget was unfortunately trimmed by  23%, so I had to exert additional effort, although my body doesn't want it... (-_-;) (guess that's life for us sofware developers). 


I had to make this web app, a screen that can search and display results, a screen to view detailed information about an item and allows a user to edit an item, and an admin screen to perform maintenance task.

Using MVP pattern helped me simplify the development, and also enabled me to boost my confidence on it, since I can perform Unit Testing even the UI part. Development is pretty easy too, define the Views, Models and couple them in the Presenter. I only took some time on the asp.net related part, although not that hard. I also isolated the data access and the service layer, just in case it will be deployed as some application in the future. I also took time to make custom UI plugins. good thing there's jQuery and some creative imagination.



For my trading side of life, OV dropped from last 0.057 to 0.048 . That's 15.78% and I'm sure many people got shocked by these movements. I also feel a bit of fear so I sold and re-entered some position, only to find out that I entered with less stocks I originally owned, although I gained money, but they can't add up to positions anymore. MACQ bought a lot and made the stock price at 0.054. I think the operations at GALOC site will resume pretty soon. As of the writing, I have most of my positions here (millions of shares). I'm able to add some at 0.05-0.052, it should have been at 0.048-0.049, but since COL didn't update on time, it was 0.052 at the time my balance is updated, that's life for me. :(


 MAKE (the merged Maybank- the malaysian bank & ATR Kim Eng -the foreign broker) also rallied, at 6/sh I'am already keen on buying it. I bought a board lot just to test. it went 11-12, then shake everyone to 9, resumed to 12 and now 26. I guess ATR Kim doesn't like CitisecOnline users (COL boys as termed by forum members) in their boat. I'm still very bullish on this, probably can hit 30-40 /sh this week, now that PSEI stays at 5k.


PNX is also moving slowly up. On March 23, the 50% dividend will be granted. There might be a lot of traders for dividend play here, but I hope it doesn't drop the price too much.



As for PNB and the merger story. Just a day before March 6 (for the amended stockholders meeting), a news was spread that the merger should not be allowed to proceed, since it will hurt PH economy (duh)... This made PNB shares drop from 70+ to 65+ per share, then after few days, it went back to 70 and closed at 72.5. I hope they would penalize those people who put up these stories. I'm sure there are many people who are bullish on PNB, but lose their money on the process.

The family feud related stock (LMG), hits 2+ and made a graceful bounce.

JFC just jumped again from 101-120, then 119.. If I bought these from 89 last january, it was already around 25% gain, and this is a blue-chip. I might consider a cost-averaging plan on this one, if it would consolidate a little. If one will just look at how bullish JFC was, even on the times of recession, JFC is a low-risk, high-reward investment.


I think stocks will break new records of high in the coming days :)

Patterns??? In stocks and work???

I've got lots of sideways price action in most of my portfolio now, but most of them do equally have good things in them.And what do they have in common? Company mergers. 

PNB's merger might not be a news anymore. On March 6, there would be a stockholders meeting to finalize the merger. PGOLD on the other hand has a study of merging with sister company S&R (for those who are not aware of S&R, it is a shop much like of Macro). RLC also has a merger with Robinson's INN Inc and Robinsons Realty and Management Corporation (both are owned 100% by Robinsons).


I'm in a bullish look with OV now, and given the opportunity, I would shift most of my money back to OV again. Actually, I was on alert last Friday due to some hearsays about institutional investors hoping to OV for dividend play. I didn't see the price decline last friday, which was also the Ex-Date for OV. This is a good sign that everyone is looking for a long time investments in OV.

As for PNX, still no news about the 50% stock dividend. UBP on the other hand announced the 3PHP/sh dividend on March 8. Also, MER got into my eyes when they announced a 4.1PHP/sh dividend and 51% equity participation in rockwell land stocks, ex-date of both on March 20. My personal Risk/Reward assessment is that, MER is a low-risk investment with pretty good rewards for medium/long term investment.


On my development life, a friend ask me about the common OOP design patterns. I'm able to share a custom pattern I've used for quite some time and he was amazed about it. I told him it was really simple and my friend seems to be enthusiastic to learn more about it, so I asked him if he would be interested to join me in my personal dev tasks. Maybe he will find out that I'm pushing more effort on my dev tasks than what I'm required to do in work. I hope he can catch up with all those design principles and help himself in future dev works.


One of the patterns I suggested to him is the MVP pattern. Using this pattern allows a flexible and maintainable solution. You can design the Model, lace it with business rules or put it on different solution as desired, create custom views which are not dependent to any specific project type and create the Presenter that will couple all your Views to Model, vv. Abstraction can be applied as much as possible.

War concerns in Iran gives the market a split views

The market (PSE) once again declined today. We're seeing reds and OIL stocks are not an exception, even if the oil price is hitting really high.


I bought OV at .053 last week, and added a little today for .05, was observing the market sentiment today and my instinct told me to cut loss early, so I sold all at .05.


Seems I got it right, the price slides down to .048 at the time of posting.


The all high and mighty UBP also beaten too much today, it was on top of losers, 135 / sh yesterday, 117 on the last time I checked it.

WIN and PHES seems to have bounced right today. Araneta seems to be on hi since last week, I wonder how long it would sit there.

PNB once again hit 70 today, but slods back to 68+. I guess many tsupiteros are playin this stock.


Still updating the layout for a site I'm designing. Who says those who dev with web front end can't dev on web back end?






Stocks with consistent dividend payouts

NOTE: the information here are as of the time of writing only, I only took this list since I like to invest in companies that maintains a good relationship with investors. I think giving a little of their earnings thru dividends payouts is good.

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