This post is the second part in a series. Make sure to start with: Making a falling sand simulator first! This will be the final product for this post (drag around inside!) Formalize our concept of a particle In the previous post, our Grid held hex strings, or a 0. If we want to be able to add new particles with different rules, we need to lay a strong foundation to build upon - that is, storing o
Python 3.11 までは、空文字でも64バイトのメモリを使用していました。(64bitプラットフォームの場合) Unicodeの内部表現のうち一番小さい PyASCIIObject 構造体が48バイトで、その構造体の後ろにASCII文字列が続きます。その文字列はNUL終端されているので、空文字列でも1バイト追加されて49バイトになります。 >>> sys.getsizeof("") 49 さらに小さいメモリブロックのアロケートをしているpymallocがメモリを(アライメントの関係で)16バイト単位で割り当てるので、49バイトのmallocでも64バイトが確保されてしまいます。 Python 3.12 からは、PyASCIIObject構造体から wchar_t* 表現をキャッシュするポインタが消え、40バイトになりました。それでASCIIで7文字までの文字列であれば48バイトに収ま
Exclamation If you're looking for someone like me on your team, I'm available. Check my resume and get in touch if you're hiring. Fly.io: the Reclaimer of Heroku's Magic Published on 05/15/2022, 901 words, 4 minutes to read Heroku was catalytic to my career. It's been hard to watch the fall from grace. Don't get me wrong, Heroku still works, but it's obviously been in maintenance mode for years. W
For many years I used the Julia programming language for transforming, cleaning, analyzing, and visualizing data, doing statistics, and performing simulations. I published a handful of open-source packages for things like signed distance fields, nearest-neighbor search, and Turing patterns (among others), made visual explanations of Julia concepts like broadcasting and arrays, and used Julia to ma
Posted on 2022-05-13 A few programming languages use a “defer” pattern for resource cleanup. This is a construct such as a defer keyword which schedules cleanup code to run at the end of the enclosing block (or function). This is available in Zig, Go and even in GCC C. fn printFile(path: str) !void { var f = try open(path) defer f.close() for line in f { print(try line) } // File is closed here. }
Regula is a tool that evaluates infrastructure as code files for potential AWS, Azure, Google Cloud, and Kubernetes security and compliance violations prior to deployment. Regula supports the following file types: CloudFormation JSON/YAML templates Terraform source code Terraform JSON plans Kubernetes YAML manifests Azure Resource Manager (ARM) JSON templates (in preview) Regula includes a library
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く