“What a bunch of intolerant, hateful, bigoted, hypocrites, claiming moral superiority to me and you while burning, stoning and beating the very thing they claim to up-hold. Keep messing with the silent majority and you will learn what intolerance really feels like as we crush your hate with our fists.” ~ Anonymous
Two-time Pulitzer Prize winner, Michael Ramirez, combines an encyclopedic knowledge of the news with a captivating drawing style to create consistently outstanding editorial cartoons on Ammoland Shooting Sports News. Share this page and help spread our pro gun, conservative message with humor. Visit : http://ift.tt/2b5QCXQ
MySQL 8 features invisible indexes. But what good is an index if you can see it? br>
Is It Really Invisible
You probably know by now that indexes can really speed up data searches. And many of you have mastered the use of EXPLAIN to see if the optimizer is using an index for your query. Which means you should know that sometimes for some queries an index does not help.
mysql> CREATE TABLE t2 ( -> i INT NOT NULL, -> j INT NOT NULL, -> UNIQUE j_idx (j) -> ) ENGINE = InnoDB; Query OK, 0 rows affected (0.01 sec)
mysql> explain select j from t2 where j>2; +----+-------------+-------+------------+-------+---------------+-------+---------+------+------+----------+--------------------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+-------+---------------+-------+---------+------+------+----------+--------------------------+ | 1 | SIMPLE | t2 | NULL | range | j_idx | j_idx | 4 | NULL | 3 | 100.00 | Using where; Using index | +----+-------------+-------+------------+-------+---------------+-------+---------+------+------+----------+--------------------------+ 1 row in set, 1 warning (0.00 sec)
mysql>
So a simple select of j with values over 2 uses j_idx. br>
Hocus pocus – Your Index is now Invisible
But what if we are not sure if that index is really helping? Deleting an index for testing (and then rebuilding) can be a time consuming task. With MySQL 8 you simple make the index invisible.
mysql> alter table t2 alter index j_idx invisible; Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0
mysql> explain select j from t2 where j>2; +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------------+ | 1 | SIMPLE | t2 | NULL | ALL | NULL | NULL | NULL | NULL | 4 | 33.33 | Using where | +----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+-------------+ 1 row in set, 1 warning (0.00 sec)
mysql>
In this overly simple example it is easy to see that the query is not using a key, does not know of any possible keys, and had to read more rows to answer the query. So the j_idx query was helping for this case. You can also know if this is true by looking for errors occuring for queries that include index hints that refer to the invisible index, Performance Schema data shows an increase in workload for affected queries, or suddenly the query starts appearing in the slow query log.
Not for Primary keys
Any key can be made invisible except implicit or explicit primary keys. And it is storage engine neutral from MySQL 8.0.1 onward but 8.0.0 can only works with InnoDB. Please read the manual for more detail.
Presto-Change-o
But how do you reverse the invisibility?
mysql> alter table t2 alter index j_idx visible; Query OK, 0 rows affected (0.00 sec) Records: 0 Duplicates: 0 Warnings: 0
Stack Overflow is filled with thousands of questions and answers, and many of those are book recommendations from programmers with many different levels of skill. Dev-Books collects together the most recommended books.
If you’re curious, the overall top recommended book is Working Effectively with Legacy Code, with Design Pattern: Elements of Reusable Object-Oriented Softwarecoming in second. While the titles for these are as dry as the Atacama Desert, the content should still be quality. You can sort books by tags, like JavaScript, C, Graphics, and whatever else. This obviously isn’t the end-all of book recommendations, but it’s certainly a good place to start if you’re just getting into coding or looking to beef up your knowledge.
Mat at Arms: Reforged and guest host Mark Dacascos – the Crying Freeman! – promote For Honor by making one of the swords featured in the game. This time, the show focused on the work that goes into making a sword’s collar, hand guard and handle.
Smart doorbells can snap a photo of whoever rings the bell, making it so you can screen all those visitors you get throughout the day. Over on Instrutables, Naran shows you how to build one with a Raspberry Pi.
The project here uses the Pi alongside an old webcam, breadboard, and a button. There’s also an optional door-opening push button and Philips Hue integration if you’re interested. Otherwise, you’ll basically set up the Pi using a special operating system called Prota, wire everything together, then hook the system into Telegram to send you the photos. You’ll find everything you need and the guide over at Instructables.
Feeling in the mood to do a little remixing of classic pieces of art? You’re in luck: the Metropolitan Museum of Art has just made hundreds of thousands of pieces available under the Creative Commons Zero license, meaning they can be used pretty much however you see fit. Read More
Self-driving cars require self-driving car software, and Udacity’s helping to feed that need with its nanodegree program in the field. Now, the online education company is also making available its self-driving car simulator via open source license, allowing anyone with a working knowledge of Unity to gab the assets, load its preexisting scenes and create their own tracks for virtual testing.
If you weren’t already aware, a lot of the ‘education’ of self-driving vehicle software happens in virtual environments, since it’s still relatively expensive to build an actual self-driving test vehicle, and a bit complicated on the regulatory side to find somewhere willing to let you test in real-world conditions – plus you have to prove you can do so with a reasonable expectation of safety. That’s a steep hurdle for tinkerers working independently, and for companies just starting out.
Udacity committed to building an open source autonomous car as part of its effort to offer its self-driving car nanodegree program, which will use code written by hundreds of its students from around the world (which will be available publicly via open source license). The company shared more details around this plan last September, when it revealed that it’s using one of the 2016 Lincoln MKZs that are popular among self-driving software and component companies because a third-party is selling them ready to roll for autonomous conversion.
Open sourcing its self-driving car simulator is an extension of this existing open approach, but one that provides even more base-level tools to the community working on this big, complex problem. Other simulation tools, including Grand Theft Auto V, have proven worthwhile virtual environments for dry runs of autonomous software, but more tools in the mix is always welcome, especially when this one comes from the company founded by former Google self-driving car project lead Sebastian Thrun.
Yesterday, Marvel released anIron Fist trailer which was mostly only okay. But Iron Fist has a secret weapon and it’s Colleen Wing (Jessica Henwick). And Marvel knows it, because it has just released a scene of Colleen kicking ass, and suddenly we’re liking Iron Fist significantly more than we did yesterday.
In the comics, Colleen is a talented martial artist who, along with her professor father, meets up with Iron Fist in New York. They become friends and allies and she avenges the death of her grandfather with his help. Colleen is also a member of the Daughters of the Dragon with Misty Knight, which we’re all hoping makes its way into the Netflix line-up.
The clip Netflix has released shows Colleen in a cage fight. Why is she in a cage fight? Don’t know. Does she dominate in it? Of course. We’ve actually seen the rest of this fight, and she’s unreasonably good in it. That said, when we saw it it also didn’t have any music yet, and it was better that way.
Also, in contrast to how most Netflix Marvel heroes spend whole seasons getting their actual iconic costumes, Colleen starts right out in white. Shame it doesn’t appear Danny Rand will follow suit (no pun intended).
Do your kids love Star Wars? Do you love photography? If so, here’s a great opportunity to join forces and turn your kids into Star Wars heroes or villains by giving them the ultimate Star Wars weapon, the lightsaber.
All you need to awaken the force are these three steps:
The setup
Capturing the shot
Light up your sabers using Photoshop
BONUS tip – The Jumping Jedi
Step #1 – The Setup
For the setup, you will want to make sure that the photographs of your kids look as close to a Star Wars scene as possible. Don’t just take a picture of your kids wearing a t-shirt standing in the kitchen. Luke Skywalker doesn’t light up his lightsaber in a kitchen. Your kids will have a lot of fun getting into character, so spend some time on the setup.
For the location, you will want to find a place that looks like it could be a scene in any of the Star Wars movies. The easiest location to use would be a park with trees, and no noticeable man-made objects in sight.
Step #2 – Capturing the Shot
Action shots
For action shots of a lightsaber battle, you will want to use a fast shutter speed of at least 1/500th of a second, and set your camera to continuous (burst) shooting mode. This will allow you to freeze the action of the battle and take multiple shots in sequence to ensure you capture the best of the action.
Shutter speed was 1/800th of a second.
Portraits
For the portraits, give your kids some epic poses to follow. To give you ideas for creative poses, do a Google images search for the Star Wars character of your choice. This will also help your child get more into the character. For example here are some for Rey.
Do basic edits to the image
After you capture the image, you will need to make a few adjustments to the image to make it stand out. This can be done in Adobe Lightroom and is the final step before your photo is ready to go into Photoshop for the lightsaber effect.
For the look of Star Wars, a few basic edits, such as increasing the contrast and the clarity will help give it a rough and grungy look that Star Wars is known for.
Notice the differences between the before and after of this image by making a few basic edits in Adobe Lightroom.
Step #3 – Light your sabers up in Photoshop
Adding the lightsaber effect is the last and final step in making turning your kid into the Star Wars character of their dreams. This process should take about five minutes per photo once you have done it a few times.
Part 1: Prepare the layer
Start by creating a duplicate layer by pressing CTRL/CMD + J.
Select the icon to create a new fill or adjustment layer, and from that menu select Hue/Saturation. Then, move the lightness slider to -100 to make it black.
Select CTRL/CMD + E to merge the adjustment layer and duplicate layer. Next, set the blending mode drop down to Screen.
At this point, your layers are prepped and ready to add the lightsaber.
Part 2: Add the lightsaber by using the brush tool
Select the brush tool, and adjust the size and hardness of the brush. The size of your brush will vary based on the size of the lightsaber and your image. Set the hardness of the brush to approximately 50%.
Begin to add your lightsaber using brush strokes. Select the end point of the lightsaber, then hold down shift, and click the other end of the lightsaber to draw a straight line. Repeat these lines multiple times to fill in the lightsaber with brush strokes. You will likely need to add free-form brush strokes around the base of the lightsaber to fill it in.
Illuminate the lightsaber
The next step allows you to illuminate the lightsaber. Create three duplicate layers of the lightsaber by selecting CTRL/CMD + J three times. For each layer, you will then select Filter > Blur > Gaussian Blur. But, each layer will be set to a different radius setting. For this image, we used 5, 15, 35, 75 for each respective layer. Note, that the amount of Gaussian Blur needed may vary based on the size of your image. Adjust these numbers as needed to ensure you have a nice glow from the lightsaber.
Select all of the duplicate layers (do not select the background), and merge them into one layer by pressing CTRL/CMD + E. Then set the blending mode to Screen.
Add color to the lightsaber
It’s now time to add color to your lightsaber. Select the icon to create a new fill or adjustment layer, and choose the option for Color Balance. Activate the clipping mask so that you only add color to the lightsaber, not the entire image. You can choose any color of your choice, but in this example, we are working with green.
You will want to add the color selection to each option for Shadows, Midtones, and Highlights. Adjust the color slider up or down based on the color preferences for your lightsaber. For this photo, we set shadows, midtones, and highlights to green at around +65.
Your lightsaber is now complete, but there is still one more important step to get a realistic photo. You need to add some glow to the subject from the illumination coming off of the lightsaber.
Part 3: Add the reflective glow from the lightsaber
Select the background or base layer. Click the icon to create a new fill or adjustment layer, and choose the option for Color Balance. Choose the same color as you used for your lightsaber, but this time as you adjust the color for Shadows, Midtones, and Highlights, it will work best if you emphasize the color around the highlights more than the shadows or Midtones. For this photo, we used Shadows +32, Midtones +38, and Highlights +70
Add a vector mask and then select CTRL/CMD + I to hide all of the color balance. Select the brush tool, and make it a soft edge brush with an opacity around +18. This will allow you to brush in a soft reflection of glow to parts of the image that make it look realistic.
Bonus – Jumping Jedi
A bonus tip that you may want to use in your Star Wars photo shoot is a jumping Jedi. With a few simple tricks, you can give the illusion of your Jedi jumping high into the air over a swinging lightsaber.
First, make sure you use a tripod as you will need the camera to be completely stationary for two different shots. You can have your Jedi jump off a chair at the same time that his enemy swings his lightsaber. Then remove the chair and capture a shot of the exact same scene, but this time without the chair or characters in the shot (tripod use is important for image alignment later).
The second shot should be empty with the exception of the background because it will allow you to take the chair out of the original picture to create the illusion of a jumping Jedi.
Here’s how it’s done in Photoshop.
Start by opening both photos as layers. You will want the empty background shot to be set as the base layer and the action shot as the top one. Select the top layer of the action shot, and click Layer > Layer Mask > Reveal all.
Select the brush tool, and make sure that your foreground color is set to black, which will allow you to brush away the top layer to reveal some of the base layer. If your foreground color is set to white as opposed to black you can switch it to black by clicking X. Simply brush over the chair (make sure you are painting on the mask NOT the layer) to make it disappear.
Add the lightsaber effect from above, and you have the illusion of a jumping Jedi.
Below are some additional examples of the final images from this Star Wars project to give you additional ideas for action shots and portraits to bring your characters to life.
Finally
You can watch this whole process in the follow short video as well:
Note: thanks to my co-author on this article, David Kahl.
Try to awaken the force in your family by giving them a lightsaber and following this tutorial. In addition, leave a comment with any other fun photography projects that you have captured with your kids or family. Share your images if you give this a go, we’d love to see them!