Bookmarks

Bookmarks

46225 bookmarks
Custom sorting
Mediabunny
Mediabunny
A JavaScript library for reading, writing, and converting media files. Directly in the browser, and faster than anybunny else.
·mediabunny.dev·
Mediabunny
harlan-zw/mdream: ☁️ Convert any site to clean markdown & llms.txt. Boost your site's AI discoverability or generate LLM context for a project you're working with.
harlan-zw/mdream: ☁️ Convert any site to clean markdown & llms.txt. Boost your site's AI discoverability or generate LLM context for a project you're working with.
☁️ Convert any site to clean markdown & llms.txt. Boost your site's AI discoverability or generate LLM context for a project you're working with. - harlan-zw/mdream
·github.com·
harlan-zw/mdream: ☁️ Convert any site to clean markdown & llms.txt. Boost your site's AI discoverability or generate LLM context for a project you're working with.
How AI Is Changing Search Behaviors
How AI Is Changing Search Behaviors
Our study shows that generative AI is reshaping search, but long-standing habits persist. Many users still default to Google, giving Gemini a fighting chance.
·nngroup.com·
How AI Is Changing Search Behaviors
Google 検索における「AI モード」を日本語で提供開始
Google 検索における「AI モード」を日本語で提供開始
非常に複雑で多面的な質問を投げかけると、瞬時に AI がわかりやすい包括的な回答を生成し、さらに深堀りするためのウェブリンクも合わせて提示してくれる ー そんな体験を想像してみてください。本日より順次、Google の強力な AI 検索体験である AI モード の日本語での提供を開始し、このような体験をお試しいただけるようになります。日本語のほか、インドネシア語、韓国語、ヒンディー語、ポルトガル語 ( ブラジル ) での提供も順次開始します。Google 検索の結果ページに表示される [ AI モード] タブより、これらの新しい言語で PCとモバイルのブラウザ、Android および iOS の Google アプリでお使いいただけます。あらゆる複雑な質問に対応できる設計AI モード は、Gemini 2.5 のカスタム バージョンを使用しており、従来は複数回の検索が必要だったような、長く、複雑な質問を一回の検索で回答します。AI モードは、探索的な質問や、地域のおすすめを探したり、旅行の計画を立てたり、複雑な手順を理解したりするといった、より複雑なタスクで特に役立ちます。実際、AI モードの初期のユーザーは、従来の検索クエリの 2 倍から 3 倍の長さの質問をしていたことがわかっています。例えば、「京都駅出発で 6 泊 7 日の旅行プランを立てて。伝統工芸とか歴史的な場所を巡るアクティビティ中心のプランで、ディナーでおすすめのレストランも入れて。」と聞くこともできます。AI モードは Google のクエリ ファンアウトと呼ばれる技術を使用しています。この技術は、質問をサブトピックに分解し、ユーザーに代わり、サブクエリに対して検索を実行します。これにより、従来の Google 検索よりはるかに深くウェブを探索できるようになり、個別の質問に最も適した、関連性の高いコンテンツをより多く見つけることができます。先ほどの質問に「10 月に行くとしたら、この地域の近くで開催予定のお祭りはある?」といった追加の質問をすることで、さらに深く掘り下げることも可能です。
·blog.google·
Google 検索における「AI モード」を日本語で提供開始
Exploring Concurrency Issues with Philosophers and Go
Exploring Concurrency Issues with Philosophers and Go
Understand key concepts in concurrency by solving the dining philosophers problem step by step while discussion different subtle problems and intricacies. Full code in Go is provided towards the end.
·clustersandcoffee.substack.com·
Exploring Concurrency Issues with Philosophers and Go
Switching from Docker to Podman
Switching from Docker to Podman
Podman offers better security, uses fewer resources, and integrates seamlessly with Linux and Kubernetes, making it a superior Docker alternative
·codesmash.dev·
Switching from Docker to Podman
Postgres Internals Deep Dive: Process Architecture
Postgres Internals Deep Dive: Process Architecture
Introduction:Ever wondered what happens inside PostgreSQL from start to shutdown? How processes work together internally?The process architecture:When we start postgres using pg_ctl, we are starting “postmaster” which is the parent process of most of the upcoming processes. Postmaster runs the main() function which calls PostmasterMain where it will do some important work likeinitializations, like GUC options parses postgres binary command-line args and sets the GUCs related to them accordingly. does some checks on datadir, lock file, control file; and creates datadir lock file which has postmaster status and pid, which is used to make sure, for 1 cluster only 1 server or a postmaster runs. loads shared libraries if we have any, along with this it calculates how much shared memory is needed for core server and libraries/extensions. it allocates that much shared memory segment. Then comes the main loop which is ServerLoop where all the child processes start. This loop never ends. If it does, the server will go down. ServerLoop (The Loop of Life):This is an infinite event loop which waits on a Latch set by signal handler, or new connection pending on any of our sockets. In this loop child processes start and the cleanup also happens when the same process dies. Requests/signals from backends are handled here. In the ServerLoop the postmaster keeps on checking if any required process is not running for some reason or may be needed to start some IO workers, background processes. LaunchMissingBackgroundProcesses will start the required child processes.The rise of child processes: The child processes of postmaster areio workers: these help to read pages asynchronously, so that load will be less on normal backends, Checkpointer: this is used to remove/recycle the old WALs and flush dirty pages from shared buffers time to time, background writer: this only flushes dirty pages from shared buffers to reduce load on normal backends by maintaining as many free shared buffers as possible, Startup process: this replays WALs in master until recovery is completed but in replica it replays continuously WALs that are being replicated to this node, wal writer: this process flushes WAL from WAL buffers to disk, Autovacuum launcher: this periodically starts autovacuum-worker processes for the vacuum process, and more will be forked based on requests, I think we can write separate blogs on these processes,so not going into further detail of each process here.  In PostgreSQL, new child processes are forked in different ways depending on when they are needed.During server startup, some child processes are created right away. Later, on demand, additional child processes may be forked, such as:Backend processes (to handle client connections) Background workers (for running user-supplied code such as from extension) Most of these child processes are launched using the postmaster_child_launch function. This function takes a value from the BackendType enum, which determines the correct main function to call for that specific type of child process.The Backend Processes:Postmaster will be listening on the listen_addresses by default its “localhost” for requests from psql clients.psql tries to connect to the postmaster address using libpq library which is a framework on top of sockets for postgres. Then the postmaster accepts the connection request and starts a new backend process to process the queries which will be coming from the psql client from now on. As the new backend is the child process of postmaster it inherits the knowledge of shared memory in it, meaning this process can also use the shared buffers because the pointers such as BufferBlocks which are initiated by postmaster.Per psql client process we get another new child process on the server. When a query needs a page it reads the page from disk if it's not already there in shared memory buffers. If there's no buffer empty to read a new page into because all are currently in-use, then the backend will try to find a victim buffer and forcefully flushes the page and then reads the page from disk into it. If more reads are happening then buffers will get filled easily, so to read new pages into the shared buffers backend which is processing the query will have to flush pages itself, because of this the query execution becomes slow. To reduce this extra work of flushing dirty buffers to disk on backends 2 other processes help which are checkpointer and background writer processes. These processes in different intervals flushes the dirty pages from shared buffers to disk, which reduces load on backends.The disguised Backend process:During replication, when the replica node starts, the startup process starts the walreceiver process while trying to read WALs.Then walreceiver process sends a connect request to primary’s postmaster with a “replication” message using libpq. Postmaster starts a normal backend process for this request but when the new forked backend process parses the startup packet using ProcessStartupPacket from walreceiver, it looks for “replication”, if it's there then the backend is turned into walsender. Walsender will read the WALs from the disk and send them to the walreceiver in physical replication.Walsender will decode the statement in the WAL and send the walreceiver in logical replication.So walsender starts as a normal backend process.The Background workers:These processes are used for running user-supplied code such as from extensions. If an extension wants to run such a process then it should register bg worker in PG_init() of the extension using RegisterBackgroundWorker. So when the postmaster learns about extensions which are mentioned in the shared_preload_libraries ,the respective _PG_init() is called ,then the bg worker will be added into the postmaster’s BackgroundWorkerList list. They are started when the postmaster calls maybe_start_bgworkers while looping in ServerLoop. There's a way to start these processes even after the server is up and running at a later point of time, by using RegisterDynamicBackgroundWorker. There are few child processes such as “logical replication launcher” which are background workers started along with other child processes of the postmaster during the start of the server.Requests through signals:Postmaster have signal handlers to handle any kind of requests as following:We can find all the definitions of below handlers,singal processors in postmaster.c.SIGNALHANDLERSignal ProcessorSIGHUPhandle_pm_reload_request_signalprocess_pm_reload_requestSIGINThandle_pm_shutdown_request_signalprocess_pm_shutdown_requestSIGQUIThandle_pm_shutdown_request_signalprocess_pm_shutdown_requestSIGTERMhandle_pm_shutdown_request_signalprocess_pm_shutdown_requestSIGUSR1handle_pm_pmsignal_signalprocess_pm_pmsignalSIGCHLDhandle_pm_child_exit_signalprocess_pm_child_exitWhen the postmaster gets a particular signal it will call the respective handler sets the related variables which forces ServerLoop to call the Signal Processor functions to do the requested work. If someone wants to re-read postgresql.conf they can send SIGHUP to the postmaster process.SIGUSR1 is used to handle pmsignal conditions representing requests from backends, and check for promote or logrotate requests from pg_ctl. We discuss more in detail about the shutdown signals and SIGCHLD below.The Shutdown Modes:In postgres to shutdown the server we have 3 modes based on how shutdown should be. Basically we can either signal the postmaster directly with the signals related to the modes or let pg_ctl do the same for us by using the “-m” option.SIGNALMODESIGTERMsmartSIGINTfastSIGQUITimmediateIn smart mode the server quits after all clients have disconnected. In fast mode the server quits directly, with proper shutdown (default). In immediate mode the server quits without complete shutdown; this will lead to recovery on restart. Now the internal stuff! When the postmaster gets any of the above signals, the respective handler is called which sets the pending_pm_shutdown_request to true and also signal specific variable which makes ServerLoop call process_pm_shutdown_request() and set specific mode. Based on the mode the way of shutdown becomes different.We can see the all below mentioned pmStates in code here. In smart mode if postmaster is running means it will be either in PM_RUN or PM_HOT_STANDBY pmState, so it will wait until the clients complete their work but new connections won’t be allowed from now on.When i say “wait” basically when loop goes into its normal working state, when the client completes their work and exits then only the backend exists successfully, which is a child exit for postmaster so it triggers process_pm_child_exit which cleans up the backend process and as initially because of the smart shutdown signal connsAllowed is set to false, this helps us here in PostmasterStateMachine where it makes the pmState to PM_STOP_BACKENDS, which makes sure that all child processes exit and postmaster shutdowns. But if we are in PM_STARTUP or PM_RECOVERY where there wont be any connections allowed ,we don’t need to wait for anyone and directly stop other children, it updates the pmState to PM_STOP_BACKENDS. In fast mode it's simple in any of the above 4 pmStates the children are stopped directly means the pmState changes to PM_STOP_BACKENDS, the postmaster doesn’t wait for clients to complete their work. In immediate mode postmaster sends SIGQUIT to all children except syslogger if enabled, for this signal during start of every child process InitPostmasterChild is called where for SIGQUIT SignalHandlerForCrashExit handler is set, which makes the process exit(2). If syslogger was enabled then this process exits at the end when all processes even postmast...
·enterprisedb.com·
Postgres Internals Deep Dive: Process Architecture
Rails Without Ruby
Rails Without Ruby
Yes, you can run Rails without installing Ruby. With VS Code devcontainers, your whole Rails setup lives inside Docker — no version managers, no sy...
·dotruby.com·
Rails Without Ruby
File preallocation on macOS in Ruby
File preallocation on macOS in Ruby
I haven’t blogged in a while, so I figured I should do that. Jet lag has blessed me with some free time this morning, so I figured I would make some content in order to feed the AI bots. I’ve been messing around with pre-allocating files on the file system on macOS. This is useful in cases where you have a large file you need to copy, and you want to copy it quickly. For example, a tar implementation where the tar file might contain large files you need to copy.
·tenderlovemaking.com·
File preallocation on macOS in Ruby
Hopp: Your new remote pair programming app meant for developers
Hopp: Your new remote pair programming app meant for developers
Hopp is built by developers, for developers. It delivers crisp screen sharing (HD), noise-free audio, and seamless remote control. Because programmers deserve better than a generic screen sharing tool.
·gethopp.app·
Hopp: Your new remote pair programming app meant for developers
ericschmar/moribito
ericschmar/moribito
Contribute to ericschmar/moribito development by creating an account on GitHub.
·github.com·
ericschmar/moribito