Give Your Mac a Voice-Activated Self Destruct Sequence

Give Your Mac a Voice-Activated Self Destruct Sequence

With Yosemite, you can create your own voice commands on your Mac using Automator. Blogger Jacob Salmela points out that if you like to live on the edge, you can make a voice activated self-destruct sequence.

All you need to do is set up an Automator action that runs a command like rm -rf / that deletes everything on your hard drive. Obviously, most of us don’t have any use for this, but if you’re worried and want an easy way to clear everything off your hard drive with a voice command, this is the way to do it.

Give Your Mac a Voice-Activated Self Destruct Command (Like Start Trek) | Jacob Salmela


via Lifehacker
Give Your Mac a Voice-Activated Self Destruct Sequence

Store UUID in an optimized way

A few years ago Peter Zaitsev, in a post titled “To UUID or not to UUID,” wrote: “There is timestamp based part in UUID which has similar properties to auto_increment and which could be used to have values generated at same point in time physically local in BTREE index.”For this post I’ve rearranged the timestamp part of UUID (Universal Unique Identifier) and did some benchmarks.Many people store UUID as char (36) and use as row identity value (PRIMARY KEY) because it is unique across every table, every database and every server and allow easy merging of records from different databases. But here comes the problem, using it as PRIMARY KEY causes the problems described below.Problems with UUIDUUID has 36 characters which makes it bulky.InnoDB stores data in the PRIMARY KEY order and all the secondary keys also contain PRIMARY KEY. So having UUID as PRIMARY KEY makes the index bigger which can not be fit into the memoryInserts are random and the data is scattered.Despite the problems with UUID, people still prefer it because it is UNIQUE across every table, can be generated anywhere. In this blog, I will explain how to store UUID in an efficient way by re-arranging timestamp part of UUID.Structure of UUIDMySQL uses UUID version 1 which is a 128-bit number represented by a utf8 string of five hexadecimal numbersThe first three numbers are generated from a timestamp.The fourth number preserves temporal uniqueness in case the timestamp value loses monotonicity (for example, due to daylight saving time).The fifth number is an IEEE 802 node number that provides spatial uniqueness. A random number is substituted if the latter is not available (for example, because the host computer has no Ethernet card, or we do not know how to find the hardware address of an interface on your operating system). In this case, spatial uniqueness cannot be guaranteed. Nevertheless, a collision should have very low probability.The timestamp is mapped as follows: When the timestamp has the (60 bit) hexadecimal value: 1d8eebc58e0a7d7. The following parts of the UUID are set:: 58e0a7d7-eebc-11d8-9669-0800200c9a66. The 1 before the most significant digits (in 11d8) of the timestamp indicates the UUID version, for time-based UUIDs this is 1.Fourth and Fifth parts would be mostly constant if it is generated from a single server. First three numbers are based on timestamp, so they will be monotonically increasing. Lets rearrange the total sequence making the UUID closer to sequential. This makes the inserts and recent data look up faster. Dashes (‘-‘) make no sense, so lets remove them. 58e0a7d7-eebc-11d8-9669-0800200c9a66 => 11d8eebc58e0a7d796690800200c9a66BenchmarkingI created created three tablesevents_uuid – UUID binary(16) PRIMARY KEYevents_int – Additional BIGINT auto increment column and made it as primary key and index on UUID columnevents_uuid_ordered – Rearranged UUID binary(16) as PRIMARY KEYI created three stored procedures which insert 25K random rows at a time into the respective tables. There are three more stored procedures which call the random insert-stored procedures in a loop and also calculate the time taken to insert 25K rows and data and index size after each loop. Totally I have inserted 25M records.Data Size Horizontal Axis – Number of inserts x 25,000 Vertical Axis – Data Size in MB The data size for UUID table is more than other two tables.Index Size Horizontal axis – Number of inserts x 25,000 Vertical axis – Index Size in MB Total Size Horizontal Axis – Number of inserts x 25,000 Vertical Axis – Total Size in MB Time taken Horizontal axis – Number of inserts x 25,000 Vertical axis – Time Taken in seconds For the table with UUID as PRIMARY KEY, you can notice that as the table grows big, the time taken to insert rows is increasing almost linearly. Whereas for other tables, the time taken is almost constant.The size of UUID table is almost 50% bigger than Ordered UUID table and 30% bigger than table with BIGINT as PRIMARY KEY. Comparing the Ordered UUID table BIGINT table, the time taken to insert rows and the size are almost same. But they may vary slightly based on the index structure.root@localhost:~# ls -lhtr /media/data/test/ | grep ibd
-rw-rw—- 1 mysql mysql  13G Jul 24 15:53 events_uuid_ordered.ibd
-rw-rw—- 1 mysql mysql  20G Jul 25 02:27 events_uuid.ibd
-rw-rw—- 1 mysql mysql  15G Jul 25 07:59 events_int.ibdTable Structure#1 events_int
CREATE TABLE `events_int` ( 
`count` bigint(20) NOT NULL AUTO_INCREMENT, 
`id` binary(16) NOT NULL, 
`unit_id` binary(16) DEFAULT NULL, 
`event` int(11) DEFAULT NULL, 
`ref_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 
`campaign_id` binary(16) COLLATE utf8_unicode_ci DEFAULT ”, 
`unique_id` binary(16) COLLATE utf8_unicode_ci DEFAULT NULL, 
`user_agent` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, 
`city` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, 
`country` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL, 
`demand_partner_id` binary(16) DEFAULT NULL, 
`publisher_id` binary(16) DEFAULT NULL, 
`site_id` binary(16) DEFAULT NULL, 
`page_id` binary(16) DEFAULT NULL, 
`action_at` datetime DEFAULT NULL, 
`impression` smallint(6) DEFAULT NULL, 
`click` smallint(6) DEFAULT NULL, 
`sold_impression` smallint(6) DEFAULT NULL, 
`price` decimal(15,7) DEFAULT ‘0.0000000’, 
`actioned_at` timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00′, 
`unique_ads` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 
`notification_url` text COLLATE utf8_unicode_ci, 
PRIMARY KEY (`count`), 
KEY `id` (`id`), 
KEY `index_events_on_actioned_at` (`actioned_at`), 
KEY `index_events_unit_demand_partner` (`unit_id`,`demand_partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#2 events_uuid
CREATE TABLE `events_uuid` ( 
`id` binary(16) NOT NULL, 
`unit_id` binary(16) DEFAULT NULL,
~
~
PRIMARY KEY (`id`), 
KEY `index_events_on_actioned_at` (`actioned_at`), 
KEY `index_events_unit_demand_partner` (`unit_id`,`demand_partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#3 events_uuid_ordered
CREATE TABLE `events_uuid_ordered` (  
`id` binary(16) NOT NULL,  
`unit_id` binary(16) DEFAULT NULL,
~
~
PRIMARY KEY (`id`),  
KEY `index_events_on_actioned_at` (`actioned_at`),  
KEY `index_events_unit_demand_partner` (`unit_id`,`demand_partner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;Conclusions Create function to rearrange UUID fields and use itDELIMITER //
CREATE DEFINER=`root`@`localhost` FUNCTION `ordered_uuid`(uuid BINARY(36))
RETURNS binary(16) DETERMINISTIC
RETURN UNHEX(CONCAT(SUBSTR(uuid, 15, 4),SUBSTR(uuid, 10, 4),SUBSTR(uuid, 1, 8),SUBSTR(uuid, 20, 4),SUBSTR(uuid, 25)));
//
DELIMITER ;InsertsINSERT INTO events_uuid_ordered VALUES (ordered_uuid(uuid()),’1′,’M’,….);SelectsSELECT HEX(uuid),is_active,… FROM events_uuid_ordered ;Define UUID as binary(16) as binary does not have any character set Referenceshttp://dev.mysql.com/doc/refman/5.1/en/miscellaneous-functions.html#function_uuidhttp://www.famkruithof.net/guid-uuid-timebased.htmlhttp://www.percona.com/blog/2007/03/13/to-uuid-or-not-to-uuid/http://blog.codinghorror.com/primary-keys-ids-versus-guids/ The post Store UUID in an optimized way appeared first on MySQL Performance Blog.
via Planet MySQL
Store UUID in an optimized way

Video: How airplanes are made

Video: How airplanes are made

Building a commercial airplane is a monumental task. It takes around 4,000 really smart engineers over 7 years of planning to make one of those flying tubes with countless experts testing and re-testing each individual part (and there are 2.65 million parts in an Airbus A350). This video shows you how they make one.

There’s even a test that involves shooting ducks into the engine! Minute Physics toured Airbus’ facilities to bring you this fascinating video below:


SPLOID is delicious brain candy. Follow us on Facebook or Twitter.

via Gizmodo
Video: How airplanes are made

Watching this machine punching through metal = Total satisfaction

Watching this machine punching through metal = Total satisfaction

Behold the TRUMPF TruPunch 2020! I don’t know if the TRUMPF TruPunch 2020 is the best. I don’t know how much the TRUMPF TruPunch 2020 costs. Hell, I don’t know anything about the TRUMPF TruPunch 2020. Except watching it in action is a surprising source of inner satisfaction. Also, trumpf should be a verb.


SPLOID is delicious brain candy. Follow us on Facebook or Twitter.

via Gizmodo
Watching this machine punching through metal = Total satisfaction

Ask for the C.L.U.E. Report Before You Buy a Home

Ask for the C.L.U.E. Report Before You Buy a Home

If you’re in the market for buying a home, there’s one report you should ask from the sellers. It’s called a C.L.U.E. report, which details insurance claims on the property made in the last several years. Those claims can affect what you would pay for homeowners insurance on the property.

The report, also known as the Comprehensive Loss Underwriting Exchange, lists every claim—even if it was denied or just inquired about (so homeowners, take note: don’t ask your insurance agency about anything you don’t want listed on the report). In some states, Forbes notes, sellers are required by law to disclose any damage or repairs, but asking them to get the C.L.U.E. report is still a smart move.

Homeowners can get their reports for free every year and should check it for errors, just like we should with our credit reports.

The Report You Should Ask for Before Buying a House | Forbes

Photo by Monika Wisniewska (Shutterstock).


via Lifehacker
Ask for the C.L.U.E. Report Before You Buy a Home

Indulge Your Inner Child and Lose a Few Hours To This Online Spirograph

Indulge Your Inner Child and Lose a Few Hours To This Online Spirograph

We’ve got computer graphics software that’s so powerful it can generate images that make it seem like dinosaurs are back. But they still can’t compare to the simple satisfaction you get from making a really complex hypotrochoid or epitrochoid with a marker and some perforated gears. So Nathan Friend was kind enough to build a browser-based Spirograph you’re probably going to want to immediately bookmark.

The online Inspirograph, as Nathan calls it, lets you swap in gears of different sizes and choose pretty much any color your computer’s screen can display. And while you don’t get that highly satisfying feeling of pen on paper as you make endless loops, it’s impossible to screw up your design on this version, unless you accidentally refresh the page. Fancy yourself a Spirograph master? Share your designs in the discussion below, it’s not like you’ve got anything better to do on a Thursday afternoon. [Inspirograph via Boing Boing]

Indulge Your Inner Child and Lose a Few Hours To This Online Spirograph


Toyland: We love toys. Join us on Facebook or follow us on Twitter.

via Gizmodo
Indulge Your Inner Child and Lose a Few Hours To This Online Spirograph

Tennessee Town Passes Policy Banning Negative Comments About The Town’s Government

The commissioners of a small Tennessee town have just voted to ban negative comments about it from social media. This stupid move was prompted by "criticism and lies" being posted online, which supposedly "hampered" the town’s government from performing its duties.

South Pittsburg City is a town of 3,000. This fact will limit the damage done by its city commissioners’ new policy (which passed with 4-1 vote), but only because the town itself is tiny. The ban, however, is super-broad. (via Ben Swann and BRACE YOURSELF for always-awesome AUTOPLAY)

It applies to all city elected representatives, appointed board members, employees, volunteers, vendors, contractors and anyone associated with the town in an official capacity who uses social networks. The policy says those persons can’t post anything negative about the city, its employees or other associates.

Examples include posted videos, blogs, online forum discussions, Facebook and Twitter, Commissioner Jeff Powers said.

Now, it’s obvious that this ban violates the First Amendment rights of everyone involved. It’s obvious to the lone dissenting voter, Paul Don King. It’s not so obvious to the rest of the commissioners, who have offered a variety of terrible defenses the new policy.

Commissioner Jeff Powers:

"It seems like every few meetings we’re having to address something that’s been on Facebook and created negative publicity," he said. "This is just an industry standard nowadays."

Oh, lord. Have you ever heard of such a slight inconvenience? "Every few meetings." Sounds exhausting. If he thinks it’s a drag dealing with negative comments periodically, just wait until he has to actively police social media for violators.

One, you’re a government, not an "industry." So, that makes this move censorship rather than some sort of half-assed town TOS. It’s called prior restraint and it’s something the Supreme Court has recognized as a violation of First Amendment rights. You can’t just tell any group of people they can’t criticize the town or its employees/"other associates." That’s not an "industry standard." It’s not even a "government standard." Criticism is to be expected, not shut down.

Powers follows that up by attempting to clarify the situation, but only makes it more incomprehensible.

Powers said the policy doesn’t forbid the use of social media, and it can be amended in the future.

"The first thing everyone wants to say is ‘I can’t post anything on Facebook,’" he said. "Well, you can. Just not [anything] that sheds a negative light on any person, entity, board or things of that nature. You can go ahead and post all you want."

Oh, OK. You’re not banning anyone employed by or doing business with the city from using social media. You’re just forbidding them from criticizing anyone employed by or doing business with the city. You can "post all you want" EXCEPT.

And "fixing it in post" with amendments isn’t a great way to run a town’s government. The idea is to produce good policies and statutes, not bad statutes that need to be amended (or rolled back) before they can mesh with the Constitution.

City Attorney Billy Gouger said the new policy is not intended to infringe on anyone’s right to free speech.

"What this policy tries to do is reconcile that right with other rights," he said. "It does, to some extent, limit your ability to criticize or comment in an official capacity."

I am completely lost as to how Gouger has managed to reconcile the policy he passed with the words he’s saying in defense of it. It is definitely "intended to curtail free speech." Free speech is the opposite of this policy’s wording. How is "limiting your ability to criticize or comment" not a limit of free speech? Because it’s in an "official capacity?" Even if that limitation manages to pass Constitutional muster (and good luck!), the limitation is effectively meaningless because the range of people this policy covers is so broad. "Volunteers, vendors and contractors" are still private citizens even if they’re doing business with the town.

If you want to write individual agreements with each of these listed parties stating that doing business with (or being employed by) South Pittsburg City means not criticizing South Pittsburg City, then by all means do so. These parties can waive their rights, but it’s still their choice. You can’t just take it away. That (again) is prior restraint — something that is exactly a "limit on free speech."

Finally, some words of "wisdom" from the mayor herself.

"Criticism is one thing," Mayor Jane Dawkins said. "Out-and-out lies and untruths — that’s another thing. Those kinds of things are the things that will be directed."

Hey, there’s a civil process for dealing with lies and untruths. Try using that instead. Libel and defamation are not protected speech and any of the four easily-bruised members of the city commission should avail themselves of that remedy. Shutting people up with a stupid, unconstitutional policy isn’t the answer, no matter how small your town is. That the number of people whose free speech rights have just been constrained will likely be low is no excuse. It’s still what it is: censorship in the form of prior restraint.

Permalink | Comments | Email This Story




via Techdirt.
Tennessee Town Passes Policy Banning Negative Comments About The Town’s Government