Sunday, June 17, 2012

html5のcanvasで線の太さを変更する。

html5のcanvasで線の太さを変更するには、lineWidthを指定します。
strokeStyleでは指定できないようです。

   // コンテキストを変数ctxに代入
   ctx.lineWidth = 5;

Friday, June 08, 2012

Installing Ubuntu

I have been trying installing Unbuntu(12.04) into Let's note R8 (CF-R8) to know how much it works compared with Windows. There were some things which were not confirmed to work. But I can expect that Ubuntu would work finely.

This is a list of test that would be needed to use Ubuntu for me.
  • Install
  • Skype (with Webcam)
  • Chrome
  • VMPlayer (to run windows)
  • Touchpad (to use circle-shaped touchpad)
  • Japanese Input with Thumb shift
  • Hibernation
Install

I used an empty USB harddrive for LiveUSB and install destination.
I divided it into two partition, which are about 4GB for LiveUSB and about 50G for install destination.

I used LinuxLive USB Creator to create LiveUSB. While running the program, A virus check program warned it vulnerable and removed program files. After then, I configured the virus check program not to work during the USB Creator makes LiveUSB.

After Shutting down Windows and configuring BIOS to boot from USB harddrive, Ubuntu booted looking correctly.

When trying installing OS into the partition of 50G, Installer said "please unmount /cdrom." but I can't unmount /cdrom. The situation has been reported already. According to it, I executed following command before partitioning starts.

sudo umount -l -r -f /cdrom

Skype (with Webcom)

To enable video chat, I used ELECOM'S UCAM-DLK130T. On configuration of Skype or Cheese application, I could see the camera work.

After installing Skype, I had to set up the sound device.
According to http://blog.livedoor.jp/zanpan/archives/52590661.html ,
I added the following line to /etc/modprobe.d/alsa-base.conf and restarted.
options snd-hda-intel model=thinkpad
It worked. I could hear the sound of sound test.

On Skype, Echo test with only sound was worked. I have not confirmed video chat yet.

Chrome

Chrome package for Linux was available.

VMPlayer

Installing VMPlayer 4.0.3 was failed, When I searched, It was found that it was necessary to patch to VMPlayer. As the version in the patch script was a bit old(4.0.2), I changed the version to 4.0.3. The patch script needed patch program

To test VMPlayer, I chose Windows XP's image for IE6 (http://www.microsoft.com/en-us/download/details.aspx?id=11575.) As the image was VHD(for VirtualPC), It needed to convert it into VMDK(for VMPlayer) and make a vmx file. To convert VHD to VMDK, I used NHC. To create vmx file, I used http://www.easyvmx.com/ . Because I was not familiar with how to create vmx file, some errors (such, no device /dev/dsp) appeared, but the OS booted.

Touchpad


CF-R8's Touchpad has a circle-shaped touchpad. In order to configure it, I referenced http://ubuntuforums.org/showpost.php?p=9727751&postcount=8 .

Japanese Input with Thumb shift

I referenced http://d.hatena.ne.jp/Room-B/20110719 to enable thumb shift.

Hibernation


I have not confirmed that hibernation worked on my PC.




Friday, June 01, 2012

jQuery Mobile イベントのサンプル

jQuery Mobile のイベントhttp://jquerymobile.com/demos/1.1.0/docs/api/events.htmlについてサンプルを作成してみました。このサンプルでは以下のイベントを拾います。
  • click
  • tap
  • taphold
  • swipe
  • swipeleft
  • swiperight
  • orientationchange
  • resize
  • scrollstart
  • scrollstop

イベントのサンプル

サンプルではイベントが発生すると、そのイベント名の文字列がcontent内のdiv要素に追加されます。clearボタンを押すと、追加されたイベント名文字列を消去します。

orientationchangeは、windowオブジェクトが発生するイベントなので、windowオブジェクトに対して、コールバックをbindしています。

    $(window).bind("orientationchange",function(e) {
        $('#text').text($('#text').text() + 'o-change[' + e.orientation + '] ');

    });

参考:
http://stackoverflow.com/questions/10023328/orientation-change-event-implementation-by-jquery-mobile-in-phone-gap