27.xhtml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. h t t :: / / t /
  4. h t t :: // // t //
  5. h ttttt ttttt ppppp sssss // // y y sssss ttttt //
  6. hhhh t t p p s // // y y s t //
  7. h hh t t ppppp sssss // // yyyyy sssss t //
  8. h h t t p s :: / / y .. s t .. /
  9. h h t t p sssss :: / / yyyyy .. sssss t .. /
  10. <https://y.st./>
  11. Copyright © 2016 Alex Yst <mailto:copyright@y.st>
  12. This program is free software: you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation, either version 3 of the License, or
  15. (at your option) any later version.
  16. This program is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. GNU General Public License for more details.
  20. You should have received a copy of the GNU General Public License
  21. along with this program. If not, see <https://www.gnu.org./licenses/>.
  22. -->
  23. <!DOCTYPE html>
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <base href="https://y.st./en/weblog/2016/01-January/27.xhtml" />
  27. <title>Default port numbers &lt;https://y.st./en/weblog/2016/01-January/27.xhtml&gt;</title>
  28. <link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png" />
  29. <link rel="stylesheet" type="text/css" href="/link/basic.css" />
  30. <link rel="stylesheet" type="text/css" href="/link/site-specific.css" />
  31. <script type="text/javascript" src="/script/javascript.js" />
  32. <meta name="viewport" content="width=device-width" />
  33. </head>
  34. <body>
  35. <nav>
  36. <p>
  37. <a href="/en/">Home</a> |
  38. <a href="/en/a/about.xhtml">About</a> |
  39. <a href="/en/a/contact.xhtml">Contact</a> |
  40. <a href="/a/canary.txt">Canary</a> |
  41. <a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
  42. <a href="/en/opinion/">Opinions</a> |
  43. <a href="/en/coursework/">Coursework</a> |
  44. <a href="/en/law/">Law</a> |
  45. <a href="/en/a/links.xhtml">Links</a> |
  46. <a href="/en/weblog/2016/01-January/27.xhtml.asc">{this page}.asc</a>
  47. </p>
  48. <hr/>
  49. <p>
  50. Weblog index:
  51. <a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
  52. <a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
  53. <a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
  54. </p>
  55. <hr/>
  56. <p>
  57. Jump to entry:
  58. <a href="/en/weblog/2015/03-March/07.xhtml">&lt;&lt;First</a>
  59. <a rel="prev" href="/en/weblog/2016/01-January/26.xhtml">&lt;Previous</a>
  60. <a rel="next" href="/en/weblog/2016/01-January/28.xhtml">Next&gt;</a>
  61. <a href="/en/weblog/latest.xhtml">Latest&gt;&gt;</a>
  62. </p>
  63. <hr/>
  64. </nav>
  65. <header>
  66. <h1>Default port numbers</h1>
  67. <p>Day 00326: Wednesday, 2016 January 27</p>
  68. </header>
  69. <p>
  70. My <a href="https://marcwithac.bandcamp.com/album/unicorns-get-more-bacon"><abbr title="compact disc">CD</abbr> from Marc With a C</a> came in the mail today.
  71. 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.
  72. 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.
  73. It is a two-song forty-five <abbr title="revolutions per minute">RPM</abbr> vinyl record.
  74. Though the postal service had damaged the record&apos;s sheath, I found the record to be quite amusing.
  75. 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.
  76. </p>
  77. <p>
  78. I received the letter from the local community college saying that I have been accepted.
  79. 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.
  80. 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.
  81. If they have a problem with it, they can simply tell me again what the best date for me to drop by is.
  82. I will likely only be able to schedule a meeting anyway, so scheduling early sounds like a good thing.
  83. </p>
  84. <p>
  85. As the generic <abbr title="Uniform Resource Identifier">URI</abbr> normalization process includes removing the port from the <abbr title="Uniform Resource Identifier">URI</abbr> if it matches the scheme-specific default port, I need a list of default ports on hand just to perform generic <abbr title="Uniform Resource Identifier">URI</abbr> normalization.
  86. I decided to implement the list of <abbr title="Uniform Resource Identifier">URI</abbr> scheme default port numbers as a constant, but I quickly found that the constant&apos;s array was huge.
  87. I think that separating constants into their own files might be a better option than I had originally thought.
  88. In the past, constants could not hold arrays and holding a single value in each file seems like a waste.
  89. With arrays though, like values, or rather, values related to the same topic, can be implemented as arrays instead of scalar values.
  90. 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.
  91. </p>
  92. <p>
  93. I found a couple interesting schemes today.
  94. The first is the <a href="https://www.iana.org/assignments/uri-schemes/prov/adiumxtra">adiumxtra</a> scheme.
  95. 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 <abbr title="Hypertext Transfer Protocol">HTTP</abbr> scheme, but because it is technically a different scheme, Adium is able to set itself as the handler of <abbr title="Uniform Resource Identifier">URI</abbr>s using it, so hyperlinks can be set up that facilitate easy installation of plugins.
  96. I would try some experimenting, but <a href="https://adium.im/about/">Adium is only available for OS X</a>.
  97. Another interesting scheme that I ran across is the <a href="https://www.iana.org/assignments/uri-schemes/prov/apt">apt</a> scheme.
  98. Allegedly, this allows one to link to a package in a Debian repository.
  99. It does not seem to work on my machine, but it is worth using whenever I talk about Debian packages.
  100. </p>
  101. <p>
  102. On the topic of <abbr title="Uniform Resource Identifier">URI</abbr>s, I have something that I should really get out there.
  103. A while ago, I said that <abbr title="Hypertext Transfer Protocol Secure">HTTPS</abbr> and <abbr title="Hypertext Transfer Protocol">HTTP</abbr> <abbr title="Uniform Resource Identifier">URI</abbr>s that lack a path are technically invalid.
  104. By that, I meant that <code>https://example.com</code> is an invalid <abbr title="Uniform Resource Identifier">URI</abbr>, as it did not even include the <code>/</code> path.
  105. However, a few days ago, I found new information.
  106. That <abbr title="Uniform Resource Identifier">URI</abbr>, as well as other <abbr title="Hypertext Transfer Protocol Secure">HTTPS</abbr> and <abbr title="Hypertext Transfer Protocol">HTTP</abbr> <abbr title="Uniform Resource Identifier">URI</abbr>s that lack a trailing slash, are still valid.
  107. And why is this? Well, while it is true that every <abbr title="Uniform Resource Identifier">URI</abbr> <strong>*must*</strong> contain a path, that path can be blank.
  108. In the case of <abbr title="Uniform Resource Identifier">URI</abbr>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.
  109. 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.
  110. With my new <abbr title="Uniform Resource Identifier">URI</abbr>-parsing tools that I am working on, I may store blank-path <abbr title="Uniform Resource Identifier">URI</abbr>s in my database instead of single-slash path <abbr title="Uniform Resource Identifier">URI</abbr>s.
  111. </p>
  112. <p>
  113. It seems that on Saturday, I will be volunteering to be a pretend victim for an emergency preparedness educational meeting.
  114. On Sunday, I will likely be headed back to Springfield to do more cleaning and sorting.
  115. </p>
  116. <p>
  117. My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
  118. </p>
  119. <hr/>
  120. <p>
  121. Copyright © 2016 Alex Yst;
  122. You may modify and/or redistribute this document under the terms of the <a rel="license" href="/license/gpl-3.0-standalone.xhtml"><abbr title="GNU&apos;s Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
  123. If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
  124. My address is in the source comments near the top of this document.
  125. This license also applies to embedded content such as images.
  126. For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
  127. </p>
  128. <p>
  129. <abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
  130. This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2016%2F01-January%2F27.xhtml"><abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 5.1</a> specification and uses style sheets that conform to the <a href="http://jigsaw.w3.org./css-validator/validator?uri=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2016%2F01-January%2F27.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
  131. </p>
  132. </body>
  133. </html>