並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 23 件 / 23件

新着順 人気順

javascript array foreach break loopの検索結果1 - 23 件 / 23件

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

        • 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

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