Clever Tool for Transferring Angles

There’s no storage in my bathroom, so last weekend’s DIY project was to build this simple shelf over the sink using scraps.

Enter a caption (optional)

The three walls of the nook are neither flat nor square. I had just one piece of scrap pine to use for the shelf, and needed to cut both ends at different angles to get it to fit properly. So I built this simple jig out of more scraps to "measure" the angles, then trace them onto the shelf:

Enter a caption (optional)

It worked okay. Then, the very next day I see this thing online:

Enter a caption (optional)

Enter a caption (optional)

That is officially the most useful-looking tool with the worst-quality product video ever.

While it wouldn’t have been wide enough to measure both angles of my shelf in a single shot, I could’ve done one side at a time and gotten close results.

It’s called the Angle-izer and it goes for about $22 on Amazon.

Enter a caption (optional)
Enter a caption (optional)
Enter a caption (optional)

Do you guys and gals have any of your own DIY angle-transferring solutions? (Preferably the kind that don’t involve math….)

via Core77
Clever Tool for Transferring Angles

Best Knives under $50

Best Knives under $50

Our friends at Everyday Carry have compiled a collection of awesome knives that won’t break the bank. There are some great ones in the bunch, like the versatile Kershaw Shuffle II and the classic wood Opinel No8, and the funky little Boker Plus Nano.

via The Awesomer
Best Knives under $50

MySQL auto update date_created and date_updated columns

It’s usually a good practice to have two columns called date_created and date_updated in every table. One can always use it in application and it helps in debugging too as to when a record was created and last updated in various circumstances and contexts.



This responsibility can be given to MySQL to automatically assign current time values to these columns.

In MySQL 5.6 onwards, this can be done by setting the data type of the columns to be either date time or timestamp and creating date_created column with NOT NULL DEFAULT CURRENT_TIMESTAMP  schema and date_updated column with NOT NULL DEFAULT ‘0000-00-00 00:00:00’ as schema with attribute ON UPDATE CURRENT_TIMESTAMP.

Below is a sample schema of a table containing date_created and date_updated columns:

CREATE TABLE `time_stamp` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `date_updated` timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’ ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

But there is a catch here, since this is not applicable to all MySQL versions. Earlier to 5.6 version, MySQL allows a table to have only one TIMESTAMP column with an automatic TIMESTAMP value, that is you can either have date_created or date_updated auto updated to CURRENT_TIMESTAMP not both.

Related to this the MySQL documentation has some very good info at this page: http://ift.tt/1wimyw9

Excerpt: "By default, TIMESTAMP columns are NOT NULL, cannot contain NULL values, and assigning NULL assigns the current timestamp."

So the workaround this is to have date_created column with timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’ schema  and date_updated column with timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’ ON UPDATE CURRENT_TIMESTAMP schema.

With above, the date_updated field is correctly updated by MySQL automatically when there is an update and to update date_created field with current timestamp value, we have to explicitly pass NULL value to date_created field which will then store the CURRENT_TIMESTAMP value in the field.

Below is a sample schema for above changes:

CREATE TABLE `time_stamp` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `date_created` timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
 `date_updated` timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’ ON UPDATE CURRENT_TIMESTAMP,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

So for a structure as above the insert query would be as below:

INSERT INTO `test`.`time_stamp`
(`id`, `date_created`) 
VALUES
(NULL, NULL);

For update the query would be:

UPDATE 
    `test`.`time_stamp` 
SET 
    `id` = ‘4’ 
WHERE 
    `time_stamp`.`id` = 1;

Above will just update the date_updated with the CURRENT_TIMESTAMP and the date_created value will remain same as earlier. Caution needs to be taken while updating records so as not update date_created field with NULL value.

One could also say that instead of MySQL automatically updating the date_updated field, I would like the date_created field to be updated automatically by it. Yes, it is just a reverse case and can be used, in which case while updating the record one has to pass NULL value to date_updated field. But the thing is that since there will be many updates and only a one time insert so passing a NULL while a one time insert reduces the overhead on us of passing a NULL for every subsequent update and let MySQL handle it for us. But yes this is debatable and there are cases where this reverse structure can be used.

Another workaround this is to have date_created field updated with current timestamp value using  a trigger when a record is inserted.

Hope this helps 🙂

PlanetMySQL Voting: Vote UP / Vote DOWN
via Planet MySQL
MySQL auto update date_created and date_updated columns

“Guns Don’t Kill People, People Kill People.” The Problem Being?

There’s a reason that Hickok45’s son is sitting in a chair with the camera towering above him for this rant. The man is taller than the tall tales anti-gunners tell to justify their crusade for civilian disarmament. One of the more popular counters thrown back at them: guns don’t kill people, people kill people!

The extravagantly bearded gun guy thinks that’s a dumb argument. No one — well hardly anyone — thinks a gun will kill someone of its own volition. Methinks he’s missing the point.

The expression reminds antis — and The People of the Gun — to focus on the killer, not the means. I don’t like it as much as “when guns are outlawed, only outlaws will have guns,” but low information voters need easily understood slogans. I say GDKP, PKP stays. You?

via The Truth About Guns
“Guns Don’t Kill People, People Kill People.” The Problem Being?

Shooting the Benjamin Pioneer Airbow from Crosman

We noted the Pioneer Airbow’s introduction when it was announced before SHOT. Crossman calls it a PCP (pre-charged pneumatic) airbow but its bullpup-like design makes it compact and easily maneuverable (though at seven pounds, it runs a little heavier than your average AR). I wouldn’t want to be a hog or a doe on the receiving end of one.

I had a chance to fire the thing last week in Montana.

RF may not have been a fan of its aesthetics, but this thing is two tons o’ fun to shoot. It’s also dead-on-balls accurate. I was shooting at 30 yards or so. The Pioneer packs 3000 PSI which gets you 8-10 full-power shots at a whopping 450 feet per second, giving it more range and making it a lot easier to charge than a crossbow.

At about $850, each one ships with three arrows, a standard 6×40 scope, sling and quiver. If you get a chance to try one, take it.

via The Truth About Guns
Shooting the Benjamin Pioneer Airbow from Crosman

Live via Sky News: Crowder Gets Louder on Gun Rights

Screen Shot 2016-06-24 at 6.01.21 PM

My friend Steven Crowder… I mean, what can you say about him?

He’s comical and common sensical, he’s outlandish and outspoken, plus he’s just a downright hoot!

But for all his wacky stunts and hilarious antics, Steven is immensely knowledgeable of the wide variety of topics – including gun rights.

Cue Sky News host British McStuffy Pants who invited Crowder on air to discuss the House Democrats’ sit-in for gun control.

Although McStuffy Pants tried his darnedest to steer the conversation using incorrect terminology and outright falsehoods, Crowder stuck in there for the entire segment, finally working the conversation back toward the real issue of gun rights and domestic terrorism.

Watch Crowder debate this SkyNews host on gun control:

The post Live via Sky News: Crowder Gets Louder on Gun Rights appeared first on Bearing Arms.

via Bearing Arms
Live via Sky News: Crowder Gets Louder on Gun Rights

Here’s how many calories you may burn standing at work versus sitting, strolling

(credit: Marco Arment)

With the rise of standing desks, office workers hope to brush off the health risks linked to prolonged sitting, including obesity, cardiovascular disease, diabetes, and early death. But they might do well to walk them off instead, a new study suggests.

In one of the few studies to carefully count the calories people burn while sitting at a desk, standing, or taking a leisurely stroll, researchers found little difference between being plopped down or upright. Standing for an hour might burn off an extra nine calories or so, about the amount in a single gummy bear. Slow walking, on the other hand, incinerated 2.4 to 2.7-fold more calories than standing or sitting, respectively. If office workers fit in an hour of strolling throughout each day—tallying trips to the bathroom, walks to the printer, or strides on a treadmill desk—they could easily burn through an extra 130 calories. That’s a little more than what previous research suggests could help people keep pounds off, the authors report in the Journal of Physical Activity and Health.

“If you’re looking for weight control or just solely at the energy expenditure, standing isn’t that much more beneficial than sitting,” Seth Creasy, an exercise physiologist at the University of Pittsburgh and lead author of the study, told Ars. Of course, calorie burning isn’t the only reason people might choose a standing desk. Being upright could be beneficial for productivity or posture, Creasy said. However, more research is needed to know if those benefits are real because the studies that have been done so far have come up with mixed or inconclusive results.

Read 11 remaining paragraphs | Comments

via Ars Technica
Here’s how many calories you may burn standing at work versus sitting, strolling

The Secret to Making Perfect Pizza Dough Is the Right Technique

Pizza dough, for the most part, is comprised of only a few basic ingredients. But there’s no doubt that some crusts are just way better than others. So what’s the difference between the good and the bad? It’s all in the technique.

In this video from the ChefSteps YouTube channel, Joe Heffernan of Seattle’s Independent Pizzeria reveals the right way to make perfect pizza dough every time. Start by mixing bread flour with some salt in a large bowl, and mixing cake yeast into a bowl of room temperature water. Make a well in the flour and salt, then add your water and yeast mixture to it. Mix it up a bit with a wooden spoon, then have a stand mixer work it with a dough hook at medium speed until the dough pulls away from the sides of the bowl. Now dust a flat work surface with flour, work the dough into a ball, and let it ferment for five to eight hours in a covered container.

When it’s done fermenting, divide the dough into portions, and gently knead it into a ball shape. Once you have a few balls of dough, pour a little olive oil into the palm of your hand, and lightly cover each one with the oil so it can retain moisture. Cover the oiled, dough balls, and let them rest in the refrigerator over night. When they’re finished resting, you can stretch and shape your perfect pizza dough into pizza pies (but let them rest for about 20 minutes at room temperature before you do), or keep them in your fridge for up to three days. You can find Heffernan’s complete pizza recipe here.

http://ift.tt/1RONyiM…

Life-Changing Pizza Dough with Joe Heffernan of Seattle’s Independent Pizzeria | YouTube

via Lifehacker
The Secret to Making Perfect Pizza Dough Is the Right Technique

Great ports we have loved

via TechCrunch
Great ports we have loved