27.xhtml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * <https://y.st./>
  4. * Copyright © 2016 Alex Yst <mailto:copyright@y.st>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <https://www.gnu.org./licenses/>.
  18. **/
  19. $xhtml = array(
  20. 'title' => 'Default port numbers',
  21. 'body' => <<<END
  22. <p>
  23. My <a href="https://marcwithac.bandcamp.com/album/unicorns-get-more-bacon">$a[CD] from Marc With a C</a> came in the mail today.
  24. The large envelope read <q><span class="underline">DO</span> <span class="underline">NOT</span> <span class="underline">BEND</span>!!!</q> in full capital letters and underlines, but the postal service had managed to let it get bent anyway, damaging the contents.
  25. As it turns out, I did not need to order the vinyl version of the album to get the bonus for early adopters that had been hinted at, but I would need a record player to make use of the bonus.
  26. It is a two-song forty-five $a[RPM] vinyl record.
  27. Though the postal service had damaged the record&apos;s sheath, I found the record to be quite amusing.
  28. I do not recognize either of the songs on the record, but at some point when I have more time, I might look them up.
  29. </p>
  30. <p>
  31. I received the letter from the local community college saying that I have been accepted.
  32. The school told me to hold off a bit before asking for an appointment to review my credits and decide what courses I need to take, but I forget how long that they said that I should wait.
  33. I will be in the area on Monday as the clinic is very close to there, so I will probably drop by then, despite it probably being earlier than they wanted.
  34. If they have a problem with it, they can simply tell me again what the best date for me to drop by is.
  35. I will likely only be able to schedule a meeting anyway, so scheduling early sounds like a good thing.
  36. </p>
  37. <p>
  38. As the generic $a[URI] normalization process includes removing the port from the $a[URI] if it matches the scheme-specific default port, I need a list of default ports on hand just to perform generic $a[URI] normalization.
  39. I decided to implement the list of $a[URI] scheme default port numbers as a constant, but I quickly found that the constant&apos;s array was huge.
  40. I think that separating constants into their own files might be a better option than I had originally thought.
  41. In the past, constants could not hold arrays and holding a single value in each file seems like a waste.
  42. With arrays though, like values, or rather, values related to the same topic, can be implemented as arrays instead of scalar values.
  43. Not only does this allow single-constant files to make more sense, it also provides a much better grouping mechanism for related information that the previously-used constant name prefixes.
  44. </p>
  45. <p>
  46. I found a couple interesting schemes today.
  47. The first is the <a href="https://www.iana.org/assignments/uri-schemes/prov/adiumxtra">adiumxtra</a> scheme.
  48. No real information is available about how it works, but my best guess when looking at their website is that it works exactly like the $a[HTTP] scheme, but because it is technically a different scheme, Adium is able to set itself as the handler of $a[URI]s using it, so hyperlinks can be set up that facilitate easy installation of plugins.
  49. I would try some experimenting, but <a href="https://adium.im/about/">Adium is only available for OS X</a>.
  50. Another interesting scheme that I ran across is the <a href="https://www.iana.org/assignments/uri-schemes/prov/apt">apt</a> scheme.
  51. Allegedly, this allows one to link to a package in a Debian repository.
  52. It does not seem to work on my machine, but it is worth using whenever I talk about Debian packages.
  53. </p>
  54. <p>
  55. On the topic of $a[URI]s, I have something that I should really get out there.
  56. A while ago, I said that $a[HTTPS] and $a[HTTP] $a[URI]s that lack a path are technically invalid.
  57. By that, I meant that <code>https://example.com</code> is an invalid $a[URI], as it did not even include the <code>/</code> path.
  58. However, a few days ago, I found new information.
  59. That $a[URI], as well as other $a[HTTPS] and $a[HTTP] $a[URI]s that lack a trailing slash, are still valid.
  60. And why is this? Well, while it is true that every $a[URI] <strong>*must*</strong> contain a path, that path can be blank.
  61. In the case of $a[URI]s that contain an authority, the path must either be blank or begin with a slash, but blank paths are always acceptable unless the scheme defines otherwise.
  62. Many schemes seem to define a blank path as being equivalent to the a path consisting of a single slash, and that is the case with the <code>https:</code> and <code>http:</code> schemes.
  63. With my new $a[URI]-parsing tools that I am working on, I may store blank-path $a[URI]s in my database instead of single-slash path $a[URI]s.
  64. </p>
  65. <p>
  66. It seems that on Saturday, I will be volunteering to be a pretend victim for an emergency preparedness educational meeting.
  67. On Sunday, I will likely be headed back to Springfield to do more cleaning and sorting.
  68. </p>
  69. <p>
  70. My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
  71. </p>
  72. END
  73. );