We’ve covered some of this before, but here’s a nice roundup of why Russia’s major weapons systems suck. It’s a handy tour through the world of over-promised, under-performing vaporwear.
“Before February 24th, 2022, the Russian Federation looked like it would deploy or soon be able to field some pretty formidable new weapons.” At least among those who hadn’t noticed Russia’s previous vaporware claims.
“In everything from fifth generation fighter jets to modern tanks, to new body armor and even tsunami-causing nuclear torpedoes, there was enough hype to make even informed Western national security experts worry about what they were seeing.”
“Little wonder that they believed Ukraine would fall in days in the months prior to the invasion. Those predictions did not turn out to be the case. And now two years later, Russia still finds itself fighting a war of attrition with no end in sight.”
It covers Russia’s one aircraft carrier, the Admiral Kuznetsov, how it’s been under repairs since 2018, is markedly less technologically advanced than American carriers, and how it has a history of corruption as well. It”s supposed to enter service again this year. I wouldn’t count on it.
Admiral Kuznetsov isn’t Russia’s only naval problem. “It is steadily retiring its Soviet-era ships and replacing them with lighter, less combat-worthy vessels.”
There’s the new, formidable (on paper) Lider-class destroyers, first unveiled in 2015 and capable of using a host of advanced new weapons. Tiny problem: “On paper” is the only place you can see them, since they haven’t started building them yet.
Then there’s “the Belgorod submarine, and particularly its Poseidon Torpedo, are two other items of hype in the Russian Navy that don’t seem to stand up to scrutiny. The Belgorod and Poseidon have often been items of fear in Western media and national security circles, which have nicknamed the former Russia’s ‘Doomsday Submarine.’”
“According to the Kremlin’s hype, the submarine and its arsenal of smart drone Poseidon torpedoes can unleash a 100 megaton yield capable of creating radioactive tsunamis that would inundate coastal communities and make them unlivable.”
“However, tests of the Poseidon have seemingly proven less than satisfactory. That shouldn’t be too surprising, because for the Poseidon torpedo to work as the Russians claim, it would need to be able to house all of the equipment needed for a nuclear reactor to convert atomic fission into electricity and propulsive force, while ensuring negligible waste heat (to avoid detection). It would also need the hardware to shield its sensitive electronics from the nuclear fission process.”
“Unfortunately for Moscow, the torpedo is too small to do this, meaning that it is either an object of hype or Russian engineers have come upon a technological leap enabling exotic engineering methods. We’ll let you decide which of the two scenarios is likelier.”
“The likeliest scenario is a yield of about one to two megatons per torpedo, which would be enough to inundate a coastal area with dangerous radioactive waters, but not to create a tsunami.” And the hundred knot speed is also bunk for numerous technical reasons.
“We now journey from the sea to the skies and look at the Russian answer to the American fifth generation F-22 and F-35 fighter jets – the Su-57 Felon. To be fair, the Su-57 does have some impressive features, like its 3D thrust vectoring engines, climb rate of 64,000 feet per minute, 66,000-foot service ceiling, Mach 2 speed, and range of 2,186 miles without refueling. In a plane vs. plane battle, the Su-57 should be a capable opponent against almost any fighter jet on the planet.”
“However, the Su-57 has a big drawback – its comparative lack of stealth. Aviation experts regard the Su-57 as being by far the least stealthy of the fifth generation fighters currently in service. For example, the F-22 Raptor is detectable at a range only under 10 miles, while the Su-57 would be detectable at a range of 35 miles.”
“Its stealth features are also concentrated in the front of the plane, meaning that if it turns or maneuvers, it is far more detectable.” Good thing fighter aircraft never need to turn or maneuver…
“Some aviation experts are even less kind and believe the Su-57’s radar cross section is similar to that of the F/A-18 Super Hornet, which is 1,000 times less stealthy than the F-35 Lightning II.”
“The Su-57 has played little part in the war in Ukraine, as the Russian aerospace forces have refused to field it in Ukrainian airspace. Instead, it has only attacked targets at long range from within Russian airspace.”
Then there’s the ridiculously low production rate. “The Kremlin ordered 76 Su-57s in 2019. 22 are in service as of December 2023, after several years of delays.” And we only have Russia’s word that they’ve produced that many. The real total could be lower. By contrast, Lockheed Martin has produced over 1,000 F-35s.
Next it’s a familiar punching bag, the T-14 Armata. “To be fair, the T-14 Armata does have significant improvements over the tanks Russia has usually fielded in Ukraine – the T-72, T-80, and T-90. These tanks have been lost in their thousands during the fighting in Ukraine, thanks to bad doctrine and their own design flaws. Because they do not segregate their ammunition magazines in a sealed compartment, they have often suffered from complete destruction with jack-in-the-box explosions.”
“The T-14 Armata mitigates this flaw with a protective capsule isolating the crew from their vehicle’s ammunition magazine.”
Unfortunately, the video goes on to say the T-14 has a low profile, which simply isn’t true. As I’ve noted before, the T-14 is 3.3 meters high vs. 2.44 meters for the M1A2, 3 meters for the Leopard 2, and 2.49 for the Challenger 2. 3.3 meters is higher even than the World War II M3 Lee tank the Soviets (who got them via Lend-Lease) called “a coffin for seven brothers.”
“The Armata’s main weapon is a 125mm 2A82-1M smoothbore gun which can fire related rounds and laser-guided missiles. This weapon would be a significant threat to the Western main battle tanks that Ukraine began fielding in larger numbers last year.” The “large numbers” are pretty small numbers.
“Unfortunately for Russia, this gun is not backward-compatible with its older tanks, which means only the Armata can field it, and that’s a problem, because there has never been a confirmed sighting of the T-14 in Ukraine. Russia has even fewer T-14 Armata tanks than it does Su-57 fighter jets.”
There follows a discussion of the T-14’s X-shaped engine that has evidently engendered a lively debate online, so I’m not going to get into it here.
“Meanwhile, the electronics for the Armata’s sensory and fire control systems are no longer as widely available due to the sanctions put in place as a result of its invasion of Ukraine. Indeed, there has not even been an assembly line built for the Armata and all of the prototypes have been made by hand. Given all of these problems, don’t expect to see the Armata fielded in large numbers, if at all, anytime soon.”
“Russia’s body armor has also been a subject of embarrassment. Many of Russia’s soldiers, especially the conscripts Putin mobilized in the autumn of 2022, have lacked proper protection. Infamously, some Russian troops were issued airsoft versions of the Ratnik body armor. Despite its problems in this area, Russia has made bold claims about what it has coming down the pike – its next-generation Sotnik body armor, which it says will be able to stop a .50 caliber Browning Machine Gun round.” Yeah, no.
We’re not even going to bother with the MiG-41, which doesn’t exist yet. Vaporware all the way down.
It’s always safest to assume that the latest Russian wunderwaffen is vaporware unless proven otherwise.
Sign up here to get Recomendo a week early in your inbox.
Blue lasers
I spend too many hours a day watching YouTubes. Many of the channels I subscribe to produce content as good as or better than anything produced by PBS, cable TV, and your average documentary. For free. For a fantastic example of world class content on YouTube watch this Veritasium episode on Blue Lasers. Turns out blue lasers were “impossible” to create, but after decades of an insane amount of work by one crazy guy in Japan, they are now possible and all the cheap screens we have in our lives now are due to him. Veritasium tells this amazing human story, with heaps of illuminating technical detail on why blue lasers were nearly impossible and how they work, all in a brilliant 33 minutes.— KK
Pocket guide to understanding a camera
I gave my wife a camera for Christmas. It has an auto-setting, but she wanted to learn how to operate it manually. We were initially puzzled by terms like ISO, shutter speed, and aperture. Then I stumbled upon a PDF guide from Humburger Fotospots that demystifies these concepts with simple icons and explanations. I printed it out and stored it in the camera case. — MF
View images of Earth in real time
The GOES Image Viewer hosts the most up-to-date real time images of Earth available to the public. You can view and download satellite images that capture the entire visible disk of Earth and are updated every 10 to 15 minutes. I don’t know much about meteorology or geoscience, but I am an Earth lover, and it’s fascinating to be able to visualize weather patterns on a global scale. — CD
Galactic compass
If you train yourself to pay attention to your surroundings you should be able to immediately point north without too much thinking. The next-level awareness is to point to the center of the galaxy at any time. Because the earth rotates during the day and orbits during the year, this direction changes constantly. You’ll need an app to help you. Galactic Compass is a free iPhone app that does only one thing: points toward the center of the galaxy. — KK
Typography Guide
If you’re like me and would like to know more about fonts than just serif and san-serif, here is a cool guide to check out: The Logo Company’s Guide to Typography and Fonts. It breaks down the entire anatomy of fonts. — CD
Ryan Holiday’s career wisdom
Writer and entrepreneur Ryan Holiday has had a varied career, from Hollywood agent assistant to marketing director for American Apparel. He’s put together a list of 37 pieces of hard-fought career advice that’s useful for anyone who works. Examples:
Find what nobody else wants to do and do it. Find inefficiency and waste and redundancies. Identify leaks and patches to free up resources for new areas. Produce more than everyone else and give your ideas away.
Always say less than necessary. Saying less than necessary, not interjecting at every chance we get — this is actually the mark not just of a self-disciplined person, but also a very smart and wise person.
Your creative output, your personal relationships, and your social life—balancing all three is impossible. You can excel in two if you say no to one. If you can’t, you’ll have none.
When people compete, somebody loses. So go where you’re the only one. Do what only you can do. Run a race with yourself.
The Spatie Media Library simplifies the process of handling media files, such as images, in Laravel. It provides features for storage, manipulation, and retrieval of media files. One of the strengths of the package is that you can easily associate uploaded files with your Eloquent Models.
In this guide, you will learn how to integrate the Media Library package into an application. We’ll use it to associate uploaded images with an Eloquent Model, specifically the Product model.
We’ll cover all the required steps like the package installation process, model setup, defining a migration, creating the controller, views and routes to show products, show a product form with upload and storing new products.
Let’s get started!
Step 1: Install Laravel
Begin by creating a new Laravel project using Composer by running:
What this publishing does is it creates a file like, for example database/migrations/2024_02_26_203939_create_media_table.php . This migration serves to define a table ‘media’ with all the columns predefined as they are required by media library.
Afterwards we need to execute this migration by running:
The Spatie Media Library has now been successfully installed.
Step 3: Create Model and Migration
Now, let’s create a “Product” model along with its migration by running:
phpartisanmake:modelProduct-m
Step 4: Add Migration Code
Open the generated migration file (database/migrations/YYYY_MM_DD_create_products_table.php) and add additional columns that could be encountered in a real-world product application, such as “name,” “description,” “price,” and “image”:
Defining our Model this way allows us to associate media, like an uploaded image, with each instance of a Product. We’ll see exactly how this is used, when we add our controller code in step 9.
Step 7: Create Controller
Generate a controller named “ProductController” by running the following Artisan command:
phpartisanmake:controllerProductController
Step 8: Add Controller Code
Now open the generated “ProductController” (app\Http\Controllers\ProductController.php) and implement the methods below to list an index page with products, show a create product form and finally storing a new product along with its uploaded image:
app/Http/Controllers/ProductController.php
<?phpnamespaceApp\Http\Controllers;useApp\Models\Product;useIlluminate\Http\Request;classProductControllerextendsController{// Display a list of created products along with their imagespublicfunctionindex() { $products =Product::latest()->paginate(10);returnview('products.index', compact('products')); }// Display the form to create a new productpublicfunctioncreate() {returnview('products.create'); }// Store a new product along with its uploaded image filepublicfunctionstore(Request $request) { $request->validate([// Sets a max image upload file size of 2048 kilobytes or 2MB, adjust as needed:'image'=>'required|image|max:2048',// Validate that other fields contain proper values too:'name'=>'required|string|max:255','description'=>'nullable|string|max:255','price'=>'required|numeric|min:0|max:999999.99', ]);// First create the product in the database using the Eloquent model $product =Product::create($request->validated());// Then associate the uploaded image file with the product $product->addMediaFromRequest('image')->toMediaCollection('product-images');// Send the user back to the product list pagereturnredirect(route('products.index'))->with('success', 'Product created successfully.'); }}
Step 9: Add a View to Create a Product
In this step we’ll create a view that contains the form to add a new product along with an uploaded image.
I made sure the blade code offers a nicely layouted form that shows error messages for missing or invalid values. This way we can guarantee the user is prompted to always upload an actual image file and fill the required fields name and price.
Create a file at resources/views/products/create.blade.php and add the following code:
In this step we’ll create a view that allows us to show all products. We will use Spatie Media Library to render a thumbnail of the uploaded product image.
Create a file at resources/views/products/index.blade.php and add the following code:
resources/views/products/index.blade.php
<!DOCTYPEhtml><htmllang="en"><head> <metacharset="UTF-8"> <metaname="viewport"content="width=device-width, initial-scale=1.0"> <title>Excel Import</title><!-- Bootstrap CSS --> <linkhref="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"rel="stylesheet"></head><body><divclass="container mt-5"><!-- Display success message if it was set--> @if(session('success')) <divclass="alert alert-success"></div> @endif <h1class="my-4">Product Listing</h1> <tableclass="table"> <thead> <tr> <thcolspan="3"></th> <thclass="text-end"> <ahref=""class="btn btn-primary">Create Product</a> </th> </tr> <tr> <th>Name</th> <th>Description</th> <th>Price</th> <th>Image</th> </tr> </thead> <tbody> @foreach($products as $product) <tr> <td></td> <td></td> <td></td><!-- Fetch a thumbnail image based on the product's associated media --> <td><imgsrc=""alt="Product Image"width="140px"></td> </tr> @endforeach </tbody> </table></div></body></html>
Step 11: Define Routes
Finally, before we can test the application, we need to define the routes to list products, show the create form, and store a product.
You can now test the application by running the development server:
Now you can navigate to http://127.0.0.1:8000/products in your browser to view the product listing. Proceed to http://127.0.0.1:8000/products/create to access the create product form.
Select an image to upload and fill in the other product details and submit the form. Verify that the product and its associated image are successfully stored in the database.
After storing the form your database contents should look somewhat like this:
Now if you continue and upload a few more you’ll see it nicely displays all the thumbnail images on the product page:
That’s it! You’ve successfully built your first application that uses Spatie Media Library to manage its uploaded media files.
Conclusion
In this tutorial, we’ve explored how to upload images using the Spatie Media Library package in a Laravel application. By following the steps outlined above, you can easily handle image uploads and storage in your Laravel projects.
Using third party packages like this can greatly speed up your development process. Before you use a package in your production application, check that the package is well maintained, supports your Laravel version, is properly documented and does not have lots of unresolved issues posted on their git page.
Spatie is a well-known company that has been developing and maintaining numerous packages for years and provides them for free as open source. The Media Library is one of their most widely used packages and is likely to meet most quality requirements.
I hope this helped you get started in using this handy third party package. Let me know in the comments what you’re using it for, how it went and what issues you may have had with it.
The Spatie Media Library simplifies the process of handling media files, such as images, in Laravel. It provides features for storage, manipulation, and retrieval of media files. One of the strengths of the package is that you can easily associate uploaded files with your Eloquent Models.
In this guide, you will learn how to integrate the Media Library package into an application. We’ll use it to associate uploaded images with an Eloquent Model, specifically the Product model.
We’ll cover all the required steps like the package installation process, model setup, defining a migration, creating the controller, views and routes to show products, show a product form with upload and storing new products.
Let’s get started!
Step 1: Install Laravel
Begin by creating a new Laravel project using Composer by running:
What this publishing does is it creates a file like, for example database/migrations/2024_02_26_203939_create_media_table.php . This migration serves to define a table ‘media’ with all the columns predefined as they are required by media library.
Afterwards we need to execute this migration by running:
The Spatie Media Library has now been successfully installed.
Step 3: Create Model and Migration
Now, let’s create a “Product” model along with its migration by running:
phpartisanmake:modelProduct-m
Step 4: Add Migration Code
Open the generated migration file (database/migrations/YYYY_MM_DD_create_products_table.php) and add additional columns that could be encountered in a real-world product application, such as “name,” “description,” “price,” and “image”:
Defining our Model this way allows us to associate media, like an uploaded image, with each instance of a Product. We’ll see exactly how this is used, when we add our controller code in step 9.
Step 7: Create Controller
Generate a controller named “ProductController” by running the following Artisan command:
phpartisanmake:controllerProductController
Step 8: Add Controller Code
Now open the generated “ProductController” (app\Http\Controllers\ProductController.php) and implement the methods below to list an index page with products, show a create product form and finally storing a new product along with its uploaded image:
app/Http/Controllers/ProductController.php
<?phpnamespaceApp\Http\Controllers;useApp\Models\Product;useIlluminate\Http\Request;classProductControllerextendsController{// Display a list of created products along with their imagespublicfunctionindex() { $products =Product::latest()->paginate(10);returnview('products.index', compact('products')); }// Display the form to create a new productpublicfunctioncreate() {returnview('products.create'); }// Store a new product along with its uploaded image filepublicfunctionstore(Request $request) { $request->validate([// Sets a max image upload file size of 2048 kilobytes or 2MB, adjust as needed:'image'=>'required|image|max:2048',// Validate that other fields contain proper values too:'name'=>'required|string|max:255','description'=>'nullable|string|max:255','price'=>'required|numeric|min:0|max:999999.99', ]);// First create the product in the database using the Eloquent model $product =Product::create($request->validated());// Then associate the uploaded image file with the product $product->addMediaFromRequest('image')->toMediaCollection('product-images');// Send the user back to the product list pagereturnredirect(route('products.index'))->with('success', 'Product created successfully.'); }}
Step 9: Add a View to Create a Product
In this step we’ll create a view that contains the form to add a new product along with an uploaded image.
I made sure the blade code offers a nicely layouted form that shows error messages for missing or invalid values. This way we can guarantee the user is prompted to always upload an actual image file and fill the required fields name and price.
Create a file at resources/views/products/create.blade.php and add the following code:
In this step we’ll create a view that allows us to show all products. We will use Spatie Media Library to render a thumbnail of the uploaded product image.
Create a file at resources/views/products/index.blade.php and add the following code:
resources/views/products/index.blade.php
<!DOCTYPEhtml><htmllang="en"><head> <metacharset="UTF-8"> <metaname="viewport"content="width=device-width, initial-scale=1.0"> <title>Excel Import</title><!-- Bootstrap CSS --> <linkhref="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"rel="stylesheet"></head><body><divclass="container mt-5"><!-- Display success message if it was set--> @if(session('success')) <divclass="alert alert-success"></div> @endif <h1class="my-4">Product Listing</h1> <tableclass="table"> <thead> <tr> <thcolspan="3"></th> <thclass="text-end"> <ahref=""class="btn btn-primary">Create Product</a> </th> </tr> <tr> <th>Name</th> <th>Description</th> <th>Price</th> <th>Image</th> </tr> </thead> <tbody> @foreach($products as $product) <tr> <td></td> <td></td> <td></td><!-- Fetch a thumbnail image based on the product's associated media --> <td><imgsrc=""alt="Product Image"width="140px"></td> </tr> @endforeach </tbody> </table></div></body></html>
Step 11: Define Routes
Finally, before we can test the application, we need to define the routes to list products, show the create form, and store a product.
You can now test the application by running the development server:
Now you can navigate to http://127.0.0.1:8000/products in your browser to view the product listing. Proceed to http://127.0.0.1:8000/products/create to access the create product form.
Select an image to upload and fill in the other product details and submit the form. Verify that the product and its associated image are successfully stored in the database.
After storing the form your database contents should look somewhat like this:
Now if you continue and upload a few more you’ll see it nicely displays all the thumbnail images on the product page:
That’s it! You’ve successfully built your first application that uses Spatie Media Library to manage its uploaded media files.
Conclusion
In this tutorial, we’ve explored how to upload images using the Spatie Media Library package in a Laravel application. By following the steps outlined above, you can easily handle image uploads and storage in your Laravel projects.
Using third party packages like this can greatly speed up your development process. Before you use a package in your production application, check that the package is well maintained, supports your Laravel version, is properly documented and does not have lots of unresolved issues posted on their git page.
Spatie is a well-known company that has been developing and maintaining numerous packages for years and provides them for free as open source. The Media Library is one of their most widely used packages and is likely to meet most quality requirements.
I hope this helped you get started in using this handy third party package. Let me know in the comments what you’re using it for, how it went and what issues you may have had with it.
Level up your transportation with the Spaceballs-inspired Ludicrous Speed Panel from Concord Aerospace. Turn its dial to increase your speed from Light to Ridiculous to Ludicrous, then go to Plaid. The Apollo-era control panel has a working main switch hidden under a “GO” cover, and its knob can be equipped with a potentiometer for controlling devices.
I remember Dark Forces, or Star Wars: Doom, as a slog. Running a demo of the 1995 game on a Gateway system with an Intel 486DX at 33 MHz, I trudged through seemingly endless gray hallways. I shot at a steady trickle of Stormtroopers with one their own (intentionally) semi-accurate blaster rifles. After a while, I would ask myself a pertinent, era-specific question: Why was I playing this low-energy nostalgia trip instead of actual Doom?
Dark Forces moved first-person shooters forward in a number of ways. It could lean on Star Wars for familiar sounds and enemies and tech, and a plot with a bit more complexity than "They’re demons, they gotta go." It let the player look up and down, jump, and crouch, which were big steps for the time. And its level design went beyond "find the blue key for the blue door," with some clever environmental puzzles and challenges.
Not that key cards don’t show up. This game is from 1995, so there are key cards, there are hidden wall-doors, and there are auto-spawning enemies. It’s not like the Dark Forces designers could entirely ignore Doom. Nobody could.
Having played through some enjoyable hours of Dark Forces Remaster, I’ve come around quite a bit on this Doom-era game’s worthiness. In 2024, I can joyfully rip through research facilities, foundries, sewers, and space stations at a breakneck clip, stuffing bad guys full of laser blasts from every angle and distance. The grenades (err, thermal detonators) actually feel viable and fun to use. The levels, and the game as a whole, are higher resolution and easier to appreciate at this faster, more frenetic pace.
Nightdive Studios continues its streak of providing spiffed-up but eminently faithful remasters of classic titles with Dark Forces Remastered. The studio’s leaders told Ars last year that their goal was games that "play the way you remember them playing. Not the way they actually did on your 486 [computer], but in an evocative manner." For me, Dark Forces Remastered feels far, far better than I remember, and so I’ve gotten a chance to absorb a lot more of the world it’s trying to evoke.
An elegant shooter full of clumsy blasters
A quick primer on Dark Forces: You are mercenary Kyle Katarn, working for the Rebellion around the time of Episode IV (the first Death Star one), helping the rebels investigate and halt the development of Dark Troopers. Dark Troopers are essentially Stormtroopers with big shoulder pauldrons and the ability to deflect blaster fire. You can use all kinds of found weapons, including blasters, land mines, and rocket launchers. But you will not become a Jedi, because that happens in the next game.
Due either to thematic or technical restrictions of the time, you’re not typically fighting huge arenas of baddies. You are meant to sneak through hallways and turn corners, popping a few at a time. Unless you’re me, that is, liberated by playing at 4K at 120 frames per second (and, sometimes, cheat codes), wantonly wrecking dudes who didn’t get the memo about my arrival.
The little voice stings—"Stop!" "You’re not authorized!"—were a delight, if often cut short by the quick dispatching of their speaker. For the first few levels, I felt like the Rebellion could have destroyed five Death Stars in just two movies if they had a few more Kyles like me. But Dark Forces does ramp up as you go on.
All the same cheat codes from the original game work—Nightdive even gives you places to type them in and then activate them in menus—and I had to lean on a couple level skips and resupplies to get through the first seven levels. The objectives get far twistier and "What did flipping that switch do?" as you roll on. Some of the battery-powered devices, like infrared goggles and gas masks, are all but essential at times, and the long levels with their repeating wall textures can have you wasting them. It’s never quite unfair, but you realize how tough this must have been at a far lower frame rate and walking speed. And without such easy access to online walk-throughs, of course.
There are new lighting effects, much nicer menus and options, gamepad support (including rumble), and polished cutscenes, in addition to the gameplay that now tilts a bit more toward Motörhead than Rush in speed and feel. But, really, what sells Dark Forces Remastered is the game beneath the upgrades. If you have any interest in hopping on Jabba the Hutt’s barge again, this is the way to do it.