並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 75件

新着順 人気順

python if else program for practiceの検索結果1 - 40 件 / 75件

  • Don't write clean code, write CRISP code — Bitfield Consulting

    I’m sure we’re all in favour of “clean code”, but it’s one of those motherhood-and-apple-pie things that no one can reasonably disagree with. Who wants to write dirty code, unless maybe it’s for a porn site? The problem, of course, is that few of us can agree on what “clean code” means, and how to get there. A rule like “methods should only do one thing”, looks great on a T-shirt, but it’s not so

      Don't write clean code, write CRISP code — Bitfield Consulting
    • Fish 4.0: The Fish Of Theseus

      About two years ago, our head maintainer @ridiculousfish opened what quickly became our most-read pull request: #9512 - Rewrite it in Rust Truth be told, we did not quite expect that to be as popular as it was. It was written as a bit of an in-joke for the fish developers first, and not really as a press release to be shared far and wide. We didn’t post it anywhere, but other people did, and we go

      • Mojo may be the biggest programming language advance in decades – fast.ai

        I remember the first time I used the v1.0 of Visual Basic. Back then, it was a program for DOS. Before it, writing programs was extremely complex and I’d never managed to make much progress beyond the most basic toy applications. But with VB, I drew a button on the screen, typed in a single line of code that I wanted to run when that button was clicked, and I had a complete application I could now

          Mojo may be the biggest programming language advance in decades – fast.ai
        • 型安全かつシンプルなAgentフレームワーク「PydanticAI」の実装を解剖する - ABEJA Tech Blog

          はじめに こちらはABEJAアドベントカレンダー2024 12日目の記事です。 こんにちは、ABEJAでデータサイエンティストをしている坂元です。最近はLLMでアプローチしようとしていたことがよくよく検証してみるとLLMでは難しいことが分かり急遽CVのあらゆるモデルとレガシーな画像処理をこれでもかというくらい詰め込んだパイプラインを実装することになった案件を経験して、LLMでは難しそうなことをLLM以外のアプローチでこなせるだけの引き出しとスキルはDSとしてやはり身に付けておくべきだなと思うなどしています(LLMにやらせようとしていることは大抵難しいことなので切り替えはそこそこ大変)。 とはいうものの、Agentの普及によってより複雑かつ高度な推論も出来るようになってきています。弊社の社内外のプロジェクト状況を見ていても最近では単純なRAG案件は減りつつあり、計画からアクションの実行、結果

            型安全かつシンプルなAgentフレームワーク「PydanticAI」の実装を解剖する - ABEJA Tech Blog
          • Every System is a Log: Avoiding coordination in distributed applications

            Every System is a Log: Avoiding coordination in distributed applications How Restate works, Part 1Posted January 22, 2025 by Stephan Ewen and Jack Kleeman and Giselle van Dongen ‐ 13 min read Building resilient distributed applications remains a tough challenge. It should be possible to focus almost entirely on the business logic and the complexity inherent to the domain. Instead, you need to revi

              Every System is a Log: Avoiding coordination in distributed applications
            • Changing std::sort at Google’s Scale and Beyond

              TL;DR; We are changing std::sort in LLVM’s libcxx. That’s a long story of what it took us to get there and all possible consequences, bugs you might encounter with examples from open source. We provide some benchmarks, perspective, why we did this in the first place and what it cost us with exciting ideas from Hyrum’s Law to reinforcement learning. All changes went into open source and thus I can

                Changing std::sort at Google’s Scale and Beyond
              • 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

                • A new way to bring garbage collected programming languages efficiently to WebAssembly · V8

                  Show navigation A recent article on WebAssembly Garbage Collection (WasmGC) explains at a high level how the Garbage Collection (GC) proposal aims to better support GC languages in Wasm, which is very important given their popularity. In this article, we will get into the technical details of how GC languages such as Java, Kotlin, Dart, Python, and C# can be ported to Wasm. There are in fact two m

                  • The Ultimate Guide to Error Handling in Python

                    I often come across developers who know the mechanics of Python error handling well, yet when I review their code I find it to be far from good. Exceptions in Python is one of those areas that have a surface layer that most people know, and a deeper, almost secret one that a lot of developers don't even know exists. If you want to test yourself on this topic, see if you can answer the following qu

                      The Ultimate Guide to Error Handling in Python
                    • 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

                      • A Walk with LuaJIT

                        The following is a chronicle of implementing a general purpose zero-instrumentation BPF based profiler for LuaJIT. Some assumptions are made about what this entails and it may be helpful to read some of our other work in this area. One major change from prior efforts is that instead of working with the original Parca unwinder we are now working with the OpenTelemetry eBPF profiler. If you missed t

                          A Walk with LuaJIT
                        • Coroutines and effects

                          For the past few months I’ve been mulling over some things that Russell Johnston made me realize about the relationship between effect systems and coroutines. You can read more of his thoughts on this subject here, but he made me realize that effect systems (like that found in Koka) and coroutines (like Rust’s async functions or generators) are in some ways isomorphic to one another. I’ve been pon

                          • Solving common problems with Kubernetes

                            I first learned Kubernetes ("k8s" for short) in 2018, when my manager sat me down and said "Cloudflare is migrating to Kubernetes, and you're handling our team's migration." This was slightly terrifying to me, because I was a good programmer and a mediocre engineer. I knew how to write code, but I didn't know how to deploy it, or monitor it in production. My computer science degree had taught me a

                              Solving common problems with Kubernetes
                            • Why Create a New Unix Shell? (2021)

                              Introduction Before explaining why I created Oil, let's review what it is. You can think of a Unix shell in two ways: As a text-based user interface. You communicate with the operating system by typing commands. As a language. It has variables, functions, and loops. Shell programs are text files that start with #!/bin/sh. In this document, we'll think of Unix shells as languages. The Oil project a

                              • The Quest for Netflix on Asahi Linux | Blog

                                Welcome to my ::'########::'##::::::::'#######:::'######::: :: ##.... ##: ##:::::::'##.... ##:'##... ##:: :: ##:::: ##: ##::::::: ##:::: ##: ##:::..::: :: ########:: ##::::::: ##:::: ##: ##::'####: :: ##.... ##: ##::::::: ##:::: ##: ##::: ##:: :: ##:::: ##: ##::::::: ##:::: ##: ##::: ##:: :: ########:: ########:. #######::. ######::: ::........:::........:::.......::::......:::: CTF writeups, prog

                                • Why pipes sometimes get "stuck": buffering

                                  Here’s a niche terminal problem that has bothered me for years but that I never really understood until a few weeks ago. Let’s say you’re running this command to watch for some specific output in a log file: tail -f /some/log/file | grep thing1 | grep thing2 If log lines are being added to the file relatively slowly, the result I’d see is… nothing! It doesn’t matter if there were matches in the lo

                                  • Advent of Code on the Nintendo DS

                                    It is December. That means annoying Christmas things are everywhere, including but not limited to the annual programming semi-competition known as Advent of Code. The problem with Advent of Code is that it is a waste of time. Most of the puzzles are in the realm of either string processing (somewhat applicable to programming), logic puzzles (not really applicable to most programming), or stupid go

                                    • The Go Programming Language and Environment – Communications of the ACM

                                      Go is a programming language created at Google in late 2007 and released as open source in November 2009. Since then, it has operated as a public project, with contributions from thousands of individuals and dozens of companies. Go has become a popular language for building cloud infrastructure: Docker, a Linux container manager, and Kubernetes, a container deployment system, are core cloud techno

                                      • Solving Quantitative Reasoning Problems With Language Models

                                        Solving Quantitative Reasoning Problems with Language Models Aitor Lewkowycz∗, Anders Andreassen†, David Dohan†, Ethan Dyer†, Henryk Michalewski†, Vinay Ramasesh†, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, Yuhuai Wu, Behnam Neyshabur∗, Guy Gur-Ari∗, and Vedant Misra∗ Google Research Abstract Language models have achieved remarkable performance on a wide range of tasks that require

                                        • The State of Python 2025 | The PyCharm Blog

                                          This is a guest post from Michael Kennedy, the founder of Talk Python and a PSF Fellow. Welcome to the highlights, trends, and key actions from the eighth annual Python Developers Survey. This survey is conducted as a collaborative effort between the Python Software Foundation and JetBrains’ PyCharm team. My name is Michael Kennedy, and I’ve analyzed the more than 30,000 responses to the survey an

                                            The State of Python 2025 | The PyCharm Blog
                                          • A leap year check in three instructions

                                            With the following code, we can check whether a year 0 ≤ y ≤ 102499 is a leap year with only about 3 CPU instructions: bool is_leap_year_fast(uint32_t y) { return ((y * 1073750999) & 3221352463) <= 126976; } How does this work? The answer is surprisingly complex. This article explains it, mostly to have some fun with bit-twiddling; at the end, I'll briefly discuss the practical use. This is how a

                                            • Andrej Karpathy — AGI is still a decade away

                                              The Andrej Karpathy episode. Andrej explains why reinforcement learning is terrible (but everything else is much worse), why model collapse prevents LLMs from learning the way humans do, why AGI will just blend into the previous ~2.5 centuries of 2% GDP growth, why self driving took so long to crack, and what he sees as the future of education. Watch on YouTube; listen on Apple Podcasts or Spotify

                                                Andrej Karpathy — AGI is still a decade away
                                              • Dynamic Programming is not Black Magic - Quentin Santos

                                                This year’s Advent of Code has been brutal (compare the stats of 2023 with that of 2022, especially day 1 part 1 vs. day 1 part 2). It included a problem to solve with dynamic programming as soon as day 12, which discouraged some people I know. This specific problem was particularly gnarly for Advent of Code, with multiple special cases to take into account, making it basically intractable if you

                                                  Dynamic Programming is not Black Magic - Quentin Santos
                                                • Engineering for Slow Internet – brr

                                                  Engineering for Slow Internet How to minimize user frustration in Antarctica. Hello everyone! I got partway through writing this post while I was still in Antarctica, but I departed before finishing it. I’m going through my old draft posts, and I found that this one was nearly complete. It’s a bit of a departure from the normal content you’d find on brr.fyi, but it reflects my software / IT engine

                                                  • prompts.chat

                                                    Welcome to the “Awesome ChatGPT Prompts” repository! While this collection was originally created for ChatGPT, these prompts work great with other AI models like Claude, Gemini, Hugging Face Chat, Llama, Mistral, and more. ChatGPT is a web interface created by OpenAI that provides access to their GPT (Generative Pre-trained Transformer) language models. The underlying models, like GPT-4o and GPT-o

                                                    • Who needs Graphviz when you can build it yourself?

                                                      We recently overhauled our internal tools for visualizing the compilation of JavaScript and WebAssembly. When SpiderMonkey’s optimizing compiler, Ion, is active, we can now produce interactive graphs showing exactly how functions are processed and optimized. You can play with these graphs right here on this page. Simply write some JavaScript code in the test function and see what graph is produced

                                                        Who needs Graphviz when you can build it yourself?
                                                      • Sayonara, C++, and hello to Rust!

                                                        This past May, I started a new job working in Rust. I was somewhat skeptical of Rust for a while, but it turns out, it really is all it’s cracked up to be. As a long-time C++ programmer, and C++ instructor, I am convinced that Rust is better than C++ in all of C++’s application space, that for any new programming project where C++ would make sense as the programming language, Rust would make more

                                                        • 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

                                                            • The Birth of UNIX - CoRecursive Podcast

                                                              When you work on your computer, there are so many things you take for granted: operating systems, programming languages, they all have to come from somewhere. In the late 1960s and 1970s, that somewhere was Bell Labs, and the operating system they were building was UNIX. They were building more than just an operating system though. They were building a way to work with computers that had never exi

                                                                The Birth of UNIX - CoRecursive Podcast
                                                              • Game Bub: open-source FPGA retro emulation handheld

                                                                I’m excited to announce the project I’ve been working on for the last year and a half: Game Bub, an open-source FPGA based retro emulation handheld, with support for Game Boy, Game Boy Color, and Game Boy Advance games. Play Video: Game Bub can play physical cartridges, as well as emulated cartridges using ROM files loaded from a microSD card. Game Bub also supports the Game Link Cable in both GB

                                                                  Game Bub: open-source FPGA retro emulation handheld
                                                                • Agents for Amazon Bedrock now support memory retention and code interpretation (preview) | Amazon Web Services

                                                                  AWS News Blog Agents for Amazon Bedrock now support memory retention and code interpretation (preview) With Agents for Amazon Bedrock, generative artificial intelligence (AI) applications can run multistep tasks across different systems and data sources. A couple of months back, we simplified the creation and configuration of agents. Today, we are introducing in preview two new fully managed capab

                                                                    Agents for Amazon Bedrock now support memory retention and code interpretation (preview) | Amazon Web Services
                                                                  • What's New in Emacs 28.1?

                                                                    Try Mastering Emacs for free! Are you struggling with the basics? Have you mastered movement and editing yet? When you have read Mastering Emacs you will understand Emacs. It’s that time again: there’s a new major version of Emacs and, with it, a treasure trove of new features and changes. Notable features include the formal inclusion of native compilation, a technique that will greatly speed up y

                                                                    • 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

                                                                      • Rust, reflection and access rules

                                                                        Reflection is something a lot of people wish the Rust language had: It is not hard to stumble across somebody with an interesting use case for it. People want to use it for serialization, GCs, better interop, and so, so much more. If you can think of a task, there is somebody out there wishing they could implement it using reflection. Sadly, it does not look like it is coming any time soon. Still,

                                                                        • Demystify RAM Usage in Multi-Process Data Loaders

                                                                          A typical PyTorch training program on 8 GPUs with 4 dataloaderworkers per GPU would create at least processes.A naive use of PyTorch dataset and dataloader can easilyreplicate your dataset's RAM usage by 40 times. This issue has probably affected everyone who has done anything nontrivial with PyTorch.In this post, we will explain why it happens, and how to avoid the 40x RAM usage. All code example

                                                                            Demystify RAM Usage in Multi-Process Data Loaders
                                                                          • A Lisp REPL as my main shell

                                                                            If you enjoy this article and would like to help me keep writing, consider chipping in, every little bit helps to keep me going :) Thank you! Update: As of 2021-02-07, not all the code and configurations used in this presentation have been published. Should happen in the coming days, stay tuned! Introduction video The concepts I’m going to present in this article were featured in a presentation at

                                                                            • Technology Trends for 2024

                                                                              This has been a strange year. While we like to talk about how fast technology moves, internet time, and all that, in reality the last major new idea in software architecture was microservices, which dates to roughly 2015. Before that, cloud computing itself took off in roughly 2010 (AWS was founded in 2006); and Agile goes back to 2000 (the Agile Manifesto dates back to 2001, Extreme Programming t

                                                                                Technology Trends for 2024
                                                                              • Gregory Szorc's Digital Home | Rust is for Professionals

                                                                                A professional programmer delivers value through the authoring and maintaining of software that solves problems. (There are other important ways for professional programmers to deliver value but this post is about programming.) Programmers rely on various tools to author software. Arguably the most important and consequential choice of tool is the programming language. In this post, I will articul

                                                                                • 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