並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 201件

新着順 人気順

simple python program for if elseの検索結果1 - 40 件 / 201件

  • 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
    • This is The Entire Computer Science Curriculum in 1000 YouTube Videos

      This is The Entire Computer Science Curriculum in 1000 YouTube Videos In this article, we are going to create an entire Computer Science curriculum using only YouTube videos. The Computer Science curriculum is going to cover every skill essential for a Computer Science Engineer that has expertise in Artificial Intelligence and its subfields, like: Machine Learning, Deep Learning, Computer Vision,

        This is The Entire Computer Science Curriculum in 1000 YouTube Videos
      • Minimal safe Bash script template

        Published on December 14, 2020   ·   Updated on December 16, 2020 Bash scripts. Almost anyone needs to write one sooner or later. Almost no one says “yeah, I love writing them”. And that’s why almost everyone is putting low attention while writing them. I won’t try to make you a Bash expert (since I’m not a one either), but I will show you a minimal template that will make your scripts safer. You

          Minimal safe Bash script template
        • CPUエミュレータをRustで自作する - Don't Repeat Yourself

          この記事は Rust Advent Calendar 2020 ならびに CyberAgent Developers Advent Calendar 25日目の記事です。 今年のはじめの頃になりますが、『CPUの創り方』という本に載っている TD4 という CPU を実装してみました。TD4 は「とりあえず動作するだけの4bit CPU」の略です。この本に載っている CPU エミュレータを実際に実装してみました。ただし、本書には GUI が載っていましたが、それは省略しました。 CPUの創りかた 作者:渡波 郁発売日: 2003/10/01メディア: 単行本(ソフトカバー) 「最近話題の RISC-V などの CPU エミュレータを作ってみたいものの、いきなり作るにはハードルが高い。何か簡単なもので素振りをして CPU の動作の仕組みをまずは知りたい」という方にはかなりオススメできる教材だ

            CPUエミュレータをRustで自作する - Don't Repeat Yourself
          • Building a tiny Linux from scratch

            Last week, I built a tiny Linux system from scratch, and booted it on my laptop! Here’s what it looked like: Let me tell you how I got there. I wanted to learn more about how the Linux kernel works, and what’s involved in booting it. So I set myself the goal to cobble together the bare neccessities required to boot into a working shell. In the end, I had a tiny Linux system with a size of 2.5 MB,

              Building a tiny Linux from scratch
            • 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
              • OOP: the worst thing that happened to programming

                > BTC: bc1qs0sq7agz5j30qnqz9m60xj4tt8th6aazgw7kxr ETH: 0x1D834755b5e889703930AC9b784CB625B3cd833E USDT(Tron): TPrCq8LxGykQ4as3o1oB8V7x1w2YPU2o5n Ton: UQAtBuFWI3H_LpHfEToil4iYemtfmyzlaJpahM3tFSoxomYQ Doge: D7GMQdKhKC9ymbT9PtcetSFTQjyPRRfkwTdismiss OOP: the worst thing that happened to programming [2/24/2025] In this article, we will try to understand why OOP is the worst thing that happened to prog

                  OOP: the worst thing that happened to programming
                • 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

                  • How I Hacked my Car

                    Note: As of 2022/10/25 the information in this series is slightly outdated. See Part 5 for more up to date information. The Car⌗ Last summer I bought a 2021 Hyundai Ioniq SEL. It is a nice fuel-efficient hybrid with a decent amount of features like wireless Android Auto/Apple CarPlay, wireless phone charging, heated seats, & a sunroof. One thing I particularly liked about this vehicle was the In-V

                    • Introducing Ezno

                      Ezno is an experimental compiler I have been working on and off for a while. In short, it is a JavaScript compiler featuring checking, correctness and performance for building full-stack (rendering on the client and server) websites. This post is just an overview of some of the features I have been working on which I think are quite cool as well an overview on the project philosophy ;) It is still

                        Introducing Ezno
                      • The End of Programming – Communications of the ACM

                        The end of classical computer science is coming, and most of us are dinosaurs waiting for the meteor to hit. I came of age in the 1980s, programming personal computers such as the Commodore VIC-20 and Apple ][e at home. Going on to study computer science (CS) in college and ultimately getting a Ph.D. at Berkeley, the bulk of my professional training was rooted in what I will call “classical” CS: p

                        • Writing a C compiler in 500 lines of Python

                          A few months ago, I set myself the challenge of writing a C compiler in 500 lines of Python1, after writing my SDF donut post. How hard could it be? The answer was, pretty hard, even when dropping quite a few features. But it was also pretty interesting, and the result is surprisingly functional and not too hard to understand! There's too much code for me to comprehensively cover in a single blog

                          • Announcing WASIX · Blog · Wasmer

                            Announcing WASIXWASIX extends the WASI proposal to build useful and productive applications today with full POSIX compatibility Today we are very excited to launch a new initiative that will start shaping the future of WebAssembly on both the browser and the server. WASI was announced about 4 years ago and was a great push to move the Wasm community forward. It got everyone so excited that even So

                              Announcing WASIX · Blog · Wasmer
                            • 型安全かつシンプルな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
                                • Lessons from Writing a Compiler

                                  The prototypical compilers textbook is: 600 pages on parsing theory. Three pages of type-checking a first-order type system like C. Zero pages on storing and checking the correctness of declarations (the “symbol table”). Zero pages on the compilation model, and efficiently implementing separate compilation. 450 pages on optimization and code generation. The standard academic literature is most use

                                  • Tales of the M1 GPU - Asahi Linux

                                    Hello everyone, Asahi Lina here!✨ marcan asked me to write an article about the M1 GPU, so here we are~! It’s been a long road over the past few months and there’s a lot to cover, so I hope you enjoy it! What’s a GPU?You probably know what a GPU is, but do you know how they work under the hood? Let’s take a look! Almost all modern GPUs have the same main components: A bunch of shader cores, which

                                      Tales of the M1 GPU - Asahi Linux
                                    • The Scary Thing About Automating Deploys - Engineering at Slack

                                      Most of Slack runs on a monolithic service simply called “The Webapp”. It’s big – hundreds of developers create hundreds of changes every week. Deploying at this scale is a unique challenge. When people talk about continuous deployment, they’re often thinking about deploying to systems as soon as changes are ready. They talk about microservices and 2-pizza teams (~8 people). But what does continuo

                                      • Interview with Ryan Dahl, Node.js & Deno creator by Evrone

                                        In an interview with Evrone, Ryan Dahl speaks about the main challenges in Deno, the future of JavaScript and TypeScript, and tells how he would have changed his approach to Node.js if he could travel back in time. We met with Ryan Dahl, the creator of Node.js, to discuss the origins of the platform, its impact on JavaScript, and his thoughts on its future. In the interview he also reflected on hi

                                          Interview with Ryan Dahl, Node.js & Deno creator by Evrone
                                        • Prototyping in Rust | corrode Rust Consulting

                                          Programming is an iterative process - as much as we would like to come up with the perfect solution from the start, it rarely works that way. Good programs often start as quick prototypes. The bad ones stay prototypes, but the best ones evolve into production code. Whether you’re writing games, CLI tools, or designing library APIs, prototyping helps tremendously in finding the best approach before

                                            Prototyping in Rust | corrode Rust Consulting
                                          • The New Internet: Tailscale's Vision for the Future of Connectivity

                                            Avery Pennarun is the CEO and co-founder of Tailscale. A version of this post was originally presented at a company all-hands. We don’t talk a lot in public about the big vision for Tailscale, why we’re really here. Usually I prefer to focus on what exists right now, and what we’re going to do in the next few months. The future can be distracting. But increasingly, I’ve found companies are startin

                                              The New Internet: Tailscale's Vision for the Future of Connectivity
                                            • Rewriting the Ruby parser

                                              At Shopify, we have spent the last year writing a new Ruby parser, which we’ve called YARP (Yet Another Ruby Parser). As of the date of this post, YARP can parse a semantically equivalent syntax tree to Ruby 3.3 on every Ruby file in Shopify’s main codebase, GitHub’s main codebase, CRuby, and the 100 most popular gems downloaded from rubygems.org. We recently got approval to merge this work into C

                                                Rewriting the Ruby parser
                                              • 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
                                                • High throughput Fizz Buzz

                                                  Fizz Buzz is a common challenge given during interviews. The challenge goes something like this: Write a program that prints the numbers from 1 to n. If a number is divisible by 3, write Fizz instead. If a number is divisible by 5, write Buzz instead. However, if the number is divisible by both 3 and 5, write FizzBuzz instead. The goal of this question is to write a FizzBuzz implementation that go

                                                    High throughput Fizz Buzz
                                                  • Hyperlight Wasm: Fast, secure, and OS-free - Microsoft Open Source Blog

                                                    Last fall the Azure Core Upstream team introduced Hyperlight: an open-source Rust library you can use to execute small, embedded functions using hypervisor-based protection. Then, we showed how to run Rust functions really, really fast, followed by using C to run Javascript. In February 2025, the Cloud Native Computing Foundation (CNCF) voted to onboard Hyperlight into their Sandbox program. We’re

                                                      Hyperlight Wasm: Fast, secure, and OS-free - Microsoft Open Source Blog
                                                    • Notes by djb on using Fil-C (2025)

                                                      Notes by djb on using Fil-C (2025) I'm impressed with the level of compatibility of the new memory-safe C/C++ compiler Fil-C (filcc, fil++). Many libraries and applications that I've tried work under Fil-C without changes, and the exceptions haven't been hard to get working. I've started accumulating miscellaneous notes on this page regarding usage of Fil-C. My selfish objective here is to protect

                                                      • Gamedev in Lisp. Part 1: ECS and Metalinguistic Abstraction - cl-fast-ecs by Andrew

                                                        Gamedev in Lisp. Part 1: ECS and Metalinguistic Abstraction In this series of tutorials, we will delve into creating simple 2D games in Common Lisp. The result of the first part will be a development environment setup and a basic simulation displaying a 2D scene with a large number of physical objects. It is assumed that the reader is familiar with some high-level programming language, has a gener

                                                          Gamedev in Lisp. Part 1: ECS and Metalinguistic Abstraction - cl-fast-ecs by Andrew
                                                        • Cheating is All You Need | Sourcegraph Blog

                                                          Heya. Sorry for not writing for so long. I’ll make up for it with 3000 pages here. I’m just hopping right now. That’s kinda the only way to get me to blog anymore. I’ve rewritten this post so many times. It’s about AI. But AI is changing so fast that the post is out of date within a few days. So screw it. I’m busting this version out in one sitting. (Spoiler alert: There’s some Sourcegraph stuff a

                                                            Cheating is All You Need | Sourcegraph Blog
                                                          • The Roc Programming Language

                                                            Examples Roc is a young language. It doesn't even have a numbered release yet, just nightly builds! However, it can already be used for several things if you're up for being an early adopter— with all the bugs and missing features which come with that territory. Here are some examples of how it can be used today. Command-Line Interfaces main! = |args| Stdout.line!("Hello!") You can use Roc to crea

                                                            • Weird Lexical Syntax

                                                              I just learned 42 programming languages this month to build a new syntax highlighter for llamafile. I feel like I'm up to my eyeballs in programming languages right now. Now that it's halloween, I thought I'd share some of the spookiest most surprising syntax I've seen. The languages I decided to support are Ada, Assembly, BASIC, C, C#, C++, COBOL, CSS, D, FORTH, FORTRAN, Go, Haskell, HTML, Java,

                                                                Weird Lexical Syntax
                                                              • 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

                                                                • Python is a Compiled Language

                                                                  This blog post hopes to convince you that Python is a compiled language. And by “Python”, I don’t mean alternate versions of Python like PyPy, Mypyc, Numba, Cinder, or even Python-like programming languages like Cython, Codon, Mojo1—I mean the regular Python: CPython! The Python that is probably installed on your computer right now. The Python that you got when you searched “python” on Google and

                                                                  • Why Rust strings seem hard | Brandon's Website

                                                                    Why Rust strings seem hard April 13, 2021 Lately I've been seeing lots of anecdotes from people trying to get into Rust who get really hung up on strings (&str, String, and their relationship). Beyond Rust's usual challenges around ownership, there can be an added layer of frustration because strings are so easy in the great majority of languages. You just add them together, split them, whatever!

                                                                    • 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

                                                                        • syntaxdesign

                                                                          One of the most recognizable features of a languages is its syntax. What are some of the things about syntax that matter? What questions might you ask if you were creating a syntax for your own language? Motivation A programming language gives us a way structure our thoughts. Each program, has a kind of internal structure, for example: How can we capture this structure? One way is directly, via pi

                                                                          • Implementing Logic Programming

                                                                            Most of my readers are probably familiar with procedural programming, object-oriented programming (OOP), and functional programming (FP). The majority of top programming languages on all of the language popularity charts (like TIOBE) support all three to some extent. Even if a programmer avoided one or more of those three paradigms like the plague, they’re likely at least aware of them and what th

                                                                              Implementing Logic Programming
                                                                            • Recto — a truly 2D language

                                                                              Masato Hagiwara Open in Recto Pad Google Colab Github Recto Pad TL;DR Recto is a 2D programming language that uses nested rectangles as its core syntax, encoding structure and recursion directly in space instead of a linear stream of text. Recto explores new ways to write, parse, and reason about code—and even natural language—spatially. Introduction Open in Recto Pad Virtually all the languages w

                                                                                Recto — a truly 2D language
                                                                              • Building a Toy Programming Language in Python

                                                                                I thought it would be fun to go outside of my comfort zone of web development topics and write about something completely different and new, something I have never written about before. So today, I'm going to show you how to implement a programming language! The project will parse and execute programs written in a simple language I called my (I know it's a lame name, but hey, it is "my" language).

                                                                                  Building a Toy Programming Language in Python
                                                                                • 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