#Generators

2025-06-07

Just did a #jskata on `return` and `yield` inside #generators [1]. Now that I did it it makes sense, but in 1h I will have forgotten it again. Is it not that natural, or complicated or is it me?

One kata a day, pushes growth your way.

[1] jskatas.org/katas/es6/language

#JavaScript #learning #generator

Jason Pettus :blobnom:jasonpettus
2025-05-24

I've stopped trying to use for anything useful, and now exclusively use them just for fucking around when I'm high on a Saturday afternoon and having a purposely low-stress day of just screwing around randomly on the computer. Another high Saturday low-stress thing I'm doing today is watching a bunch of Looney Tunes from 1931, so on a lark I asked an AI bot to present me cartoon characters of that period but with a dark, threatening and surreal background.

An image generated by Google's AI image generator using the phrase, "1920s cartoon characters, but with a dark, threatening and surreal background."An image generated by Google's AI image generator using the phrase, "1920s cartoon characters, but with a dark, threatening and surreal background."
Hit new slatestHitnewslatest
2025-05-19

AI Video Tools: A New
Cybersecurity Threat?

Discover can be exploited by to breach your and steal sensitive data. Stay !, 🤖👇
hitnewslatest.com/2025/05/ai-v

Hacker Newsh4ckernews
2025-04-15
2025-04-15

Музыка за пару минут: топ-10 бесплатных нейросетей для генерации песен

Музыка за пару минут: топ-10 бесплатных нейросетей для генерации песен Музыка всегда была отражением времени — от величественных симфоний прошлого до качёвых битов современности. Сегодня нейросети всё активнее проникают во все сферы жизни, и музыка, конечно, не стала исключением. Когда‑то создание качественной музыки требовало несколько лет обучения, часов практики и безграничной фантазии композиторов. Но что, если вам скажут, что теперь её могут создавать машины? Эти алгоритмы способны сочинять музыку разных жанров — от эпических симфоний до тяжёлого рока — и всё это с минимальным вмешательством человека. Как бы удивился Бах, узнав, что сейчас «Токкату и фугу» можно создать парой кликов с помощью нейросети. Но так ли хороши эти генераторы, как о них говорят? Чтобы выяснить это, мы решили провести небольшой эксперимент. Пристегнитесь — мы въезжаем в мир генерации музыки, это обещает быть интересным! Приятного Вам прочтения!

habr.com/ru/companies/bothub/a

#ai #musicmaking #generators #suno #udio #stable_audio #riffusion #music

2025-03-31

New Kitten update

• 🥳 Kitten HTML templates and kitten.Component render functions can now be async.

kitten.small-web.org

This is quite a big one and it took me finally biting the bullet and getting my head around generators in JavaScript to implement properly.

So now you can mix synchronous and asynchronous components as you like and if there are any asynchronous components in your templates they will automatically be awaited (even if you forget to use await) ;)

I’ll write a proper post/tutorial/documentation for it soon but for the time being enjoy the screenshots where a layout template gets the latest three posts from my mock fediverse public timeline service and displays them on the page.

The kitten.Component version also has a refresh button that streams a different three to the page.

For those of you unfamiliar with Kitten, this is all the code in either example. No scaffolding, nothing. Pop either into a file called index.page.js and run kitten in that folder and visit https://localhost to see the example run.

Enjoy!

:kitten:💕

#Kitten #SmallWeb #async #components #templates #HTML #CSS #JavaScript #NodeJS #generators #web #dev

const BasicLayoutTemplate = async ({ title, SLOT }) => {
  const posts = (await (await fetch('https://streamiverse.small-web.org/public/')).json()).splice(0, 3)

  return kitten.html`
    <main>
      <page css>
      <h1>${title}</h1>
      ${SLOT}
      <h2>Fediverse posts</h2>
      <ul>
        ${posts.map(post => kitten.html`
          <li><img src='${post.account.avatar}'> ${[post.content]}</li>
        `)}
      </ul>
      <style>
        li { display: flex; gap: 1em; margin-bottom: 1em; }
        img { width: 5em; height: auto; }
      </style>
    </main>
  `
}

export default async () => await kitten.html`
  <${BasicLayoutTemplate} title='Async components are fun!'>
    <markdown>
      Oh, isn’t this __nice?__
    </markdown>
  </>
`class BasicLayoutTemplate extends kitten.Component {
  async html ({title, SLOT}) {
    return kitten.html`
      <main id='page' morph>
        <page css>
        <h1>${title}</h1>
        ${SLOT}
        <${FediversePosts.connectedTo(this)} />
      </main>
    `
  }
}

class FediversePosts extends kitten.Component {
  async html () {
    const posts = (await (await fetch('https://streamiverse.small-web.org/public/')).json()).splice(Math.floor(Math.random()*6), 3)

    return kitten.html`
      <div id='posts' morph>
        <h2>Fediverse posts</h2>
        <ul>
          ${posts.map(post => kitten.html`
            <li><img src='${post.account.avatar}'> ${[post.content]}</li>
          `)}
        </ul>
        <button name='refresh' connect>Refresh</button>
        <style>
          li { display: flex; gap: 1em; margin-bottom: 1em; }
          img { width: 5em; height: auto; }
        </style>
      </div>
    `
  }

  onRefresh () { this.update() }
}

export default class MyPage extends kitten.Page {
  async html () {
    return kitten.html`
      <${BasicLayoutTemplate.connectedTo(this)} title='Async components are fun!'>
        <markdown>
          Oh, isn’t this __nice?__
        </markdown>
      </>
    `
  }
}Screenshot of the functional components version (first screenshot) running in the browser. The page has a large title “Async components are fun!” Under that is the slotted content: “Oh, isn’t this nice?” with “nice?” in boldface. Under that is a smaller heading “Fediverse posts” followed by a list of three posts accompanied by avatar images. The first one is by me (“The only legitimate use of privilege is to help bring about the kind of world where you would not have had it to begin with. #privilege”), the second by Laura Kalbag (“Here’s to 38…”) and the last is by Lydia Conwell (”Can #FrancescaAlbanese be Prime Minister now?)
2025-03-27

"Generators" are a powerful tool in PHP when working with large or streamed datasets. They help improve memory efficiency, performance, and scalability, making them a great alternative to traditional array-based processing.

Do you already use generators in your projects?

dev.to/robertobutti/efficientl

#php #tutorial #article #generators

FLOWBLADE Generators are Media Items that render into animated media clips when placed on timeline.

Currently there are three different types of Generators.

1. Backgrounds Generators are animated backgrounds.
2. Texts Generators are animated texts.
3. Cover Transitions Generators are incoming shapes that cover the frame fully and then disappear creating a transition.

Flowblade Generators are implemented as Python scripts using Fluxity API.

#Linux #Flowblade #generators #Python #Fluxity

The Flowblade movie editor logo and the Python logo on a white background.
Claudio Piresclaudiocamposp
2025-03-24
2025-03-18

[Перевод] Rust: объясняем Владение и Субструктурные типы на пальцах

Системы типов помогают разработчикам создавать надежные и безопасные программы. Однако такие термины, как «субструктурные типы» или «владение», нередко кажутся сложными и трудными для понимания, особенно для тех, кто не сталкивался с теорией типов в академической среде. Новый перевод от

habr.com/ru/companies/ncloudte

#мойофис #перевод #rust #async #futures #generators #языки_программирования #владение

nemo™ 🇺🇦nemo@mas.to
2025-03-13

Dive into the world of creative text generators with Perchance! ✍️ Whether you're crafting stories, building games, or just having fun, Perchance lets you create your own generators with ease. Sign up is simple, and they only email you when you ask. 👍 Get started now! 👉 perchance.org/welcome #textgenerator #creativecoding #generators #perchance

Claudio Piresclaudiocamposp
2025-03-11
Kevin Karhan :verified:kkarhan@infosec.space
2025-03-04

@hanno #Ammonia also seems rather wasteful.

Why not use #Methanol as that can be used with #FuelCells, thus allowing for a clean replacement of #Diesel - #Generators in applications like #EmergencyPower for #Hospitals and other #CriticalInfrastructure?

2025-02-05

I've been using Nikola - getnikola.com/ for my two blogs for the last few years, and I'm finding the mechanics cumbersome.

I thought it was just a matter of acclamating, but it's not. It's been quite a while and quite a number of posts, and it's not getting any easier.

My needs are so minimal, I'm thinking I should maybe look into moving to another static site generator.

Hugo is what all the cool kids are using, but when I look at it I get intimidated by the whole go module based theme thing and ... Uck. I just need something utterly DUMB ASS simple.

Does anyone use something like this that they like? Am I over-inflating Hugo's complexity?

The truth is I was a pretty happy Wordpress user back in the day, but I was an idjit and ran my site poorly so it got knocked over by a script kiddie.

#static #site #generators #staticsite #nikola #wordpress #blogging

2025-01-25

Random thought for anyone who has been running a generator in Southern California over the past few days (especially you newbies):

1. CHANGE THE OIL (undoubtedly needs to be changed)

2. MAYBE CHANGE THE AIR FILTER

3. STABIL in the gas tank... just in case you don't use it again for awhile.

4. MAKE sure you run the carb dry before storing (shut of fuel supply and let it run until it shuts off by itself), so gasoline doesn't sit in your carb and gum up.

(Much better solution is natural gas/propane conversion).

#DisasterPreparedness #generators

2025-01-19

Repeating this advice: if you used your generator last week to keep power to your house in Southern California, it most likely needs an oil change. Do it before Monday. They need an oil change every 100 hours. 5w30 or 10w30 depending on your model, usually. #generators #backuppower #PSPS #poweroutages

2025-01-12

Carbon Monoxide Hazards

When used in a confined space, generators can produce
high levels of CO within minutes. When you use a portable
generator, remember that you cannot see or smell CO. Even if
you do not smell exhaust fumes, you may still be exposed
to CO.

Danger labels are required
on all portable generators
manufactured or imported on
or after May 14, 2007.

If you start to feel sick, dizzy, or
weak while using a generator, get to fresh air RIGHT AWAY. DO NOT DELAY. The CO from generators can rapidly kill you.

2/x

#safety #generators #disasters

When used in a confined space, generators can produce
high levels of CO within minutes. When you use a portable
generator, remember that you cannot see or smell CO. Even if
you do not smell exhaust fumes, you may still be exposed
to CO.
Danger labels
are required
on all portable
generators
manufactured or
imported on
or after
May 14, 2007.
If you start to
feel sick, dizzy, or
weak while using
a generator, get to fresh air RIGHT AWAY. DO NOT DELAY. The
CO from generators can rapidly kill you.
2025-01-12

Portable Generator Hazards

Portable generators are useful when temporary or remote
electric power is needed, but they also can be hazardous. The
primary hazards to avoid when using a generator are carbon
monoxide (CO) poisoning from the toxic engine exhaust,
electric shock or electrocution, fire and burns.

Every year, people die in incidents related to portable generator use. Most of the incidents associated with portable generators reported to CPSC involve CO poisoning from generators used indoors or in partially-enclosed spaces.

1/x

#safety #generators #disasters

Portable Generator Hazards
Portable generators are useful when temporary or remote
electric power is needed, but they also can be hazardous. The
primary hazards to avoid when using a generator are carbon
monoxide (CO) poisoning from the toxic engine exhaust,
electric shock or electrocution, fire and burns.
Every year, people die in incidents related to portable
generator use. Most of the incidents associated with portable
generators reported to CPSC involve CO poisoning from
generators used indoors or in partially-enclosed spaces.

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst