Profile

Cover photo
Dan Harper
Works at Radweb
Attended University of Portsmouth
Lives in Portsmouth
673 followers|49,635 views
AboutPostsPhotosYouTubeReviews

Stream

Dan Harper

Shared publicly  - 
 
Sunset, Southsea beach
1
Add a comment...

Dan Harper

Shared publicly  - 
 
 
DevTools: 3 Steps To A Better Dock-To-Right Experience In Canary

As of today, you longer need custom hacks or themes to get an optimal dock-to-right experience in DevTools. Horizontal splitting for Elements and Sources landed and are just 3 quick steps away:

1) Enable DevTools experiments under chrome://flags
2) Check "Allow horizontal split in Elements and Sources panels" in Settings > Experiments
3) Right-click in Elements/Sources and select "Split Horizontally". Boom.

As you can see in the screenshot below, dock-to-right in this mode expands main panels across the DevTools, moving sub-panels to a new tabbed row accordingly. Lots more room to work in and it's a little easier on the eyes :)

Big thanks to +Pavel Feldman and the team for taking the time to implement this welcome change.
1
Add a comment...

Dan Harper

Shared publicly  - 
 
 
I bought a digital video download today that required a video player from Leaping Brain. As usual, the proprietary player wasn't great and to transfer it to my iPhone I'd need another proprietary player. Ugh. But I browsed around and found that the video had been downloaded into a hidden directory as a bunch of .mov files. Great, except none of the files would play.

It turned out the actual player, launched from their compiled app, was a Python wrapper around some VLC libraries. Nothing funny going on, as far as I could tell, but when I tried to launch the player directly, nothing happened. The compiled app was modifying the .mov files right before they were loaded into the player, and then reverting the file on disk. According to http://leapingbrain.com/mod-machine/faq/:

 "We apply our BrainTrust™ proprietary video encryption to your movies before we upload them to our servers. If someone ever was able to gain access to your content, the files would be useless and unplayable, because they are stored in a scrambled, encrypted format. Once downloaded to the user’s hard drive, the files are still encrypted and only readable via the MOD Machine Player by a legitimate owner. We are not aware of a better DRM scheme than ours. Where Windows Media DRM is easily crackable, and doesn’t run on Macs, BrainTrust™ works great on Windows 8, Vista, Windows XP and Mac, and is virtually uncrackable."

Virtually uncrackable? Well, since they load the file from a Python script, it's easy to make a copy of the "decrypted" file before it's reverted. Having done so, I was curious to see the encryption scheme. By comparing the binary files, I discovered the "proprietary video encryption" algorithm: for the first 15kB, each 1kB block has its initial bytes xor'd with the string "RANDOM_STRING". That's the "scrambled, encrypted format" that leaves these files "useless and unplayable".
1
Rich Boakes's profile photo
 
L. M. F. A. O.
 ·  Translate
Add a comment...

Dan Harper

Shared publicly  - 
 
Portsmouth and Southsea Girls - Luke Ferre
1
Add a comment...

Dan Harper

Shared publicly  - 
 
 
Discussion with TimBL on internet/web regulation, neutrality & free speech.
1
Add a comment...
In his circles
317 people
Have him in circles
673 people

Dan Harper

Shared publicly  - 
 
This is the extension I've been missing all my life!
1
Add a comment...

Dan Harper

Shared publicly  - 
 
This extension adds a new button on GitHub repos to open it as a 5 minute fork :)
1
Add a comment...

Dan Harper

Shared publicly  - 
 
Wtf is this mood stuff on Google+ about? It's like we've just jumped back to 2005 and MySpace.

Meh. Whatever.
1
Dan Harper's profile photoRich Boakes's profile photo
4 comments
 
Oh yeah, on iPad the Mood button is Link instead. 
Add a comment...

Dan Harper

Shared publicly  - 
 
 
A lesson in shortcuts.

Long ago, as the design of the Unix file system was being worked out, the entries . and .. appeared, to make navigation easier. I'm not sure but I believe .. went in during the Version 2 rewrite, when the file system became hierarchical (it had a very different structure early on).  When one typed ls, however, these files appeared, so either Ken or Dennis added a simple test to the program. It was in assembler then, but the code in question was equivalent to something like this:
   if (name[0] == '.') continue;
This statement was a little shorter than what it should have been, which is
   if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue;
but hey, it was easy.

Two things resulted.

First, a bad precedent was set. A lot of other lazy programmers introduced bugs by making the same simplification. Actual files beginning with periods are often skipped when they should be counted.

Second, and much worse, the idea of a "hidden" or "dot" file was created. As a consequence, more lazy programmers started dropping files into everyone's home directory. I don't have all that much stuff installed on the machine I'm using to type this, but my home directory has about a hundred dot files and I don't even know what most of them are or whether they're still needed. Every file name evaluation that goes through my home directory is slowed down by this accumulated sludge.

I'm pretty sure the concept of a hidden file was an unintended consequence. It was certainly a mistake.

How many bugs and wasted CPU cycles and instances of human frustration (not to mention bad design) have resulted from that one small shortcut about  40 years ago?

Keep that in mind next time you want to cut a corner in your code.

(For those who object that dot files serve a purpose, I don't dispute that but counter that it's the files that serve the purpose, not the convention for their names. They could just as easily be in $HOME/cfg or $HOME/lib, which is what we did in Plan 9, which had no dot files. Lessons can be learned.)
1
Add a comment...

Dan Harper

Shared publicly  - 
 
The first InventoryBase mobile app is now out! You can now write property inventory reports, with photos, offline and sync them back to InventoryBase afterwards.
It's a PhoneGap app, built on Backbone.js with CoffeeScript. Available on Android and pending review on iOS.
1
1
Add a comment...
People
In his circles
317 people
Have him in circles
673 people
Work
Occupation
Web Developer
Employment
  • Radweb
    Lead Developer, 2011 - present
  • Envato
    Core Staff Author, 2008 - present
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Portsmouth
Previously
Stourport
Links
YouTube
Contributor to
Story
Tagline
"Binaries and Hexadecimals"
Introduction
Programmer. I build large Backbone.js apps backed by FuelPHP. Tuts+ author. Developer at Radweb. Winner of University of Portsmouth's Enterprise Challenge 2012.
Education
  • University of Portsmouth
    BSc Web Technologies, 2009 - 2013
    First Class Honours
  • Stourport Sixth Form Centre
    A-Levels: IT, History, Sociology, Japanese, 2007 - 2009
  • Stourport High School
    GCSEs: inc. IT, History, Drama, French, Spanish, 2004 - 2007
Basic Information
Gender
Male
Other names
Daniel Harper
A traditional sweet shop, really well presented. How do places like this not exist elsewhere?
Public - 2 years ago
reviewed 2 years ago
1 review
Map
Map
Map