Thursday, May 28, 2009

Hairstyles

Here's another conversation about hair. Read on and enjoy..^_^


Wednesday, May 13, 2009

Tuesday, May 12, 2009

Hit Counter in a Web Page

The site I've been working on needs a text hit counter in it.  As usual, I searched the internet to look for answers since I'm new to this.  I found two solutions: through storing in the database and through storing in a text file.  The database looks complicated (and IS complicated) but read it anyway.  It touches some files, and the Global.asax.  But although it looks complicated, I was really trying to avoid the text file solution.  And then I found this forum thread for the same solution.  A user somehow said it's better to use the text file, that's because the solution might not be that reliable after all.

So I'm using the text file, and so far, I like the results.  Here's the code I used (courtesy of Dipal Choksi):
    private int GetHitCounter()
    {
        StreamReader ctrFile;
        FileStream ctrFileW;
        StreamWriter sw;

        string strPath = HttpContext.Current.Server.MapPath("hitcounter.txt");
        string strCounterContents = string.Empty;
        int nCounter = 0;

        if (File.Exists(strPath))
        {
            ctrFile = File.OpenText(strPath);
            strCounterContents = ctrFile.ReadLine().ToString();
            ctrFile.Close();
            nCounter = Convert.ToInt32(strCounterContents);
        }
        else
            nCounter = 0;

        nCounter++;

        ctrFileW = new FileStream(strPath, FileMode.OpenOrCreate, FileAccess.Write);
        sw = new StreamWriter(ctrFileW);
        sw.WriteLine(Convert.ToString(nCounter));
        sw.Close();
        ctrFileW.Close();

        return nCounter;
    }

And then in my public method, I called GetHitCounter()
        string temp = string.Empty;
        int nCount = 0;
        nCount = GetHitCounter();
        temp = nCount.ToString();
        return temp;

My reference used image to return the counter.  He (or She) used the namespace System.Drawing for the image, hence, the GDI+ classes.  I, on the other hand, only needed the string retult, so there's no need for me to use the other method he (or she) used to return the counter.  Anyway, if you just want the current hit count, just remove the nCounter++; from GetHitCounter() method.

That's all.  I hope other people might find this helpful.  Happy coding.. ^_^


Saturday, May 9, 2009

2010 Philippine Election Automation - Update

I was watching tv earlier, then while channel-hopping (again), I came across ABS-CBN's Bandila giving updates on the planned Election Automation.  Well, the report said that the government is open to the possibility that the proposed automation will not happen in the 2010 National Elections, and that they are still preparing if in case the elections will be done manually again.

The reason for this is because all the bidders got disqualified during the pre-bidding.  Bandila listed a handful of companies that bid for the automation, and said that this bidders failed to submit all the bidding requirements, hence, they were disqualified.  I guess the Government is really double checking everything this time to avoid anomalies in the future, just like what happened in the previous biddings (e.g. ZTE and Agricultural products). 

Anyway, what we can do is to be patient for this.  Biddings are really a  pain in the a**, so we can't do anything about it but to wait and see.  These requirements are not easy to get.  Tax clearance, annual ITR, and Statement of Accounts, which basically proves the same thing -- you're a taxpayer!  Then there's the sworn statement of compliance to Implementing Rules and Regulations, Certificate of Authenticity, and other papers that needs to be notirized.  Then copies of your accreditation, business permit, certification from DTI, certification from PhilGEPS, and your outstanding and/or past contracts.  If you lack just one of these requirements, then say goodbye to the bidding.  Really troublesome!  But even so, these requirements are there to ensure the company's credibility.  I just hope the right bidder will win.  I mean, we're talking about our future leaders here.  So goodluck to the people, and goodluck to Philippines' IT Industry.. =p


Tuesday, May 5, 2009

Having A Headache - Ranting Again...

Well, where should I actually start? I just want to rant (again) about my cousin.  I've posted before a rant about her, and thanks for those who sympathized.  But here she goes again.  If before, it was just me.  Nor, it's the whole family against her, and we can't do anything because of our father.

My mom isn't getting any younger, and our youngest is still too young, still in the first year of high school this coming June.  And so, my siblings and I are doing our best not to give her any problem.  But this LOVELY cousin of ours is, on contrary to us, doing her worst!!!  She doesn't respect our mom at all, and she acts like everything in this house is her own.  Can't she consider for a second that she's just living here (also) just by HER request???  I mean, even us, our parents' own kids, don't act as if we own everything here.  Geesh!

Okay, what she did this time?  During my brother-in-law's birthday, she had a talk with his sister, whom he enrolled for college here in NDKC.  Well, we thought it triggered her envious intentions again, that in the morning the next day, she approached our mom and told her, "Te, mu-eskwela NA LANG ko".  And by that statement, Mama thought, she isn't really serious or even willing to study..because of the fact that she used "NA LANG".  And in the first place, cuz already refused to study.  Yet, when my brother-in-law's sister plans to study here, cuz goes saying she'll study!  What does she think about college???  It's not easy, we all know it.  Aside from the workloads in studying, we still have to worry about money.  It isn't something that we just pick up anywhere we want to!  Does she really think it's easy for our parents to support a college student, and yet will be wasted when the one they're supporting to will just stop?  Does she reallyl think we're rich??? She doesn't have common sense, I'd say. *sigh...Mom, of course, didn't want any trouble so she just didn't speak.  And of course, because Mom got offended, she didn't tell to our father about her decision to study.  If she wants to, she's the one who should tell father.  But of course, the damage has been done to our mom.  She's really hurt, everyone knows it except cuz and our father.

Next incident is about the fruit seedlings.  Cuz approached papa nights before we went to Sirawan.  She asked if she could have some hills of fruit seedlings (which is from what I remember, costs around P50 each budded seedling).  She asked! She didn't buy!!!  My father, not knowing about her plans, thought that the seedlings will be for her sister Hilda (for her new house in Inawayan) and allowed her to TAKE some.  Then the day after, mom told us, she went at our backyard and chose seedlings from the pile, not even saying a word to our mother, who was also busy rearranging the rubber seedlings. Not even a simple "Te, manguha ko ha.  Nananghid na man ko kay Uncle".  Talk about respect!!!  So my mom got offended again.  Even when she saw my cuz was getting direct seedlings and not budded, Mom didn't say a word.  She was so pissed off.

The day came and started loading the seedlings in the pickup.  Papa saw that those were not budded, so he sort of scolded mom.  He replaced all direct with budded ones (don't forget that it costs P50 each not so long ago, so now it will maybe run to P60 or P65 each budded seedling).  I don't know how many hills, but it was plenty.  When we arrived there, she unloaded the seedlings in their house and we left her there.  We went straight to our aunt's house.  Later that day, a tricycle arrived carrying the seedlings we just brought.  My father was a little shocked when she told him that she GAVE the seedlings to their neighbor (and not to Hilda whom Papa thought will receive the seedlings).  You judge what she just did!

So right now, the whole family (except maybe for Papa) is againsts her.  My mom always tells me and my sisters, she wishes our cuz will leave.  We can handle the chores here anyway.  Besides, we won't be having any headache.