Berkeley and Hitler

Here’s the best article you are likely to read about the absurdity of calling ANY American president Hitler. This is the sort of persuasion (sprinkled with facts) that can dissolve some of the post-election cognitive dissonance that hangs like a dark cloud over the country. Share it liberally, so to speak. You might save lives.

Speaking of Hitler, I’m ending my support of UC Berkeley, where I got my MBA years ago. I have been a big supporter lately, with both my time and money, but that ends today. I wish them well, but I wouldn’t feel safe or welcome on the campus. A Berkeley professor made that clear to me recently. He seems smart, so I’ll take his word for it.

I’ve decided to side with the Jewish gay immigrant who has an African-American boyfriend, not the hypnotized zombie-boys in black masks who were clubbing people who hold different points of view. I feel that’s reasonable, but I know many will disagree, and possible try to club me to death if I walk on campus. 

Yesterday I asked my most liberal, Trump-hating friend if he ever figured out why Republicans have most of the Governorships, a majority in Congress, the White House, and soon the Supreme Court. He said, “There are no easy answers.”

I submit that there are easy answers. But for many Americans, cognitive dissonance and confirmation bias hide those easy answers behind Hitler hallucinations. 

I’ll keep working on clearing the fog. Estimated completion date, December 2017. It’s a big job.

Scott Adams

Co-founder of WhenHub

Author of How to Fail at Almost Everything and Still Win Big

via Scott Adams’ Blog
Berkeley and Hitler

Watch Adam Savage Give a Nerf Blaster an Impressive Scifi Movie Prop Makeover

Despite being made of plastic, Nerf’s dart blasters look incredibly realistic and detailed—as long as you can ignore their garishly bright colors. Adam Savage apparently could not, however, so he spent an entire day giving the Nerf Longstrike CS-6 a fantastic facelift to make it look like a prop from of a scifi blockbuster.

Nerf blasters come with those bright color schemes as a way to catch the eye of little kids in a toy store, and because of government regulations preventing toy weapons from looking too much like the real thing.

Savage’s makeover of the discontinued Longstrike CS-6 doesn’t end up looking like something you’d find in a gun store. Instead, it resembles a sci-fi prop it definitely comes across as a weapon you’d expect to see a space marine carrying into battle. If you’re not already jealous of this creation, you will be after learning this was actually the Secret Santa Christmas gift Savage created for a lucky Imgur user who posted his unboxing of the magnificent prop online.

[YouTube]

via Gizmodo
Watch Adam Savage Give a Nerf Blaster an Impressive Scifi Movie Prop Makeover

Build your own matchbox sized DIY timelapse spy camera for only $30

I’ve been a huge fan of the Arduino for quite a few years now. It allows me control cameras and lights in ways that would be otherwise impossible. As an open source project based on the Atmel AVR microcontrollers, compatible boards come in all shapes and sizes now. One such incarnation is the Adafruit Trinket, a tiny Arduino clone based on the ATtiny85. It’s extremely small, and ideal for projects like this one.

To show off the Trinket’s abilities, the folks at Adafruit built a tiny timelapse camera. Using a mini spy camera module with a built in microSD slot, the Trinket controls all the timing for when shots are taken. The whole thing fits inside a matchbox, but Adafruit are a little more practical than that. They designed a custom case for 3D printing and made the plans for that available, too.

To make the camera, you only need a few components.

Total cost is around $30 plus a memory card. The camera module accepts microSD cards up to 32GB in capacity. Given the relatively low resolution (1280×720 for stills), that will let you record for hours. This camera module has three connectors. One is positive power, one is ground, and one is the trigger signal. When the trigger signal is connected to ground for a brief moment, it fires a shot and saves it to the microSD.

This is the mechanism the Adafruit Trinket takes advantage of, as there doesn’t need to be any real communication between it and the camera. And it’s also not having to process any image data itself. This is essentially the same way I’ve controlled DSLRs and other cameras with Arduinos myself.

Power comes from a 100mAh 3.7v LiPo battery. This goes into a little charging circuit, so that it can be charged while the system is in use. Otherwise, it would probably run flat in about an hour. To charge the battery, power simply comes from a USB cable plugged into the Trinket. Power to the system, then gets sent back out from the charging circuit to the Trinket and the camera module. This way, whether the power is being pulled from the battery or USB, everything gets the power it should.

You could actually save yourself a little money if you already have a USB battery or intend to keep it permanently on USB power. You can completely eliminate the 100mAh battery, charging circuit and on/off switch, saving yourself about $12.

As ground is common, only a single wire is required between the Trinket and the camera module. The camera module’s trigger goes into digital pin 0 on the Trinket, and then it’s just a case of programming it. The code is extremely simple.

The init and setup() function tells the Trinket what port we’re using and to set it as an output. The loop() function runs continually while the Trinket has power. Every five seconds, it sends the signal low for 50ms, causing it to take a shot which then saves out to the microSD.

There’s no manual control over things like exposure, although the camera seems to do a pretty good job of metering exposure all by itself. You do get to choose your interval, although if you want to change it, you’ll have to edit the code, recompile and upload again.

As mentioned, they also build a 3D printed enclosure for the camera, which you can see in the animation above. Adafruit also posted a video showing how it was designed, and have made the plans available here to print your own.

While you’ll only get the equivalent of 720p footage, there are other camera modules out there that you could use. Although they do tend to increase in cost quite rapidly, and most don’t have internal storage. So, then you’re moving onto something like the Raspberry Pi Zero and suddenly your total cost has gone from around $30 up to around $100.

So, it’s a handy little project for a basic timelapse camera. It’s small, unobtrusive, and cheap to build. I could see a few of these being very handy as wildlife or security cameras with slight modification, too. All you’d need to do is hook up a PIR sensor to the Trinket, and modify the code a little, to have it send a shot when something moves in front of it, rather than on a timer.

[via Adafruit]

via DIYPhotography.net – Photography and Studio Lighting – Do It Yourself
Build your own matchbox sized DIY timelapse spy camera for only $30

Staying Motivated as an Entrepreneur – Top Tips from Some of the World’s Most Successful Entrepreneurs

Staying motivated is one of the most difficult things for entrepreneurs. It is the lack of motivation that causes many entrepreneurs to quit.

Below are some tips on how some of the world’s successful entrepreneurs stayed motivated despite the ups and downs in the business.

Joe Martin, President of Merchandize Liquidators, LLC

Joe Martin, an Israeli-born, founded Merchandize Liquidators while pursuing a Business Administration degree at Florida International University. Hardworking and persistent to finish college, he opened Merchandise Liquidators to pay his way through college. Although faced with different challenges during the start of his business such as time and money for capital, it didn’t stop him from reaching his goal.

He was an international student during that period, which means he had to stay as a full-time student for legal reasons. The main issue he faced regarding his business was to convince major chain stores that he could get their closeouts on a consistent basis regardless of the lack of capital to buy goods and space to place it.

According to Joe Martin, socializing with the most successful people is the key to staying motivated. He says that when you socialize with people who are at a higher level of success than you, you get a mental push that will help you break the barriers that are stopping you from making millions.

See Also: 7 Power Habits of Great Leaders, Business Icons and Inspirational Achievers

Chase Jarvis, CEO at CreativeLive

chase jarvis

Chase Jarvis, along with Craig Swanson, founded CreativeLive. Chase, a leader and a renowned creative himself, dedicated his company to providing an online space for visionary instructors to connect with creative professionals. He was not just the present CEO at CeativeLive, but also a director, an award winning photographer, and media maven. Furthermore, he created campaigns for Starbucks, RedBull, Nike, Apple, and other companies. He is also known for creating Best Camera, the world’s first photo application that lets the user share images to social networks.

Chase Jarvis first took the spotlight when he became the world’s best photographer at a young age. He went ahead to create CreativeLive which is the world’s biggest live-streaming education company.

Chase says that much of his success and motivation was from following his passions. He says that you should go after something that is dear to you and not random market opportunities. If you go for random opportunities, you will only be doing it for the dollars and thus you will not have the passion to stay with it.

Juanita Hines, Regional Consulting

juanita hines

Juanita Hines, passionate about helping people succeed, founded Regional Consulting. Because of her ability to help craft perfect resumes for her clients, she was known to be the “Resume Whisperer.” Her passion for helping has led her to start her company dedicated to professional empowerment by providing interview coaching and training in communities where no such opportunities were previously available.

Juanita also does a lot of speaking engagements at youth camps and schools. She also works with other non-profit organizations in encouraging students to start planning for their futures and assist professionals with insights on how to heighten their careers.

Juanita says that you should surround yourself with people who are striving to pursue their own success. This will encourage you to succeed in your own life as well.

See Also: 5 Women Entrepreneurs Who Failed Before Becoming Millionaires 

Tim Ferriss, best-selling author and CreativeLive instructor

tim ferris

Tim Ferriss, considered as one of “Most Innovative Business People, is also an author. He wrote “The 4-Hour Workweek, the 4-Hour Body, and the 4-Hour Chef”, considered as Wall Street Journal and #1 New York Times bestsellers. Furthermore, he is an investor and consultant in Twitter, Facebook, Shopify, Uber, Duolingo and much more. His podcast was also recognized as the “Best of 2015” by Apple and the #1 business podcast on iTunes.

Tim’s key to success and staying motivated is to choose your friends wisely. He says that the best advice he ever received and still keeps him going is that you become an average of the 5 people who you associate with most.

Will Curran, President of Endless Entertainment

will curran

Will Curran, who was only 17 during that time, started his interest in DJing. He found a need missing in the entertaining industry and went head-first into satisfying such need.

Due to his passion for putting on events, each mistake he made became building blocks to grow his company further. One of his discoveries during the journey towards his goal was how customers would start coming to him if he provided excellent customer service after which everything would fall into place.

Will says that you succeed by fighting the small battles. He says he finds joy in overcoming obstacles and celebrating even small wins. He rewards himself after all the jobs are well done. According to Will, you can get overwhelmed if you focus too much on the bigger picture.

Justin Palmer, Founder & CEO of MedSaverCard

Justin gets his motivation by thinking about his future freedom. He says that entrepreneurship requires a lot of hard work but if you concentrate on your business now, it will give you the freedom and resources for the years to come.

 

The post Staying Motivated as an Entrepreneur – Top Tips from Some of the World’s Most Successful Entrepreneurs appeared first on Dumb Little Man.


via Dumb Little Man – Tips for Life
Staying Motivated as an Entrepreneur – Top Tips from Some of the World’s Most Successful Entrepreneurs

The Hard Drives Most (and Least) Likely to Fail, According to Backblaze

Every year, backup service Backblaze takes a look at failure rates amongst the hard drives in its data centers. This year’s no different, and they’ve got all kinds of stats for all kinds of drive.

By the end of 2016, Backblaze cataloged 73,653 hard drives. Of those drives, three models, a 4TB Toshiba model, 8TB Toshiba model, and 8TB Seagate model were the only ones that recorded no drive failures, though that 8TB drive came out in November so it doesn’t really qualify. Perhaps most importantly though, the overall number of failures for the year is only 1.95%, down from 2015’s 2.47% and 2014’s 6.39%.

As for failures by vendor for the year, WDC tops the list, with a 3.88% failure rate, though when it comes to volume, Seagate’s 2.65% failure rate is notable because of the number of drives in the test (45,531 as opposed to WDC’s 1,626). How Backblaze account for failures, drive counts, and drive days is all documented over on their site if you’re curious.

Perhaps even more interestingly, they’ve also included statistics ranging back all the way to 2013, where one particular Seagate model (ST1500DL003) had an astounding failure rate of 90.92%.

Of course, all this data is limited to the data Backblaze collects, which is limited to the drives in their data centers. This doesn’t necessarily resemble the typical consumer experience since you’re probably not putting your hard drive through nearly the use they are. Regardless, it’s a fascinating look and a good starting point if you’re shopping for a new hard drive or a little worried about one you’re using.

Backblaze Hard Drive Stats for 2016 | Backblaze


via Lifehacker
The Hard Drives Most (and Least) Likely to Fail, According to Backblaze

It’s Finally Easy to Watch Other Space, the Best Scifi Comedy You’ve Never Seen

Do you remember Paul Feig’s scifi comedy Other Space? You’ll be forgiven for saying no. The 2015 series premiered on Yahoo Screen and felt like it promptly vanished off the face of the Earth because of it. Which is a damn shame, because it’s bloody brilliant—and now, it’s actually easy to watch in its entirety (for free!), which is something you totally should do.

Other Space followed the profoundly dysfunctional crew of the UMP Cruiser, after they get stranded in another universe during their first mission. The cast was stacked with great comedians including MST3K’s Joel Hodgson, a pre-Ghostbusters reboot Neil Casey, and Eugene Cordero, who’s basically been in everything. There were only eight episodes in the first season, but Screen’s geolocking meant that not only did Other Space not really have much of an audience, the chance for more was all but gone when Screen itself shuttered early last year—and with it, we lost a smart, incredibly funny scifi sitcom.

The rights to the show have reverted back to Feig, who understandably feels like Other Space got a rough deal. But speaking to Splitsider recently, Feig said he wanted to turn that around by attempting to drum up some enthusiasm for the show—something he and former showrunner Owen Ellickson could then use to pitch another season of Other Space to networks. Such enthusiasm should be easy to find now, as Feig has made the entire first season is now available to watch, from anywhere in the world, on the show’s own Tumblr. For free!

So when you’ve got a moment, check it out—you won’t regret it, and hopefully it leads to Other Space finding new life on TV.

[Splitsider via AV Club]

via Gizmodo
It’s Finally Easy to Watch Other Space, the Best Scifi Comedy You’ve Never Seen

MySQL Procedure Analyse Use

Sometimes we are not sure if the database design we have created and our site has been using is correct and optimised. We all do have this feeling at times don’t we 🙂

Well, MySQL provides with PROCEDURE ANALYSE() to help us detect inconsistencies in our database design by suggesting for an optimal datatype and data length for columns.

The syntax for using PROCEDURE ANALYSE() is as below:

SELECT ... FROM ... WHERE ... PROCEDURE
ANALYSE([max_elements,[max_memory]])

Ref: http://ift.tt/2kOxxvQ

We will create a sample database for our case here and try out some things.

Lets create a database called analyse_db.

mysql> CREATE DATABASE `analyse_db`
DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Then lets create a table called employee where we can keep our data.

mysql> CREATE TABLE `analyse_db`.`employee` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL,
`dept_id` INT NULL DEFAULT NULL,
`country` VARCHAR(100) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;

Lets insert some data into it, so that finally we have some records in it as displayed below:

mysql> SELECT * FROM `employee`;

Let us now run PROCEDURE ANALYSE() on the table.

mysql> SELECT * FROM `employee` PROCEDURE ANALYSE();


So from the analysis result we can take away below points:

First row output

1. From the first row output above, employee.id column seems to be fine, but the output suggests that we have enum as datatype for it. The suggestion makes sense given the less number of records we have in our table right now but in the long run our table would be much larger and each row value would be unique and enum would not suit our purpose. So we can neglect this suggestion.

Second row output

2. From the second row output above, employee.name has a min and max length of 8 and 13, average length of 10 and we have assigned a max varchar length of 100 while creating the table. This seems like a wrong decision on our part to assign it 100, when the range of length for values for this column is in between 8 and 13, but taking into consideration the very less data and our future estimate that there will be longer names with some even having middle names, our column design is fine. Also taking into consideration point 1 above, enum type can similarly be neglected for this column too.

Third row output

3. From the third row output above, employee.dept_id has repeated values of same departments which if are not mapped to another department table and do not have probability to change then they can be added as a enum type, but since there may be a probability that a new department can be added in future, our consideration for the data type is fine.

In addition to this, the result also shows that we have allowed for NULL in our schema while there are no NULL values in any of the values for the column, so we can mark it as NOT NULL, which makes SQL operations faster, provided we also have in our requirement that every employee should have a department value assigned.

Excerpt from the MySQL site manual page related to table column optimisation:

"– Use the most efficient (smallest) data types possible. MySQL has many specialized types that save disk space and memory. For example, use the smaller integer types if possible to get smaller tables. MEDIUMINT is often a better choice than INT because a MEDIUMINT column uses 25% less space.

– Declare columns to be NOT NULL if possible. It makes SQL operations faster, by enabling better use of indexes and eliminating overhead for testing whether each value is NULL. You also save some storage space, one bit per column. If you really need NULL values in your tables, use them. Just avoid the default setting that allows NULL values in every column."

Ref: http://ift.tt/1r4rnuX

Fourth row output

4. From the fourth row output above, our country list consists of only four set of values for this example but in a real world example this may vary with an increased constant list which is very rarely modified. So in this case we can change this column to enum with the list of countries, since this will help us save some storage space and will provide us an additional constraint on the values stored for country.

Note: Even phpMyAdmin has an interface to run this check and access this info. In the table structure page, you will find a "Propose table structure" link which does this action for you as shown below:

Propose table structure link.
Propose table structure action result.

So to conclude PROCEDURE ANALYSE() provides some very important insight into schema design for an optimal data type like column length, type and NULL value usage, which we can consider, but not all of it needs to be taken into account considering application requirement, future data possibilities and usage 🙂
via Planet MySQL
MySQL Procedure Analyse Use

If You Call This a ‘Muslim Ban,’ You Are a Shameless Liar

I’m not going to bother with an in depth breakdown of Trump’s Executive Order on immigration. Plenty of those have already been written, and a few of them are even accurate (examples: here and here). I have only a few random points that need to be emphasized:

1. EVERYONE CALM DOWN.

I wasn’t able to pay very close attention to the news this weekend, so I witnessed the hysterical meltdown over the Executive Order before I’d had a chance to read the actual text (a step that 98 percent of the protesters have clearly not taken). From the way the Left went into full meltdown mode, you’d think that Trump took some kind of extreme, incredible, unthinkable step. That is, you might come to that conclusion if you hadn’t noticed that the Left is now in a state of perpetual nuclear meltdown. The Fukushima meltdown went on for three days; the Left’s own nuclear meltdown is sure to outlast that by a factor of a thousand.

Trump’s action here is certainly more than Obama ever did or ever would do, but it’s not entirely unprecedented even by Obama’s standards. As has been pointed out many times since Friday, Obama put a temporary hold on the Iraqi refugee program for 6 months back in 2011. If you happened to be in an airport after Obama signed that order, you may have noticed the complete lack of protesting going on. On second thought, you probably would not have noticed because, back in those ancient times, you never would have expected to see a national panic over a reasonable measure meant to ensure that terrorists aren’t entering the country. But those were also the days when Obama could assassinate US citizens without the Left uttering a word or protest. They were more easy going back then, it seems. I wonder why?

Anyway, yes, Trump’s order goes beyond Obama’s. Trump is putting a hold on the Syrian refugee program until the process can be revamped and security measures are put in place. He’s also suspending all refugee admissions for just 4 months. And he is temporarily preventing the citizens of 7 terrorists hot spots from entering the United States. Those hot spots are: Iraq, Syria, Iran, Libya, Somalia, Sudan, and Yemen. It should be noted that Trump did not single out those countries by name in his Executive Order. He simply adopted the Obama Administration’s list of “countries of concern.” It was Obama who highlighted them initially. Trump just took the next logical step.

If these measures seem radical, they only seem radical to us because we’d grown accustomed to a president who did very little to protect national security and sovereignty. Indeed, we’d grown accustomed to a president who, infamously, couldn’t even bring himself to verbally acknowledge Islamic terrorism. Compared to that, yes, what Trump has done here is absolutely shocking. Looked at objectively, however, it’s honestly not that radical. It’s not a big deal at all, really. It’s a sensible first step towards ensuring that American citizens are better protected from the violence and chaos overseas.

What would these protesters have us do, anyway? Somalia, Syria, Libya — these are failed states. They’re literal breeding grounds for terrorism. They’re like an assembly line for mass murdering zealots. These are some of the most dangerous places on Earth. Nobody is saying that we should never again admit anyone from this region of the world, but it seems enormously sensible to take a brief and temporary pause to assess how we admit them.

Should we not even do that much? Really?

Continue Reading

The post If You Call This a ‘Muslim Ban,’ You Are a Shameless Liar appeared first on The Matt Walsh Blog.

via The Matt Walsh Blog
If You Call This a ‘Muslim Ban,’ You Are a Shameless Liar

PHP and MySQL Basics IV — SQL Injection and Prepared Statements

SQL Injection is a highly feared and often misunderstood problem. The basic phobia is that someone hijacks your SQL request and suddenly has full access to everything in your database. Well, it usually is not that easy and it is actually easy to avoid.

Rule 1: Never Trust User Supplied

The usual example is something like a query SELECT * FROM customer_data WHERE customer_id='$id' and the programmer was expecting an integer for the customer_id. But a dastardly use inserts some horrible SQL code to pirate the information so the query looks like SELECT * FROM customer_data WHERE customer_id=1 OR customer_id > 0 and suddenly all your customer data is out free in the universe waiting for who knows what.

The code could have checked to see if the value of customer_id was truly an integer or returning an error if not. The is_int function was designed to do just this.

if is_int($customer_id) {
//Do all the stuff we want to do if we have a integer
//submitted for a customer_id
} else {
echo "Hey! I want an INTEGER for a customer identification number!";
}

Even more dastardly and from the PHP Manual where the dastardly injector resets all the passwords:


<?php
But a malicious user subits the value ' or uid like'%admin% to $uid to change the admin's password, or simply
sets $pwd to hehehe', trusted=100, admin='yes to gain more privileges. Then, the query will be twisted:
>?php

// $uid: ' or uid like '%admin%
$query = "UPDATE usertable SET pwd='...' WHERE uid='' or uid like '%admin%';"
// $pwd: hehehe', trusted=100, admin='yes
$query = "UPDATE usertable SET pwd='hehehe', trusted=100, admin='yes' WHERE
...;";?>

Paranoid yet? This is another case checking the values for reasonableness can save grief. Is the uid an integer, is that integer in a proper range for uids? If too low or too high, you need to suspect someone is doing something bad.

On the database side

One thing I have recommended and implemented for years is separate users for SELECTs and INSERT/UPDATE/DELETEs. It is too easy to use one connection string over and over. But if you are in a situation where you need to take ‘loose’ information from an user and use that information against you data base, you need to split the queries. Set up a cust_read account on the MySQL server that can read customer data ONLY. The a corresponding cust_mod for all the other queries. This way you are assured that they can not delete or update records with that account if things get compromised. Also do not user superuser accounts like root for production database interactions — save these accounts for maintenance functions.

Bound variables

The MySQL server supports using anonymous, positional placeholder with ?. Again from the PHP Manual:


/* Prepared statement, stage 1: prepare */
if (!($stmt = $mysqli->prepare("INSERT INTO test(id) VALUES (?)"))) {
echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;
}

Or as used in a SELECT


/* Prepared statement, stage 1: prepare */
if (!($stmt = $mysqli->prepare("SELECT * FROM test WHERE id = ?"))) {
echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;
}
/* Prepared statement, stage 2: bind and execute */
$id = 1;
if (!$stmt->bind_param("i", $id)) {
echo "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error;
}

if (!$stmt->execute()) {
echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error;
} else {
echo "Got it!!!\n";
}

Prepared Statements – Help But Not A Cure

Prepared statements make it nearly impossible to cram lots of data into one variable. That was nearly impossible.

Take the extra time to make sure that integers are really integers and that they are in the correct range of numbers. If you are looking for a string of up to say 30 characters that you do something when the length is over run. MySQL used to get a lot of flack with people running servers in less that strict mode and having excess data truncated with only a warning generated. Now sometimes that data is valuable. But if your corporate standard is to store emails in 45 characters and the user is trying to store 50, you need to programmatically warn those with long emails that their data is too long (and the Ops folks that the email to the account if going to bounce (if you do accept that truncated email)).

RTFM

The PHP Manual’s section on SQL Injection is a must read. Do use separate MySQL accounts for SELECTs and INSERT/UPDATE/DELETEs. Keep asking yourself how to keep from exposing more data than the absolute minimum needed. Do not use SELECT * FROM foo but instead explicitly name the columns in your select statement; If something goes wrong you are not exposing data column that may have private information. And be paranoid — keep asking if there is something else you can do to protect the data.
via Planet MySQL
PHP and MySQL Basics IV — SQL Injection and Prepared Statements