Slowness of Google Docs

Don’t get me wrong. I love Google Docs.

But it’s slowness drives me crazy.

When I start opening a Doc it goes through several frustrating phases (with very rough times):

  1. blank page – 5 seconds
  2. content (which can’t be edited) – another 10 seconds
  3. rendering table of contents in sidemenu – another 3 seconds

The frustrating stages are 2 and 3 where it feels as if I should be able to edit content but can’t.

In total, it’s almost 20 seconds before the content can be edited. What makes it even more frustrating is that during phase 2 it appears as if the content can be edited but can’t until various other things have loaded.

Software and cascading problems

One of my pet peeves about software is how problems seem to cascade. E.g. I have an app I built which is on the App Store. I temporarily took it off the market as a supplier who provides some of the data was experiencing problems. They resolved the issue so I decided to put the app back on the market. I have a bookmark to the iTunes Connect dashboard. The dashboard needs a password. To avoid having to remember all these passwords or write them down somewhere I store in another piece of software called 1Password.

However, I got an error saying “Browser could not be verified”.

I Google’d the problem but the page (https://discussions.agilebits.com/discussion/72074/browser-could-not-be-verified-after-updating-the-1-password-app-on-mac ) was loading extremely slowly. When the page finally loaded it suggested restarting my Mac.

Various software updates took advantage of the system restart so it was around 10 minutes before I could connect to iTunes Connect.

Now, that error had gone but clicking on the password entry didn’t fill out the email and password as usual. I had to manually copy it from 1Password and paste it in.

Finally, once in the iTunes Connect dashboard, I had to figure out how to put the app back on sale. The Dashboard looked like this:

  1.  a menu at the top:

App Store Features TestFlight Activity App AnalyticsSales and Trends

None of which seemed relevant.

2.  a sidebar with:

APP STORE INFORMATION

App Information

Pricing and Availability

iOS APP

3.6.0 Developer Removed From Sale

tvOS APP

1.0 Prepare for Submission

VERSION iOS tvOS

3. a content block with this at the top:

Developer Removed From Sale

Nothing here seemed particularly clear about how you put the app back on the market.

So, some more Google’ing.

The first link was to Apple’s documentation:

https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/ChangingAppStatus.html

The problem with this documentation is that it goes on for literally dozens of pages. I really wanted an answer that didn’t involve half an hour of wading through vast reams of unrelated text.

So I visited the second link on an iPhone development forum:

http://iphonedevsdk.com/forum/business-legal-app-store/113598-app-is-developer-removed-from-sale-can-you-put-it-back-on.html

which went something like this:

Question: Hi guys, just a quick question, when I remove the app from sale (developer removed from sale) it is still in my “menage apps screen”, how can I put it back on sale? Does it need to go through a review process again?

Answer: No, just turn it on again by selecting which country you want it in

Not terribly useful as it didn’t tell you how you select countries.

Back to the Apple docs.

Scanning through it I found, around 3/4 of the way down the document (around 11 pages of text) I finally found the information I needed, confusingly under Removing an App from Sale.

You have to go into Pricing and Availability, select “Available in all territories” and Save.

This was a pretty trivial example but shows off some of the complexity that can accumulate. A simple thing like ticking a box took around an hour to do.

What happens when a browser requests a web page like example.com?

  1. you enter example.com
  2. your browser will do a DNS look up for the IP address of this URL. This process is:
    1. check browser cache – the OS does not tell the browser the TTL for each DNS record so the browser caches DNS records itself for 2 – 30 minutes
    2. check OS cache – e.g. gethostbyname on the Mac and Windows
    3. check router cache
    4. check ISP DNS cache
    5. recursive search
      1. root nameserver
      2. .com nameserver
      3. example.com nameserver
  3. browser sends a GET HTTP request to the web server along with other headers. e.g.
    1. Host: example.com
    2. Accept: types of responses it will accept
    3. Connection: TCP connection
    4. Cookie:
  4.  server probably responds with a 301 Permanent redirect to www.example.com
  5. browser sends out another request to www.example.com
  6.  server handles the request
    1. i.e. it reads the request, any parameters and cookies
  7. server sends back an HTML response which consists of
    1. HTTP/1.1 200 OK header
    2. Cache-Control:
    3. Expires:
    4. Pragma:
    5. Content-Encoding: gzip
    6. Content-Type: text/html; charset=utf-8
    7. Date:
    8. Byte blob which the Content-Encoding section tells you is gzip’d.
    9. Decompress the blob to get the HTML
  8. Browser renders the HTML as it starts receiving it
  9. Browser sends requests for objects embedded in the HTML. E.g.
    1. images
    2. CSS
    3. JS
  10. Browser sends further AJAX

See  Hypertext Transfer Protocol — HTTP/1.1 (RFC 2616): https://tools.ietf.org/html/rfc2616

Restarting Apache

This is my current Linux gripe.

Apache has been around for over 20 years now.

Surely, Linux distributions could have arrived at some form of consistency by now.

No!

CentOS
systemctl restart httpd.service

Ubuntu
sudo restart apache2
OR
sudo service apache2 restart

 

Not only is the way you restart the daemon different but even the name used for Apache is different.

Un-f**g-believeable!

what’s a good dbm for a phone call (GSM or UMTS)

Basically, for GSM:
-105 to -100 = Bad/drop call
-99 to -90 = Getting bad/signal may break up
-89 to -80 = OK/shouldn’t have problems, but maybe
-79 to -65 = Good
Over -65 = Excellent

More here:

http://www.howardforums.com/showthread.php/1523050-dBm-signal-strength-on-GSM-acceptable-numbers

And how do you find the dbm of your phone signal?

On Android, *#*#info#*#*

i.e. *#*#4636#*#*

It will automatically go into a very detailed set of information screens. No need to tap the Dial button.

https://www.quora.com/Which-brand-of-mobile-phone-do-real-techies-use-and-why/answer/Leonid-S.-Knyshov?srid=3soS

Software avalanche – switch language level to JSX Harmony

I was playing around with some JavaScript in PHPStorm and got this message in yellow at the top of the IDE:

Switch language level to JSX Harmony

The options were Switch Dismiss Cog icon (which has Fix all Annotator Problems in File). After doing a search to see what would happen if I did switch I found very little. So, I decided to go down the rabbit hole and click Switch to see what changed.

Note: to set the language level back after Switching go to Preferences and search for “javascript language” and set it to ECMAScript 5.

screen-shot-2016-10-05-at-10-26-08-amhttp://www.snowcrash.eu/wp-content/uploads/2016/10/Screen-Shot-2016-10-05-at-10.26.08-AM-300x99.png 300w, http://www.snowcrash.eu/wp-content/uploads/2016/10/Screen-Shot-2016-10-05-at-10.26.08-AM-588x194.png 588w" sizes="(max-width: 730px) 100vw, 730px" />

When you select Switch, then you get the option (in Green now, just to confuse things further):

screen-shot-2016-10-05-at-10-19-25-amhttp://www.snowcrash.eu/wp-content/uploads/2016/10/Screen-Shot-2016-10-05-at-10.19.25-AM-300x7.png 300w, http://www.snowcrash.eu/wp-content/uploads/2016/10/Screen-Shot-2016-10-05-at-10.19.25-AM-768x19.png 768w, http://www.snowcrash.eu/wp-content/uploads/2016/10/Screen-Shot-2016-10-05-at-10.19.25-AM-588x15.png 588w, http://www.snowcrash.eu/wp-content/uploads/2016/10/Screen-Shot-2016-10-05-at-10.19.25-AM.png 1163w" sizes="(max-width: 474px) 100vw, 474px" />

File watcher ‘Babel’ is available for this file. Description: ‘Transpiles ECMAScript 6 code to ECMAScript 5’

Add watcher    Dismiss    Cog icon

with

screen-shot-2016-10-05-at-10-22-40-amhttp://www.snowcrash.eu/wp-content/uploads/2016/10/Screen-Shot-2016-10-05-at-10.22.40-AM-300x78.png 300w" sizes="(max-width: 340px) 100vw, 340px" />

  • Edit inspection profile setting
  • Fix all ‘File watcher available’ problems in file
  • Run inspection on …
  • Disable inspection

Given that I was actually in the middle of doing some Symfony programming, I decided to let sleeping dogs lie and set the language level back to ECMAScript 5.

PHP Annotations

Basically, think of docblocks.

The idea behind them originally was to provide documentation on code. E.g. what the parameters of a method were, etc. See these slides for an overview

However, PHP Annotations take this a bit further by letting you inject behaviour. E.g. you can use these docblock statements to change the functionality of the class (i.e. injecting behaviour) which can promote decoupling. E.g. see Symfony uses PHP Annotations for Routing and Doctrine uses PHP Annotations for metadata.

Take a look at these articles / slides:

An overview: http://www.slideshare.net/rdohms/annotations-in-php-they-exist

and a rather interesting counter argument to using them: https://r.je/php-annotations-are-an-abomination.html 

 

Terminal side-by-side with Chrome Dev Tools

It bugs me that you have to switch from your browser to your Terminal to do things like check git, start servers, etc. It’s context switching which is always bad for developer productivity. E.g. you switch but can’t find the right Terminal or can’t find the right browser window when you switch back.

So this looked promising: http://blog.dfilimonov.com/2013/09/12/devtools-terminal.html

It promises to embed a terminal right in your Dev Tools as a separate tab. I was a little sceptical given that the github code is several years old.

But it does! Very neat. However, I assume it hasn’t been updated in a long time because it’s rather clunky. i.e. you have to start a command line tool then login via a WebSocket in your Terminal tab (via the Hamburger menu).

All the same – pretty cool. But I’ll probably still be switching between Chrome, my PHPStorm IDE and Terminal for some time to come.

How to restart Apache on the Mac

Over the years, the command for restarting Apache has changed. E.g. here are some:

/etc/init.d/apache2 restart

rcapache2 restart

sudo service apache2 restart

sudo restart apache2

sudo apachectl restart

For even more options see:

http://www.cyberciti.biz/faq/ubuntu-linux-start-restart-stop-apache-web-server/

I finally got fed up of having to work out which option I needed and wrote a simple Mac menu bar app called Mescalero (after the Apache tribe) that lets you restart the Apache web server using a simple GUI. It’s in Beta right now. Sign up to join as a beta user or to be notified once it is formally released here: http://labs.abraxor.com/mescalero/