タグ

2013年12月11日のブックマーク (4件)

  • What Wikipedia Teaches

    Content-driven AdSensers sometimes bemoan Wikipedia. They seem to imagine that it ranks well for so many terms because it just has so many pages, and so many contributors, and is so well known. The wiki-mystique blinds people to the fact you can rank higher for terms by just doing some of the same things Wikipedia does. Have definition pages. If your site is about widget repair, and some of that i

  • Econsultancy Articles - Digital Marketing & Ecommerce

    The latest articles on global digital marketing and ecommerce from Econsultancy’s award-winning analysts and experts We’ve seen lots of examples of new intelligent search features or conversational agents in the last six months in online retail – from Walmart, Instacart and Amazon, for example. In a recent article, I tried out some AI-powered product discovery features to see how useful they might

    Econsultancy Articles - Digital Marketing & Ecommerce
  • 正規表現サンプル(正規表現Tips その1)

    \d 0〜9の数字を表す正規表現です。 \D 数字以外を表す正規表現です。 正規表現では小文字が大文字になると反対の意味を持ちます。 \s 空白文字を表す正規表現です。空白文字とは…半角スペース、タブ文字のことです。 \S 空白文字以外を表す正規表現です。 正規表現では小文字が大文字になると反対の意味を持ちます。 \w 英数字と「_」(アンダーバー)を表す正規表現です。つまり「ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_」です。 \W \w以外を表す正規表現です。 正規表現では小文字が大文字になると反対の意味を持ちます。 \n 改行文字を表します。LFと呼ばれる改行です。UNIX系マシンの標準的な改行コードです。 \r 改行文字を表します。CRと呼ばれる改行です。Apple系マシンの標準的な改行コードです。 Window

    a20130517
    a20130517 2013/12/11
  • PHP 配列を回すならforかforeachか

    今日、社内で「PHPの配列をループで回すのにforを使うか、foreachを使うか」という話が面白かったので、メモ。 ここでいう配列はキーが数字で、0からの連番であることを想定してます。(キーが数字以外や連番で無い場合は、foreachを使います。) 例えば↓のようにDBテーブルからレコードを読み込んだ内容が入ってる場合、$listをループで回すならforとforeachのどちらを使うべきかという話です。 <?php $list = array(); $list&#91;&#93; = array('id' => 1, 'name' => 'hoge'); $list[] = array('id' => 2, 'name' => 'foo'); $list[] = array('id' => 3, 'name' => 'bar'); ?> for文派 <?php for ($i = 0 ;

    a20130517
    a20130517 2013/12/11
    “1. 添え字が数字だろうが、何だろうが要素を順番に参照できる (PHPでは全てもともと連想配列ですが)リストかハッシュかを意識する必要が無い。”