You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
This page was archived by the author on May 15, 2025. It is still available for reference but may not include the most up-to-date information. I get a lot of people asking me about the best practice for Facebook login flow. Most of us are used to logging people in using an email address and a hash of their password, but how do you log a user in from Facebook when they never enter a password on you
(Last Updated On: 2023年12月8日) 追記:最近のOWASPガイドの更新でJavaScript文字列はUnicodeエンコードで安全性を確保するよう変更されました。元々このブログでもUnicodeエスケープのまま利用するように書いています。他の言語のユーザーはUnicodeエスケープを利用しましょう。PHPもASCII領域の文字をUnicodeエスケープするようにした方が良いと思います。これは提案して実現するように努力します。 JSONはJavaScriptのオブジェクトや配列を表現する方式でRFC 4627で定義されています。メディアタイプはapplication/json、ファイル拡張子はjsonと定義されています。 PHPにJSON形式のデータに変換するjson_encode関数とjson_decode関数をサポートしています。 JSON関数がサポートされている
pratphall.org 2018 Copyright. All Rights Reserved. The Sponsored Listings displayed above are served automatically by a third party. Neither the service provider nor the domain owner maintain any relationship with the advertisers. In case of trademark issues please contact the domain owner directly (contact information can be found in whois). Privacy Policy
2000年代後半は Ruby、2010年代は JavaScript のベストプラクティス本がたくさん見られるようになった。 ベストプラクティス本が出版されるということは新しいバージョンに移行するための準備がなされていることも意味する。 JavaScript のバージョンアップに関して IE が大きな障害になっていたが、MicroSoft が自動的なアップグレードを設定したり、2014年の Windows XP サポート打ち切りに備えて、Google のように IE8 以下のサポートを打ち切る企業が登場し、新しいバージョンが受け入れられる状況が進んでいる。2013年前半において EcmaScript 6 の機能実装はあまり進んでいない。 Ruby に関しては、Ruby 1.8 と Ruby 1.9 の隔たりが大きいことが問題になっていたが、Ruby 1.9 と 2.0 の際はあまり多くないと
追記 DB接続時にcharset=utf8を指定 bindValueで暗黙の型変換されないように変更 Pimpleをサービスロケータとして使う場合の注意点を追加 テンプレートとしてフラットなPHPからTwigで書いた場合を追加 前提 スクリプト、ファイル、DBの文字コードはすべてUTF-8で統一です。 また、最初に以下のMySQLのテーブルがあることを前提として記事を書いています。 Database: MySQL user: myuser password: mypassword CREATE TABLE `blog_db`.`post` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, `body` text NOT NULL, `date` date NOT NULL, PRI
2008年4月27日日曜日 関数型(3) - 畳み込み fold, reduce 次の2つの計算を、畳み込み関数を使用して書く。 1 + 2 + 3 + 4 + 5 = 15 1 * 2 * 3 * 4 * 5 = 120 Scheme R Haskell JavaScript Erlang Ruby Scala Python OCaml PHP Scheme Gauche 0.8 $ gosh gosh> (fold (lambda (x y) (+ x y)) 0 '(1 2 3 4 5)) 15 gosh> (fold (lambda (x y) (* x y)) 1 '(1 2 3 4 5)) 120 gosh> (exit) ➢ 簡略化できる $ gosh gosh> (fold + 0 '(1 2 3 4 5)) 15 gosh> (fold * 1 '(1 2 3
たとえば PHP で、 if ($hoge) { ... } とか書いてあったら、 $hoge がどんな値のときに if の中身が実行されるのか即答できますか。 こういう書き方は多くの言語で可能ですが、言語によって何が真で何が偽になるのかが異なるので、それぞれまとめてみました。 C言語 C言語には bool 型が無い。 0 (int) だけが偽となり、それ以外はすべて真となる。 NULL 定数は stddef.h で以下のように ((void*)0) と定義されているため、偽値として使える。 意見が分かれそうなところですが、個人的にはNULLを偽値として使用するは好きじゃないです。 #ifndef __cplsuplus #define NULL ((void*)0) #else #define NULL __null #endif C++ C++になると bool 型が出てくる。C と同
Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su
HTTPレスポンスをajaxでストリーミング的に受け取りたいとき、要するにHTTPストリーミングをしたい時には、Transfer-Encoding: chunkedなレスポンスを生成してやるとよい。こうするとAjaxではHTTPレスポンス全体を受け取るのを待たずに、レスポンスの中身にアクセスすることが出来るようになる。従って、一つのHTTPコネクションでサーバ側から任意のデータを好きなタイミングでプッシュすることが出来る。 コード 一秒ごとに生成されるJSONをストリーム的に受け取るデモのコードが以下。 <?php // push.php function output_chunk($chunk) { echo sprintf("%x\r\n", strlen($chunk)); echo $chunk . "\r\n"; } header("Content-type: applicati
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く