432 stories
·
4 followers

Coffee could become really popular…

1 Comment

…if someone would just invent some sort of vessel for drinking it out of.

Pic: @EliotLandrum

The post Coffee could become really popular… appeared first on We Want Plates.

Read the whole story
chrisminett
5 days ago
reply
Crazy hipsters
Milton Keynes, UK
Share this story
Delete

Removing Object Properties Before Var_Dumping Them

1 Comment

I'm working on a project at the moment (a PHP library for CouchDB, if you must know) that is designed to make HTTP calls and therefore holds a Guzzle HTTPClient object as an object property. This is great except when I need to debug something and the output of my call to var_dump() is several screens high ...

There's a Magic Method for That

It's possible to amend the behaviour of var_dump() by declaring a __debugInfo() method in the class defining the object you're dumping. This magic method will be called automatically when PHP encounters a call to var_dump() or print_r() with an object of this class as the target.

For my example, I just wanted to remove a property called "client" from the object, so the code looks like this:

    public function __debugInfo()
    {
        // remove the $client property because the output is HUGE
        $result = get_object_vars($this);
        unset($result['client']);
        return $result;
    }

The get_object_vars() returns all the properties in an array that we can then alter before returning it, and it's the return value that is used by var_dump(). The array elements still get dumped as object properties, but without that one large property that I wanted to avoid!

Read the whole story
chrisminett
7 days ago
reply
Potentially useful. But then I'd hate to see that in committed code, which means it's got to be added when you need it. At which point you'd be better off debugging properly with break points and stepping through, surely!?
Milton Keynes, UK
letssurf
7 days ago
This is great. Especially for libraries. Who needs all of the details guzzle gives when it could provide a useful var_dump.
Share this story
Delete

Boeing jet makes plane outline over America on Dreamliner test flight

1 Comment
A Dreamliner jet draws the shape of a plane over America during an engine test flight.
Read the whole story
chrisminett
14 days ago
reply
"When you have to test your new RollsRoyce engine for 17 hours, you might as well have a bit of fun."
Milton Keynes, UK
Share this story
Delete

Tesla Model S is being used as chase car to launch spy planes on Royal Air Force base

1 Comment

Lockheed’s U-2S spy planes are famously difficult to launch and land. Their extremely poor field of vision requires a chase car on the ground that can keep up with them.

They use some powerful vehicles and now we learn that the Air Force has turned to the all-electric Tesla Model S to launch its own spy planes. more…





Read the whole story
chrisminett
22 days ago
reply
Amazing footage (towards end), clever use of the instant acceleration!
Milton Keynes, UK
Share this story
Delete

Delicious Brains: Announcing serializededitor.com: A Visual Editor for PHP Serialized Data

1 Comment

On the Delicious Brains site there's a new post from Gilbert Pellegram announcing serializededitor.com, an editor specifically designed to help visually edit serialized PHP data.

I recently built a command line daemon in PHP to emulate AWS SQSD for the purposes of testing in Mergebot. As it turns out, one of the benefits of building a large, complex product like Mergebot is that there are pieces of the system that we need to build for the project that might be of use to other developers.

Today, we’re launching that system piece, a free online visual editor for PHP serialized data as serializededitor.com.

In this article, I’ll explain how and why we built this “side” project and how I overcame some of the challenges I faced when building this project.

He starts off with the problem they were trying to solve when creating the editor, mostly centered around determining the differences between two pieces of serialized data. They found something similar to what they were wanting but it didn't provide the "easy editiing" functionality they wanted. He then goes through some of the issues they bumped up against along the way: working with the data and PHP's unserialize, the creation of their own parser, the work to create the Vue.js frontend and re-serializing the data once complete.

They've also open sourced the project over on GitHub so you can clone it locally and contribute back.

Read the whole story
chrisminett
23 days ago
reply
Could be useful sometimes. Although doesn't seem to allow adding new data, so maybe limited scope.
Milton Keynes, UK
Share this story
Delete

An Open Letter To Microsoft: A 64-bit OS is Better Than a 32-bit OS

1 Comment

Windows 32 Bit vs. 64 Bit

Editor’s Note: Our co-founder & CTO, Brian Wilson, was working on a few minor performance enhancements and bug fixes (Inherit Backup State is a lot faster now). We got a version of this note from him late one night and thought it was worth sharing.

There are a few absolutes in life – death, taxes, and that a 64-bit OS is better than a 32-bit OS. Moving over to a 64-bit OS allows your laptop to run BOTH the old compatible 32-bit processes and also the new 64-bit processes. In other words, there is zero downside (and there are gigantic upsides).

32-Bit vs. 64-Bit

The main gigantic upside of a 64-bit process is the ability to support more than 2 GBytes of RAM (pedantic people will say “4 GBytes”… but there are technicalities I don’t want to get into here). Since only 1.6% of Backblaze customers have 2 GBytes or less of RAM, the other 98.4% desperately need 64-bit support, period, end of story. And remember, there is no downside.

Because there is zero downside, the first time it could, Apple shipped with 64-bit OS support. Apple did not give customers the option of “turning off all 64-bit programs.” Apple first shipped 64-bit support in OS X 10.6 Tiger in 2009 (which also had 32-bit support, so there was zero downside to the decision).

This was so successful that Apple shipped all future Operating Systems configured to support both 64-bit and 32-bit processes. All of them. Customers no longer had an option to turn off 64-bit support.

As a result, less than 2/10ths of 1% of Backblaze Mac customers are running a computer that is so old that it can only run 32-bit programs. Despite those microscopic numbers we still loyally support this segment of our customers by providing a 32-bit only version of Backblaze’s backup client.

Apple vs. Microsoft

But let’s contrast the Apple approach with that of Microsoft. Microsoft offers a 64-bit OS in Windows 10 that runs all 64-bit and all 32-bit programs. This is a valid choice of an Operating System. The problem is Microsoft ALSO gives customers the option to install 32-bit Windows 10 which will not run 64-bit programs. That’s crazy.

Another advantage of the 64-bit version of Windows is security. There are a variety of security features such as ASLR (Address Space Layout Randomization) that work best in 64-bits. The 32-bit version is inherently less secure.

By choosing 32-bit Windows 10 a customer is literally choosing a lower performance, LOWER SECURITY, Operating System that is artificially hobbled to not run all software.

When one of our customers running 32-bit Windows 10 contacts Backblaze support, it is almost always a customer that did not realize the choice they were making when they installed 32-bit Windows 10. They did not have the information to understand what they are giving up. For example, we have seen customers that have purchased 8 GB of RAM, yet they had installed 32-bit Windows 10. Simply by their OS “choice”, they disabled about 3/4ths of the RAM that they paid for!

Let’s put some numbers around it: Approximately 4.3% of Backblaze customers with Windows machines are running a 32-bit version of Windows compared with just 2/10ths of 1% of our Apple customers. The Apple customers did not choose incorrectly, they just have not upgraded their operating system in the last 9 years. If we assume the same rate of “legitimate older computers not upgraded yet” for Microsoft users that means 4.1% of the Microsoft users made a fairly large mistake when they choose their Microsoft Operating System version.

Now some people would blame the customer because after all they made the OS selection. Microsoft offers the correct choice, which is 64-bit Windows 10. In fact, 95.7% of Backblaze customers running Windows made the correct choice. My issue is that Microsoft shouldn’t offer the 32-bit version at all.

And again, for the fifth time, you will not lose any 32-bit capabilities as the 64-bit operating system runs BOTH 32-bit applications and 64-bit applications. You only lose capabilities if you choose the 32-bit only Operating System.

This is how bad it is -> When Microsoft released Windows Vista in 2007 it was 64-bit and also ran all 32-bit programs flawlessly. So at that time I was baffled why Microsoft ALSO released Windows Vista in 32-bit only mode – a version that refused to run any 64-bit binaries. Then, again in Windows 7, they did the same thing and I thought I was losing my mind. And again with Windows 8! By Windows 10, I realized Microsoft may never stop doing this. No matter how much damage they cause, no matter what happens.

You might be asking -> why do I care? Why does Brian want Microsoft to stop shipping an Operating System that is likely only chosen by mistake? My problem is this: Backblaze, like any good technology vendor, wants to be easy to use and friendly. In this case, that means we need to quietly, invisibly, continue to support BOTH the 32-bit and the 64-bit versions of every Microsoft OS they release. And we’ll probably need to do this for at least 5 years AFTER Microsoft officially retires the 32-bit only version of their operating system.

Supporting both versions is complicated. The more data our customers have, the more momentarily RAM intensive some functions (like inheriting backup state) can be. The more data you have the bigger the problem. Backblaze customers who accidentally chose to disable 64-bit operations are then going to have problems. It means we have to explain to some customers that their operating system is the root cause of many performance issues in their technical lives. This is never a pleasant conversation.

I know this will probably fall on deaf ears, but Microsoft, for the sake of your customers and third party application developers like Backblaze, please stop shipping Operating Systems that disable 64-bit support. It is causing all of us a bunch of headaches we do not need.

The post An Open Letter To Microsoft: A 64-bit OS is Better Than a 32-bit OS appeared first on Backblaze Blog | Cloud Storage & Cloud Backup.

Read the whole story
chrisminett
72 days ago
reply
Crazy
Milton Keynes, UK
Share this story
Delete
Next Page of Stories