Dijkstra’s algorithm in python

As others have pointed out, due to not using understandable variable names, it is almost impossible to debug your code. Following the wiki article about Dijkstra’s algorithm, one can implement it along these lines (and in a million other manners): This code is more verbous than necessary and I hope comparing your code with mine … Read more

Visual list of all installed fonts with respective pangram phrase?

“Open the Fonts dialog (Windows->Dockable Dialogs->Fonts) Right click any font in the list Choose ‘Render Font Map’ In the dialog that appears, leaving the ‘Filter (regexp)’ blank will list all your installed Fonts.” Source: http://gimpforums.com/thread-font-examples This forum thread clearly lists the steps for rendering a sample of each font in your GIMP library. I hope that this … Read more

Visual List of iOS Fonts?

Have you tried iOS Fonts? This gives you a visual of all of the available fonts with the ability to enter your own string of text to see how it would look. This doesn’t appear to have been updated for iOS 7 however but I am unaware of any additional fonts which have been added since … Read more

What is a slug?

A slug is a part of the URL when you are accessing a resource. Say you have a URL, such as the one below, that displays all of the cars in your system: When you would want to reference a particular car in your system, you would provide the following URL: Notice how the URL … Read more

Finding the index of an item in a list

Reference: Data Structures > More on Lists Caveats follow Note that while this is perhaps the cleanest way to answer the question as asked, index is a rather weak component of the list API, and I can’t remember the last time I used it in anger. It’s been pointed out to me in the comments that because this answer is heavily … Read more