2013年12月25日 星期三

lubuntu手動升級

不知道為什麼軟體升級圖形介面都開不起來
用下面指令手動更新
do-release-upgrade -d

Ubuntu增加user至group


  1. useradd username   //新增user
  2. useradd -g groupname username   //新增user至群組
  3. groupadd groupname  //新增群組
  4. usermod -a -G groupname username   //將user增加至群組

2013年12月19日 星期四

將project從Ubuntu搬到Debian, compiler出現libc.so.6: version `GLIBC_2.14' not found錯誤

因為使用的lubuntu環境都有些小bugs
更到最新版可已解決但是又會出現其他bugs
聽說Debian比較穩定, 決定搬家 ^^

把資料直接搬移到Debian, 結果compiler出現問題, 暈~~~
出現下面的錯誤:
libc.so.6: version `GLIBC_2.14' not found
在想說是不是該手動搬glibc-2.14.tar.xz來,
還好Make clean之後再Make就解決了 ^^
看來是兩個環境使用的系統不一樣, 需要重新compiler

2013年12月16日 星期一

lubuntu 13.10不能夠autostart APP

  1. 開啟Start Menu/Preferences/Default applications for LXSession
  2. 到autostart頁面設定Disable autostarted applications為no
  3. 沒有看到Default applications for LXSession, 可先自行安裝lxsession-default-apps
或是
  1. 修改desktop.conf
  2. #disable_autostart=config-only
  3. disable_autostart=no
可在Desktop Session Settings設定要autostart的APP
或在
autostart file內添加自動啟動程式

2013年12月3日 星期二

搬移ubuntu home目錄至另一顆硬碟

  1. cfdisk /dev/sdb                    //建立partition
  2. mkfs.ext4 /dev/sdb1          //format為ext4格式  
  3. mkdir /media/tmp
  4. mount /dev/sdb1 /media/tmp
  5. rsync -avx /home /media/tmp
  6. mount /dev/sdb1 /home
  7. ls -l /home                            //確認是否成功
  8. umount /home
  9. umount /media/tmp
  10. rm -r /media/tmp
  11. rm -rf /home/*
建立自動掛載
#blkid
/dev/sda1: UUID="bba98b54-13c4-49fc-bdb8-998d0d771844" TYPE="ext4"
/dev/sda5: UUID="0ef50f74-032e-4790-bd7b-8e19e770f7ea" TYPE="swap"
/dev/sdb1: UUID="e71eed4f-2188-4f33-a5e1-d76b7e6084f4" TYPE="ext4"

#leafpad /etc/fstab
增加
UUID=e71eed4f-2188-4f33-a5e1-d76b7e6084f4    /home    ext4    defaults    0    2

2013年12月1日 星期日

Achieve Silverlight UI 1

安裝環境設置
1. 安裝 Microsoft Visual Studio 2005.
2. 安裝 Windows Embedded CE 6.0.
3. 安裝 Microsoft Visual Studio 2005 Service pack 1.
4. 安裝 Microsoft Visual Studio 2005 Service pack 1 for Vista (Vista System).
5. 安裝 Windows Embedded CE 6.0 Service pack 1.
6. 安裝 Windows Embedded CE 6.0 R2.
7. 安裝 Windows Embedded CE 6.0 R3.
建置可執行 Silverlight UI 的 Emulator OS
1. 新增 Windows CE project.

2.      選擇 Device Emulator BSP.
3. 選擇所需的 components.
·         選擇 PDA Device for Web Pad type.
·         移除不需要的 components 以增加建造速度.
·         完成 project 的建造.
4. 增加執行 Silverlight UI 所需的 components.
·         須增加 Silverlight for Windows Embedded 及 Image Decoder components.
·         Silverlight for Windows Embedded 為了解讀 XAML 檔案並執行 Silverlight.
·         Image Decoder 可 decode 並協助顯示顯示 Silverlight 所需的圖片.
·         輸入 XAML 搜尋 component.
·         增加 Silverlight for Windows Embedded 及 Image Decoder components.

5. 設置 project 環境.
·         選擇 project Properties 進入設定選單.

·         使用 Release 版本的 OS.

·         支援大於 64 MB 的記憶體.

6. 建置 OS.
·         選擇建置 Release 版本.

·         第一次建置, 使用 Rebuild.

7. Download 至 Emulator.
·         進入 Emulator 設定選單, 並設置為 640 X 480  的解析度.

·         Download OS.

·         看到 OS 畫面.


WinCE6.0 Use Silverlight build up UI

1.      Build up WinCE 6.0 with Silverlight runtime.
2.      Prepare a Silverlight project.
Refer attached files, Achieve SilverlightUI 1.
3.      Silverlight coding steps.
·         XAML runtime initial.
bIsXRInitialized = XamlRuntimeInitialize();
if (!bIsXRInitialized)
 return FALSE;
·         Get application instance.
hResult = GetXRApplicationInstance(&pApplication);
if(FAILED(hResult))
{
RETAILMSG(MSG_FLAG, (TEXT("XAML: GetXRApplicationInstance %x error."), hResult));
return FALSE;
}
·         Add resource.
hResult = pApplication->AddResourceModule(hInstance);
if(FAILED(hResult))
{
RETAILMSG(MSG_FLAG, (TEXT("XAML: AddResourceModule %x error."), hResult));
return FALSE;
}
·         Set XAML.
//
直接指定 XAML file 路徑
// cSourceXaml.SetFile(TEXT("\\Windows\\Page.xaml"));
//
將 XAML file 加入 resource 後, 可用此方式
cSourceXaml.SetResource(hInstance, TEXT("XAML"), MAKEINTRESOURCE(IDR_XAML1));
·         Set Silverlight window.
XRWindowCreateParams WindowParameters;
ZeroMemory(&WindowParameters, sizeof(WindowParameters));
WindowParameters.Style = WS_CAPTION | WS_SYSMENU;
WindowParameters.pTitle = TEXT("Silverlight Sample UI");
WindowParameters.Left = 0;
WindowParameters.Top = 0;
·         Get visual host.
hResult = pApplication->CreateHostFromXaml(&cSourceXaml, &WindowParameters, &pVisualHost);
if(FAILED(hResult))
{
RETAILMSG(MSG_FLAG, (TEXT("XAML: CreateHostFromXaml %x error."), hResult));
return FALSE;
}
·         Get root.
pVisualHost->GetRootElement(&pRootElement);
·         Get window handle but dialog don't need this.
pVisualHost->GetContainerHWND(&hwnd);
·         Add image mouse down handle.
// I1
是 XAML 圖形元件名稱, 透由 find name 找出其 handle.
pRootElement->FindName(TEXT("I1"), &pImg);
pImg->AddMouseLeftButtonDownEventHandler((IXRDelegate<XRMouseButtonEventArgs> *)
CreateDelegate(this, &MySilverlight::OnMouseLeftButtonDownEventHandler));
·         Mouse down handle implementation.
class MySilverlight
{
// Mouse enter event handler
HRESULT OnMouseLeftButtonDownEventHandler(IXRDependencyObject *pSender,
XRMouseButtonEventArgs *pArgs)
{
if(!bFocus)
{
// to do your code
}
else
{
// to do your code
}
}
}

·         Run Silverlight.
#if 0
// Use dialog
hResult = pVisualHost->StartDialog(NULL);
if(FAILED(hResult))
{
RETAILMSG(MSG_FLAG, (TEXT("XAML: StartDialog %x error."), hResult));
return FALSE;
}
#endif
// Use window
pVisualHost->ShowWindow();
UpdateWindow(hwnd);
// Start processing
pApplication->StartProcessing(&exitCode);
Refer attached files, Achieve Silverlight UI 2.