Loafing Around

https://theawesomer.com/photos/2022/02/loafing_around_t.jpg

Loafing Around

Link

Sit back and enjoy this 14-minute video from a bread factory in Korea, where ingredients are combined, then kneaded into dough and baked in industrial ovens. Then the freshly-baked loaves of white and chestnut bread glide along an assembly line, tumble out of their pans, and head to the cooling racks before slicing.

The Awesomer

How a Coin Counting Machine Works

https://theawesomer.com/photos/2022/02/how_a_coin_sorting_machine_works_t.jpg

How a Coin Counting Machine Works

Link

This Cummins Allison Jetsort coin sorter machine can count and separate 10,000 coins per minute, yet its sorting mechanism has just a single moving part. YouTuber Herb-O-Matic shows how its centrifugal action and precision-cut grooves ensure the right coins go into the right slots and bags. Full video here.

The Awesomer

Seattle VC says this startup is the ‘fastest growing company I’ve seen’ in 23 years of investing

https://cdn.geekwire.com/wp-content/uploads/2022/02/CarbonRobotics_2022LaserWeeder_poster-16×9-basic-whitebg.jpg

The 2022 LaserWeeder from Carbon Robotics has a span of three crop rows, roughly 20 feet wide, and uses 30 lasers to zap weeds. (Carbon Robotics Image)

Weeds may be a fast-growing headache for farmers, but a startup building machinery powered by artificial intelligence to zap them is growing pretty quickly, too.

Seattle-based Carbon Robotics unveiled its latest piece of agtech equipment on Monday, the 2022 LaserWeeder, a robotic implement that can be pulled behind a tractor and uses computer vision and AI to quickly identify and target weeds in fields, and thermal energy to eliminate them.

“Carbon is the fastest growing company I’ve seen in 23 years of VC,” Erik Benson, managing director of Voyager Capital in Seattle, told GeekWire. “This is a future $50 billion company.”

Founded in 2018, Carbon is led by Isilon Systems co-founder Paul Mikesell, who sold Isilon for $2.25 billion in 2010 and spent time at Uber and Facebook before heading for the farm.

The company took in $27 million in a funding round last September, and has raised $36 million to date.

Voyager Capital, Anthos Capital, Ignition Capital and Fuse are among those who invested in the company.

Carbon Robotics employs 35 people and plans to grow to 50 this year.

The updated LaserWeeder uses 30 industrial CO2 lasers, more than three times the amount in the company’s previous self-driving Autonomous LaserWeeder, which was released in April 2021. The new machine can cover an average of two acres per hour.

“We’ve proven the effectiveness of our laserweeding technology and the immense benefits it offers farmers, including healthier crops and soil, decreased herbicide use, and reduced chemical and labor costs,” Mikesell said in a news release.

The new LaserWeeder is already sold out, thanks to orders from a number of farms, and Carbon is currently accepting pre-orders for 2023.

GeekWire

PHP Monitor 5.0 for macOS is Here

https://laravelnews.imgix.net/images/phpmon-5-0-featured.png?ixlib=php-3.3.1

PHP Monitor, the lightweight native Mac app to manage PHP and Laravel Valet, has released v5.0!

The author Nico Verbruggen announced the release yesterday:

Here are some of the highlight features summarized from the release notes:

  • Link a folder in Valet
  • Site list performance improvements
  • Faster and improved site search
  • Site list displays project type (i.e., Laravel, WordPress, etc.) from composer.json
  • Brew services status in the dropdown menu (PHP, Nginx, Dnsmasq, etc.)
  • See project’s PHP version requirement at a glance in the site list
  • Compatibility status per site
  • Change PHP versions from the compatibility status on the sites list
  • Automatic update of PHP INI changes
  • Alfred integration
  • Sponsor awareness – a one-time message to sponsor the author

One of my favorite features added is linking a folder and securing it (adding HTTPS) during creation:

PHP Monitor folder linking example

Linking a folder makes it convenient to manage projects via the UI and visualize the requirements for all your sites in one place. The site list updates in v5.0 are insane!

On his blog, the author has written about the 5.0 release with insider details. I recommend giving it a read and following the author for future updates.

To get started, check out the GitHub project for documentation and installation instructions. Since this project is free and open-source, you can support the creator by sponsoring his work.

Laravel News

Rudy Giuliani Shocker: Revealed as Contestant on Fox’s ‘Masked Singer,’ Triggers Liberal Judges to Walk Off

https://www.louderwithcrowder.com/media-library/image.jpg?id=29228886&width=980

If you watch FOX’s "The Masked Singer" and are worried about spoilers… Whoops, too late! Rudy Guliani was revealed as one of the masked singers and two of the liberal judges were pissed. First, if you are unfamiliar with the show–I’ve never watched and am going off of this Deadline article–this is the masked singer.


Preview: The Good, The Bad, And The Cuddly | Season 7 | THE MASKED SINGER

youtu.be

Celebrities dress up as furries and sing songs. Other celebrity judges have to guess who the celebrity is. On a taping for the debut episode, one of those celebrities is Rudy Guiliani. If you want to know what furry he was or what song he sang, you’ll have to tune in to the show. OR, you can not care. What’s making the story trend is that two leftist judges, Robin Thicke and Ken Jeong, walked off in protest.

Robin Thicke is best known as being Alan Thicke’s less talented son, and for that one song where he stole the melody from Marvin Gaye. That one song people say is kinda rapey. Except, now, the people who call it rapey won’t care as much after Thicke stuck it to a Trump associate by walking off a stage. Ken Jeong is best known from this gif:

Rudy Guliani is, as you all know, the former Mayor of New York City and a frequent guest on the Louder with Crowder program. He’s also friends with Donald Trump and was in the news for some legal challenge that if mentioned will cause Facebook to immediately slap this post with a "fact" check. I’ll just say those legal challenges are most likely what triggered Thicke and Jeong. That, and how dare Fox normalize someone who has a different opinion than them. Leftists hate it when that happens.

If you were wondering why Rudy is trending today, I hope this clears things up.

The Louder with Crowder Dot Com Website is on Instagram now! Follow us at @lwcnewswire and tell a friend!


Steak-FIGHT at the Golden Corral! Crowder & Dave Rip on it for 10 minutes! | Louder With Crowder

youtu.be

Louder With Crowder

Optimus Prime Wants You to Go the Hell to Sleep

https://i.kinja-img.com/gawker-media/image/upload/c_fill,f_auto,fl_progressive,g_center,h_675,pg_1,q_80,w_1200/ba009492ecde73f47b299db909a23498.jpg

You can now have Optimus Prime read you a bedtime story. This is not a sentence I expected to write today, and yet, it is now an inescapable fact that you can go to bed listening to the dulcet tones of the leader of the Autobots… as he describes the horrible wars that enveloped his home planet Cybertron before coming to Earth. Sweet dreams!

To clarify, you’ll need to have access to the immensely popular meditation/relaxation/sleep assistance app Calm—specifically, the Calm Kids iteration—to hear Optimus narrate a “Sleep Story,” which the company describes as being “soothing tales that mix music, sound fx, and incredible voice talent to help you drift into dreamland.” The story is titled “History of the Transformers,” which doesn’t seem like a tale that would be easy to drift off to given that the vast majority of it has to do with the endless wars between the Autobots and the Decepticons.

That said, Optimus, as per the classic cartoons and modern live-action movies, is played by Peter Cullen, whose deep, low, soothing voice seems absolutely tailor-made to lull just about anyone to sleep, no matter what he was reading. You can get a too-brief 30-second preview of the Sleep Story over at Calm, and hear for yourself.

The press release adds, “This never-before-heard Transformers story tells the history of the Autobots and Decepticons, taking listeners deeper into the More-Than-Meets-the-Eye themes of the iconic franchise, exploring bravery, leadership, friendship, and STEM.” I’m very curious about how much importance will be placed on science, technology, engineering, and mathematics in the recording, given that 1) virtually all of the STEM in Transformers is made up, and 2) I don’t know much you’re going to learn about these sciences while you are literally falling asleep. There’s not a chance in hell that any fact I heard would remain in my mind come daybreak, no matter what robot told it to me

“History of the Transformers” is available now in the Calm Kids app. If we’re lucky, the next release will be terrorist leader Cobra Commander reading a bedtime story about the time he created an entire game show just to make G.I. Joe feel dumb.


Wondering where our RSS feed went? You can pick the new up one here.

Gizmodo

Database transaction middleware in Laravel

https://nico.orfanos.dev/card.png

Why transactions are a good thing.

Let’s say that in your application all users have to belong to a team. And in your createUser action, you create a user and then you assign this user a team.

$user = User::create(['email'=> '[email protected]'); $user->teams()->attach($team->id); //Throws an exception

If you get an Exception while attaching the Team to the User, your application ends with a wrong state where you have a User which hasn’t a Team assigned.

This is simple to fix in this case, but it can be more complex in other cases and by using database transactions will yourself these state fixes. Because, when using database transactions, if the team assignment throws an exception, your application will also prevent the user creation.

How to implement write transactions in Laravel

Database transactions are good practice for all write actions. Therefore we create a global middleware for this, using the following command.

$ php artisan make:middleware DatabaseTransaction

and we change the handle method like below:

//app/Http/Middleware/DatabaseTransaction.php public function handle($request, \Closure $next) { if (!in_array($request->method(),['POST','PUT','PATCH','DELETE'])) { return $next($request); } DB::beginTransaction(); try { $response = $next($request); } catch (\Exception $e) { DB::rollBack(); throw $e; } if ($response->getStatusCode() > 399) { DB::rollBack(); } else { DB::commit(); } return $response; }

This code will check if we make a write operation by checking if the request method of the request is a write one, and start a transaction. If within the write request something goes wrong it will roll back the transaction.

The only thing left to do is to register the middleware to our web middleware group in the app/Http/Kernel.php.

//app/Http/Kernel.php protected $middlewareGroups = [ 'web' => [ // ... \App\Http\Middleware\DatabaseTransaction::class ], ];

Now your application will use this DatabaseTransaction middleware on every request.

What to keep in mind

Once you have fully integrated database transactions in your applications, there is this one thing that you need to watch out for when dispatching jobs. If you dispatch a job and later your application rolls back, your job will still be processed by your queue.

For that reason, Laravel has the afterCommit method which you can chain after the dispatch. This way you are safe that the dispatch will only run if the response was successful.

So if you also are sending an email after the user creation, your code should look like this:

$user = User::create(['email'=> '[email protected]'); $user->teams()->attach($team->id); dispatch(new SendWelcomeEmail($user))->afterCommit();

Final words

The accuracy, completeness, and reliability of your database data are viable things for your application. Using database transactions in Laravel is easy for us to take advantage of them.

Laravel News Links