並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 45件

新着順 人気順

python convert string to int only if possibleの検索結果1 - 40 件 / 45件

  • Command Line Interface Guidelines

    Contents Command Line Interface Guidelines An open-source guide to help you write better command-line programs, taking traditional UNIX principles and updating them for the modern day. Authors Aanand Prasad Engineer at Squarespace, co-creator of Docker Compose. @aanandprasad Ben Firshman Co-creator Replicate, co-creator of Docker Compose. @bfirsh Carl Tashian Offroad Engineer at Smallstep, first e

      Command Line Interface Guidelines
    • プロと読み解く Ruby 3.1 NEWS - クックパッド開発者ブログ

      技術部の笹田(ko1)と遠藤(mame)です。クックパッドで Ruby (MRI: Matz Ruby Implementation、いわゆる ruby コマンド) の開発をしています。お金をもらって Ruby を開発しているのでプロの Ruby コミッタです。 本日 12/25 に、ついに Ruby 3.1.0 がリリースされました(Ruby 3.1.0 リリース )。今年も Ruby 3.1 の NEWS.md ファイルの解説をします。NEWS ファイルとは何か、は以前の記事を見てください。 プロと読み解く Ruby 2.6 NEWS ファイル - クックパッド開発者ブログ プロと読み解くRuby 2.7 NEWS - クックパッド開発者ブログ プロと読み解くRuby 3.0 NEWS - クックパッド開発者ブログ 本記事は新機能を解説することもさることながら、変更が入った背景や苦労な

        プロと読み解く Ruby 3.1 NEWS - クックパッド開発者ブログ
      • research!rsc: Coroutines for Go

        This post is about why we need a coroutine package for Go, and what it would look like. But first, what are coroutines? Every programmer today is familiar with function calls (subroutines): F calls G, which stops F and runs G. G does its work, potentially calling and waiting for other functions, and eventually returns. When G returns, G is gone and F continues running. In this pattern, only one fu

        • GPT in 60 Lines of NumPy | Jay Mody

          January 30, 2023 In this post, we'll implement a GPT from scratch in just 60 lines of numpy. We'll then load the trained GPT-2 model weights released by OpenAI into our implementation and generate some text. Note: This post assumes familiarity with Python, NumPy, and some basic experience with neural networks. This implementation is for educational purposes, so it's missing lots of features/improv

          • Onyx, a new programming language powered by WebAssembly · Blog · Wasmer

            Onyx, a new programming language powered by WebAssemblyLearn about Onyx, a new imperative programming language that leverages WebAssembly and Wasmer for seamless cross-platform support What is Onyx? Onyx is a new programming language featuring a modern, expressive syntax, strict type safety, blazingly-fast build times, and out-of-the-box cross platform support thanks to WebAssembly. Over the past

              Onyx, a new programming language powered by WebAssembly · Blog · Wasmer
            • Golang Mini Reference 2022: A Quick Guide to the Modern Go Programming Language (REVIEW COPY)

              Golang Mini Reference 2022 A Quick Guide to the Modern Go Programming Language (REVIEW COPY) Harry Yoon Version 0.9.0, 2022-08-24 REVIEW COPY This is review copy, not to be shared or distributed to others. Please forward any feedback or comments to the author. • feedback@codingbookspress.com The book is tentatively scheduled to be published on September 14th, 2022. We hope that when the release da

              • Parsing SQL - Strumenta

                The code for this tutorial is on GitHub: parsing-sql SQL is a language to handle data in a relational database. If you worked with data you have probably worked with SQL. In this article we will talk about parsing SQL. It is in the same league of HTML: maybe you never learned it formally but you kind of know how to use it. That is great because if you know SQL, you know how to handle data. However

                  Parsing SQL - Strumenta
                • How terminal works. Part 1: Xterm, user input

                  Motivation Introduction User input strace Printing non-printable stty raw -echo -isig UTF-8 Conclusion Motivation This blog series explains how modern terminals and command-line tools work. The primary goal here is to learn by experimenting. I’ll provide Linux tools to debug every component mentioned in the discussion. Our focus is to discover how things work. For the explanation of why things wor

                  • Kalyn: a self-hosting compiler for x86-64

                    Over the course of my Spring 2020 semester at Harvey Mudd College, I developed a self-hosting compiler entirely from scratch. This article walks through many interesting parts of the project. It’s laid out so you can just read from beginning to end, but if you’re more interested in a particular topic, feel free to jump there. Or, take a look at the project on GitHub. Table of contents What the pro

                    • Why I use attrs instead of pydantic

                      This post is an account of why I prefer using the attrs library over Pydantic. I'm writing it since I am often asked this question and I want to have something concrete to link to. This is not meant to be an objective comparison of attrs and Pydantic; I'm not interested in comparing bullet points of features, nor can I be unbiased since I'm a major contributor to attrs (at time of writing, second

                      • The OpenSSL punycode vulnerability (CVE-2022-3602): Overview, detection, exploitation, and remediation | Datadog Security Labs

                        emerging threats and vulnerabilities The OpenSSL punycode vulnerability (CVE-2022-3602): Overview, detection, exploitation, and remediation November 1, 2022 emerging vulnerability On November 1, 2022, the OpenSSL Project released a security advisory detailing a high-severity vulnerability in the OpenSSL library. Deployments of OpenSSL from 3.0.0 to 3.0.6 (included) are vulnerable and are fixed in

                          The OpenSSL punycode vulnerability (CVE-2022-3602): Overview, detection, exploitation, and remediation | Datadog Security Labs
                        • What's new in Python 3.11?

                          What's new in Python 3.11?Built-in TOML support, better exceptions, and typing improvements. By Tushar·InsightsPython The first beta release of Python 3.11 is out, bringing some fascinating features for us to tinker with. This is what you can expect to see in 2022's release of Python later this year. Even better error messagesPython 3.10 gave us better error messages in various regards, but Python

                            What's new in Python 3.11?
                          • How I wrote my own "proper" programming language

                            The diagram above is the compiler for the language Bolt we’ll be building. What do all the stages mean? I have to learn OCaml and C++? Wait I haven’t even heard of OCaml… Don’t worry. When I started this project 6 months ago, I had never built a compiler, nor had I used OCaml or C++ in any serious project. I’ll explain everything in due course. In this series of posts we’ll be building a proper pr

                              How I wrote my own "proper" programming language
                            • Lean for JavaScript Developers — overreacted

                              Lean for JavaScript DevelopersSeptember 2, 2025 This is my opinionated syntax primer for the Lean programming language. It is far from complete and may contain inaccuracies (I’m still learning Lean myself) but this is how I wish I was introduced to it, and what I wish was clarified. Why Lean? This post assumes you’re already eager to learn a bit of Lean. For motivation, I humbly submit to you two

                                Lean for JavaScript Developers — overreacted
                              • My thoughts on writing a Minecraft server from scratch (in Bash)

                                My thoughts on writing a Minecraft server from scratch (in Bash) For the past year or so, I've been thinking about writing a Minecraft server in Bash as a thought excercise. I once tried that before with the Classic protocol (the one from 2009), but I quickly realized there wasn't really a way to properly parse binary data in bash. Take the following code sample: function a() { read -n 2 uwu echo

                                • A Lisp Interpreter Implemented in Conway’s Game of Life

                                  Lisp in Life is a Lisp interpreter implemented in Conway’s Game of Life. The entire pattern is viewable on the browser here. To the best of my knowledge, this is the first time a high-level programming language was interpreted in Conway’s Game of Life. Running Lisp on the Game of Life Lisp is a language with a simple and elegant design, having an extensive ability to express sophisticated ideas as

                                    A Lisp Interpreter Implemented in Conway’s Game of Life
                                  • 0.10.0 Release Notes ⚡ The Zig Programming Language

                                    Tier 4 Support § Support for these targets is entirely experimental. If this target is provided by LLVM, LLVM may have the target as an experimental target, which means that you need to use Zig-provided binaries for the target to be available, or build LLVM from source with special configure flags. zig targets will display the target if it is available. This target may be considered deprecated by

                                    • 【GROMACS】Umbrella samplingによるMD simulation 【In silico創薬】【SMD】 - LabCode

                                      Windows 11 Home, 13th Gen Intel(R) Core(TM) i7-13700, 64 ビット オペレーティング システム、x64 ベース プロセッサ, メモリ:32GB Umbrella Samplingの概要と目的Umbrella Samplingは、分子がめったに起こさないような状態変化(たとえば、タンパク質同士が離れるなど)を詳しく調べるための計算手法です。通常の分子動力学(MD)では、エネルギー的に安定な状態にとどまりやすく、重要な変化が起こる確率が低いため、十分な情報が得られません。 たとえば、タンパク質AとBがくっついている状態から、少しずつ離れていく様子を観察したいとき、まずAとBを少しずつ引き離すSteered Molecular Dynamics(SMD)などのシミュレーションで、さまざまな距離の構造を取得します。その中から、0.5nm、0.7

                                      • NumPy 2.0.0 Release Notes — NumPy v2.4.dev0 Manual

                                        Getting started What is NumPy? Installation NumPy quickstart NumPy: the absolute basics for beginners Fundamentals and usage NumPy fundamentals NumPy for MATLAB users NumPy tutorials NumPy how-tos Advanced usage and interoperability Using NumPy C-API F2PY user guide and reference manual Under-the-hood documentation for developers Interoperability with NumPy Extras Glossary Release notes 2.4.0 2.3.

                                        • Fine-Tune Whisper For Multilingual ASR with 🤗 Transformers

                                          For demonstration purposes, we'll fine-tune the multilingual version of the small checkpoint with 244M params (~= 1GB). As for our data, we'll train and evaluate our system on a low-resource language taken from the Common Voice dataset. We'll show that with as little as 8 hours of fine-tuning data, we can achieve strong performance in this language. 1{}^11 The name Whisper follows from the acronym

                                            Fine-Tune Whisper For Multilingual ASR with 🤗 Transformers
                                          • Writing Pythonic Rust

                                            Over the past several weeks I have been attempting to reimplement the API of an existing python library as a wrapper for an equivalent library in Rust. tl;dr: this ended up being much harder than I expected it to be, partly because of important differences in the behaviour of the two languages, and partly because of the (self-imposed) obligation to match an existing (idiomatic) python API. Motivat

                                            • Unicode is harder than you think · mcilloni's blog

                                              Reading the excellent article by JeanHeyd Meneide on how broken string encoding in C/C++ is made me realise that Unicode is a topic that is often overlooked by a large number of developers. In my experience, there’s a lot of confusion and wrong expectations on what Unicode is, and what best practices to follow when dealing with strings that may contain characters outside of the ASCII range. This a

                                              • Why We Use Julia, 10 Years Later

                                                Exactly ten years ago today, we published "Why We Created Julia", introducing the Julia project to the world. At this point, we have moved well past the ambitious goals set out in the original blog post. Julia is now used by hundreds of thousands of people. It is taught at hundreds of universities and entire companies are being formed that build their software stacks on Julia. From personalized me

                                                  Why We Use Julia, 10 Years Later
                                                • Laurence Tratt: Better Shell History Search

                                                  I spend an awful lot of my day in Unix terminals running shell commands. For some reason, the variance in efficiency between different people when using the shell is huge: I know people who can run rings around me, and I’ve come across more than one paid professional who doesn’t use the “up” key to retrieve the previous command. I chose that last example very deliberately: most of the commands mos

                                                  • Type Parameters Proposal

                                                    Ian Lance Taylor Robert Griesemer August 20, 2021 StatusThis is the design for adding generic programming using type parameters to the Go language. This design has been proposed and accepted as a future language change. We currently expect that this change will be available in the Go 1.18 release in early 2022. AbstractWe suggest extending the Go language to add optional type parameters to type an

                                                    • 789 KB Linux Without MMU on RISC-V

                                                      Follow @popovicu94 In this guide, we’ll build a very tiny Linux kernel, weighing in at 789 K, and requiring no MMU support. We’ll write some userspace code and this will be deployed on a virtual RISC-V 64-bit machine, without MMU, and we’ll run some tiny programs of our own. As a reminder, please go through the guide for a micro Linux distro to understand the concepts behind what we’re doing today

                                                        789 KB Linux Without MMU on RISC-V
                                                      • Plan 9 Desktop Guide

                                                        PLAN 9 DESKTOP GUIDE INDEX What is Plan 9? Limitations and Workarounds Connecting to Other Systems VNC RDP SSH 9P Other methods Porting Applications Emulating other Operating Systems Virtualizing other Operating Systems Basics Window Management Copy Pasting Essential Programs Manipulating Text in the Terminal Acme - The Do It All Application Multiple Workspaces Tiling Windows Plumbing System Admin

                                                        • OpenAssistant/oasst1 · Datasets at Hugging Face

                                                          'Jew' or 'rabbi'"},"role":{"kind":"string","value":"assistant"},"lang":{"kind":"string","value":"en"},"review_count":{"kind":"number","value":3,"string":"3"},"review_result":{"kind":"bool","value":true,"string":"true"},"deleted":{"kind":"bool","value":false,"string":"false"},"rank":{"kind":"number","value":1,"string":"1"},"synthetic":{"kind":"bool","value":false,"string":"false"},"model_name":{"ki

                                                            OpenAssistant/oasst1 · Datasets at Hugging Face
                                                          • A Deep Dive into eBPF: Writing an Efficient DNS Monitoring.

                                                            eBPF / XDP is an in-kernel virtual machine, provides a high-level library, instruction set and an execution environment inside the Linux kernel. It’s used in many Linux kernel subsystems, most prominently networking, tracing, debugging and security. Including to modify the processing of packets in the kernel and also allows the programming of network devices such as SmartNICs. Use cases in eBPF im

                                                              A Deep Dive into eBPF: Writing an Efficient DNS Monitoring.
                                                            • Large Text Compression Benchmark

                                                               Large Text Compression Benchmark Matt Mahoney Last update: July 3, 2025. history This competition ranks lossless data compression programs by the compressed size (including the size of the decompression program) of the first 109 bytes of the XML text dump of the English version of Wikipedia on Mar. 3, 2006. About the test data. The goal of this benchmark is not to find the best overall compressi

                                                              • Python pathlib Cookbook: 57+ Examples to Master It (2022)

                                                                A mega tutorial with dozens of examples on how to use the pathlib module in Python 3 When I started learning Python, there was one thing I always had trouble with: dealing with directories and file paths! I remember the struggle to manipulate paths as strings using the os module. I was constantly looking up error messages related to improper path manipulation. The os module never felt intuitive an

                                                                  Python pathlib Cookbook: 57+ Examples to Master It (2022)
                                                                • Scientific Computing in Rust - aftix's dominion

                                                                  While getting my degree in Physics, I had to take classes in both MatLab and Python for scientific computing. I preferred python, where we used the SciPy and NumPy packages. In fact, I used those packages again (along with matplotlib) in an undergraduate research project simulating bacteria films. There's a catch: I was also pursuing a degree in Computer Science, and Python just wasn't fast enough

                                                                  • cuneicode, and the Future of Text in C

                                                                    Following up from the last post, there is a lot more we need to cover. This was intended to be the post where we talk exclusively about benchmarks and numbers. But, I have unfortunately been perfectly taunted and status-locked, like a monster whose “aggro” was pulled by a tank. The reason, of course, is due to a few folks taking issue with my outright dismissal of the C and C++ APIs (and not showi

                                                                      cuneicode, and the Future of Text in C
                                                                    • Flipping Pages: An analysis of a new Linux vulnerability in nf_tables and hardened exploitation techniques

                                                                      This blogpost is the next instalment of my series of hands-on no-boilerplate vulnerability research blogposts, intended for time-travellers in the future who want to do Linux kernel vulnerability research. Specifically, I hope beginners will learn from my VR workflow and the seasoned researchers will learn from my techniques. In this blogpost, I'm discussing a bug I found in nf_tables in the Linux

                                                                      • Python behind the scenes #6: how Python object system works

                                                                        As we know from the previous parts of this series, the execution of a Python program consists of two major steps: The CPython compiler translates Python code to bytecode. The CPython VM executes the bytecode. We've been focusing on the second step for quite a while. In part 4 we've looked at the evaluation loop, a place where Python bytecode gets executed. And in part 5 we've studied how the VM ex

                                                                        • Reindex, Transform, and Aggregate datasets using pandas Library

                                                                          Most of the time, the dataset we will get from the business will be dirty and cannot be used straight forward to train machine learning models. Therefore, we must treat the dataset and bring it to the desired form to input it into an algorithm. This tutorial discusses reindexing, transforming, and aggregating datasets in Pandas. What are Reindexing, Transforming, and Aggregating?Reindexing, transf

                                                                            Reindex, Transform, and Aggregate datasets using pandas Library
                                                                          • D-Bus overview - Fedora Magazine

                                                                            What D-Bus is D-Bus serves various purposes aiming to facilitate the cooperation between different processes in the system. This article will describe D-Bus and how it performs this function. From the D-Bus creators definition: D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it

                                                                              D-Bus overview - Fedora Magazine
                                                                            • Nine Rules for Elegant Rust Library APIs

                                                                              Photo by Kai Dahms on UnsplashI love creating software libraries. Two months ago, I started porting one of our Python packages into a Rust crate. This new Rust crate matches the Python package’s ease of use and expressiveness. Along the way, I learned nine rules that can help you create beautiful libraries in Rust. The rules are: Create examples that don’t embarrass you.Accept all kinds of strings

                                                                                Nine Rules for Elegant Rust Library APIs
                                                                              • Fitting a Forth in 512 bytes

                                                                                Fitting a Forth in 512 bytes June 10, 2021 · 31 minute read This article is part of the Bootstrapping series, in which I start from a 512-byte seed and try to bootstrap a practical system. Software is full of circular dependencies if you look deep enough. Compilers written in the language they compile are the most obvious example, but not the only one. To compile a kernel, you need a running kerne

                                                                                  Fitting a Forth in 512 bytes
                                                                                • BPF CO-RE (Compile Once – Run Everywhere)

                                                                                  What does it mean for a BPF application to be portable? And why it's actually hard to achieve that without BPF Compile Once — Run Everywhere (CO-RE)? In this post we'll see what are the challenges of writing BPF programs that can work across multiple kernel versions and how BPF CO-RE is helping to address this problem. This post was originally posted on Facebook's BPF blog. If you are curious abou