Ruger 10/22 Takedown Lite

Ruger Takedown LiteSturm, Ruger & Co. announced a new line of rimfire rifles called the 10/22 Takedown Lite. The new rimfire long guns are designed with a lighter weight barrel assembly, a modular stock and take down easily for compact storage and transportation. The new Takedown Lite rifles use a tensioned target barrel assembly that place a […]

Read More …

The post Ruger 10/22 Takedown Lite appeared first on The Firearm Blog.


via The Firearm Blog
Ruger 10/22 Takedown Lite

Two DIY Air Conditioners Put to the Test

DIY air conditioners may seem like a cheap way to beat the heat, but they aren’t perfect. This video puts two homemade versions to the test and compares them to real AC units.

In this video from the Consumer Reports YouTube channel, air conditioning specialist Chris Regan built two homemade AC units that cost around $30 to see how they actually perform. Over the span of an hour, both DIY units were only able to bring the testing room’s temperature down about three degrees. And half an hour of running, the temp began to rise back up. When they tested spot cooling with the DIY units, however, they found the air to be about 15 degrees cooler. So, best case scenario, you have to sit right next to your DIY AC to get any sort of benefit from it. A homemade unit is better than nothing, but you’ll be much better off with a real AC unit that can cool entire rooms and maintain the temperature.

Putting a Homemade Air Conditioner to the Test | YouTube

via Lifehacker
Two DIY Air Conditioners Put to the Test

The Only Three Types of Sandpaper You Really Need

When you’re laboring away on a woodworking project you’ll likely need multiple types of sandpaper, from a course grit for rough surfaces to a finer grit as you finish. But sandpaper is available in a wide spectrum of grit, so how do you know which to buy? Here are the only three types you’ll really need.

Steve Ramsey of Woodworking for Mere Mortals simplifies it down into the three basic grades of grit that you’ll need for the vast majority of your projects: 120, 80, and 220.

120 grit is his primary workhorse for the majority of work. The lower the grit the rougher the paper, so Steve recommends you have 80 grit paper on hand for more aggressive shaping. And as you’d expect, the finer 220 grit is for finishing and surfacing a project. Watch his video for more sandpaper fundamentals and tips.

The Only 3 Sandpapers You Really Need via Popular Mechanics

via Lifehacker
The Only Three Types of Sandpaper You Really Need

Looking inside the MySQL 5.7 document store

MySQL 5.7 Document Store

MySQL 5.7 Document StoreIn this blog, we’ll look at the MySQL 5.7 document store feature, and how it is implemented.

Document Store

MySQL 5.7.12 is a major new release, as it contains quite a number of new features:

  1. Document store and “MongoDB” like NoSQL interface to JSON storage
  2. Protocol X / X Plugin, which can be used for asynchronous queries (I will write about it as well)
  3. New MySQL shell

Peter already wrote the document store overview; in this post, I will look deeper into the document store implementation. In my next post, I will demonstrate how to use document store for Internet of Things (IoT) and event logging.

Older MySQL 5.7 versions already have a JSON data type, and an ability to create virtual columns that can be indexed. The new document store feature is based on the JSON datatype.

So what is the document store anyway? It is an add-on to a normal MySQL table with a JSON field. Let’s take a deep dive into it and see how it works.

First of all: one can interface with the document store’s collections using the X Plugin (default port: 33060). To do that:

  1. Enable X Plugin and install MySQL shell.
  2. Login to a shell:
    mysqlsh --uri root@localhost
  3. Run commands (JavaScript mode, can be switched to SQL or Python):
    mysqlsh --uri root@localhost
    Creating an X Session to root@localhost:33060
    Enter password:
    No default schema selected.
    Welcome to MySQL Shell 1.0.3 Development Preview
    Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    Type 'help', 'h' or '?' for help.
    Currently in JavaScript mode. Use sql to switch to SQL mode and execute queries.
    mysql-js> db = session.getSchema('world_x')                                                                                                                                                                 <Schema:world_x>
    mysql-js> db.getCollections()
    {
        "CountryInfo": <Collection:CountryInfo>
    }

Now, how is the document store’s collection different from a normal table? To find out, I’ve connected to a normal MySQL shell:

mysql world_x
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 2396
Server version: 5.7.12 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> show create table CountryInfo
*************************** 1. row ***************************
       Table: CountryInfo
Create Table: CREATE TABLE `CountryInfo` (
  `doc` json DEFAULT NULL,
  `_id` varchar(32) GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,'$._id'))) STORED NOT NULL,
  PRIMARY KEY (`_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
mysql> show tables;
+-------------------+
| Tables_in_world_x |
+-------------------+
| City              |
| Country           |
| CountryInfo       |
| CountryLanguage   |
+-------------------+
4 rows in set (0.00 sec)

So the document store is actually an InnoDB table with one field: doc json + Primary key, which is a generated column.

As we can also see, there are four tables in the world_x database, but db.getCollections() only shows one. So how does MySQL distinguish between a “normal” table and a “document store” table? To find out, we can enable the general query log and see which query is being executed:

$ mysql -e 'set global general_log=1'
$ tail /var/log/general.log
2016-05-17T20:53:12.772114Z  186 Query  SELECT table_name, COUNT(table_name) c FROM information_schema.columns WHERE ((column_name = 'doc' and data_type = 'json') OR (column_name = '_id' and generation_expression = 'json_unquote(json_extract(`doc`,''$._id''))')) AND table_schema = 'world_x' GROUP BY table_name HAVING c = 2
2016-05-17T20:53:12.773834Z  186 Query  SHOW FULL TABLES FROM `world_x`

As you can see, every table that has a specific structure (doc JSON or specific generation_expression) is considered to be a JSON store. Now, how does MySQL translate the .find or .add constructs to actual MySQL queries? Let’s run a sample query:

mysql-js> db.getCollection("CountryInfo").find('Name= "United States"').limit(1)
[
    {
        "GNP": 8510700,
        "IndepYear": 1776,
        "Name": "United States",
        "_id": "USA",
        "demographics": {
            "LifeExpectancy": 77.0999984741211,
            "Population": 278357000
        },
        "geography": {
            "Continent": "North America",
            "Region": "North America",
            "SurfaceArea": 9363520
        },
        "government": {
            "GovernmentForm": "Federal Republic",
            "HeadOfState": "George W. Bush",
            "HeadOfState_title": "President"
        }
    }
]
1 document in set (0.02 sec)

and now look at the slow query log again:

2016-05-17T21:02:21.213899Z  186 Query  SELECT doc FROM `world_x`.`CountryInfo` WHERE (JSON_EXTRACT(doc,'$.Name') = 'United States') LIMIT 1

We can verify that MySQL translates all document store commands to SQL. That also means that it is 100% transparent to the existing MySQL storage level and will work with other storage engines. Let’s verify that, just for fun:

mysql> alter table CountryInfo engine=MyISAM;
Query OK, 239 rows affected (0.06 sec)
Records: 239  Duplicates: 0  Warnings: 0
mysql-js> db.getCollection("CountryInfo").find('Name= "United States"').limit(1)
[
    {
        "GNP": 8510700,
        "IndepYear": 1776,
        "Name": "United States",
        "_id": "USA",
        "demographics": {
            "LifeExpectancy": 77.0999984741211,
            "Population": 278357000
        },
        "geography": {
            "Continent": "North America",
            "Region": "North America",
            "SurfaceArea": 9363520
        },
        "government": {
            "GovernmentForm": "Federal Republic",
            "HeadOfState": "George W. Bush",
            "HeadOfState_title": "President"
        }
    }
]
1 document in set (0.00 sec)
2016-05-17T21:09:21.074726Z 2399 Query  alter table CountryInfo engine=MyISAM
2016-05-17T21:09:41.037575Z 2399 Quit
2016-05-17T21:09:43.014209Z  186 Query  SELECT doc FROM `world_x`.`CountryInfo` WHERE (JSON_EXTRACT(doc,'$.Name') = 'United States') LIMIT 1

Worked fine!

Now, how about the performance? We can simply take the SQL query and run

explain

:

mysql> explain SELECT doc FROM `world_x`.`CountryInfo` WHERE (JSON_EXTRACT(doc,'$.Name') = 'United States') LIMIT 1
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: CountryInfo
   partitions: NULL
         type: ALL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 239
     filtered: 100.00
        Extra: Using where
1 row in set, 1 warning (0.00 sec)

Hmm, it looks like it is not using an index. That’s because there is no index on Name. Can we add one? Sure, we can add a virtual column and then index it:

mysql> alter table CountryInfo add column Name varchar(255)
    -> GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,'$.Name'))) VIRTUAL;
Query OK, 0 rows affected (0.12 sec)
Records: 0  Duplicates: 0  Warnings: 0
mysql> alter table CountryInfo add key (Name);
Query OK, 0 rows affected (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 0
mysql> explain SELECT doc FROM `world_x`.`CountryInfo` WHERE (JSON_EXTRACT(doc,'$.Name') = 'United States') LIMIT 1
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: CountryInfo
   partitions: NULL
         type: ref
possible_keys: name
          key: name
      key_len: 768
          ref: const
         rows: 1
     filtered: 100.00
        Extra: NULL
1 row in set, 1 warning (0.00 sec)

That is really cool! We have added an index, and now the original query starts using it. Note that we do not have to reference the new field, the MySQL optimizer is smart enough to translate the

(JSON_EXTRACT(doc,'$.Name') = 'United States'

 to an index scan on the virtual column.

But please note: JSON attributes are case-sensitive. If you will use

(doc,'$.name')

 instead of

(doc,'$.Name')

 it will not generate an error, but will simply break the search and all queries looking for “Name” will return 0 rows.

Finally, if you looked closely at the output of

db.getCollection("CountryInfo").find('Name= "United States"').limit(1)

 , you noticed that the database has outdated info:

"government": {
            "GovernmentForm": "Federal Republic",
            "HeadOfState": "George W. Bush",
            "HeadOfState_title": "President"
        }

Let’s change “George W. Bush” to “Barack Obama” using the .modify clause:

mysql-js> db.CountryInfo.modify("Name = 'United States'").set("government.HeadOfState", "Barack Obama" );
Query OK, 1 item affected (0.02 sec)
mysql-js> db.CountryInfo.find('Name= "United States"')
[
    {
        "GNP": 8510700,
        "IndepYear": 1776,
        "Name": "United States",
        "_id": "USA",
        "demographics": {
            "LifeExpectancy": 77.0999984741211,
            "Population": 278357000
        },
        "geography": {
            "Continent": "North America",
            "Region": "North America",
            "SurfaceArea": 9363520
        },
        "government": {
            "GovernmentForm": "Federal Republic",
            "HeadOfState": "Barack Obama",
            "HeadOfState_title": "President"
        }
    }
]
1 document in set (0.00 sec)

Conclusion

Document store is an interesting concept and a good add-on on top of the existing MySQL JSON feature. Using the new .find/.add/.modify methods instead of the original SQL statements can be convenient in some cases.

Some might ask, “why do you want to use document store and store information in JSON inside the database if it is relational anyway?” Storing data in JSON can be quite useful in some cases, for example:

  • You already have a JSON (i.e., from external feeds) and need to store it anyway. Using the JSON datatype will be more convenient and more efficient.
  • You have a flexible schema, typical for the Internet of Things for example, where some sensors might only send temperature data, some might send temperature/humidity/light (but light information is only recorded during the day), etc. Storing it in the JSON format can be more convenient so that you do not have to declare all possible fields in advance, and do not have to run “alter table” if a new sensor starts sending new types of data.

In the next two blog posts, I will show how to use document store for Internet of Things / event streaming, and how to use X Protocol for asynchronous queries in MySQL.

via Percona Database Performance Blog
Looking inside the MySQL 5.7 document store

Watch Star Wars: A New Hope by Simply Scrolling Through a Website

You probably can’t get away with watching movies at your desk all day at work. But since most websites are still totally acceptable, warm up your scrolling finger, and go to town on this incredible fan tribute that sees the entire original Star Wars: A New Hope turned into one long scrollable schematic.

The site’s making of is even more incredible. The artist, illustrator and graphic novelist Martin Panchaud, created 157 images in Adobe Illustrator that together measure over 400 feet in length.

Panchaud didn’t skimp on the detailing, either. Every last line in the movie is included, as is every last nook and cranny on ships like the Millennium Falcon. The site is as much a Star Wars reference tool as it is a way to while away the hours on a boring Tuesday afternoon.

[SWANH.net via Twitter – iA Inc.]


via Gizmodo
Watch Star Wars: A New Hope by Simply Scrolling Through a Website

Trump 2012 Tweet: Obama Spoke for Me After Newtown

Screen Shot 2016-05-22 at 5.18.56 PM

The Dowager Empress of Chappaqua has picked a fight with Donald Trump, claiming that his promise to end gun-free zones in schools will mean kids in classrooms packing heat. That has lead to much to-ing and fro-ing between the campaign and someone unearthing the above tweet. Was Trump referring to Obama’s stance on guns? Will it hurt the Donald? Nothing else has. Pass the popcorn.

0

via The Truth About Guns
Trump 2012 Tweet: Obama Spoke for Me After Newtown

SNL: Farewell Mr. Bunting

SNL: Farewell Mr. Bunting

A group of prep school students is upset that their school has fired their beloved teacher, Mr. Bunting (Fred Armisen), so they’re going to stand up for what they believe in. We won’t give away the punchline, but the payoff is well worth the lengthy setup. Well played, SNL.

via The Awesomer
SNL: Farewell Mr. Bunting

13 Items Every Rifle Shooter Should Carry in Their Range Bag

Ryan-Cleckner-

By Ryan Cleckner

(This is an excerpt from Ryan’s book, Long Range Shooting Handbook, 25% of the sales of which will benefit military charities.)

If you’re not careful, you can easily get carried away with accessories. I love gadgets and gear as much as the next guy but please make sure that both your rifle and optic are of enough quality that allow you to shoot long range effectively before you purchase the latest top-of-the-line laser rangefinder. For example, if your laser rangefinder costs more than your scope, you might be doing it wrong. Sure, you’ll know exactly how far away that 912.3 yard target is, but you’re not going to be able to hit it. Remember that quote from the beginning of this section, “It’s the Indian, not the arrow.”  Some of the best shooters I know can use a rifle with a sling and iron sights to out-shoot most others with a rifle with bipod legs and a scope . . .

6.1  Shooting Bag

I firmly believe that a shooting bag is a crucial part of the precision rifle system. Where my rifle goes, my pack follows. My shooting bag serves as a platform for my rifle and it carries things for both the rifle and me.

A shooting bag is the best all-around platform for shooting your rifle. The beauty of a shooting bag as a platform is its consistency.  As discussed above, bipods can react inconsistently depending on the surface they are on. A rifle rested on a shooting bag, however, reacts the same whether the shooting bag is on grass or concrete.

In addition to serving as an accurate and stable platform for shooting, a shooting bag does something else – it carries things. If I am going to carry around equipment with me, it must be for a purpose. For example, I carry extra ammunition in case I need more than I have on my person or in my rifle, I carry my DOPE book so that I can add and reference information, I carry a calculator and rangefinder to help with range estimation, and I carry water and food in case I am thirsty or hungry.

By using my shooting bag as a shooting platform, I’m able to access each of these things directly in front of me. Instead of breaking my position to go searching for a bag laying on the ground behind me, I can reach in my bag for a snack while staying on my rifle and looking at the target.  If I need to get up and move quickly, I can simply grab my rifle in one hand, my bag in the other, and go.

I encourage you to employ a practice we used in the military – only have one thing out of your bag at a time.  If you do this, you won’t have gear strewn about you on the ground making it hard to pack up in a hurry and easy to lose.  Having your gear scattered everywhere is often called a “gypsy camp” or a “yard sale.” Don’t do it.

Here is a list of things, at a minimum, that I keep in my shooting bag:

  • Water
  • Food
  • Ammunition
  • DOPE Book
  • Sand Sock
  • Calculator
  • Range-finder
  • Tools
  • Mil-dot Master
  • Binoculars
  • Flashlight
  • Rain Jacket
  • Jacket for warmth

 

Ryan Cleckner was a special operations sniper team leader in the US Army’s 1st Ranger Bn (75th) with multiple combat deployments and a sniper instructor. He has a series of basic online instructional videos (more to come shortly) and his book, Long Range Shooting Handbook, is available at Amazon.

The post 13 Items Every Rifle Shooter Should Carry in Their Range Bag appeared first on The Truth About Guns.

via The Truth About Guns
13 Items Every Rifle Shooter Should Carry in Their Range Bag

Backblaze Releases Billion-Hour Hard Drive Reliability Report

jones_supa writes: The storage services provider Backblaze has released its reliability report for Q1/2016 covering cumulative failure rates of mechanical hard disk drives by specific model numbers and by manufacturer. The company noted that as of this quarter, its 60,000 drives have cumulatively spun for over one billion hours (100,000 years). Hitachi Global Storage Technologies (HGST) is the clear leader here, with an annual failure rate of just 1% for three years running. The second position is also taken by a Japanese company: Toshiba. Third place goes to Western Digital (WD), with the company’s ratings having improved in the past year. Seagate comes out the worst, though it is suspected that much of that rating was warped by the company’s crash-happy 3 TB drive (ST3000DM001). Backblaze notes that 4 TB drives continue to be the sweet spot for building out its storage pods, but that it might move to 6, 8, or 10 TB drives as the price on the hardware comes down.



Share on Google+

Read more of this story at Slashdot.

via Slashdot
Backblaze Releases Billion-Hour Hard Drive Reliability Report