並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 24 件 / 24件

新着順 人気順

reversed function in python listの検索結果1 - 24 件 / 24件

  • 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

    • microgpt

      microgpt.py P%]� �tP� """ The most atomic way to train and run inference for a GPT in pure, dependency-free Python. This file is the complete algorithm. Everything else is just efficiency. @karpathy """ import os # os.path.exists import math # math.log, math.exp import random # random.seed, random.choices, random.gauss, random.shuffle random.seed(42) # Let there be order among chaos # Let there be

        microgpt
      • Announcing TypeScript 5.2 - TypeScript

        Today we’re excited to announce the release of TypeScript 5.2! If you’re not familiar with TypeScript, it’s a language that builds on top of JavaScript by making it possible to declare and describe types. Writing types in our code allows us to explain intent and have other tools check our code to catch mistakes like typos, issues with null and undefined, and more. Types also power TypeScript’s edi

          Announcing TypeScript 5.2 - TypeScript
        • microgpt

          This is a brief guide to my new art project microgpt, a single file of 200 lines of pure Python with no dependencies that trains and inferences a GPT. This file contains the full algorithmic content of what is needed: dataset of documents, tokenizer, autograd engine, a GPT-2-like neural network architecture, the Adam optimizer, training loop, and inference loop. Everything else is just efficiency.

          • Azure OpenAI Service の Assistants API でデータ分析 - Taste of Tech Topics

            こんにちは、igaです。 最近は気温の上下が大きいので、服装選びが大変ですね。 今回は、Azure OpenAI Servce Assistants APIを使ってみました。 Azure OpenAI Servce Assistants APIに横浜市の人口データを投入して、人口の増減がどう推移しているのか自動で分析させてみました。 Azure OpenAI Servce Assistants API Azure OpenAI Servce Assistants APIとは Azure OpenAI Servce Assistants APIは、2024年4月現在パブリックプレビューとして利用できる機能です。 learn.microsoft.com Azure OpenAI Servce Assistants API(以降、Assistantsと表記します)により、Azure OpenAI

              Azure OpenAI Service の Assistants API でデータ分析 - Taste of Tech Topics
            • 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

              • 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

                • Eliciting Reasoning in Language Models with Cognitive Tools

                  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 about the mechanisms underlying these

                  • 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
                    • Ordering Movie Credits With Graph Theory

                      At Endcrawl we're always thinking about the hard work that goes into making film and TV, and how that work translates to on-screen credits. A feature film may involve thousands of people, hundreds of distinct job titles or "roles," and dozens of departments. So there's plenty for a producer to worry about, like: Did we forget or misspell a name? Is this the correct way to credit that role? Do all

                        Ordering Movie Credits With Graph Theory
                      • Renato Athaydes

                        Revenge of Lisp (Part 1⁄2) Background vector created by upklyak - www.freepik.com This may surprise you if you know me, but I’ve been learning Common Lisp for a few weeks now. It all started when I was reading, funnily enough, a blog post about another, much more hyped, language called Julia. The post was titled Julia and the reincarnation of Lisp, and in it the author lamented that despite his lo

                        • The Alkyne GC · mcyoung

                          Alkyne is a scripting language I built a couple of years ago for generating configuration blobs. Its interpreter is a naive AST walker1 that uses ARC2 for memory management, so it’s pretty slow, and I’ve been gradually writing a new evaluation engine for it. This post isn’t about Alkyne itself, that’s for another day. For now, I’d like to write down some notes for the GC I wrote3 for it, and more

                            The Alkyne GC · mcyoung
                          • The simplicity of Prolog

                            Back to homepage Nowadays the most popular programming languages are Python, Javascript, Java, C++, C#, Kotlin and Ruby, and the average programmer is probably familiar with one or more of these languages. It's relatively easy to switch from one to another (barring any framework specific knowledge that may be needed), since they are all imperative (and for the most part object-oriented) languages,

                            • 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

                              • A from-scratch tour of Bitcoin in Python

                                I find blockchain fascinating because it extends open source software development to open source + state. This seems to be a genuine/exciting innovation in computing paradigms; We don’t just get to share code, we get to share a running computer, and anyone anywhere can use it in an open and permissionless manner. The seeds of this revolution arguably began with Bitcoin, so I became curious to dril

                                • std::flip

                                  std::flip is a little-known utility from the C++ standard library header <functional>: it is a higher-order function that accepts a Callable and returns an equivalent Callable with the order of its parameters reversed (or “flipped”). To understand how it can be useful, let’s start with a simple example. Consider the following tree node class: struct node { int value; node* parent = nullptr; node*

                                  • A History of the Future, 2025-2040 — LessWrong

                                    This is an all-in-one crosspost of a scenario I originally published in three parts on my blog, No Set Gauge. Links to the originals: A History of the Future, 2025-2027A History of the Future, 2027-2030A History of the Future, 2030-2040 Thanks to Luke Drago, Duncan McClements, Theo Horsley, and Bilal Chughtai for comments. 2025-2027Below is part 1 of an extended scenario describing how the future

                                      A History of the Future, 2025-2040 — LessWrong
                                    • Primitive Recursive Functions For A Working Programmer

                                      Primitive Recursive Functions For A Working Programmer Aug 1, 2024 Programmers on the internet often use “Turing-completeness” terminology. Typically, not being Turing-complete is extolled as a virtue or even a requirement in specific domains. I claim that most such discussions are misinformed — that not being Turing complete doesn’t actually mean what folks want it to mean, and is instead a stand

                                      • 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
                                        • AtCoder - 解法パターンの整理 - 競プロはじめました

                                          よく出る思考パターン・覚えておきたいアイディアをメモしておきます. 問題の分類にもなっています.参考になるコードのリンクをメモしている問題もあります. 【2022.01追記】最近は,このページではなく,タグで分類するようにしています. 入力 出力 改行して出力 bool False, True 比較演算子 all, any 切り捨て・切り上げ(床関数・天井関数) 四捨五入 ソート 反転(逆順) スライス 後ろから指定 文字列操作 置換 リストの結合 deque - 先頭・末尾への追加・削除 アルファベット⇔数字 文字列の位置(左端,右端) 正規表現 リスト操作 注意 2要素の入れ替え set 生成 集合演算 setの中にlistはダメ! 組み合わせ 出現回数 - collections.Counter 同じ値になる組み合わせ 二項係数 二項係数(mod 10**9+7) mod mod 1

                                            AtCoder - 解法パターンの整理 - 競プロはじめました
                                          • Catching the big fish: Analyzing a large-scale phishing-as-a-service operation | Microsoft Security Blog

                                            In researching phishing attacks, we came across a campaign that used a rather high volume of newly created and unique subdomains—over 300,000 in a single run. This investigation led us down a rabbit hole as we unearthed one of the operations that enabled the campaign: a large-scale phishing-as-a-service operation called BulletProofLink, which sells phishing kits, email templates, hosting, and auto

                                              Catching the big fish: Analyzing a large-scale phishing-as-a-service operation | Microsoft Security Blog
                                            • Flatpak Is Not the Future

                                              ← ludocode.com Flatpak Is Not the Future Original date: 2021-11-18 Last updated: 2021-11-23 Deploying apps for the Linux desktop is hard. A major problem has historically been library compatibility. Different Linux distributions, and even different versions of the same distribution, have had incompatible libraries. Unfortunately, there hasn’t always been a culture of backwards compatibility on the

                                              • What's new at Google I/O 2023

                                                Introducing the Extensions publishing experience If you’re a developer with an idea for a new extension - or if you want to help people get started with your business’ API - you can now use the Extensions publishing experience to build, publish, and share your own extensions with millions of Firebase and Google Cloud developers across the world. This is the first step towards building a thriving e

                                                  What's new at Google I/O 2023
                                                • ABC283で入茶しました!〜成長日記〜 - 成長観察日記

                                                  華麗なる右アッパー(©︎Ruteさん)で、ついに照り焼き色になりました〜!!! すごい、どこもかしこも茶色でうれしい!! うれしいので、わたしのAtCoder歴を辿る、成長観察日記をお届けすることにしました。 ひとりじゃ絶対無理だったーので、お礼も込めて、アカウント名を出したりしてしまってます…もしよろしくなかったら消すので、教えてください! というわけで、お見苦しいところもある日記ですが、どうぞ行けるところまでお付き合いください 第一部 2021年 11月 伝来 12月 12/11(土) はじめてのAC、そしてはじめてのWA 12/15(水)〜12月末 2022年 1月 01/02(日)〜01/04(火) 01/08(土) はじめてのコンテスト はじめての0完 01/30(土) 2回目のコンテスト はじめてのコンテスト中AC 2月 02/05(土) 3回目のABC はじめてのTLE 再び

                                                    ABC283で入茶しました!〜成長日記〜 - 成長観察日記
                                                  1