並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 34 件 / 34件

新着順 人気順

foreach loop for array in javascriptの検索結果1 - 34 件 / 34件

  • Google TypeScript Style Guide

    // Good: choose between two options as appropriate (see below). import * as ng from '@angular/core'; import {Foo} from './foo'; // Only when needed: default imports. import Button from 'Button'; // Sometimes needed to import libraries for their side effects: import 'jasmine'; import '@polymer/paper-button'; Import paths TypeScript code must use paths to import other TypeScript code. Paths may be r

    • neue cc - ゼロアロケーションLINQライブラリ「ZLinq」のリリースとアーキテクチャ解説

      ゼロアロケーションLINQライブラリ「ZLinq」のリリースとアーキテクチャ解説 2025-05-05 ZLinq v1を先月リリースしました!structとgenericsベースで構築することによりゼロアロケーションを達成しています。またLINQ to Span, LINQ to SIMD, LINQ to Tree(FileSystem, JSON, GameObject, etc.)といった拡張要素と、任意の型のDrop-in replacement Source Generator。そして.NET Standard 2.0, Unity, Godotなどの多くのプラットフォームサポートまで含めた大型のライブラリとなっています!現在GitHub Starsも2000を超えました。 https://github.com/Cysharp/ZLinq structベースのLINQそのものは

      • JavaScript Best Practices | The WebStorm Blog

        IDEs CLion DataGrip DataSpell Fleet GoLand IntelliJ IDEA PhpStorm PyCharm RustRover Rider RubyMine WebStorm Plugins & Services Big Data Tools Code With Me JetBrains Platform Scala Toolbox App Writerside JetBrains AI Grazie Junie JetBrains for Data Kineto Team Tools Datalore Space TeamCity Upsource YouTrack Hub Qodana CodeCanvas .NET & Visual Studio .NET Tools ReSharper C++ Languages & Frameworks K

          JavaScript Best Practices | The WebStorm Blog
        • A virtual DOM in 200 lines of JavaScript

          In this post I’ll walk through the full implementation of a Virtual DOM in a bit over 200 lines of JavaScript. The result is a full-featured and sufficiently performant virtual DOM library (demos). It’s available on NPM as the smvc package. The main goal is to illustrate the fundamental technique behind tools like React. React, Vue and the Elm language all simplify the creation of interactive web

          • All JavaScript and TypeScript Features of the last 3 years

            TypeScript as envisioned by Stable DiffusionThis article goes through almost all of the changes of the last 3 years (and some from earlier) in JavaScript / ECMAScript and TypeScript . Not all of the following features will be relevant to you or even practical, but they should instead serve to show what’s possible and to deepen your understanding of these languages. There are a lot of TypeScript fe

              All JavaScript and TypeScript Features of the last 3 years
            • 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
              • 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 video games use LUTs and how you can too

                  Look-up-tables, more commonly referred to as LUTs, are as old as Mathematics itself. The act of precalculating things into a row or table is nothing new. But in the realm of graphics programming, this simple act unlocks some incredibly creative techniques, which both artists and programmers found when faced with tough technical hurdles. We’ll embark on a small journey, which will take us from simp

                    How video games use LUTs and how you can too
                  • Why People are Angry over Go 1.23 Iterators - gingerBill

                    NOTE: This is based on, but completely rewritten, from a Twitter post: https://x.com/TheGingerBill/status/1802645945642799423 TL;DR It makes Go feel too “functional” rather than being an unabashed imperative language. I recently saw a post on Twitter showing the upcoming Go iterator design for Go 1.23 (August 2024). From what I can gather, many people seem to dislike the design. I wanted to give m

                    • Atkinson Dithering

                      Atkinson Dithering When the Macintosh was released in 1984, it featured a square-pixeled black-and-white display at a crisp 72 dots per inch. The 512x342 resolution might seem less than impressive today, but for the time it was a pleasantly high-resolution consumer-grade computer. Among other things, the monospaced Monaco 9pt bitmap font featured characters that were 6 pixels wide, allowing the Ma

                      • A Small Guide for Naming Stuff in Front-end Code

                        Reading Time: 9 minutes Phil Karlton has famously said that the two hardest things in computer science are naming things and cache invalidation1. That’s still kinda true in front-end development. Naming stuff is hard, and so is changing a class name when your stylesheet is cached. For quite a few years, I’ve had a gist called “Tiny Rules for How to Name Stuff.” Which is what you think: little tiny

                          A Small Guide for Naming Stuff in Front-end Code
                        • WebKit Features for Safari 26.2

                          Safari 26.2 is a big release. Packed with 62 new features, this release aims to make your life as a web developer easier by replacing long-standing frustrations with elegant solutions. You’ll find simpler ways to create common UI patterns with just a few lines of HTML or CSS, and no JavaScript — like auto-growing text fields with CSS field-sizing, and buttons that open/close dialogs and popovers w

                            WebKit Features for Safari 26.2
                          • Is WebAssembly magic performance pixie dust? — surma.dev

                            Toggle dark mode Add WebAssembly, get performance. Is that how it really works? The incredibly unsatisfying answer is: It depends. It depends on oh-so-many factors, and I’ll be touching on some of them here. Why am I doing this? (You can skip this) I really like AssemblyScript (full disclosure: I am one of their backers). It’s a very young language with a small but passionate team that built a cus

                              Is WebAssembly magic performance pixie dust? — surma.dev
                            • Google TypeScript Style Guide

                              // Good: choose between two options as appropriate (see below). import * as ng from '@angular/core'; import {Foo} from './foo'; // Only when needed: default imports. import Button from 'Button'; // Sometimes needed to import libraries for their side effects: import 'jasmine'; import '@polymer/paper-button'; Import paths TypeScript code must use paths to import other TypeScript code. Paths may be r

                              • JavaScriptによるZ80エミュレータでの「手抜き」回転行列 - Qiita

                                3EB0 LD A,B0H 84 ADD A,H D660 SUB A,60H D8 RET C 1F RRA 5F LD E,A 9F SBC A,A E60F AND A,0FH 3C INC A 47 LD B,A 3ECE LD A,CEH 92 SUB A,D D69C SUB A,9CH D8 RET C CB47 BIT 0,A 2802 JR Z,+4 CB20 SLA B CB4F BIT 1,A 2804 JR Z,+6 CB20 SLA B CB20 SLA B E67C AND A,7CH 57 LD D,A CB22 SLA D 0F RRCA 0F RRCA 1F RRA 67 LD H,A 9F SBC A,A E680 AND A,80H 92 SUB A,D 6F LD L,A 3001 JR NC,+3 25 DEC H 16F3 LD D,F3H 19

                                  JavaScriptによるZ80エミュレータでの「手抜き」回転行列 - Qiita
                                • 【JavaScript】ループ処理をマスターしよう

                                  はじめに プログラミング始めたての頃、JavaScript の書籍とか読んでるとこんなこと思いませんか? 「JavaScript ってループのやり方多すぎてどこで何を使えばいいかよくわからん」 かく言う僕もついこの前まではとりあえず生!のノリで forEach を乱用しまくり野郎だった頃が記憶に新しいです。 今回はそんな方に向けて状況によって適切なループ処理を選択できるようになるための、いちアプローチになればと思いこの記事を書きました。 参考になれば幸いです 🙏 ループ処理の選択基準 まず、以下 3 つの分類で扱うループを振り分けるのが良いと思います。 シンプルに配列やオブジェクトをループしたいとき ループの要素ごとに条件を設け配列を加工したいとき ループの要素ごとに真偽値を取得したいとき 3 つの大カテゴリーで分けることができましたら以下のカテゴリーからループを選択します。 シンプルに

                                    【JavaScript】ループ処理をマスターしよう
                                  • Big O

                                    Big O notation is a way of describing the performance of a function without using time. Rather than timing a function from start to finish, big O describes how the time grows as the input size increases. It is used to help understand how programs will perform across a range of inputs. In this post I'm going to cover 4 frequently-used categories of big O notation: constant, logarithmic, linear, and

                                      Big O
                                    • 【WordPress】自作のカスタムブロックをブロックエディタに追加する方法(サンプル配布)|takeo / グラフィックデザイナー

                                      2018年12月にリリースされたWordpress 5.0から、ブロックエディタ(Gutenberg)での記事編集がデフォルトとなりました。 直感的で使いやすく、最近はアップデートで種類も増えてきましたが、用意されているブロックだけでは物足りない…と感じる方は多いはず。 デフォルトの「カスタムHTML」ブロックや、「クラシック」ブロックなど方法はありますが、毎回それを書くのは手間ですし、一括でテンプレートをカスタマイズ・更新できないので不便ですよね。 一括で自由にカスタマイズできるブロックを使えるようにしたい…という方のために、自作したブロックをGutenbergエディタで呼び出せるようにする方法を解説します。 細かい部分まで説明すると長くなってしまうので、初回は簡単なブロックを1つ追加するまで解説します。 この記事で解説したサンプルを一式ダウンロードできるので、「読んでもよくわからない!

                                        【WordPress】自作のカスタムブロックをブロックエディタに追加する方法(サンプル配布)|takeo / グラフィックデザイナー
                                      • JavaScriptによるPC-8001エミュレータにおける2000年問題 - Qiita

                                        5月29日の記事で、私(安岡孝一)はこう書いた。 N-BASICのルーチンのうち 0018 1文字出力(メッセージ出力用) 093A 画面幅設定 1602 時計読み込み(ランダムのモト) 52ED 文字列出力 を独自実装する必要があったため、かなり作業が難航した。結論として「1602 時計読み込み(ランダムのモト)」は実装しきれなかった 昨日の記事で、カレンダークロックμPD1990ACの読み込みをエミュレートできたので、今なら「1602 時計読み込み(ランダムのモト)」が実装できる。ただ、N-BASICのカレンダー用バッファは、EA76に秒(BCD 2桁)、EA77に分(BCD 2桁)、EA78に時(BCD 2桁)、EA79に日(BCD 2桁)、EA7Aに月(下位4ビット)、EA7Bに年(BCD 2桁)を入れることになっており、2000年問題が発生する。年をEA7B~EA7Dに拡張(BC

                                          JavaScriptによるPC-8001エミュレータにおける2000年問題 - Qiita
                                        • Why would anyone need JavaScript generator functions?

                                          Generators are an odd part of the JavaScript language. And some people find them a bit of a puzzle. You might be a successful developer for decades and never feel the need to reach for them. Which raises the question, if you can go so long without ever needing them, what are they good for? Generators have a funny syntax, too. They have these strange starred function definitions; you can’t define t

                                            Why would anyone need JavaScript generator functions?
                                          • JavaScriptによるPC-8001エミュレータにおけるドットスクロール - Qiita

                                            214FF3 LD HL,F34FH 1100F3 LD DE,F300H 1A LD A,(DE) 060A LD B,0AH ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2D DEC L ED67 RRD 2B DEC HL 10E6 DJNZ -24 7D LD A,L FE3F CP A,3FH C8 RET Z 217800 LD HL,0078H 19 ADD HL,DE EB EX DE,HL 214F00 LD HL,004FH 19 ADD HL,DE 18D4 JR -42 <!DOCTYPE html><head><meta charset="UTF-8" /> <meta htt

                                              JavaScriptによるPC-8001エミュレータにおけるドットスクロール - Qiita
                                            • JavaScriptによるZ80エミュレータでの「手抜き」sin関数 - Qiita

                                              この表を64バイトに圧縮するのは難しくはないが、あえて表なしに挑戦したい。ただ、乗算のないZ80でマクローリン展開とかゾッとするので、多少の誤差(1/128程度)には目をつぶりつつ、一次関数のあたりで何とか計算してみたい。第1象限すなわち00H≦C≦40Hの範囲で、40年前の私(安岡孝一)が思いついたのは、だいたい以下のような感じ。 00H≦C≦18Hの場合:C×6 18H≦C≦25Hの場合:C×4.5+36 26H≦C≦32Hの場合:C×3+92 33H≦C≦3EHの場合:C+193 3EH≦C≦40Hの場合:255 このアイデアを、第2・第3・第4象限にも拡張すると、Z80プログラムはこう書ける。 79 LD A,C E67F AND A,7FH FE41 CP A,41H 3803 JR C,+5 2F CPL C681 ADD A,81H 6F LD L,A FE19 CP A,1

                                                JavaScriptによるZ80エミュレータでの「手抜き」sin関数 - Qiita
                                              • JavaScriptによるPC-8001エミュレータにおける「tan関数の有理数近似」直線 - Qiita

                                                <!DOCTYPE html><head><meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>PC-8001 Emulator by Koichi Yasuoka, June 25, 2025</title> <script> var pc8001=new Object(); pc8001.memory=new Array(65536); pc8001.memory.fill(0x76); ["0000 C3 00 DA", "045A C3 50 09", // clear display "093A 79 32 62 EA 78 32", // init display "0940 65 EA C6 B0 3E 14 8F 32 66 EA D3 30 3E 20

                                                  JavaScriptによるPC-8001エミュレータにおける「tan関数の有理数近似」直線 - Qiita
                                                • JavaScriptによるZ80エミュレーションはフラグを全て実装する必要があるのか - Qiita

                                                  スタックポインタを使って、7バイト分のデータを1バイト手前にずらしている。フラグ(というよりはFレジスタ)の8ビットは、全てちゃんと保持されてないとマズイ。ただ、この手の命令は「POP AF」「PUSH AF」「EX AF,AF'」しか無いので、それだけのためにHalfcarryフラグだのNegationフラグだのサポートするのはシンドイし、ましてや「SCF」や「CCF」で謎の3ビット目と5ビット目がどこから来るかとか、考えたくもない。なので、Zero、Carry、Sign、Parity-Overflow以外の4ビットについては、演算結果には左右されず、値を保持しておくだけにした。 5月25日時点のプログラムリストを、以下に公開しておくことにする。よければ、昨日の記事と較べてみてほしい。 <!DOCTYPE html><head><meta charset="UTF-8" /> <meta

                                                    JavaScriptによるZ80エミュレーションはフラグを全て実装する必要があるのか - Qiita
                                                  • James Shore: Testing Without Mocks: A Pattern Language

                                                    Automated tests are important. Without them, programmers waste a huge amount of time manually checking and fixing their code. Unfortunately, many automated tests also waste a huge amount of time. The easy, obvious way to write tests is to make broad tests that are automated versions of manual tests. But they’re flaky and slow. Folks in the know use mocks and spies (I say “mocks” for short in this

                                                    • How fast is javascript? Simulating 20,000,000 particles

                                                      How fast is javascript? Simulating 20,000,000 particles The challenge, simulate 1,000,000 particles in plain javascript at 60 fps on a phone using only the cpu. Let's go. Ok, this is not a particularly difficult challenge if you did all the work on a gpu but the rule of the challenge is to use the CPU only or as much as possible and to stay in js land so no wasm. I know what you are thinking. This

                                                        How fast is javascript? Simulating 20,000,000 particles
                                                      • μPD1990ACへの書き込みはJavaScriptでどこまでエミュレートすべきなのか - Qiita

                                                        6月2日の記事で、私(安岡孝一)はこう書いた。 なお、カレンダークロックへの書き込みは、今回は実装していない。 こう書いたのだが、カレンダークロックμPD1990ACへの書き込みを、ムラムラとJavaScriptでエミュレートしたくなった。具体的には 1663 217AEA LD HL,EA7AH 1666 7E LD A,(HL) 1667 ED67 RRD 1669 2E76 LD L,76H 166B 112903 LD DE,0329H 166E 3E01 LD A,01H 1670 1819 JR 168BH 1672 1605 LD D,05H 1674 7B LD A,E 1675 E607 AND A,07H 1677 4F LD C,A 1678 CB0E RRC (HL) 167A 9F SBC A,A 167B E608 AND A,08H 167D 0D DEC C

                                                          μPD1990ACへの書き込みはJavaScriptでどこまでエミュレートすべきなのか - Qiita
                                                        • CommonJS to ESM in Node.js

                                                          Yesterday, I refactored Place1, which is a non-trivial Node.js app, to use ECMAScript Modules (ESM). Here’s a diff of the full set of changes. This is the approach I took and some of the issues I ran into, in case it helps someone else: Find and replace First off, I started by running the following regular expression2 to quickly convert CommonJS require syntax to ESM import syntax: Find const (.*?

                                                            CommonJS to ESM in Node.js
                                                          • Javascript Worst Practices

                                                            Everyone talks about the “best practices” to follow around different technologies, and sometimes we tend to listen to that advice. However, what about the things we’re doing and we’re not even aware that they’re not only wrong, but terrible practices? Let’s take a quick look at 5 of the worst things you can do to your code while writing JavaScript. Taking advantage of the language’s implicit type

                                                              Javascript Worst Practices
                                                            • JavaScriptによるPC-8001エミュレータはμPD1990ACの夢を見るか - Qiita

                                                              Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? 2120F3 LD HL,F320H 110300 LD DE,0003H CB7B BIT 7,E 2009 JR NZ,+11 7B LD A,E D310 OUT (10H),A 1D DEC E 1D DEC E 3E03 LD A,03H 181A JR +28 DB40 IN A,(40H) E610 AND A,10H B2 OR A,D 1F RRA 57 LD D,A 7B LD A,E 1D DEC E E603 AND A,03H 200B JR NZ,+13 B2 OR A,D 27 DAA C6F0 ADD A

                                                                JavaScriptによるPC-8001エミュレータはμPD1990ACの夢を見るか - Qiita
                                                              • ECMAScript proposal: iterator helpers

                                                                Update 2022-12-15: New section “How will this proposal affect future JavaScript APIs?” In this blog post, we look at the ECMAScript proposal “Iterator helpers” by Gus Caplan, Michael Ficarra, Adam Vandolder, Jason Orendorff, Kevin Gibbons, and Yulia Startsev. It introduces utility methods for working with iterable data: .map(), .filter(), .take(), etc. The style of the proposed API clashes with th

                                                                • PHPでもforkがしたい! - FANCOMI Ad-Tech Blog

                                                                  Introduction はじめまして、ADN事業部所属エンジニアのk_oomoriと申します。業務ではアドネットワークサービスnend(ネンド)においてPHPやJavaScriptのプログラミングからサーバソフトウェアあたりまでの領域を担当させていただいております。 さて最初の投稿となる今回は、PHPにおけるプロセスのフォーク(fork)を扱おうと思います。 フォークとは、簡単に言うと最初に起動したプロセス(以下親プロセスと言います)が自身の複製として子プロセスを生成し、複数プロセスで並列処理を行うというものです。 Perlなどでは結構よく使われているようですが、PHPではあまり聞いたことがなかったので、この機会に紹介したいと思います。 !!!注意!!! PHPでfork等のプロセス制御機能を利用するためには、マニュアルに明記されているとおり、configureオプションを指定してPHP

                                                                    PHPでもforkがしたい! - FANCOMI Ad-Tech Blog
                                                                  • JavaScriptによるPC-8001エミュレータにおけるドットスクロールを用いたドットイートゲームの試作 - Qiita

                                                                    Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? <!DOCTYPE html><head><meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>PC-8001 Emulator by Koichi Yasuoka, June 30, 2025</title> <script> var pc8001=new Object(); pc8001.memory=new Array(65536); pc8001.memory.fill(0x76); ["0000 C3 00

                                                                      JavaScriptによるPC-8001エミュレータにおけるドットスクロールを用いたドットイートゲームの試作 - Qiita
                                                                    • PHPエンジニア必見!Twigテンプレートエンジン完全ガイド2024

                                                                      Twigとは?現代のPHP開発に必要なテンプレートエンジン Symfony製テンプレートエンジンが選ばれる3つの理由 Twigは、PHP用の高速で拡張性のあるテンプレートエンジンとして、現代のWeb開発において重要な位置を占めています。Symfonyフレームワークのデフォルトテンプレートエンジンとして採用されており、以下の3つの主要な理由で多くの開発者から支持されています。 優れた開発者エクスペリエンス 直感的で読みやすい構文 自動エスケープによるセキュリティ対策 IDE対応による強力な補完機能 高いパフォーマンス コンパイルされたPHPコードとしてキャッシュ 最適化された実行速度 メモリ効率の良い処理 強力な機能セット テンプレート継承によるコード再利用 マクロによる関数定義機能 豊富な組み込みフィルターとファンクション 従来のPHPテンプレートと比較した際の革新的な特徴 従来のPHPテ

                                                                        PHPエンジニア必見!Twigテンプレートエンジン完全ガイド2024
                                                                      1