Tuesday, November 12, 2013

How are you, Air Canada?!

About 20 years ago, my 1st flight with Air Canada, I still remember that's Dec 8, a very cold winter day, ground covered with all snow. I arrived in Edmonton, but I lost one of my bag with bottles of expensive Chinese Mao Tai if you know some liquor from China:). That time my spoken English and listening are so limited, but I had to communicate with Air Canada to get my bag back. After a few weeks my bag was dragged to my apartment and finally I got it back even though the Mao Tai was opened, I guess it was checked by some officer:(

1996 I went to my home town through Shanghai with Air Canada, my home town is about 6 hours bus from Shanghai at that time without highway yet. Again I lost one new luggage, which I just bought for this trip. I left my home town contact information and went home; a few days later my new luggage came dirty on crowded bus, mot much complained, I felt fortune to get it back in just a few days.


2005 I visited China with whole family by Air Canada and again we missed one luggage on the way back to Canada! After a few month registering case on Air Canada website and talking to agents, I almost had no hope to get my luggage back (only compensation by Air Canada is $100!). Well, it was finally located and sent it back to me. When I opened my out-of-shape luggage, most gift/stuff was squeezed. Well, what can I say, it came back after a few month travelling around world, I wish I could did this free travelling!

Until now such losing luggage experience gave me a big stress every time I travel with checked luggage, I was so worried and always triple check to make sure I keep those luggage receipts in case any luggage gets lost. Recently I travel to China a lot to visit my parents and I believe Air Canada improved the process about the checked luggage, but unfortunately I encounter some new headache about cancelled and delayed air flights.

This Summer (2013) we booked tickets with Air Canada and we were stuck at Vancouver! That evening all passenger were on board and airplane is driving out and ready to take off, after 30 minutes waiting Captain told us there were some air-conditioning issue to fix before taking off. So we were patiently waiting and then were told that airplane had to go back for checking, shortly after reaching the dock we were notified to get off and wait inside. Soon it announced that the flight cancelled.

What a chaos and we had some miscommunication and finally whole family ran to some hotel outside airport in the Vancouver city at 2am in the morning and had to get back airport for re-check-in for another airplane departing at next day 9am. A lot of passenger were mad, especially those with connection flights, one of lady was so upset and ask all of us refuse to aboard, but nobody listened to her, since everyone was so tired and wanted to leave as soon as we could and got over with this. I was pretty sad to see that lady was screaming and kicking the coupon paper which Air Canada offers for this chaos, it's 15% off next purchase, come on, I don't think that lady will take Air Canada again:(




We were glad to take off next day and arrived safely in Beijing even it's was 12 hours delay, I have sympathy for those who missed next connecting flight, train or bus. When coming back the flight was delay again! We were late at Vancouver, and could not catch the booked flight to Edmonton. This time we were experienced with no panic and we were staying in the Fairmount hotel inside Vancouver airport, not bad, my daughters were excited to stay this nice hotel for a few hours.

That's my stories with Air Canada, I just want to say Air Canada, how are you doing? I wish you getting better and I heard news doing well. Do I ride with Air Canada again?

Yes, I think so, there are many reasons, just to speak a couple :))
1. I am a Canadian, hohoho
2. I just know a high school classmate, working at Air Canada Montreal office, Mr Yu, hahaha
......

Do I choose Air Canada if there is other option? I don't know honestly....

Monday, October 7, 2013

UTF-8 without BOM

I promise this post will be good:)

A while ago set up a group forum using phpbb, overall phpbb3 is not bad even though it lacks of some popular features and you need some module for some popular features.

As more and more posts on our forum, I thought it might be a good idea to mark those posts with over a certain number of views. I checked and phpbb3 comes with popular topic based on posts, I want to have popular posts based on views.

Thanks and hates to http://startrekguide.com/mods, I found that some simple update of a few php files could get what I wanted:)) since I am so lazy and web stuff is just one of my hobbies. Why I hate? After I followed the instruction to update those files, I found the crazy warning about "Cannot modify header information - headers already sent by (output started t /includes/acp/acp_board.php:1)"!

What the heck? I changed file back (didn't save a copy since I was thinking those changes are so simple:(). Still same error pops up, double checked the space, commas, etc, still same error! It gets me frustrated, so I decided to change configure php file (even it says don't touch this file:( ) to uncomment the debug mode line to see what's really going on. Damn, even worse, whole phpbb forum is not running!

Thanks to the Internet search, sounds like I was having some encoding type issue, I edited those files in notepad to make sure same as UTF-8, but still same thing! Searched again, I was educated that I need to save as UTF-8 without BOM, the notepad doesn't have this option so called BOM:(

After downloaded notepad++ and edit the files and applied the changes according to http://startrekguide.com/mods, now I havd to say thanks. After that everything was working properly:)

I thought I should write this out and again LONG LIVE INTERNET SEARCH! (mostly google or baidu?:))

Byte order mark

From Wikipedia, the free encyclopedia
      
The byte order mark (BOM) is a Unicode character used to signal the endianness (byte order) of a text file or stream. It is encoded at U+FEFF byte order mark (BOM). BOM use is optional, and, if used, should appear at the start of the text stream. Beyond its specific use as a byte-order indicator, the BOM character may also indicate which of the several Unicode representations the text is encoded in.[1]

Thursday, August 29, 2013

ORCL - FORMAT_ERROR_BACKTRACE

Having a few packages to send email around, often I find exception error is hard to trace since I was just using SQLerrm function in exception, which only shows the error without telling the source.
1st I thought I could look for ways to find where exactly the error occurs, such as showing function/procedure name, then after a little online search, I found dbms_utility package has a nice function: FORMAT_ERROR_BACKTRACE, which displays the error line number, better than function/procedure name!
 
This procedure displays the call stack at the point where an exception was raised, even if the procedure is called from an exception handler in an outer scope. The output is similar to the output of the SQLERRM function, but not subject to the same size limitation.
Syntax
DBMS_UTILITY.FORMAT_ERROR_BACKTRACE 
  RETURN VARCHAR2;
Return value
 
NICE! Also if you want to look at full error stack, check FORMAT_ERROR_STACK function.
 
To use, just simply add such line (red) as the below:
 
EXCEPTION
    WHEN OTHERS THEN
      dbms_output.put_line (dbms_utility.FORMAT_ERROR_BACKTRACE);
      V_MSG_SUB_ERROR := V_MSG_SUB_ERROR;
      V_MSG_ERROR     := V_MSG_ERROR || SQLERRM || '
' || dbms_utility.FORMAT_ERROR_BACKTRACE || V_MSG_SIG;
      UTL_MAIL.SEND(SENDER     => EMAIL_FROM,
                    RECIPIENTS => EMAIL_ERROR_TO,
                    CC         => EMAIL_BCC,
                    SUBJECT    => V_MSG_SUB_ERROR,
                    MESSAGE    => V_MSG_ERROR,
                    MIME_TYPE  => 'text/html');
  END;

"In a real-world application, the error backtrace could be very long. Generally, debuggers and support people don't really want to have to deal with the entire stack; they are mostly going to be interested in that top-most entry. The developer of the application might even like to display that critical information to the users so that they can immediately and accurately report the problem to the support staff. In this case, it is necessary to parse the backtrace string and retrieve just the top-most entry." - by Steven Feuerstein 
 

Friday, April 19, 2013

Home 2 routers with 2 ssids

We had the Cisco Linksys router at home for quite time, maybe 2,3 years. Since we moved into the current house, the upstairs wireless singal is kind of weak, especaily for Dell/HP laptops. So I decided buy a new router.

After some homework, I bought WestDigital Mynet N750, was thinking about N900 with DLNA support and 7 ports, but the comments on N750 looks better than N900. Anyway, I may check out N900 later some time, so far N750 singal is pretty good.

With 2 routers I have now I decided to setup 2 routers with 2 ssids, one is for N, one is for mixed B/G since I am still using 1st Gen iPod (ancient, isn't it?) and a HP mini laptop (very slow).  Even though my network skill is very rusty, but I thought it should be easy to set up.

Pretty easy to set up and the old iPod is connected to the 2nd router, obtaining right IP address, just could not get into Internet complainting about DNS problem, then set the DNS to the 1st router default gateway. Then it is all working:). This reminds me of old days when I was taking Network Specialist courses.

Some key points I could think of:

Any router had external and internal IP address, internal IP is easy and most time is just DHCP, external IP is what ever the IP talking outside the own network, for 2nd router the external IP is the IP within 1st router range, and for 1st router is the IP with my Internet Service Provider network range.

DNS is just like chain pass from internal to external, from router 2 go to router 1, then router to ISP DNS server to find real route to the web pages you want to see.

And also dont forget the 2 routers are in different subnets (1.1 and 0.1, you can do whatever number you want, just keep 192.168 or if you prefer the other private network start with 10 and 172).

Here is the diagram of my home network of 2 routers with 2 ssids:)

Next I will talk a bit about the hot DLNA topic.



Tuesday, March 19, 2013

Joomla or Wordpress

Doing some web site revamp recently, and amazed by the easiness and friendless of making website and there are so many nice templates you could choose, too many choice.

Looks Word press is very popular and I did get one for one of my clients, and will make it ready for themselves to update the content. For Joomla, was working with it before, and seems more complicated and powerful than Word press.

For my next project, I would like to choose Joomla if I could get the template I like. Now start to clean our hosting site stuff, so many blog/forum when I was testing. I would like to have one good forum package well support multiple languages such as English and Chinese.

Over all, here is a nice way to decide if you have difficult to choose which one:
(picture from http://www.sitepoint.com/ and thanks!)

Just now working on 2 templates, one is WordPress, one is Joomla, WordPress is OK to apply the dump.sql, but Joomla is a pain when dealing with different version. If I have time, I will definitely create my own template instead of buying. The version compatibility of Joomla is sure a pain.

Thursday, March 14, 2013

Confucius and Confusion

Sounds really funny, since I was very young I am a confused boy, very puzzled and bewildered, but never lost for what I want.

I am confused by the life, the meaning of life, and think the world is full of confusion. That's why I picked confusion as my nick. Then I tried to find the adjective for confusion and I don't like confusional(?), so I decided to use confusious(even though no such word), then people are thinking I was wrong and should be confucius. Well, should I change this to the famous ancient great Master Kong? Let me know your answer:)

Confucius Says (子曰)is so profound, and let's review the Top 10 quotes from Master Kong (so many and I just pick what I like:):

Just a thought: I have to say sorry to Master Kong, since in the end he was confused and failed. The Only savior is Our Lord! Don't you agree?!

1. “Never impose on others what you would not choose for yourself.”

己所不欲,勿施于人。

2. “Real knowledge is to know the extent of one’s ignorance.”

知之为知之,不知为不知,是知也。

3. “Keep what you say and carry out what you do.”
言必信,行必果。

4. “A gentleman sets strict demands on himself while a petty man set strict demands on others.”

君子求诸己,小人求诸人。

5. “The Superior Man is aware of Righteousness, the inferior man is aware of advantage.”

君子喻於义,小人喻於利。

6. “The gentleman wishes to be slow in speech but quick in action.”
君子欲讷于言而敏于行。

7. “When I walk along with two others, they may serve me as my teachers.”

三人行,必有我师焉。

8. “He who learns but does not think, is lost. He who thinks but does not learn is in great danger.”

学而不思则罔,思而不学则殆。

9. “He that would perfect his work must first sharpen his tools.”

工欲善其事,必先利其器。

10. “If you look into your own heart, and you find nothing wrong there, what is there to worry about? What is there to fear?”

君子坦荡荡,小人长戚戚。

太多啦,加一个:有朋自远方来,不亦乐乎?
Is it not delightful to have friends coming from distant quarters?

Friday, March 1, 2013

ORCL - LISTAGG

Very handy Listagg Function
 
During my daily routine, I constantly need to display multiple values for single row, I have to write a few lines of code until the LISTAGG function!
 
Description of listagg.gif follows
 
 
Examples from oracle
 
The following single-set aggregate example lists all of the employees in Department 30 in the hr.employees table, ordered by hire date and last name:
 
SELECT LISTAGG(last_name, '; ') WITHIN GROUP (ORDER BY hire_date, last_name) "Emp_list",
    MIN(hire_date) "Earliest"
    FROM employees
    WHERE department_id = 30;

Emp_list                                                     Earliest
------------------------------------------------------------ ---------
Raphaely; Khoo; Tobias; Baida; Himuro; Colmenares            07-DEC-02