並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 13 件 / 13件

新着順 人気順

booleanの検索結果1 - 13 件 / 13件

タグ検索の該当結果が少ないため、タイトル検索結果を表示しています。

booleanに関するエントリは13件あります。 programming開発設計 などが関連タグです。 人気エントリには 『Boolean のカラムを生やす前に考えたいこと』などがあります。
  • Boolean のカラムを生やす前に考えたいこと

    その方が単純に情報量が増えるため 最初 boolean にしてたけど後から時刻もほしくなるということはよくある。後から日時型のカラムに変えようと思っても、過去のイベントの日時は失われてしまっていて困る。今は日時が必要でないように感じても日時にしておく方がよい。 またアプリケーション的に使わなくても、データ分析のためにあると嬉しいことは多い。 コード的にも特に扱いにくくなることはない 以下のようにして簡単に boolean と同じ感覚で扱うことができる。 class Post < ApplicationRecord scope :unpublished, -> { where(published_at: nil) } scope :published, -> { where.not(published_at: nil) } def published? !published_at.nil?

      Boolean のカラムを生やす前に考えたいこと
    • Typescript では !! と Boolean() が完全に同じ動作ではない

      🌼 はじめに 皆さんは Javascript である値を boolean に変換するときどういう方法も使いますか?よく使われる方法は!!(二重否定・Double negation)か、Boolean()だと思います。 const hello = Boolean("hello"); // true const world = !!"world" // true Typescript のハンドブックでもその2つを紹介してます。 You can always coerce values to booleans by running them through the Boolean function, or by using the shorter double-Boolean negation. いちおう型の観点では、!!を使ったら型がtrueかfalseになり、Boolean()関数を使った

        Typescript では !! と Boolean() が完全に同じ動作ではない
      • Why doesn't Ruby have Boolean class?

        https://burikaigi.dev/speakers/004/ This is BuriKaigi, so I talked about "Boolean (Bu-rian)" :)

          Why doesn't Ruby have Boolean class?
        • GitHub - Genivia/ugrep: ugrep 5.1: A more powerful, ultra fast, user-friendly, compatible grep. Includes a TUI, Google-like Boolean search with AND/OR/NOT, fuzzy search, hexdumps, searches (nested) archives (zip, 7z, tar, pax, cpio), compressed files (gz,

          Ugrep is a true drop-in replacement for GNU grep (assuming you copy or symlink ug to grep, egrep and fgrep), unlike many other popular grep claiming to be "grep alternatives" or "replacements" when those actually implement incompatible command-line options and use a different, incompatible regex matcher i.e. Perl regex versus POSIX regex grep (ugrep supports both) Ugrep is fast, user-friendly, and

            GitHub - Genivia/ugrep: ugrep 5.1: A more powerful, ultra fast, user-friendly, compatible grep. Includes a TUI, Google-like Boolean search with AND/OR/NOT, fuzzy search, hexdumps, searches (nested) archives (zip, 7z, tar, pax, cpio), compressed files (gz,
          • Kubernetes コンテナ名を y にすると実行できなくて困った(YAML の Boolean の話) - SIer だけど技術やりたいブログ

            環境 Kubernetes 1.15 ]# kubectl version Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c3324

              Kubernetes コンテナ名を y にすると実行できなくて困った(YAML の Boolean の話) - SIer だけど技術やりたいブログ
            • booleanを極力使わないReactの書き方  | HireRoo Tech Blogs

              UIの状態を表すために、複数のbooleanが条件に利用される場合、各状態に名前をつけて状態を表現するほうが、可読性が高く、必要最小限の実装で済みます。

                booleanを極力使わないReactの書き方  | HireRoo Tech Blogs
              • Tips on naming boolean variables - Cleaner Code

                Originally posted at michaelzanggl.com. Subscribe to my newsletter to never miss out on new content. There is a convention to prefix boolean variables and function names with "is" or "has". You know, something like isLoggedIn, hasAccess or things like that. But throughout my career I have seen and written code where this convention was just thrown out the window. So let's check out some of these e

                  Tips on naming boolean variables - Cleaner Code
                • ActiveRecord::Type::Boolean#cast の返り値が nil となるケースについて - Qiita

                  API などでクライアント側から渡ってきた "true"、"false"、1、0 などの値を、 Ruby の true や false として扱いたいときがある。 Ruby では false と nil 以外の値はすべて true として扱われるため、!! を先頭につけたとしても実現できない。

                    ActiveRecord::Type::Boolean#cast の返り値が nil となるケースについて - Qiita
                  • [小ネタ] flake8利用時にSQLAlchemyでBoolean型のフィルタを掛けるときの注意点 | DevelopersIO

                    こんにちは!DA(データアナリティクス)事業本部 インテグレーション部の大高です。 先日、SQLAlchemyを利用しているPythonの環境にflake8を導入したのですが、思いがけない問題を起こしたので、自分自身への備忘録としても残しておきたいと思います。 前提 今回の環境は以下のような環境です。 SQLAlchemyを利用したPythonプロジェクト環境 flake8を導入して、Visual Studio Codeでコードを自動チェックするようにしている 起きた問題 SQLAlchemyでフィルタを使う際に、以下のようなコードがあるとします。 users = session.query(User).filter(User.deleted == False) このようなコードはFalseとの比較演算子として==を利用しているのでflake8からお叱りをうけます。 comparison

                      [小ネタ] flake8利用時にSQLAlchemyでBoolean型のフィルタを掛けるときの注意点 | DevelopersIO
                    • 【Laravel】boolean型にしたカラムのデータが0/1で返ってくる(Modelでキャストする)【MySQL】

                      と設定したはずが、データを取得するとint(0) / int(1)になっていることはないでしょうか。 実はMySQLではboolean型は無く、上記の設定で作成されるカラムは `is_xxx` tinyint(1) NOT NULL DEFAULT '0', となります。 そのためこれをこのまま取得すると0/1になってしまいます。 利用箇所で毎回キャストするのは面倒です。 ではどう対応するのか、Laravelの場合はModelにcastの機能があります。 参考:https://readouble.com/laravel/8.x/ja/eloquent-mutators.html

                        【Laravel】boolean型にしたカラムのデータが0/1で返ってくる(Modelでキャストする)【MySQL】
                      • Pandas error "Unalignable boolean Series provided as indexer" - ITipsUs

                        pandas.DataFrame is useful to handle table format data. With using pandas, we can import CSV or Excel data and extract specific rows. One day, pandas raised such an error. This error message was difficult for us to understand. What was the cause of error ? So today I will introduce about "Pandas error 'Unalignable boolean Series provided as indexer'". "Unalignable boolean Series provided as indexe

                          Pandas error "Unalignable boolean Series provided as indexer" - ITipsUs
                        • [TypeScript][ESLint]@typescript-eslint/strict-boolean-expressionsでTruthy/Falsyの判定を禁止する | DevelopersIO

                          [TypeScript][ESLint]@typescript-eslint/strict-boolean-expressionsでTruthy/Falsyの判定を禁止する 吉川@広島です。 JS/TSのコードに触れていると、以下のようなTruthy/Falsyを利用したnullチェックを見ることがあると思います。 const foo: Foo | undefined = getFoo() if (foo) { // fooがundefinedでない場合の処理 } 個人的に、Truthy/Falsyを使った判定は後からコードを見返した際に「nullチェックをしているのか」「0をチェックしているのか」「空文字 "" をチェックしているのか」など一瞬読解に迷う場合があるため、より厳密な判定をする方が好みです。 例えばnullチェックであれば != null と書くようにした方が意図が明確に伝わ

                            [TypeScript][ESLint]@typescript-eslint/strict-boolean-expressionsでTruthy/Falsyの判定を禁止する | DevelopersIO
                          • [朗報]FigmaのVariantsにBooleanが追加、コンポーネント管理がスッキリできる! - Qiita

                            レイヤーのオンオフをVariantsで設定できるようになった 控えめに言って神アップデートです。 以前までは、ボタンのアイコンのあるなしやフォームのエラーメッセージのあるなしなど、「ちょっとした要素のあるなしの違い」をいちいちVariantを分けて作成するか、Instance上で該当部分を非表示にする必要がありました。 しかし、FigmaのアップデートによってレイヤーにオンオフのBooleanを設定できるようになり、こうした「ちょっとした要素のあるなしの違い」が 「ある」状態だけを作成すれば良く なりました!!! 使い方 使い方は簡単です。 1.コンポーネントを作成する まずはオンオフのある要素が「ある」状態のコンポーネントを作成します。 2. コンポーネントプロパティを作成をする 次にプロパティパネルからコンポーネントプロパティの作成を選択し、「Boolean」を選択します。 選択すると

                              [朗報]FigmaのVariantsにBooleanが追加、コンポーネント管理がスッキリできる! - Qiita
                            1

                            新着記事