Thursday, July 16, 2015

PHP: Snippet: XML Parsing Example

// XMLを取得
$myXMLData = file_get_contents($xmlURL . $xmlURLParameter);

// XMLをパース
$xml = simplexml_load_string($myXMLData) or die (“Error: Cannot create object”);

// タイトルを取得
$title = $xml->entry->title;

// 概要を取得
$summary = $xml->entry->summary;

// 概要を行で分解
$lines = explode(PHP_EOL, $summary);

Google Calendar: XML

https://www.google.com/calendar/feeds/xxxxxxxx%40gmail.com/public/basic?futureevents=true&orderby=starttime&sortorder=ascending&max-results=1&singleevents=true&hl=en

PHP: function: isToday_new

// 今日か?
function isToday_new($y, $m, $d)
{  
   if (date('Y-m-d') == date ('Y-m-d', strtotime($y . "-" . $m . "-" . $d)))
   {
      $retval = true;
   }
   
   return $retval;
}

PHP: function: monthENtoJP

// 月を英語から数値へ
function monthENtoJP($en)
{
   $monthENtoNum = array(
      "Jan" => 1 , 
      "Feb" => 2 , 
      "Mar" => 3, 
      "Apr" => 4, 
      "May" => 5, 
      "Jun" => 6, 
      "Jul" => 7, 
      "Aug" => 8, 
      "Sep" => 9, 
      "Oct"=> 10, 
      "Nov" => 11, 
      "Dec" => 12);

   return $monthENtoNum[$en];
}

PHP: function: weekdayENtoJP

// 曜日を英語から日本語へ
function weekdayENtoJP($en)
{
   $weekdayENtoJP = array(
      "Sun" => "日",
      "Mon" => "月",
      "Tue" => "火",
      "Wed" => "水",
      "Thu" => "木",
      "Fri" => "金",
      "Sat" => "土");

   return $weekdayENtoJP[$en];
}

Tuesday, July 14, 2015

Amusement Park (遊園地): Seibuen Amusement Park (西武園ゆうえんち)

Admission ticket
  • Adult: 1100 yen
  • Child: 500 yen
  • Senior: 500 yen
One day ticket
  • Admission ticket
  • Adult: 3300 yen
  • Child: 2800 yen
Hello Kitty fairy tale town ticket
  • Admission ticket
  • Adult: 2200 yen
  • Child: 1600 yen
Water park ticket
  • Admission ticket
  • Adult: 2200 yen
  • Child: 1200 yen
  • Senior: 1200 yen
One day summer ticket
  • Admission ticket
  • Ride ticket
  • Water park ticket
  • Hello Kitty water park ticket
  • Adult: 2800 yen
  • Child: 1700 yen
  • Senior: 1700 yen
Hello Kitty water park ticket
  • Adult with Admission ticket: 500 yen 
  • Child with Admission ticket: 900 yen
  • Senior with Admission ticket: 500 yen
  • Adult with water park ticket: 600 yen
  • Child with water park ticket: 500 yen
  • Senior with water park ticket: 500 yen
  • Adult with fairy tale town ticket: 600 yen
  • Child with fairy tale town ticket: 100 yen
  • Senior with fairy tale town ticket: 100 yen
Water park group discount ticket
  • Admission ticket
  • Adult: 1700 yen
  • Child: 800 yen
  • Senior: 800 yen
One day summer group discount ticket
  • Adult: 2500 yen
  • Child: 1500 yen
  • Senior: 1500 yen
Water park economical ticket
  • Admission ticket
  • 2 rides ticket
  • One day Seibu-line train ticket
  • Adult: 2300 yen
  • Child: 1300 yen

Amusement Park (遊園地): Toshimaen (としまえん)

Admission ticket (入場券)
  • Adult (大人): 1000 yen
  • Child (子供): 500 yen
One day ride ticket (乗り物1日券)
  • Admission ticket (入場券)
  • Adult (大人): 4200 yen
  • Child (子供): 3200 yen
One day ride with kids ticket (キッズ乗り物1日券)
  • Admission ticket (入場券)
  • Adult (大人): 2700 yen
  • Child (子供): 2200 yen
One day water park ticket (プール1日券)
  • Admission ticket (入場券)
  • Adult (大人): 4000 yen
  • Child (子供) with height over 110 cm: 3000 yen
  • Child (子供) with height below 110 cm: 2000 yen
One day ride and water park ticket
  • Admission ticket (入場券)
  • Adult (大人): 4500 yen
  • Child (子供) with height over 110 cm: 3500 yen
  • Child (子供) with height below 110 cm: 2700 yen

globe:DEPARTURES

globe

MP4 to FLV

Task:
  • MP4 video to FLV video
  • No block noise
  • Good sound quality
  • Keep aspect ratio
Input:

  • H264 MPEG-4 AVC (part 10) (avc1)
  • Resolution: 1280x720
  • Frame rate: 29.970030
  • Decoded format: Planar 4:2:0 YUV
  • MPEG AAC Audio (mp4a)
  • Channels: Stereo
  • Sample rate 48000 Hz
The app I used:

WonTube Free Video Converter
https://itunes.apple.com/jp/app/wontube-free-video-converter/id495101962?l=en&mt=12


The app's screenshot:
WonTube Free Video Converter
Results:
  • FLV file (6000kbps; 340MB)
  • FLV file (3000kbps; 176MB)

Flash video


  • Flash video is Digital container format
  • Flash Video may be embedded in SWF
  • SWF is acronym for Small Web Format
  • FLV and F4V are Flash Video
  • F4V is based on ISO base media file format
  • F4V started from Flash Player 9 update 3
  • FLV and F4V are supported in Adobe Flash Player
  • FLV was originally developed by Macromedia
  • Flash Video uses RTMP
  • RTMP is acronym for Real Time Messaging Protocol
  • RTMP is a Proprietary protocol
  • FLV may contain videos with different codecs
  • Codecs includes Sorenson Spark, VP6, H.264, HE-AAC
  • SWF supports video from Flash Player 6
  • Flash Player 7 added support for FLV
  • Flash Player does not check Filename extension
  • F4V is completely different from FLV
  • F4V does not support Screen video
  • F4V does not support Sorenson Spark
  • F4V does not support VP6 video compression format
  • F4V does not support ADPCM
  • F4V does not support Nellymoser audio compression format
  • F4V is strongly recommended by Authors of Flash Player
  • FLV has limitation when streaming H.264 or AAC
  • File suffix for Flash Video is .flv ?
  • Internet media type for FLV is video/x-flv ?
  • File suffix for F4V is .f4v ?
  • Internet media type for F4V is video/mp4 ?
  • SWF for Flash Player 6 or later can communicate with Adobe Flash Media Server
  • Adobe Flash Media uses RTMP
  • Flash Player can play FLV embedded in SWF created for Flash Player 7
  • Flash Player can play F4V embedded in SWF created for Flash Player 9
  • FLV contain Bitstream of variant of H.263
  • FLV uses Sorenson Spark
  • Sorenson Spark is a variant of H.263
  • Sorenson Spark is older Codec
  • Sorenson Spark is widely available and compatible
  • Sorenson Spark is the first Codec supported in Flash Player
  • Sorenson Spark is required Video coding format in Flash Player 6 and 7
  • On2 TrueMotion VP6 is supported in Flash Player 8 and newer
  • On2 TrueMotion VP6 is preferred in Flash Player 8 and newer
  • On2 TrueMotion VP6 has better quality than Sorenson Spark
  • On2 TrueMotion VP6 is computationally more complex than Sorenson Spark
  • Screen video is also called Screenshare
  • FLV supports two versions of Screenshare
  • Screenshare is an Codec for Screencast