顯示具有 雜症 標籤的文章。 顯示所有文章
顯示具有 雜症 標籤的文章。 顯示所有文章

2015年5月5日 星期二

linux locale

1. 查詢機器上已經安裝的語系
  •  locale -a
2.編輯 local文件
  • sudo vim /var/lib/locales/supported.d/local
  • 文件中加入 zh_TW.UTF-8 UTF-8
  • 離開vim
3.加入語系
  • sudo locale-gen

後記:
      為什麼要設定local,因為當你 tomcat utf-8 設定都設了,程式也沒問題,html宣告也對了,DB設定也對了,但寫入db的中文不對勁,那就是最底層的linux語系缺少zh_TW.UTF-8造成的。


參考資料:
  • http://tutul.logdown.com/posts/2014/08/13/ubuntu-server-12-04-lts-change-language
  • http://www.arthurtoday.com/2009/11/ubuntu-locale.html

2011年11月11日 星期五

Flex4 TIleLayout 在width 100% 下出現的奇怪的row


<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
xmlns:s="library://ns.adobe.com/flex/spark" 
xmlns:mx="library://ns.adobe.com/flex/mx" 
minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[ 
protected function addItem(event:MouseEvent):void
{ 
var item:Button = new Button();
item.label = String(testContainer.numElements);
item.width = 50;
item.height = 50;
testContainer.addElement(item); 
} 

protected function clearAll(event:MouseEvent):void
{ 
testContainer.removeAllElements(); 
}

protected function clearLastItem(event:MouseEvent):void
{
if(testContainer.numElements > 0)
{
testContainer.removeElementAt(testContainer.numElements - 1); 
} 
} 
]]>
</fx:Script>
<s:controlBarContent>
<s:Button click="addItem(event)" label="add item"/>
<s:Button click="clearLastItem(event)" label="clear last "/>
<s:Button click="clearAll(event)" label="clearAll"/>
</s:controlBarContent>


<s:SkinnableContainer id="testContainer" 
backgroundColor="0xcccccc" 
alpha="0.8" 
width="100%" 
>

<s:layout> 
<s:TileLayout id="tileLayout" 
clipAndEnableScrolling="true" 
paddingLeft="5"
paddingRight="5"
orientation="rows" 
/> 
</s:layout> 
</s:SkinnableContainer> 
</s:Application>


一個解決的方式是繼承TileLayout並override updateDisplayList 如下:
override public function updateDisplayList(unscaledWidth:Number , unscaledHeight:Number):void
  {
   super.updateDisplayList(unscaledWidth , unscaledHeight);
   (target as GroupBase).explicitHeight = Math.ceil(rowCount * (rowHeight + verticalGap) - verticalGap);
  }


詳細內容請參考:http://forums.adobe.com/thread/565055

SWF在google瀏覽器下無法切換輸入法

問題:Flash / Flex SWF在google瀏覽器下無法做輸入法切換
平台: Windows7
瀏覽器:chrome 15.0.874.106 m

解決方法:
1.在chrome網址列中輸入chrome://plugins/打開plugins頁面。
2.點擊詳細資訊
3.在flashPlayer項目中將gcswf32.dll項目關閉,留下NPSWF32.dll啟動。
PS.若你有手動安裝過flashPlayer會有NPSWF32.dll,若沒有到Adobe下載安裝即可。