#Generators excel at lazy iteration and memory efficiency, implementing Iterator interface for foreach loops
#Fibers enable cooperative multitasking and nested suspension, perfect for #CLI tools and state machines
#Generators excel at lazy iteration and memory efficiency, implementing Iterator interface for foreach loops
#Fibers enable cooperative multitasking and nested suspension, perfect for #CLI tools and state machines
#Coroutines in #PHP: Functions That Can Pause and Resume
#Generators provide asymmetric, stackless coroutines - can pause execution with yield keyword and resume with next() method
What if your PHP functions could pause, resume, and remember where they left off, like little self-aware scripts?
That’s what coroutines are for, and PHP gives you two tools to use them: Generators (since 5.5) and Fibers (in PHP 8.1).
I break it all down with real code, plus a hot potato metaphor you won’t forget:
https://doeken.org/blog/coroutines-in-php?utm_source=mastodon
#Development #Techniques
CSS blob recipes · What’s the easiest way to make fun shapes? https://ilo.im/164zjl
_____
#Shapes #Blobs #Generators #Design #WebDesign #WebDev #Frontend #CSS #HTML #SVG
I've stopped trying to use #AI #image #generators 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.
New Kitten update
• Kitten HTML templates and kitten.Component render functions can now be async.
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!
"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?
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!
https://perchance.org/welcome #textgenerator #creativecoding #generators #perchance
@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?
I've been using Nikola - https://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.
After failed attempts in 2021 and 2023, southeast Texas lawmakers have filed bills to require generators in nursing homes and assisted living centers.
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).
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
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
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
CPSC Safety Alert: Portable Generator Hazards
#safety #generators #disasters
Generator safety PSA: ***DO NOT FILL UP A RUNNING GASOLINE GENERATOR***
Gasoline fumes are released when you refuel the tank, and there is a high risk of igniting those vapors from the hot exhaust of the generator. You should not only turn OFF the generator, but also WAIT FOR IT TO COOL DOWN.
(you can get devices to toggle tanks/etc. safely, but most people do not have this).
The worst time to cause yourself burn injuries (and worse yet, maybe set your neighborhood on fire) is during the middle of a disaster.
Will AI Code Generators Overcome Their Insecurities This Year? – Source: www.darkreading.com https://ciso2ciso.com/will-ai-code-generators-overcome-their-insecurities-this-year-source-www-darkreading-com/ #rssfeedpostgeneratorecho #DarkReadingSecurity #CyberSecurityNews #DARKReading #Generators
There is some cruel irony in the fact that after extensive use of (carefully supervised!) #AI #text #generators, my purely human-written paragraphs started to trigger AI detectors as “100% AI-generated”.