PHPの標準関数のみでユニークなトークンを作りたかったので、メモとして残します。 目的 メールアドレス認証時に使用するアクティベーションキー用のトークンを発行したく、 実行する度に被らないランダムな文字列を取得するのが目的です。 TL;DR
PHPの標準関数のみでユニークなトークンを作りたかったので、メモとして残します。 目的 メールアドレス認証時に使用するアクティベーションキー用のトークンを発行したく、 実行する度に被らないランダムな文字列を取得するのが目的です。 TL;DR
numpy.random.mtrand.RandomState.randint¶ method RandomState.randint(low, high=None, size=None, dtype='l')¶ Return random integers from low (inclusive) to high (exclusive). Return random integers from the “discrete uniform” distribution of the specified dtype in the “half-open” interval [low, high). If high is None (the default), then results are from [0, low). low : int or array-like of ints Lowes
概要 この記事ではErlang/OTP 18.0で実装される新しい疑似乱数のrandモジュールと,その既定値のアルゴリズムXorshift116+について説明します. 経緯 2014年末にErlang上のXorshift PRNGの説明記事を書きました. その後すぐに2015年の1月からOTP TeamのDan Gudmundsson (@dgud on GitHub,以下Dgud)とOTPへの実装を前提とした新しい疑似乱数モジュールの実装に向けて共同作業が始まりました. そしてXorshift*/+の原作者Sebastiano Vigna(以下Vigna)によって,ErlangのSmall Integerの特性を考慮したXorshift116+というアルゴリズムが考案され,OTP 18.0-rc2でrandモジュールとして実装されました. 以下,文中敬称略,かつ,である調,で. 18.0
Posted on: 2017-12-12 I've written previously about a way to query for records in a shuffled order that works for pagination. The TL;DR was: use a shuffled (not random) ordering, based on a prime integer parameter. SELECT whatever FROM table ORDER BY large_integer_field % prime_integer_parameter -- modulo to shuffle LIMIT 10 OFFSET 0; Reuse the prime_integer_parameter with OFFSET 10 for subsequent
The "how" of Ruby on Rails: Hivelogic's Dan Benjamin prepares non-Rails developers, designers, and other creative professionals for their first foray into Rails. Learn what Ruby on Rails is (and isn't), and where it fits into the spectrum of web development and design. See through the myths surrounding this powerful young platform, and learn how to approach working with it. Incorporating accessibi
こんにちは 方川です。 今回紹介するプラグインはMTのテンプレートの一部をPHPを利用してランダム表示させる為のプラグインです。phpが使える方にとっては簡単な機能ですが、PHPを意識せずMTタグを利用してランダム表示を実現できます。 では、具体的な利用例として 1. 画像をランダム表示させる 2. エントリの内容をランダムで表示させる 1については、言うまでもなくバナー等でよく見かける機能だと思いますが、このプラグインはHTML自体をランダムで表示させることを目的としてます。さらにMTのプラグインということでMTタグで出力される内容をランダムの対象にできます。そこがこのプラグインの利点という感じでしょうか。 インストールの仕方 RotationTemplates.plをプラグインディレクトリに保存してください。 利用環境 このプラグインが提供しているタグはPHPコードをHTML上に埋め込
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く