Just found out this lovely tidbit today that IE 11 has decided to drop MSIE from its user-agent. That means that if you need to detect any version of IE, you’ll need to use a different regular expression.
This is what I came up with for my use case. The MSIE part captures <= 10 and the Trident part should capture 11+.
Just a note for myself here, I always forget this one. If you’ve made a change to an apache configuration file for a plesk website, you need to run this command to tell Plesk about it.
This is just a quick tip. Let’s say that you’ve got “http://www.google.com/search?q=1234″ in cell B1 in Excel, but you want to display “google.com”. You can use this formula:
=SUBSTITUTE(MID(B1, FIND(“//”, B1)+2, FIND(“/”, B1, FIND(“//”, B1)+2)-8), “www.”, “”)
This isn’t perfect as it assumes you always use “http://”, but it works pretty well for a quick, easy fix.
In general, you should always be forward thinking when creating your database schema, but it’s impossible to foresee every business need for every aspect of every project. In some cases, you’ll have to alter your table structure – maybe add, drop, or alter a column. Read more…
I just posted benchmarks for checking for an empty string that I ran when looking to improve the efficiency of an application. Another simple benchmark I ran was for ways to check if an array is empty.
Like strings, there are a ton of ways to check if am array is empty. These here are not exhaustive, but a few that I chose to test:
- $array == false
- count($array) == 0
- $array == array()