並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 46件

新着順 人気順

correct syntax for if statement in pythonの検索結果1 - 40 件 / 46件

  • 関数名、メソッド名、変数名でよく使う英単語のまとめ

    プログラミングをしていると関数名、メソッド名、変数名をどうするか悩みます。 ロジックより命名に時間を費やすこともざらにあります。翻訳したり、一般的な命名規則なのかいつも検索して大変です。 よく使うサイトの内容をコピってメモしておく 関数名とメソッド名の違いについて よく使う英単語のまえに、いつもごっちゃにして使っているけど、定義はこんな感じ 「関数」と「メソッド」の違い 似ているところ どちらも何か(引数)を入れると処理をして何か(戻り値)を返してくれます。 違うところ やってること自体は大差ありません。概念としては違います。 メソッドはオブジェクト指向で登場する用語で、オブジェクトの動作を定義したものです。 まずオブジェクトありきなのですね。一方の関数は、オブジェクト云々は関係ありません。 個人的な使い分け Java で登場する関数は「メソッド」です。C 言語で登場する関数は「関数」と呼

      関数名、メソッド名、変数名でよく使う英単語のまとめ
    • REST API Design Best Practices Handbook – How to Build a REST API with JavaScript, Node.js, and Express.js

      By Jean-Marc Möckel I've created and consumed many API's over the past few years. During that time, I've come across good and bad practices and have experienced nasty situations when consuming and building API's. But there also have been great moments. There are helpful articles online which present many best practices, but many of them lack some practicality in my opinion. Knowing the theory with

        REST API Design Best Practices Handbook – How to Build a REST API with JavaScript, Node.js, and Express.js
      • 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

        • 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
          • RFC 9562: Universally Unique IDentifiers (UUIDs)

             Internet Engineering Task Force (IETF) K. Davis Request for Comments: 9562 Cisco Systems Obsoletes: 4122 B. Peabody Category: Standards Track Uncloud ISSN: 2070-1721 P. Leach University of Washington May 2024 Universally Unique IDentifiers (UUIDs) Abstract This specification defines UUIDs (Universally Unique IDentifiers) -- also known as GUIDs (Globally Unique IDentifiers) -- and a Uniform Resou

              RFC 9562: Universally Unique IDentifiers (UUIDs)
            • 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

              • AST vs. Bytecode: Interpreters in the Age of Meta-Compilation

                233 AST vs. Bytecode: Interpreters in the Age of Meta-Compilation OCTAVE LAROSE, University of Kent, UK SOPHIE KALEBA, University of Kent, UK HUMPHREY BURCHELL, University of Kent, UK STEFAN MARR, University of Kent, UK Thanks to partial evaluation and meta-tracing, it became practical to build language implementations that reach state-of-the-art peak performance by implementing only an interprete

                • 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
                  • 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
                    • 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

                      • February 2021 (version 1.54)

                        Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.54.1: The update addresses an issue with an extension dependency. Update 1.54.2: The update addresses these issues. Update 1.54.3: The update addresses this issue. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the February 2021 release of Vi

                          February 2021 (version 1.54)
                        • Patterns for Building LLM-based Systems & Products

                          Patterns for Building LLM-based Systems & Products [ llm engineering production 🔥 ] · 66 min read Discussions on HackerNews, Twitter, and LinkedIn “There is a large class of problems that are easy to imagine and build demos for, but extremely hard to make products out of. For example, self-driving: It’s easy to demo a car self-driving around a block, but making it into a product takes a decade.”

                            Patterns for Building LLM-based Systems & Products
                          • 0.8.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

                            • Zig in 30 minutes

                              test.md A half-hour to learn Zig This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/ Basics the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with) You'll want to declare a main() function to get

                                Zig in 30 minutes
                              • 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

                                • 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
                                  • How to write a linter using tree-sitter in an hour

                                    This article was discussed on Hacker News. This is a continuation of my last post on how to write a tree-sitter grammar in an afternoon. Building on the grammar we wrote, now we’re going to write a linter for Imp, and it’s even easier! The final result clocks in less than 60 SLOC and can be found here. Recall that tree-sitter is an incremental parser generator. That is, you give it a description o

                                    • Eliciting Reasoning in Language Models with Cognitive Tools

                                      arXiv:2506.12115v1 [cs.CL] 13 Jun 2025 Eliciting Reasoning in Language Models with Cognitive Tools Brown Ebouky IBM Research - Zurich ETH Zurich Brown.Ebouky@ibm.com Andrea Bartezzaghi IBM Research - Zurich abt@zurich.ibm.com Mattia Rigotti IBM Research - Zurich mrg@zurich.ibm.com Abstract The recent advent of reasoning models like OpenAI’s o1 was met with excited spec- ulation by the AI community

                                      • Rust on MIPS64 Windows NT 4.0

                                        Introduction Some part of me has always been fascinated with coercing code to run in weird places. I scratch this itch a lot with my security research projects. These often lead me to writing shellcode to run in kernels or embedded hardware, sometimes with the only way being through an existing bug. For those not familiar, shellcode is honestly hard to describe. I don’t know if there’s a very form

                                          Rust on MIPS64 Windows NT 4.0
                                        • 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

                                          • Node.js — Node.js v22.7.0 (Current)

                                            2024-08-22, Version 22.7.0 (Current), @RafaelGSS Experimental transform types support With the new flag --experimental-transform-types it is possible to enable the transformation of TypeScript-only syntax into JavaScript code. This feature allows Node.js to support TypeScript syntax such as Enum and namespace. Thanks to Marco Ippolito for making this work on #54283. Module syntax detection is now

                                              Node.js — Node.js v22.7.0 (Current)
                                            • PEP 8 – Style Guide for Python Code | peps.python.org

                                              PEP 8 – Style Guide for Python Code Author: Guido van Rossum <guido at python.org>, Barry Warsaw <barry at python.org>, Alyssa Coghlan <ncoghlan at gmail.com> Status: Active Type: Process Created: 05-Jul-2001 Post-History: 05-Jul-2001, 01-Aug-2013 Table of Contents Introduction A Foolish Consistency is the Hobgoblin of Little Minds Code Lay-out Indentation Tabs or Spaces? Maximum Line Length Shoul

                                                PEP 8 – Style Guide for Python Code | peps.python.org
                                              • Now in Preview – Amazon CodeWhisperer- ML-Powered Coding Companion | Amazon Web Services

                                                AWS News Blog Now in Preview – Amazon CodeWhisperer- ML-Powered Coding Companion As I was getting ready to write this post I spent some time thinking about some of the coding tools that I have used over the course of my career. This includes the line-oriented editor that was an intrinsic part of the BASIC interpreter that I used in junior high school, the IBM keypunch that I used when I started co

                                                  Now in Preview – Amazon CodeWhisperer- ML-Powered Coding Companion | Amazon Web Services
                                                • A string formatting library in 65 lines of C++

                                                  In this write-up, I will walk you through an implementation of a string formatting library for C++ I came up with for my video game. The end result came out really compact, at only 65 lines of code—providing a skeleton that can be supplemented with additional functionality at low cost. Usage Given a format buffer… char buffer[64]; String_Buffer buf = {str, sizeof str}; …the fmt::format function pr

                                                  • 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

                                                    • October 2022 (version 1.73)

                                                      Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.73.1: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the October 2022 release of Visual Studio Code. There are many updates in this version that we hope you'll like, some of the key highlights include: Searc

                                                        October 2022 (version 1.73)
                                                      • 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

                                                        • Rust in Perspective

                                                          We are discussing and working toward adding the language Rust as a second implementation language in the Linux kernel. A year ago Jake Edge made an excellent summary of the discussions so far on Rust for the Linux kernel and we (or rather Miguel and Wedson) have made further progress since then. For the record I think this is overall a good idea and worth a try. I wanted to add some background tha

                                                            Rust in Perspective
                                                          • April 2021 (version 1.56)

                                                            Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.56.1: The update addresses these security issues. Update 1.56.2: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the April 2021 release of Visual Studio Code. The VS Code team has been busy this month working

                                                              April 2021 (version 1.56)
                                                            • Ubuntu 24.04 LTS (Noble Numbat) Release Notes

                                                              Noble Numbat Release Notes Table of Contents Introduction New features in 24.04 LTS Known Issues Official flavours More information Introduction These release notes for Ubuntu 24.04 LTS (Noble Numbat) provide an overview of the release and document the known issues with Ubuntu and its flavours. For details of the changes applied since 24.04, please see the 24.04.2 change summary. Support lifespan

                                                              • If Not React, Then What? - Infrequently Noted

                                                                Over the past decade, my work has centred on partnering with teams to build ambitious products for the web across both desktop and mobile. This has provided a ring-side seat to a sweeping variety of teams, products, and technology stacks across more than 100 engagements. While I'd like to be spending most of this time working through improvements to web APIs, the majority of time spent with partne

                                                                  If Not React, Then What? - Infrequently Noted
                                                                • Node.js — Node.js v22.9.0 (Current)

                                                                  2024-09-17, Version 22.9.0 (Current), @RafaelGSS New API to retrieve execution Stack Trace A new API getCallSite has been introduced to the util module. This API allows users to retrieve the stacktrace of the current execution. Example: const util = require('node:util'); function exampleFunction() { const callSites = util.getCallSite(); console.log('Call Sites:'); callSites.forEach((callSite, inde

                                                                    Node.js — Node.js v22.9.0 (Current)
                                                                  • A Review of Nim 2: The Good & Bad with Example Code

                                                                    I've been using Nim for about 1-2 years now, and I believe the language is undervalued. It's not perfect, of course, but it's pleasant to write and read. My personal website uses Nim. After reading a recent article on Nim ("Why Nim") and the associated HN comments, it's clear that comments and some information about Nim are misleading and outdated. Since Nim 2, a tracing Garbage Collector is not t

                                                                    • Why APL is a language worth knowing

                                                                      “A language that doesn't affect the way you think about programming, is not worth knowing.”, by Alan J. Perlis. Why APL is a language worth knowing Alan Perlis, the computer scientist recipient of the first Turing award, wrote “A language that doesn't affect the way you think about programming, is not worth knowing.” ― Alan J. Perlis, 1982. Special feature: Epigrams on programming. ACM Sigplan Not

                                                                        Why APL is a language worth knowing
                                                                      • Java is criminally underhyped

                                                                        It's likely that you read the title of this post and thought "what is this guy smoking? Java is everywhere!" You're correct, Java still dominates enterprise and runs some of the world's largest mission-critical applications. But Java's adoption isn't what I'm talking about, I'm talking about its hype. I spend a lot of time around inexperienced programmers. And what do inexperienced programmers lov

                                                                        • Funny Programming Languages

                                                                          January 19, 2023 Funny Programming Languages One of the weirdest and most wonderful things about people is that they can make a joke out of anything. For any human discipline there's people making jokes about that discipline. In programming, that starts with memes like "how do I exit vim" (as typified in places like r/programmerhumor), or funny examples of awful code (such as from TheDailyWTF).1 T

                                                                            Funny Programming Languages
                                                                          • JupyterLab Changelog — JupyterLab 4.5.0a3 documentation

                                                                            JupyterLab Changelog# v4.4# JupyterLab 4.4 includes a number of new features (described below), bug fixes, and enhancements. This release is compatible with extensions supporting JupyterLab 4.0. Extension authors are encouraged to consult the Extension Migration Guide which lists deprecations and changes to the public API. Code console improvements# The code console prompt can now be positioned on

                                                                            • Exhaustive Union Matching in Python - Preferred Networks Research & Development

                                                                              Pattern matching on algebraic data types is a powerful technique to process a given input and many programming languages have adopted it in one way or another. A check on whether a given match is “exhaustive”, i.e., covers all possible inputs, is helpful to avoid bugs when the set of possible inputs is extended; for example, when new enumeration values are added. In this blog post I will first bri

                                                                                Exhaustive Union Matching in Python - Preferred Networks Research & Development
                                                                              • HTML Whitespace is Broken - Devel without a Cause

                                                                                HTML Whitespace is Broken September 2, 2024Recently, I was working on a project which required a deeper understanding of how whitespace works in HTML. I was never a fan of HTML's whitespace behavior before as I've been burned by it a few times. But as I dug into it more deeply, I found myself discovering complex design issues that I wanted to explore in a blog post. This is partially to write down

                                                                                  HTML Whitespace is Broken - Devel without a Cause
                                                                                • Combobulate: Structured Movement and Editing with Tree-Sitter

                                                                                  Combobulate: Structured Movement and Editing with Tree-Sitter Combobulate is a package that adds advanced structured editing and movement to many programming modes in Emacs. Here's how it works, and how it can enrich your editing experience in Emacs. About a year ago I released an alpha – prototype, really – version of a tool I call Combobulate. I’d been using it personally for a while before I le

                                                                                    Combobulate: Structured Movement and Editing with Tree-Sitter