Thursday, July 16, 2015

Aspirin

Chemical Garden

PHP: Snippet: 任意のURLパラメータの値を取得


// Urlのパラメータの値を見つけて取得。?page_id%3D100&param2%3D200となっている場合、$pageIDは100になる。
   if (preg_match('/page_id%3D([0-9]+)/', $line, $match))
   {
      $pageID = $match[1];
   }

PHP: Snippet: 1行内の任意の標識文字に対する値の取得

// Label: の後に書いてある文字列を取得する
if (mb_strpos($line, “Label:”) !== false)
{
   $str = mb_substr($line, mb_strpos($line, “Label:”) + strlen(“Label:“));
}

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)