タグ

programmingとcodeに関するh6nのブックマーク (2)

  • Haskell programming tips - HaskellWiki

    Preface This page shows several examples of how code can be improved. We try to derive general rules from them, though they cannot be applied deterministically and are a matter of taste. We all know this, please don't add "this is disputable" to each item! Instead, you can now add "this is disputable" on /Discussion and change this page only when some sort of consensus is reached. Be concise Don't

  • 画面の解像度やdensity(ピクセル密度)の取得方法 | Techfirm Android Lab

    Androidは、マルチスクリーンに対応しています。 これはどういう事かというと、解像度の異なる端末でも、同じように表示させる事ができる仕組みです。 ピクセル指定で画像を作成したり、プログラム上でレイアウトを制御すると、 高解像度の端末では、横幅が足りなかったり、ボタンが小さくて押せない、といった現象が起きます。 その為、解像度の異なる端末でも、一つのバイナリで対応させるには、それらを考慮した 実装が必要になります。 その解決法のいくつかをご紹介します。 1.layout.xmlにて、dip指定でサイズを指定 dipというのは、device-independent pixelの略で、直訳しますと 端末に依存しないピクセル となります。 これはどういう単位か、というと、160 dpiの1ピクセルの物理的な大きさを1dipと定義しています。 つまり、320dpiのスクリーン

  • 1