Thursday, January 31, 2013 #

I'm back and here what I've been doing!

Hey guys, 

Sorry that I've not been updating my blog for quite some time now, as I've been rather busy a work in my ex company. I didn't even have time for my family, not to mention about blogging!

Phew! Luckily I quite and joined this new company (I don't want to disclose too much to avoid any unnecessary troubles, heh!) and I'm thrown into a whole new ground, which I'm requested to really work on enhancing the existing PHP systems, running on Apache and MySQL. That's great! I've been fiddling with them since my polytechnic (college equivalent) time (but never really working on any serious project from scratch). Now then I was given this task right from the beginning, which is a good learning opportunity for me.

Later on, I was told to attend both SharePoint and Spring.NET courses. And right before everything kicks off, I was requested to attend the CIE from Microsoft on SharePoint 2013 and Office 2013. Well, quite a lot of new and cool stuff, but not enough to blow my mind away yet, moreover, the presenter was not given enough time to touch on other new features too (which I seriously think so). 

Then right now I was almost reaching the end of my Sprint.NET course run by VMWare Singapore on the Core Spring.NET, and hopefully it would be beneficial to my work (which one of my colleagues already roll out something based on that). Quite an intensive course, and instructor is really flying through course materials with us, and skipping some not-so-important lab exercises. 

I guess it's time for me to explore and study more on Spring.NET during my free time. Seriously, I didn't find myself absorbing enough stuff for brain digestion later, everything is returned to the instructor after the day. Oh yeah, my instructor is Nik Trevallyn-Jones, not sure any of you know him? I personally find him technically strong and knowledgeable in Spring.NET and other technologies and programming languages. But the stuff is still not so easy for me, due to the 4-day course to cover everything Core Spring.NET. Oh gosh....

How you guys been doing?

Any suggestions on picking up Spring.NET and the implementation of it? 

Do let me know. Right now I'm reading the online and PDF versions of the documentation of Spring.NET ;-)

Posted On Thursday, January 31, 2013 9:18 AM | Comments (0)

Thursday, December 6, 2012 #

Open Source MariaDB, the MySQL fork to replace MySQL?

Frankly speaking, I’ve been out of touch with the Open source world for quite some time. Until recently, after I’ve joined the new government agency, I managed to do some research while given time to learn new technologies and languages.

I started reading tech blogs and tech news again (since I’m not as busy as before where I need to rush for project deadlines in and out), and I spotted this MariaDB that really attracts my attention, this is the link to ZDNet article - http://www.zdnet.com/open-source-mariadb-a-mysql-fork-challenges-oracle-7000008311/ Open-Source MariaDB, a MySQL fork, challenges Oracle

Yes, you’re right, MariaDB is a MySQL fork, and as mentioned in the article, MariaDB is run by the founder of MySQL, Michael ‘Monty’ Widenius, and he claims MariaDB is faster, more secure and has more features than MySQL. I’m actually very excited to know that the code is maintained by the same dedicated core team of MySQL in the past 18 years. They even bother to form a foundation, the MariaDB Foundation, to promote MariaDB.

Already, there’s a lot of open source software officially supporting MariaDB, such as  Drupal, Jelastic – Java in the cloud, Kajona, MediaWiki, phpMyAdmin, Plone, SaltOs, WordPress, and Zend Framework. But the hosting service provider might not be readily supporting MariaDB in their hosting solution.

Time will tell whether MariaDB would be the real replacement for MySQL, I’m sorry I don’t think I should use alternative here ;-)

For more information, please visit MariaDB official site.

Posted On Thursday, December 6, 2012 3:44 PM | Comments (0)

Wednesday, December 5, 2012 #

New Working Environment Starting November

This is actually a post dated update. After I’ve been working in the private sectors for so many years (the 2 years when I was working as IT trainer in a secondary school is not counted, as I was working under a contract with a private IT training agency), I’ve decided to try my luck into public sector. And fortunately, I passed the interview and I was offered a position of Web Administrator in a government statutory board, that’s Agency for Science, Technology and Research (of Singapore).

During my previous employment with a Japanese MNC (multinational company), it was a totally new environment for me, as I had never worked for a Japanese company before, but the first time I work for Japanese company also gave me the very first nightmare I have with them, and vowed not to work for them anymore, and any other Japanese companies. No doubt I have freedom of choosing the tools and methods I wish to use for the projects, but the project management is simply too messy and out of order. And a lot of time, I don’t find that everyone is working as a team, more like achieving their own goals. Accountability for project is not shared, all lumped onto the shoulders of the developer in charge (they called it Software Engineer). I was working on a windows based .NET project, which I already voiced out that it’s not manageable by just 1 software engineer, but it seems like nobody cares, even the one who propose the solution to customer doesn’t care much. What he cares is whether you deliver the project on time so that he can please his customer and the senior management of his good work.

Too many stories to tell, and I just simple doesn’t want to talk too much on this as it has already became the past to me. With my new title with the government agency, I hope to contribute my best to them, while learning as much as I can.

I will share whatever I can on technologies, methodologies, and etc whichever I’m allowed and permitted to (of course, for those non-work-related stuff, I would be glad to share with you without much hesitation).

Thank you!

Posted On Wednesday, December 5, 2012 9:35 AM | Comments (0)

Tuesday, August 23, 2011 #

Upgraded to Firefox 6

Not sure am I slow in doing so? But today I just fire up my Firefox and immediately I receive a prompt to upgrade my Firefox 5 to 6. Here is what I seen after successfully upgraded it.

Nothing much special, but i appreciate the good work. But I guess you might notice some changes on the screenshot too.

Enjoy!

 

The Up-to-date page after successfully upgraded to Firefox 6.

Firefox 6 Upgrade Successfull Page

And this is the Add-on manager

Firefox Add-on

Posted On Tuesday, August 23, 2011 1:20 PM | Comments (0)

Thursday, August 4, 2011 #

[JavaScript in ASP.NET] How to convert the input date to Julian Date for Date Comparison?

I often find it hard to convert a date string into the date I desired. I'm not sure is it only me or any of you encounter the same problem before. Whenever I tried to do something like:

var myDate = new Date(dateString);

I will always get Today's date, instead of the value i stored in the dateString variable. And most of the time, when people show you sample codes on how to make comparison between date string by converting them into Date, it normally won't work for me.

One of the reason could be I actually get the date string as dd-MMM-yyyy format, for example, if today's date is 4th August 2011, I will get 04-Aug-2011, that's for easy reading. What if you have a Jan 5, 2011 displayed as 05-01-2011, so without knowing the locale, what is your guess? Is it Jan 1, 2011 or May 1, 2011? So 05-Jan-2011 would be clearer if your actual date is Jan 5, 2011.

My methods involve more steps, but at least it's working for me.

This is what I did in the <script> block of my ASP.NET Source:
        
   //I actually put this in a function
   var toDate = document.getElementById('ctl00_ContentPlaceHolder1_txtDateTo')

            var frmDate = document.getElementById('ctl00_ContentPlaceHolder1_txtDateFrom')

            var today = new Date();

            Date.prototype.getJulian = function() {
                return Math.floor((this / 86400000) -
                (this.getTimezoneOffset() / 1440) + 2440587.5);
            }
   
   //To convert from a Date variable, it take more steps, if I try to reduce the steps
   //it will give me the value NaN. I noticed I can't do it this way:
   // var tmpToday = today.format('dd-MMM-yyyy');
   // var julToday = new Date(getDate(tmpToday)).getJulian();
   // These 2 lines are what get me a 'NaN' value
   
   //The actual working codes
   var tmpToday = today.format('dd-MMM-yyyy');
            var tmpjulToday = new Date(getDate(tmpToday));
            var julToday = tmpjulToday.getJulian();
   
            var julToday = today.getJulian();

            var tmpFromDate = new Date(getDate(frmDate.value));
            var tmpToDate = new Date(getDate(toDate.value));

            var julFromDate = tmpFromDate.getJulian();
            var julToDate = tmpToDate.getJulian();
   //End of the function
   
  //Function to convert Date format to M/d/Y format 
  function getDate(inputDtStr) {

            var pos1 = inputDtStr.indexOf(dtCh)
            var pos2 = inputDtStr.indexOf(dtCh, pos1 + 1)
            var strDay = inputDtStr.substring(0, pos1)
            var strMonth = inputDtStr.substring(pos1 + 1, pos2)
            var strYear = inputDtStr.substring(pos2 + 1)
            strYr = strYear

            switch (strMonth) {
                case 'Jan':
                    strMonth = "01";
                    break;
                case 'Feb':
                    strMonth = "02"
                    break;
                case 'Mar':
                    strMonth = "03"
                    break;
                case 'Apr':
                    strMonth = "04"
                    break;
                case 'May':
                    strMonth = "05"
                    break;
                case 'Jun':
                    strMonth = "06"
                    break;
                case 'Jul':
                    strMonth = "07"
                    break;
                case 'Aug':
                    strMonth = "08"
                    break;
                case 'Sep':
                    strMonth = "09"
                    break;
                case 'Oct':
                    strMonth = "10"
                    break;
                case 'Nov':
                    strMonth = "11"
                    break;
                case 'Dec':
                    strMonth = "12"
                    break;
            }

            if (strDay.charAt(0) == "0" && strDay.length > 1) strDay = strDay.substring(1)
            if (strMonth.charAt(0) == "0" && strMonth.length > 1) strMonth = strMonth.substring(1)
            for (var i = 1; i <= 3; i++) {
                if (strYr.charAt(0) == "0" && strYr.length > 1) strYr = strYr.substring(1)
            }
            month = parseInt(strMonth)
            day = parseInt(strDay)
            year = parseInt(strYr)

            var dateVal = month + "/" + day + "/" + year

            return dateVal

        }
  
Why I need Julian Date function? That is because, if I just get the today.getJulian(), and compare with frmDate value, I would always get the result that my frmDate value is earlier than today's date, even though I actually set the frmDate value to be the same as Today's date. Why? Because when you declare a new Date() variable, it actually includes the timestamp, so when you use getJulian() on it, it will get you the Julian date numeric value including the timestamp, which is of course always earlier than your formatted date, e.g. 04-Aug-2011, which is without the timestamp.

Do you have better solution? Please kindly share with me and the rest and we shall make this solution available to everyone who needs it!

Enjoy!

Posted On Thursday, August 4, 2011 5:18 PM | Comments (0)

Thursday, July 7, 2011 #

Some Go Resources and Tips to Share

...Continued from the previous post.

   

If you all are keen, and if you want to play real-time on iPhone with other players, you can download this Panda-Tetsuki client from AppStore, it connects to IGS server, and allow you to play with other players.

   

For those keen on playing on computer, try http://www.gokgs.com/ or 1-day per move (you can make more moves, if your opponents also response to your moves within the same day) mode – http://www.dragongoserver.net or http://nwgo.braindog.org/

   

If you are comfortable with Chinese interface, you can play at http://weiqi.sports.tom.com and this site is very popular and a lot of good players (also a lot of bad players, not that they play badly, it's the they bully weaker players, some high-dan players create low kyu account to crush weak players too, they call those players as landmine), and sometime you see pro players giving lessons there, otherwise, try http://www.eweiqi.com , or http://weiqi.sina.com.cn (and of course, there's free online learning materials on http://weiqi.sports.tom.com too, it's in Chinese. )

   

eWeiqi has less landmines though. But Tom is a more popular Go server.

   

There is one Go server that integrates multi-country servers into one (sort of link them up in a Go network), and everyone get their own Country segment, while also able to play with players from other countries, it's a collaboration between China, Japan, and Korea. Chinese and Korean servers normally have a lot of strong players. (It could be Sina server, I can't really remember)

   

If you follow the modern Chinese Go development, you will noticed that there's someone like "Sai" in "Hikaru no Go" that plays on the Internet before, he had beaten all the pro players playing online (for those Chinese pro players who did play Go online), and no one knows who is he yet, and he also disappeared out of sudden after creating a lot of hoo-hah in Go world.

   

By the way, those Go games played in Hikaru no Go are actually the real game records of those professional Go players, it's not fictitious. Here's the list on Sensei's Library (http://senseis.xmp.net/ a good English resources for Go):

   

http://senseis.xmp.net/?HikaruNoGo%2FGames

   

(Note: as indicated in the list, a few games are unidentified yet, maybe if they asked the author of the Hikaru No Go and/or Umeza Yukari they might know it better)

   

And lastly, if you can't get your opponent to review your games, and you can't find anyone else do review for/with you, you can request for a review here:

   

http://gtl.xmp.net/services/requestreview/

   

Enjoy and have fun learning and playing Go!

   

Find me on KGS or Tom, if I'm available, we can play a bit, nick on these two servers is mychew. Nick used on IGS is jenson, so do Dragon Go Server (http://www.dragongoserver.net) and Northwest Go Server (http://nwgo.braindog.org).

   

I've temporarily shutdown my Go forums, will try to create a new one again using different forum engine (as the previous one give me a lot of problems in terms of forum maintenance). And I have a Go room in KGS, it sounds a bit odd and funny though, and it happens to be the name of a green tea canned drink company too - Heave & Earth Go Club. It's under the Club category.

Posted On Thursday, July 7, 2011 10:17 AM | Comments (0)

Tuesday, July 5, 2011 #

My Journey with Go and Programming

My dear fellow programmers/developers, how you kill your time while you're not coding? Some people go jogging, some listen to their favourite tracks, some catch movies, some read, and the list goes on and on.

   

For me, one of the stuff I enjoy doing is Go. So what the heck is this Go, you may ask (of course if you're already playing and enjoying it, you won't need to ask me). Go is an ancient board game carrying the 5000 years history with it, while still keep getiing improved on the rules and styles of game opening, counterattacks, and etc. It's a board game played by two players, one of them playing with black stones, and another white, with black playing first.

   

Just why so much fun with Go? Why bother about knowing this since I'm not interested? Well, I guess you will get hooked to it once you start learning the beauty of Go, and the fun of indulging in games with others. It's played on a board with 19x19 grid lines. I won't tell you too much of the nature of it and the gameplay, as I will be listing out some great sites for you to explore.

   

It's more fun when you explore more on your own, isn't it?

   

I started learned about the existence of this game since childhood. That's when I was watching drama series from China, and I found the game interesting and fascinating. But nowhere near my place has people playing it or selling the game set. Maybe it's just not as popular yet. So I ended up learning Chinese Chess, which I enjoyed playing it to a certain extend, and even challenge classmates and neighbours. And later on, I get bored with it, and my friend introduce me to a world of Chess (International Chess), and I get hooked up to Chess very quickly. I even participated in inter-school tournaments, which later on had my interest spread to District Level, and finally founded our very first Chess Club in school. Well, we managed to get a teacher-in-charge and quite a number of new members. We even organized our very first Inter-Class tournaments. But due to it's close to year-end and getting near to our final year exam, the school has suggested us to postpone the tournament.

   

Soon, when I was in high school, my younger brother, who introduce me to a Japanese comic series, Hikaru No Go and get me addicted, as I finally can get my eyes on a comic that's talk about Go. Thanks to my father, who bought us a computer, and connected to Internet, we managed to search for Go online. To our surprises, there are a lot of Go resources available in both English and Mandarin.

   

Since then, my interest has made me dedicated my time to Go, and I reach the stage where I almost flung my high school studies, and spending most of my time in studying Go. I gotten pretty excited when I know a friend who gave me a set of Go board with stones from China. I began my journey half on Go board, half on computer Go board, and getting all my learning materials printed off from Internet.

   

When I went to college (Ngee Ann Polytechnic in Singapore), and I began astounded by the power of Internet speed there, and having gotten myself a notebook, which is a must for IT students, I started sourcing for not only PDF books but also SGF format "books" and game records, as well as other ebook formats to learn how to play Go. Until one day, the friend (I regard him as an elder brother of me) rang an alarm and asked me to stop playing and focus on studies if I were to continue be friend with him. So I heeded to his advice and no longer learning Go. Until I finally graduated, I started in touch with Go once again.

   

I ended up knowing a friend from Taiwan, and have him gathered a series of Go learning books used in China and so-called for training kids to be professional players, my brother brought it back from Taiwan for me, during his trip there. So I ended up learning Go again after many years of no-Go days. It has been about 6 years I never learn or play any Go. Then I finally setup Go forums for Chinese and English speaking players, and requested a Club Room on KGS (Kiseido Go Server - http://www.gokgs.com/) and started having a lot of players playing inside the room. I even play in office with my fellow co-workers and teaching them the basics.

   

And then I changed job and play alone, but I enjoyed myself pretty much interacting with various level of players, and we even have joined Hong Kong room invitational friendly tournaments, though we lost, that's a great experiences to everyone.

   

However, due to my part-time degree studies, I once again give up Go for a few years until recently I'm quite confident I wont be distracted by Go and would in fact helps in my studies, and I picked up Go from scratch again, and spread my love in Go to colleagues. And I started watching the anime of Hikaru No Go again, and getting very involved.

   

Due to my busy schedule, I seldom play on KGS now, but I will try to spend some time over every weekend (if I'm free) to play some games of Go. I play on those 1 move per day Go server like Dragon Go Server (http://www.dragongoserver.net) and Northwest Go Server (http://nwgo.braindog.org) most of the time. It's still fun for me, even though I make more mistakes now, and lost quite a number of games.

   

Playing Go not only kill time and train my mind, it also helps in my studies and my work as a programmer, try it and I'm sure you'll love it!

Posted On Tuesday, July 5, 2011 3:28 PM | Comments (0)

Wednesday, June 22, 2011 #

[AJAX Numeric Updown Control] Microsoft JScript runtime error: The number of fractional digits is out of range

If you have been using Ajax control toolkits a lot (which I will skip the parts on where to download and how to configure it in Visual Studio 2010), you might have encountered some bugs or limitations of the controls, or rather, some weird behaviours. I would call them weird behaviours though.

Recently, I've been working on a Ajax numeric updown control, which i remember clearly it was working fine without problems. In fact, I use 2 numeric updown control this time.

So I went on to configure it to be as simple as possible and I will just use the default up and down buttons provided by it (so that I won't need to design my own). I have two textbox controls to display the value controlled by the updown control. One for month, and another for year.

<asp:TextBox ID="txtMonth" runat="server" CssClass="txtNumeric" ReadOnly="True" Width="150px" />

<asp:TextBox ID="txtYear" runat="server" CssClass="txtNumeric" ReadOnly="True" Width="150px" />

So I will now drop 1 numeric updown control for each of the textboxes.

<asp:NumericUpDownExtender ID="txtMonth_NumericUpDownExtender"
    runat="server" TargetControlID="txtMonth" Maximum="12" Minimum="1" Width="152">
</asp:NumericUpDownExtender>
                        
<asp:NumericUpDownExtender ID="txtYear_NumericUpDownExtender"
    runat="server" TargetControlID="txtYear" Width="152">
</asp:NumericUpDownExtender>                        
                        
You noticed that I configure the Maximum and Minimum value for the first numericupdown control, but I never did the same for the second one (for txtYear). That's because it won't work, well, at least for me.

So I remove the Minimum="2000" and Maximum="2099" from there. Then I would configure the initial value to the the current year, and let the year to flow up and down freely. If you want, you want write the codes to restrict it.

Here are the codes I used on PageLoad:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not Page.IsPostBack Then

            If Trim(txtMonth.Text) = "" Then

                Me.txtMonth.Text = System.DateTime.Today.Month

            End If

            If Trim(txtYear.Text) = "" Then

                Me.txtYear.Text = System.DateTime.Today.Year

            End If

        End If

    End Sub
 


Enjoy!

Posted On Wednesday, June 22, 2011 3:14 PM | Comments (1)

Monday, June 13, 2011 #

Having Problem with AJAX ModalPopUpExtender?

Recently, when I'm working on a ModalPopUp for my own custom alert with ModalPopUpExtender, I encountered an issue which myself can't explain.

   

Here is what I did:

   

First, I design a panel (pnlPopUp) with a title and message body labels, and then an OK button to close the pop up message.

   

<asp:Panel ID="pnlPopUp" runat="server" BackColor="#FFFFCC" BorderStyle="Solid"

BorderWidth="1px" CssClass="panel" Height="150px"

style="position:absolute; top: 407px; left: 478px;" Width="300px">

<table class="style12" style="width: 100%; height: 100%">

<tr>

<td align="center" class="headerTD" colspan="3">

<asp:Label ID="lblTitle" runat="server" CssClass="PageDispText" Text="Title"></asp:Label>

</td>

</tr>

<tr>

<td class="style21">

</td>

<td class="style22">

<asp:Label ID="lblMessage" runat="server" CssClass="label" Height="100%"

Text="No Message Here" Width="100%"></asp:Label>

</td>

<td class="style22">

</td>

</tr>

<tr>

<td class="style17">

&nbsp;</td>

<td align="center" class="style20">

<asp:Button ID="btnOk" runat="server" CssClass="Button" Text="OK"

Width="50px" />

</td>

<td>

&nbsp;</td>

</tr>

</table>

</asp:Panel>

   

   

Second, I drop a button to trigger the Popup for testing. So I just name it btnPopUp.

   

<asp:Button ID="btnPopUp" runat="server" Text="Show Pop-up" />

   

Next, I drop a ModalPopUpExtender, which I configure it to pop up my pnlPopup when I click on btnPopup. And you know what? It doesn't work. So I'm quite puzzled why is it behaving so.

   

I googled this until I come to conclusion, there's no people facing the same problem. Just before I gave up, I found 1 person facing the same issue, people mentioned about ScriptManger. But well, I did have a ScriptManager, and it's placed in my Master Page, thus, I think there shouldn't be any issue since my Default will use the ScriptManager from Master Page.

   

So, with it still not working (which means, nothing was shown when I clicked on the btnPopUp), I try to change the Popup object to btnPopup and the control to pnlPopup, and you know what happens? It works! So I'm quite frustrated how would this happen?

   

And I went on to replace btnPopUp with a hyperlink control, so the target pop up object is now set back to pnlPopUp, but the control that trigger the pop up would now be a hyperlink instead. And to my surprise, it also works!

   

<asp:HyperLink ID="HyperLink1" runat="server" CssClass="label">Show Pop Up</asp:HyperLink>

   

I really don't understand why is it behaving so weird. Since my Master Page is doing nothing with the Script Manager, so I've decided to remove it, then I will manually add a new ScriptManager for Default.aspx. Now, I tried to set back the PopupControlID to pnlPopUp, and the TargetControlID to btnPopUp, and setup the other properties in the ModalPopUpExtender, and finally it's working perfectly! Of course, you might want to set the background alpha to around 50-70% to create an effect to inform users that the pop-up lockout the background until you get rid of this pop-up alert by clicking on the "Ok" button.

   

<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnPopUp"

PopupControlID="pnlPopUp" OkControlID="btnOk"

BackgroundCssClass="modalBackgroundCSS" >

</asp:ModalPopupExtender>

   

   

You can make use of the BackGrondCssClass to achieve this. Properties you might want to set for the modalPopUp would be:

   

background-color:#fff; /** or #ffffff or any other color you like */

filter:alpha(opacity=60);

opacity:0.6px;

   

 Modal Pop-up Sample

   

Good luck experimenting with ModalPopupExtender and have fun!

Posted On Monday, June 13, 2011 1:05 PM | Comments (1)

Sunday, May 29, 2011 #

Finally MacDailyNews iPhone App is up!

image1196800802.jpgfor those who knows what is MacDailyNews and those who has been following the news from MDN from their iOS devices, great news for you!

Not sure whether this post has came a bit late for me to announce here, but I still want to inform fellow MDN-ers please go get your MDN apps updated.

The screenshot shows what are the changes announced in the update.

Enjoy!
-- JC --

Posted On Sunday, May 29, 2011 10:34 PM | Comments (0)