What does __FILE__ mean?

The realpath() function gives you the file-system path, with any symbolic links and directory traversing (e.g. ../../) resolved. The dirname() function gives you just the directory, not the file within it. __FILE__ is a magic constant that gives you the filesystem path to the current .php file (the one that __FILE__ is in, not the one it’s included by if it’s an … Read more

What’s different between URI, request-URI and URL?

The URI standard is STD 66, which currently maps to RFC 3986. URI vs. URL Section 1.1.3 describes the difference between URIs and URLs (and URNs). Components Section 3 describes the components a URI can have. For the URI http://www.example.org:56789/a/b/c.txt?t=win&s=chess#para5 these would be: Scheme: http Authority: www.example.org:56789 User Information: not present Host: www.example.org Port: 56789 Path: /a/b/c.txt Query: t=win&s=chess Fragment: para5 request-URI The term “request-URI” is not defined … Read more

Shortest possible depth of a leaf in decision tree (comparison sorting algorithm)

The absolute best case happens when we just check every element and see that the data’s already sorted. This will result in n-1 comparisons and thus the leaf will have a depth of n-1. Practically, this happens for insertion sort (which isn’t all that good otherwise though). Does it change depending on the algorithm? Absolutely. The best case of an … Read more

Is it possible to embed animated GIFs in PDFs?

I haven’t tested it but apparently you can add quicktime animations to a pdf (no idea why). So the solution would be to export the animated gif to quicktime and add it to the pdf. Here the solution that apparently works: Open the GIF in Quicktime and save as MOV (Apparently it works with other … Read more

Check in / Check out in subversion

If you use AnkhSVN in Visual Studio, read its documentation. You may also want to try VisualSVN plug-in if there are issues with AnkhSVN Can someone clarify the steps required to check in / check out to subversion. With SVN you checkout from repository, make local changes, and commit them to the repository with svn commit command.