Here’s a little Python script I wrote for converting leading tabs to spaces (two spaces per tab). We used this to make the indenting in all of our ColdFusion files consistent. Continue Reading »
Here’s the latest chart comparing Python 3 and Python 2 Stack Overflow posts. Continue Reading »
You have an opening for a Python developer in your company. Your company is awesome, so you expect to get a lot of applications. You only want to interview developers who have some experience writing object-oriented Python code. You don’t need to test the breadth of their immediate knowledge as much as their ability to get a project done using all the resources available to them.
Here’s an idea for a project you can give the candidates to demonstrate their proficiency with Python. Continue Reading »
Please share to see if we can get the NYTimes.com to change this.
Dear New York Times website,
Awhile back, you released a new website design that prevents readers like me from copying content from your articles. When I double-click on a word to highlight it, the page zooms. That’s not what I want or expect. If I need to zoom in on a web page, I can zoom. All modern browsers have built-in methods for changing the display size of page content. Continue Reading »
The short answer is in the title. Never use static methods in Python.
The initial intention of this post was to provide a simple and concrete use case for a static method in Python. I started with this 7-year conversation about static methods on StackOverflow, which seemed promising. But it doesn’t contain a single practical use case. And I think I know why. There are none.
Creating a static method is straightforward enough, but as Nathan Tregillus sort of asks in this post, the real question is why would you ever want to?
In answer to a similar question about when to use static methods in Java, Associate Prof not-just-yeti wrote this short-and-sweet explanation: Continue Reading »
If you are using XAMPP to do PHP development and you want to test your pages on your iPhone, you will need to:
- Find your local IP address
- Configure XAMPP to allow access from your mobile device (not necessary on Macs).
Continue Reading »
You’re trying to use XAMPP to do PHP development. But when you start Apache, you get this error. The chances are that it’s due to a blocked port. In this video, I’ll show you how to fix that error by changing the port that Apache uses. Below the video, I provide text instructions. Continue Reading »
We are about to launch a new website and, in doing so, we have restructured our URLs and used 301 redirects to point the old URL to the new URL. To make sure that we caught all the changes, we compiled a list of URLs on our old site using our sitemap and the Landing Page report from Google Analytics. We then used the Python’s request library to check all the URLs.
Using BeautifulSoup, you can easily check your own sitemap to make sure you don’t have any links pointing to missing pages. The code below shows how to do this using the NASA sitemap.
Continue Reading »
Python 3 came out in 2008. That’s eight whole years ago. This past month, April 2016, is the first month that there have been more Python 3-related questions on Stack Overflow than Python 2-related questions. It has taken a long time, but Python 3 finally seems to be getting as much usage as Python 2. It’ll be interesting to see if this is a tipping point and usage of Python 2 begins to plummet. Here’s the latest chart:
Continue Reading »
According to the W3C, HTML5 attribute values can be wrapped in single quotes or double quotes or no quotes at all. The same rules apply to HTML4, though some form of quotes is recommended. And in XHTML, values have to be wrapped in quotes, either single or double.
Dreamweaver CC 2015, out of the box, only wants double quotes around attribute values, which is weird. Misha Abesadze asked about this on the Adobe forum and Madhusudan N answered by describing how to fix Dreamweaver so that it doesn’t mark single-quoted attribute values with error messages. In the video below, we show the solution: Continue Reading »