Kyle bagged himself some real quality people

https://gunfreezone.net/wp-content/uploads/2021/11/FDHKc66UYAErVDI.jpeg

The upside of social media is that the professional media no longer has a monopoly on information.

The media is trying to do its best to George Zimmerman Kyle Rittenhouse.

Social media has done its homework.

This is the skateboarder who Kyle canoed.

None of that expressly justified shooting him, but it makes it harder to believe that Huber was the good guy trying to help people.

This information also has a way of swinging jury opinions.

Good.

I shed no tears over a wife beater who got split in half by a 223.

Speaking of Dune

https://gunfreezone.net/wp-content/uploads/2021/10/tumblr_nz9rdunO6L1rl43cyo1_1280.png

Dune is a great book.

Like Starship Troopers (another favorite) and Atlas Shrugged, the plot is really just a way of making a philosophical and political treatise into something enjoyable to read.

And it’s great.

I highly recommend reading or twice.  The first time abridged to get the plot, then again unabridged to focus on the philosophy and not worry about plot points.

But, if you really want the most distilled understanding of Dune, the best is a Tumblr page called Calvin & Muad’Dib.

It’s just Calvin & Hobbes strips with the original text replaced with Dune quotes.

It’s epic.

How very true and how much we see this today.

How valuable the philosophy and how clearly it’s shown in a simple comic strip.

I love it.

 

Comic for October 29, 2021

https://assets.amuniversal.com/41f6c6800e80013a7e87005056a9545d

Thank you for voting.

Hmm. Something went wrong. We will take a look as soon as we can.

Dilbert Daily Strip

death and gravity: reader 2.5 released

https://death.andgravity.com/_file/reader-2-0/reader.png

Hi there!

I’m happy to announce version 2.5 of reader, a Python feed reader library.

What’s new? #

Here are the most important changes since reader 2.0.

Enable search by default #

Full-text search is now enabled by default
– there are no additional dependencies to install,
and no required action before using it.

Statistics #

To allow users to understand how they consume content,
it is now possible to get some statistics on feed and user activity.

First, you can count the number of entries per day
during the last 1, 3, 12 months.
This is useful to get an idea of how often a feed / tag / query
gets new entries, and how it changes over time.

Second, the time when an entry was last marked as read/important is recorded.
This allows seeing if, how often, and how soon you engage with new entries
– I’m still working on how to translate this into a useful summary.
Also, it allows seeing if an entry was explicitly marked as unimportant.

Improved duplicate handling #

The entry_dedupe plugin got significantly better:

  • reduce false negatives by using approximate string matching
  • make it possible to re-run the plugin for existing entries
  • delete old duplicates instead of marking them as read/unimportant

User-added entries #

Users can now add entries to existing feeds.
This is useful when you want to keep track of an article
that "fell off the end" of a feed that only has the last X articles.

New data #

You can now get the subtitle and version of a feed.
Also, it is possible to know when an entry was added to reader,
and by whom (the feed or the user).

New plugin hooks #

It is now possible to run arbitrary actions after a feed is updated.

New Python versions #

reader now supports Python 3.10 and PyPy 3.8.

Other changes #

  • A number of convenience properties, methods, and arguments were added.
  • The web applications and plugins were updated to take advantage of the features above.
  • A number of bugs were fixed and methods were sped up.

See the changelog for details.

What is reader? #

reader takes care
of the core functionality required by a feed reader,
so you can focus on what makes yours different.

reader in action
reader allows you to:

  • retrieve, store, and manage Atom, RSS, and JSON feeds
  • mark entries as read or important
  • add tags and metadata to feeds
  • filter feeds and articles
  • full-text search articles
  • get statistics on feed and user activity
  • write plugins to extend its functionality

…all these with:

  • a stable, clearly documented API
  • excellent test coverage
  • fully typed Python

To find out more, check out the GitHub repo and the docs,
or give the tutorial a try.

Why use a feed reader library? #

Have you been unhappy with existing feed readers and wanted to make your own, but:

  • never knew where to start?
  • it seemed like too much work?
  • you don’t like writing backend code?

Are you already working with feedparser, but:

  • want an easier way to store, filter, sort and search feeds and entries?
  • want to get back type-annotated objects instead of dicts?
  • want to restrict or deny file-system access?
  • want to change the way feeds are retrieved by using Requests?
  • want to also support JSON Feed?

… while still supporting all the feed types feedparser does?

If you answered yes to any of the above, reader can help.

Why make your own feed reader? #

So you can:

  • have full control over your data
  • control what features it has or doesn’t have
  • decide how much you pay for it
  • make sure it doesn’t get closed while you’re still using it
  • really, it’s easier than you think

Obviously, this may not be your cup of tea, but if it is, reader can help.

Planet Python

‘Thank God You Are Not on the Supreme Court’: Sen. Tom Cotton Disembowels AG Merrick Garland

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

Sometimes, you wanna go right to the videotape. Here is Senator Tom Cottom saying what we’re all thinking about Merrick Garland right to his douchey-looking face.


Sen. Cotton On AG Garland Responding To NSBA Letter By Targeting Parents: “Shameful"

youtu.be

"[Scott Smith] was cited by the school boards association as a domestic terrorist, which we now know, that letter and those reports were the basis [for your memorandum]. Your performance is shameful, thank God you are not on the Supreme Court."

Let’s fill in some context. Merrick Garland was being grilled over the White House’s attack on parents at school board meetings. The National School Board Association wrote to the White House to do something about the angry parents they referred to as "threats of violence." The poster child for these threats was Scott Smith, who was angrily removed from a Loudoun County school board meeting. Joe Biden’s White House, of course, was more than happy to side against the parents in favor of the school boards. Unlike the teachers’ unions, middle-class parents don’t give Joe Biden and the Democrats millions and millions of dollars.

THEN, we find out the reason Mr. Smith was angry was that his daughter was (allegedly) raped and the school tried to cover it up.

THEN, Garland testified to a House Committee that he never heard of the case.

THEN, the NSBA retracted their initial letter and apologized for the incendiary rhetoric. You know, calling parents "domestic terrorists" and whatnot. This is also where we find out the White House may have helped the NSBA write the incendiary rhetoric.

This all brings us to today. And Sen. Tom Cotton disemboweling Merrick Garland.

I’m glad we had this talk.

Get your content free from Big Tech’s filter. Bookmark this website and sign up for our newsletter!


THIS Is Why We #FightLikeHell: LwC Mission Statement | Louder with Crowder

youtu.be

Louder With Crowder

Watch: Ted Cruz EVISCERATES Merrick Garland Over Targeting Parents and You Just Love to See It

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

This afternoon, Attorney General Merrick Garland testified before a congressional hearing, and he wasn’t prepared for the kind of metaphorical beating he was going to receive. Senator Ted Cruz gave one helluva performance, skull dragging Garland for every single person in the chamber to see. It made for very compelling television. It was magnificent.

In my head I see Willem Dafoe firing his pistol in the air, "It was a firefight!"

Cruz definitely came in guns-a-blazing, immediately laying into the frail old man with a heavy punch to the gut.

"You came before this committee in your confirmation hearing, you promised things would be different. I asked you specifically, quote, ‘Will you commit to this committee that under your leadership the department of justice will not target the political opponents of this administration.’ Here was your answer, quote, ‘Absolutely. It’s totally inappropriate for the department to target any individual because of their politics or position in a campaign.’ That was your promise just a few months ago. I’m sorry to say you have broken that promise."


Ted Cruz absolutely LAYS into AG Garland, and it is amazing

youtu.be

And before Garland could even begin to process anything, Cruz eviscerated him. He demonstrated just how the AG did, in fact, weaponize the DOJ against parents in an act of political persecution. Garland played stupid—which is never difficult for a leftist hack—as Cruz drilled into him about the FBI being sicked on parents, who the National School Board Association recently described as "domestic terrorists", an event linked directly to the recent rape of a young girl in a Loudoun County school.

Cruz proceeded to grind the white-haired radical into the floor as Garland refuses to answer questions relating to the conflict of interest regarding the DOJ protecting the teaching of CRT and his son-in-law profiting from it.

I cannot describe the throttling properly without thousands of words. Needless to say, you must watch the video to appreciate it, and I promise you will not be disappointed.

Parents are fighting back against CRT. Workers are fighting back against vaccine mandates. And we have a handful of leaders in government who are fighting back against the radicalism in the Biden administration. My fellow Americans, #FightLikeHell.

Get your content free from Big Tech’s filter. Bookmark this website and sign up for our newsletter!


THIS Is Why We #FightLikeHell: LwC Mission Statement | Louder with Crowder

youtu.be

Louder With Crowder

First trailer for Pixar’s ‘Lightyear’ shows the man behind the toy

http://img.youtube.com/vi/BwPL0Md_QFQ/0.jpg

With four movies under its belt, the Toy Story franchise remains the undeniable crown jewel in Pixar’s portfolio. But after Toy Story 4 put something of a boy on Woody’s story, the focus is now shifting to Buzz Lightyear. The first trailer for Lightyear just arrived, and it sure paints a different picture than what we’re used to in the Toy Story universe. For one, the titular character isn’t a toy, but a real flesh-and-blood human who appears to be the inspiration for the Buzz Lightyear figure we know so well. 

The trailer definitely gives off origin story vibes, as it looks like Buzz makes the journey from pilot to intergalactic explorer in his signature spacesuit. How he gets from there to a beloved toy in the Toy Story world remains to be seen — but since this is Pixar, we’re expecting the two stories to collide in a way that’s fairly unexpected. 

Lightyear is set to hit theaters on June 17th, 2022, with Chris Evans voicing Buzz for the first time. Unfortunately for those of us who have gotten used to watching new Pixar films on Disney+, it seems like you’ll have to head out into the world if you want to see this during that summer release window.

Engadget

Different Ways to Back up MySQL Databases and Tables

https://blog.devart.com/wp-content/uploads/2021/08/dbforge-studio-for-mysql-download.png

The article provides an overview of the backup types available in MySQL and describes how-to examples of using the mysqldump command-line utility to take a backup of the database, tables, data, or schema and to restore the MySQL database. In addition, you can view how to generate a database backup with MySQL Workbench and how […]

The post Different Ways to Back up MySQL Databases and Tables appeared first on Devart Blog.

Planet MySQL

Understanding lockForUpdate and sharedLock in Laravel

https://miro.medium.com/max/1200/1*bp5NUD3p_KDDUxlgPH1exg.png

😥 Pessimistic Locking

We fixed the flaw of magically altering the inflation levels, but we face another issue: what if the balance changes mid-transaction? To better show the issue, we will have a new person that also needs money from Alice. Meet Charlie!

In this specific example, because we have a web app with thousands of HTTP web requests (slightly exaggerated, but banks do encounter this), we will ignore the fact that PHP is a blocking-IO programming language in the examples.

Let’s say that Alice has a fast sleight of hand, and both transactions where Alice sends money to Bob and Charlie are done, like at the same time, in the matter of microseconds. This means that if the odds are just right, the database will pull the records at the very same time, and send money at the very exact time.

If this scenario occurs, you will merely become stunned how from $100, you turned a total of $200 in the bank, $100 for each account.

The issue here is because we don’t have a locking mechanism in place for our database.

// FIRST REQUEST
$alice = User::find(1); // 'balance' => 100,
$bob = User::find(2); // 'balance' => 0,
Bank::sendMoney($alice, $bob, 100); // true// SECOND REQUEST
$alice = User::find(1); // 'balance' => 100,
$charlie = User::find(3); // 'balance' => 0,
Bank::sendMoney($alice, $charlie, 100); // true, but should have been false

This happens because if both queries run the SELECT statements (the ones defined by find()) at the same time, both requests will read that Alice has $100 in her account, which can be false because if the other transaction has already changed the balance, we remain with a reading saying she still has $100.

In this particular case, this is what might happen:

Request1: Reads Alice balance as $100
Request2: Reads Alice balance as $100
Request1: Subtract $100 from Alice
Request2: Subtract $100 from Alice
Request1: Add $100 to Bob
Request2: Add $100 to Charlie

But because we don’t know which runs faster, for various reasons, this can also happen:

Request1: Reads Alice balance as $100
Request2: Reads Alice balance as $100
Request1: Subtract $100 from Alice
Request1: Add $100 to Bob
Request2: Subtract $100 from Alice
Request2: Add $100 to Charlie

The ideal situation would be this one:

Request1: Reads Alice balance as $100
Request1: Subtract $100 from Alice.
Request1: Add $100 to Bob
Request2: Reads Alice balance as $0
Request2: Don't allow Alice to send money

The solution would be to be able to run the SELECT statements one-after-another, so we make sure that the request reads from the database the true balance for Alice.

✅ Implementing Pessimistic Locking

Laravel has a neat way to tackle this issue with the help of queries. Databases (like MySQL) have a thing called deadlock. Deadlocks permit the one who runs a query to specifically describe whose rows can be selected or updated within a specific query.

Laravel has a documentation section about deadlocks, but it was hard for me to digest what does what, so I came up with a better example.

Laravel documentation says:

A “for update” lock prevents the selected records from being modified or from being selected with another shared lock.

This is what we want. If we run lockForUpdate in our find() statements, they will not be selected by another shared lock.

And for the shared lock:

A shared lock prevents the selected rows from being modified until your transaction is committed.

Is this also what we want? Of course, if we apply this to the find() queries, the rows (in the first one Alice & Bob, in the second one Alice & Charlie) will not be read, nor modified until our update transaction got committed successfully.

// FIRST REQUEST
DB::statement(function () {
$alice = User::lockForUpdate()->find(1); // 'balance' => 100,
$bob = User::lockForUpdate()->find(2); // 'balance' => 0,
Bank::sendMoney($alice, $bob, 100); // true
});
// SECOND REQUEST
DB::statement(function () {
$alice = User::lockForUpdate()->find(1); // 'balance' => 0,
$charlie = User::lockForUpdate()->find(3); // 'balance' => 0,
Bank::sendMoney($alice, $charlie, 100); // false
});

Obviously, having a lockForUpdate would be just enough, because, by definition, any rows selected by it will never be selected by another shared lock, either lockForUpdate() or sharedLock().

Alternatively, just like Laravel says, you may use sharedLock() just so other queries won’t select the same rows until the transaction is finished. The use case would be for strong read consistency, making sure that if another transaction may be in process, to not get outdated rows.

Thanks to Laravel and deadlocks, we can now avoid any inflation.👏

But if you decide to run your bank in Laravel, you should use Event Sourcing, you definitely don’t want to play with the market. 🤨

Supporting our work

If you enjoyed this article or you are using one or more Renoki Co. open-source packages in your production apps, in presentation demos, hobby projects, school projects or so, spread some kind words about our work or sponsor our work via Patreon for some exclusive articles full of Laravel tips and best practices. 📦

Laravel News Links