Google Web Fonts went strange
I have experienced a virtuemart page went very well in the development environment but after it went live, some fonts in the template went strange. That is because the live environment is https enabled and the template is hard code of the css files of Google Web Fonts in the page:
such as:
Code
<link href='http://fonts.googleapis.com/css?family=Oswald&v1' rel='stylesheet' type='text/css'> |
Well, that is not hard just two lines of PHP codes
Firstly, we should check whether they are in https site
Code
$httporhttps = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; |
Then, we change all font css reference like this:
Code
<link href='<?php echo $httporhttps; ?>fonts.googleapis.com/css?family=Oswald&v1' rel='stylesheet' type='text/css'> |
Finally, the fonts will display correctly
IPhone 5 in Brisbane
Yesterday, I went to Vodafone Shop in City. I found they have iPhone 5 and the salesperson gave an iPhone 5 to me. I tried to use it for a few minutes. That is very light and sounds a bit lighter than my S3. Moreover, I found it has OLED, the color is sharper too. Generally, that is great, but the price is very expensive. I checked the basic plan is $30 per month and $18 for phone per month. For "$0 Phone" plan, that is $80 per month. That is a lot!
Samsung Galaxy Note II
Recently,Samsung has released Galaxy Note II. I watched the promotion video from Samsung. That is so great! It looks like a BIG version of Galaxy S3. But it got a newer Android version. Moreover, it has a bigger screen too! I think that will be better for reading and watching video. I hope I can have a real one now. But now, I only can watch the youtube video.
Multi-APKs in Developer Console - Android
I got the notification in Developer Console. It supports Multi-APKs. You can have each apk to each:
- version of Android
- Screen Size
- CPU architecture
That is very helpful. I was considering to build a new version for Android 4.0 and put it into a new apps, e.g. AdvGenToDoV4. Now, I can put it into the original app. That is the better way to organize.
JSON in WCF
A lot of people know about WCF supports XML as the return response. Actually, it supports JSON. All you need to set ResponseFormat.
Code
[WebGet(ResponseFormat=WebMessageFormat.Json)] | |
[OperationContract] | |
public SessionKeyDTO Authenicate(string username, string password) |
And you need to set web.config
Code
<behavior name="AdvCMS.Services.Service2AspNetAjaxBehavior"> | |
<webHttp/> | |
<enableWebScript /> | |
</behavior> |
It needs <webhttp/>. That is easy!
The code is a part of our CMS, AdvGenCMS.

