Guy creates handheld railgun with a 3D-printer

An ambitious maker has built a partly 3D-printed railgun that can fire aluminum or graphite projectiles at over 250 meters per second (560 mph). No, this isn’t Quake, but it’s no janky, all-plastic gun, either. The "handheld" weapon houses six capacitors that weigh 20 pounds and deliver over 1,800 joules of energy per shot. And it indeed works just like a full-sized railgun, using parallel electrodes to fire an "armature" bullet. The creator, David Wirth, added an Arduino Uno R3 to monitor charging levels, temperature and other factors, and tweaked the rails after he noticed "plasma damage."

The resulting design was complex enough that he even made a 3D CAD drawing that would do DARPA proud (above). The test shots with graphite and aluminum projectiles were far less lethal than a regular gun, as you can see in the videos below. Nevertheless, the aluminum "bullet" still put a half-inch dent in the steel-backed plywood target, and the graphite projectile "probably just vaporized," according to the Wirth.

Update: The post originally said that the gun fires 3,000 kilojoule shots, but the correct number is 1,800 joules.

Via: Kotaku

Source: Xtamared (Imgur)

via Engadget
Guy creates handheld railgun with a 3D-printer

Preparing your MySQL schema for a character set change

Recently I blogged about identifying necessary index changes when changing the character set for a MySQL database. In this follow-up post I want to talk about general schema changes that you should consider when changing your character set from latin1 to utf8, from utf8 to utf8mb4, etc. The main issue is with long VARCHAR columns and columns with columns with length limits that are enforeced in bytes rather than characters.
The manual points out the main areas where you may have trouble:
A TINYTEXT column can hold up to 255 bytes, so it can hold up to 85 3-byte or 63 4-byte characters. Suppose that you have a TINYTEXT column that uses utf8 but must be able to contain more than 63 characters. You cannot convert it to utf8mb4 unless you also change the data type to a longer type such as TEXT.
Similarly, a very long VARCHAR column may need to be changed to one of the longer TEXT types if you want to convert it from utf8 to utf8mb4.
The point on TINYTEXT is pretty clear. Frankly I’m not sure why anyone uses TINYTEXT to begin with, but if you have TINYTEXT columns in your database and you are changing your character set, this might be a great opportunity to change those columns to a TEXT type that supports longer values, such as MEDIUMTEXT, TEXT, or LONGTEXT.
Long VARCHAR columns can be a problem because MySQL has a row length limit of 65,535 bytes, and one really long VARCHAR or a few relatively long VARCHARs in a multi-byte character set can push your rows past that limit. For example you can have a VARCHAR(20000) in utf8 because it takes up a maximum of 60,000 bytes, but you can’t have a VARCHAR(20000) in utf8mb4 because that requires up to 80,000 bytes of storage.
Here’s my simple recommendation for preparing a MySQL schema for a character set change:
Change all TINYTEXT columns to TEXT, MEDIUMTEXT, or LONGTEXT
Change all long VARCHAR columns to TEXT, MEDIUMTEXT, or LONGTEXT
Read on for sample queries that generate the necessary DDL to modify the relevant columns, and examples that illustrate the problem.
Generating DDL
The following information_schema query generates ALTER TABLE statements to change all TINYTEXT columns in your database to TEXT:
— change all tinytext columns to text
select concat(‘alter table ‘,t.table_schema,
‘.’,
t.table_name,
‘ modify column ‘,
c.column_name,
‘ ‘,
‘text’,
‘ character set ‘,
character_set_name,
‘ collate ‘,
collation_name,
‘ ‘,
case when c.is_nullable = ‘yes’ then ‘null’ else ‘not null’ end,
case when c.column_default is not null and c.column_default != ” then concat(‘ default ”’,c.column_default,””) else ” end,
‘;’) as ddl
from information_schema.columns c
inner join information_schema.tables t on t.table_schema = c.table_schema and t.table_name = c.table_name
where c.column_type = ‘tinytext’
and t.table_type = ‘base table’
order by t.table_name asc;
The following information_schema query generates ALTER TABLE statements to change all long VARCHAR columns in your database to LONGTEXT. I’m using an arbitrary limit of 2,000 characters to define long VARCHAR columns. You can tweak that number to your own particular use case. Also the choice of LONGTEXT is somewhat arbitrary. Feel free to change that to TEXT or MEDIUMTEXT if that works better for your use case.
— change all varchar columns 2000 characters or longer to longtext
select concat(‘alter table ‘,t.table_schema,
‘.’,
t.table_name,
‘ modify column ‘,
c.column_name,
‘ ‘,
‘longtext’,
‘ character set ‘,
character_set_name,
‘ collate ‘,
collation_name,
‘ ‘,
case when c.is_nullable = ‘yes’ then ‘null’ else ‘not null’ end,
case when c.column_default is not null and c.column_default != ” then concat(‘ default ”’,c.column_default,””) else ” end,
‘;’) as ddl
from information_schema.columns c
inner join information_schema.tables t on t.table_schema = c.table_schema and t.table_name = c.table_name
where c.data_type = ‘varchar’
and c.character_maximum_length >= 2000
and t.table_type = ‘base table’
order by t.table_name asc, c.column_name asc;
Those queries will generate multiple ALTER TABLE statements if more than one column needs to be modified in a given table. In order to avoid gratuitous rebuilds of large tables you may want to combine the multiple statements into a single ALTER TABLE for each relevant table.
Examples
Since TINYTEXT columns can only store 255 bytes, if I try to insert more than (255/N) N-byte characters the value is either silently truncated or the insert fails, depending on sql_mode.
Here’s an example:
“`
mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> create table if not exists tinytext_test (
-> id int auto_increment primary key,
-> str tinytext
-> ) engine = InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.04 sec)
mysql> — insert 255 one byte characters
mysql> insert into tinytext_test (str) values (repeat(‘$’,255));
Query OK, 1 row affected (0.00 sec)
mysql> — change table and column to utf8
mysql> alter table tinytext_test DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table tinytext_test modify column str tinytext CHARACTER SET utf8;
Query OK, 1 row affected (0.06 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> — insert 255 two byte characters
mysql> insert into tinytext_test (str) values (repeat(‘å’,255));
Query OK, 1 row affected, 1 warning (0.00 sec)
Warning (Code 1366): Incorrect string value: ‘\xC3\xA5\xC3\xA5\xC3\xA5…’ for column ‘str’ at row 1
mysql> — insert 255 three byte characters
mysql> insert into tinytext_test (str) values (repeat(‘€’,255));
Query OK, 1 row affected, 1 warning (0.00 sec)
Warning (Code 1265): Data truncated for column ‘str’ at row 1
“`
Here’s a query to show how many characters are stored for each row. As expected we get floor(255/N) characters in each row:
mysql> select left(str,1),length(str),char_length(str) from tinytext_test;
+————-+————-+——————+
| left(str,1) | length(str) | char_length(str) |
+————-+————-+——————+
| $ | 255 | 255 |
| å | 254 | 127 |
| € | 255 | 85 |
+————-+————-+——————+
3 rows in set (0.00 sec)
If I enable strict sql_mode and try to insert 255 multi-byte characters then the INSERT will fail with an error:
“`
mysql> set session sql_mode = ‘STRICT_ALL_TABLES’;
Query OK, 0 rows affected (0.00 sec)
mysql> — insert 255 three byte characters
mysql> insert into tinytext_test (str) values (repeat(‘€’,255));
ERROR 1406 (22001): Data too long for column ‘str’ at row 1
“`
For long VARCHAR columns, if I try to change the character set of the column in a way that will violate the 65,535 byte row length limit MySQL will either silently convert the column to a TEXT data type, or the ALTER TABLE statement will fail.
Here’s an example where a single very long VARCHAR column is converted from VARCHAR to MEDIUMTEXT:
“`
mysql> set names utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> create table if not exists single_varchar_test (
-> id int auto_increment primary key,
-> str varchar(50000)
-> ) engine = InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.05 sec)
mysql> alter table single_varchar_test DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table single_varchar_test modify column str varchar(50000) CHARACTER SET utf8;
Query OK, 0 rows affected, 1 warning (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 1
Note (Code 1246): Converting column ‘str’ from VARCHAR to TEXT
mysql> desc single_varchar_test;
+——-+————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+——-+————+——+—–+———+—————-+
| id | int(11) | NO | PRI | NULL | auto_increment |
| str | mediumtext | YES | | NULL | |
+——-+————+——+—–+———+—————-+
2 rows in set (0.00 sec)
“`
Here’s an example with several long VARCHAR columns where the ALTER TABLE statement that would push the table past the 65,535 byte row length limit actually fails:
“`
mysql> set names utf8mb4;
Query OK, 0 rows affected (0.00 sec)
mysql> create table if not exists multi_varchar_test (
-> id int auto_increment primary key,
-> str1 varchar(5000),
-> str2 varchar(5000),
-> str3 varchar(5000),
-> str4 varchar(5000)
-> ) engine = InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.04 sec)
mysql> alter table multi_varchar_test DEFAULT CHARSET=utf8mb4;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table multi_varchar_test modify column str1 varchar(5000) CHARACTER SET utf8mb4;
Query OK, 0 rows affected (0.10 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table multi_varchar_test modify column str2 varchar(5000) CHARACTER SET utf8mb4;
ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
“`
I don’t know why MySQL does the implicit data type change versus throwing an error in some cases, but the last two examples show that both of those benaviors exist.
via Planet MySQL
Preparing your MySQL schema for a character set change

UPDATE: Facebook User, Asif, Regains Friendship With Scorned Ex-Best Friend, Mudasir

UPDATE: Facebook User, Asif, Regains Friendship With Scorned Ex-Best Friend, Mudasir

Exactly a month ago to the day, our fragile world was rocked when a Facebook user from the Gujranwala District in Pakistan announced that he was severing ties with his then-former best friend Mudasir in favor of new best friend Salman. Today, however, people from all corners of the globe can breathe easy—Asif and Mudasir are friends once more.

http://ift.tt/1ZJEuOP…

After the original post announcing the split (seen below) picked up steam on the internet, Asif appears to have coped with his sudden internet fame by creating his own celebrity Facebook page, Prince Asif Raza Rana (Official).

UPDATE: Facebook User, Asif, Regains Friendship With Scorned Ex-Best Friend, Mudasir

The original friendship-disbanding post.

UPDATE: Facebook User, Asif, Regains Friendship With Scorned Ex-Best Friend, Mudasir

Asif’s latest announcement on the renewed friendship from his official Facebook page.

Though as Asif must surely know, fame and fans are poor substitutes to the life-affirming warmth and fulfillment that only a true, lasting friendship can provide. And according to today’s announcement, not only has he reconciled with the previously denounced Mudasir, but the two reunited friends have even formed something of a best friend triumvirate with Mudasir’s temporary replacement, Salman.

Salman, for his part, is taking the sudden position reversal in stride.

UPDATE: Facebook User, Asif, Regains Friendship With Scorned Ex-Best Friend, Mudasir

Mudasir commented on the announcement post, confirming what might have once seemed too good to be true to fans of the original duo.

UPDATE: Facebook User, Asif, Regains Friendship With Scorned Ex-Best Friend, Mudasir

He even took to his own Facebook page to confirm the renewed friendship independently, though with significantly less word art.

UPDATE: Facebook User, Asif, Regains Friendship With Scorned Ex-Best Friend, Mudasir

As for the previous accusations against Mudasir (and presumably the sole reason for the original split), which saw Asif claiming that “he became very selfish, Proudy, and those who shows me Attitude, I keep them under my Foot…… Huuhhh…….Now SAlman AHmad Naqash is my best friend……Its for information to all,” Mudasir had this to say:

UPDATE: Facebook User, Asif, Regains Friendship With Scorned Ex-Best Friend, Mudasir

We’ve reached out to both Mudasir and Asif for comment on their renewed friendship, and will update when and if we hear back.


Contact the author at ashley@gawker.com.

via Gizmodo
UPDATE: Facebook User, Asif, Regains Friendship With Scorned Ex-Best Friend, Mudasir

Apple’s Patent Loss To University Of Wisconsin A Reminder That Universities Are Often The Worst Patent Trolls

You may have heard the news this week that Apple lost a patent lawsuit filed by the University of Wisconsin, and may be on the hook for up to $862.4 million in damages. This news should serve as a reminder that universities are some of the nation’s worst patent trolls, actively ignoring their own stated missions to widely spread academic research and knowledge. For example, the University of Wisconsin’s stated mission is:

The mission of the University of Wisconsin System is to develop human resources, to discover and disseminate knowledge, to extend knowledge and its application beyond the boundaries of its campuses, and to serve and stimulate society by developing in students heightened intellectual, cultural, and humane sensitivities, scientific, professional and technological expertise, and a sense of purpose. Inherent in this broad mission are methods of instruction, research, extended training, and public service designed to educate people and improve the human condition. Basic to every purpose of the UW System is the search for truth.

Notice how much of that is about sharing knowledge and improving the world. But, of course, when UW had a chance to say "pay me!" it didn’t skip a beat. And many universities are doing the same thing. It’s a massive problem and it’s one caused almost entirely by Congress. We’ve discussed this a few times before, but in 1980, Congress passed the Bayh-Dole Act, which was supposed to incentivize more research at universities by allowing those universities to patent that research. The people who supported this idea were working off the myth that patents are the main way to incentivize innovation and research. This is wrong, and from this initial mistake, lots of serious problems have flowed. The Bayh-Dole Act has been a dismal failure in many, many ways, leading to a world now where many universities have resorted to patent trolling.

What really happened in the wake of the Bayh-Dole Act, was that many universities thought that they’d (1) patent all their professors’ research (2) license it and (3) profit like crazy. The reality was that they did the first part — and then many universities set up "tech transfer offices" to try to license it. And then they ran smack dab into reality, which is that most of their patents sucked and no one wanted to license them. Making matters worse, even when they had a legitimate or interesting patent, the universities massively overvalued those patents, demanding licensing fees that were ridiculous.

The end result was a near total disaster for most universities. Rather than make money, most universities lost a ton of money between all the patent filing and the expensive tech transfer offices that were supposed to be a revenue generator, but turned out to be massive losses for the vast majority of universities that set them up (there are very few exceptions). On top of that, this rush to patent and license resulted in a secondary problem: it actually decreased research and information sharing. Historically, professors would often share research with colleagues and work together on projects. But universities started pushing them not to do that as much, because of the patents. And on top of that, it became riskier to do follow on research over fears around the patents. So the entire intent of the bill backfired drastically.

As a result, many university tech transfer offices followed one of two paths to try to justify their existence: they sold off patent portfolios to patent trolls directly (Intellectual Ventures’ big initial portfolio of patents was mostly them buying junk patent portfolios from desperate universities, who needed to show some sort of return), or they started patent trolling themselves. The University of California at Berkeley became a major patent troll. As did the University of Southern California. And Carnegie Mellon. And, apparently, the University of Wisconsin as well.

This recent ruling is just the latest example of how far we’ve come and just how much damage the Bayh-Dole Act has done. It’s not only diminished university research and important information sharing, it’s now leading these universities to actively attack actual innovators and shake them down for money. If Congress really wants to fix patent trolling, it really needs to roll back the Bayh-Dole Act.

Permalink | Comments | Email This Story


via Techdirt.
Apple’s Patent Loss To University Of Wisconsin A Reminder That Universities Are Often The Worst Patent Trolls

A look into how restaurant napkins are made

A look into how restaurant napkins are made

The very best thing about dining fine at fancy restaurants is getting treated like royalty with the impeccable service. The second best thing about eating at a nice place is that you get to wipe your mouth with napkins that are perfectly threaded to wipe away mess and so luxurious that you feel guilty your skin is touching it. Here’s how those napkins are made, from a bonus clip of Mind of a Chef.


SPLOID is delicious brain candy. Follow us on Facebook, Twitter, and YouTube.

via Gizmodo
A look into how restaurant napkins are made

Pick Up A New USB Battery Pack For As Little as $5

Pick Up A New USB Battery Pack For As Little as $5

There’s no such thing as having too much battery life, and we’ve spotted several fantastic USB battery pack deals, including a pair or Aukey chargers for $5, and one of Anker’s new PowerCore models (which would be suitable for charging a USB-C MacBook) for $23.

Note: The aluminum Aukey charger is significantly smaller than the plastic 10,000mAh one, but it ships free with Prime, while the larger one is an add-on item. There are <cough> ways to get around that restriction, however.

Aukey 3300mAh Aluminum Alloy Portable External Battery ($5) | Amazon

http://ift.tt/1hIMlKp…

Aukey 10000mAh External Battery Pack Power Bank Charger ($5) | Amazon | Use code HLYLFEOY

http://ift.tt/1c2r5VL…

Anker PowerCore 15600 Compact Portable Charger External Battery Pack ($23) | Amazon | Promo code VI2VAM27

http://ift.tt/1c2r5VL…

More Deals

http://ift.tt/1dJr9CX…


Commerce Content is independent of Editorial and Advertising, and if you buy something through our posts, we may get a small share of the sale. Click here to learn more. We want your feedback.

Send deal submissions to Deals@Gawker and all other inquiries to Shane@Gawker.

via Gizmodo
Pick Up A New USB Battery Pack For As Little as $5

The Hoont Indoor Pest Repeller Drives Pests Out of Your Home (and Keeps Them Out)

The Hoont Indoor Pest Repeller Drives Pests Out of Your Home (and Keeps Them Out)

It doesn’t matter if you live in the country, the city, or the suburbs, chances are you’ve had to battle pests of all stripes over your living space. I’ve tried just about every pest control trick in the book, and so far the easiest and simplest tool to keep mice away has been this electromagnetic and ultrasonic plug-in device.

This is the first post in a new series entitled Lifehacker Reviews Anything. We asked you what you wanted us to review, and you came back with lots of ideas—including a product I’ve already been trying out myself: the Hoont Indoor Pest Repeller.

http://ift.tt/1ISPUDN…

I’ve had pigeons make their love nests in my gutters, squirrels dig behind my siding, and ants make their annual invasion into my kitchen. For me, though, no pest has been as wily, resilient, and as disgusting as mice. Exterminators set out traps and patched up holes around my home with steel wool. I tried humane traps that let you capture and release mice somewhere else, sprayed peppermint oil (a supposed natural mouse deterrent) around my kitchen, and even, in desperation, resorted to creating “pee-rimeters” around my house with coyote urine and bobcat urine (my dog was not a big fan of that. Great way to start a pissing contest, by the way). Somehow the mice evaded all these tricks—even taking the peanut butter and cheese bits off of the traps—and continued to gnaw through our pantry goods.

http://ift.tt/1jslrrU…

Three months ago, I decided to try the Hoont Indoor Pest Repeller and we haven’t had a problem with mice since—no more droppings to clean up, dead mice to dispose of, or need to hide all food in mouse-proof glass containers. It’s been an enormous relief.

I wish I hadn’t waited so long, but I had had bad experiences with a similar product in the past. In my old apartment years ago, I had tried one of these gadgets and it was almost laughable to see mice actually hanging around the device. But since every other option wasn’t working, I decided to give this another try.

I chose the Hoont repeller because of the combination of low price ($30), good reviews (4.2 stars on Amazon), and features. Unlike similar devices (including category bestseller Rid Tech repeller, the one suggested by a Lifehacker commenter), the Hoont uses both ultrasonic sound to deter pests and electromagnetic technology that sends electronic pulse signals through in-wall wiring, supposedly disturbing existing nests and stopping pests from passing through walls. It also has blinking lights that lets you know it’s working, and the option to vary frequency waves so pests don’t get used to the high frequency sounds. That’s probably its most important feature, since one of the biggest criticisms of these devices is that they only work for a short time (a few days) before the pests get accustomed to the noise. The multiple frequencies make this more of a permanent, cruelty-free, and invisible barrier between my family and these pests.

The Hoont Indoor Pest Repeller Drives Pests Out of Your Home (and Keeps Them Out)

I set up three of these devices in the areas we had seen mice the most: the kitchen, dining room, and basement. According to the manufacturer, the repeller is effective for up to 5,000 square feet, but the ultrasonic sound doesn’t penetrate hard surfaces like furniture, cabinets, and ceilings, so you’ll need one for each room.

The instructions that come with the device are short on details, but basically you just have to plug the thing in and wait for it to work, which could take up to a week. (The instructions do warn that you might notice more pest activity at first as the pests start to get disturbed and scramble to get out of your home. For us, the mice were gone in about four days after plugging the Hoont Pest Repellers in.)

So far, we’re three months into mice-free living! A couple of weeks ago, however, I was afraid the repeller had stopped working. We found the dreaded mice droppings again in our kitchen. There had been a big storm that week and we were having construction done on our house, so I think perhaps those two factors drove new mice (or a lone mouse) in. My faith in the device was revived, though: After that one day, we’ve had no signs of mice since. I think the new mice (or mouse) came in, got irritated by the ultrasonic waves, and promptly left. That, to me, is how a pest repellent should work: Not only drive out existing pests but keep new ones from settling in.

The Hoont Pest Repeller is supposed to also work against rats, ants, roaches, fleas, bats, and other pests. I thankfully haven’t had to test those out, although it doesn’t seem like it works against fruit flies, since those buggers still occasionally show up uninvited to my house. I’ll take fruit flies, which are easy to get rid of, over mice any day, though.

http://ift.tt/1jslsMq…

While the Hoont Pest Repeller is a success story for me, I have to warn you that your mileage might vary. Studies and others’ personal experiences with electronic pest control devices have mixed results and none of these devices can claim 100% effectiveness (although the Hoont does have a satisfaction guarantee). In particular, when it comes to deterring bugs, like mosquitos, studies on the electronic repellents show they don’t work (perhaps because there are over a million species of insects and some might respond to ultrasound but others are oblivious to it, Sonic Technology points out).

http://ift.tt/1VVTpRp…

It doesn’t help that the short range of these devices and their inability to work around corners or furniture are limiting. Today’s Homeowner offers this test to see if you have a good location for one of these:

To test out the location of your device, place a lamp next to the device, turn off all the other lights, and note the beams and shadows from the lamp. The repellent sound waves will pretty much only be active where the light reaches.

Most of the negative reviews on Amazon for this involve insects, although some reviewers do say it worked for their bug problems. For $30 a room, it’s really worth a try if you’re tired of dealing with pests (especially mice) and just want to drive them out of your home the cleanest and most humane way possible. It’s a lot more pleasant to use than coyote urine, at least.

http://ift.tt/1jslrIk…


via Lifehacker
The Hoont Indoor Pest Repeller Drives Pests Out of Your Home (and Keeps Them Out)