123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <?xml version="1.0" encoding="utf-8"?>
- <!--
-
- h t t :: / / t /
- h t t :: // // t //
- h ttttt ttttt ppppp sssss // // y y sssss ttttt //
- hhhh t t p p s // // y y s t //
- h hh t t ppppp sssss // // yyyyy sssss t //
- h h t t p s :: / / y .. s t .. /
- h h t t p sssss :: / / yyyyy .. sssss t .. /
-
- <https://y.st./>
- Copyright © 2016 Alex Yst <mailto:copyright@y.st>
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org./licenses/>.
- -->
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <base href="https://y.st./en/weblog/2016/11-November/27.xhtml" />
- <title>I figured out how to get include.d's new URI API implemented. <https://y.st./en/weblog/2016/11-November/27.xhtml></title>
- <link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png" />
- <link rel="stylesheet" type="text/css" href="/link/basic.css" />
- <link rel="stylesheet" type="text/css" href="/link/site-specific.css" />
- <script type="text/javascript" src="/script/javascript.js" />
- <meta name="viewport" content="width=device-width" />
- </head>
- <body>
- <nav>
- <p>
- <a href="/en/">Home</a> |
- <a href="/en/a/about.xhtml">About</a> |
- <a href="/en/a/contact.xhtml">Contact</a> |
- <a href="/a/canary.txt">Canary</a> |
- <a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
- <a href="/en/opinion/">Opinions</a> |
- <a href="/en/coursework/">Coursework</a> |
- <a href="/en/law/">Law</a> |
- <a href="/en/a/links.xhtml">Links</a> |
- <a href="/en/weblog/2016/11-November/27.xhtml.asc">{this page}.asc</a>
- </p>
- <hr/>
- <p>
- Weblog index:
- <a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
- <a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
- <a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
- </p>
- <hr/>
- <p>
- Jump to entry:
- <a href="/en/weblog/2015/03-March/07.xhtml"><<First</a>
- <a rel="prev" href="/en/weblog/2016/11-November/26.xhtml"><Previous</a>
- <a rel="next" href="/en/weblog/2016/11-November/28.xhtml">Next></a>
- <a href="/en/weblog/latest.xhtml">Latest>></a>
- </p>
- <hr/>
- </nav>
- <header>
- <h1>I figured out how to get include.d's new <abbr title="Uniform Resource Identifier">URI</abbr> <abbr title="application programming interface">API</abbr> implemented.</h1>
- <p>Day 00631: Sunday, 2016 November 27</p>
- </header>
- <img src="/img/CC_BY-SA_4.0/y.st./weblog/2016/11/27.jpg" alt="A small, flowered plant with an interesting leaf pattern" class="weblog-header-image" width="811" height="480" />
- <h2 id="general">General news</h2>
- <p>
- Vanessa's package arrived.
- While I can't say that I'm a fan of Amazon and their business practices, I can say this: unlike the Blair Candy Company, Amazon delivers what you order.
- </p>
- <p>
- One of the shift leaders tried to get me to cover a closing shift tomorrow, which because I already have an opening shift, would have meant that I would be working from open to close.
- I agreed to take the shift, despite not wanting such long hours, because I can't really afford to turn down hours when they come my way.
- However, the shift that needed to be covered had come from a shift leader.
- The other closing shift leader didn't want to replace that shift leader with a lower-ranking crew member, so I am off the hook.
- </p>
- <p>
- My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
- </p>
- <h2 id="dreams">Dream journal</h2>
- <p>
- I woke up in the middle of the night from a dream about horrific situations in emergency rooms and ambulances.
- Critical medical supplies were depleted, and patients had no hope of survival.
- However, due to quick thinking and improvisation, paramedics and other medical professionals were able to save these people anyway and prevent permanent damage to them.
- </p>
- <p>
- I went back to bed, and my alarm woke me from another dream.
- This time, President-elect Donald Trump was "down-voting" negative comments about themself online.
- However, it was heavily implied that by "down-voting", what was really meant was censoring and outright deleting.
- </p>
- <h2 id="include.d"><a href="https://git.volatile.ch./y.st./include.d/releases">include.d</a></h2>
- <p>
- I figured out what I needed to do with include.d's <abbr title="Uniform Resource Identifier">URI</abbr>-handling <abbr title="application programming interface">API</abbr>.
- Mostly, at least.
- I needed to have the constructor method set the properties directly instead of relying on other methods to do that.
- I also needed to replace those methods with normalization/validation methods that return the normalized value (or throw an exception if the string is invalid) instead of setting the value.
- I then needed to have child classes rely on the parent's constructor to set the properties.
- The tricky part was be getting the child class to perform its scheme-specific normalizations and validations while still allowing the parent class's constructor to do its thing.
- The child class's constructor needs to have already parsed the data to normalize it before allowing the parent class to touch it.
- Converting the data back to a string and passing it to the parent class to reparse it seems counterproductive.
- Likewise, I cannot simply have the child class overwrite the normalization/validation methods.
- After all, the parent class must <strong>*always*</strong> verify that the data conforms to <abbr title="Request for Comments">RFC</abbr> 3986.
- That functionality must not be allowed to be overwritten.
- I could have the parent class call both the child's normalization method and its own, but that means either always checking to see if a second normalizer exists or normalizing twice using the same method when using the parent class directly.
- I ended up setting up dummy normalization methods that do nothing, calling them every time, and allowing child classes to overwrite <strong>*those*</strong> without actually touching the parent's own normalization methods.
- </p>
- <p>
- I was planning to work on include.d tomorrow and work exclusively on my course essay today, but I couldn't resist trying to flesh out my new ideas for <code>\st\y\uri</code>'s <abbr title="application programming interface">API</abbr> to see if they were even feasible.
- I still have the <code>\st\y\uri\gopher</code> class to rewrite though.
- The rest of the rewrite was a success, and I don't anticipate any problems with this class.
- </p>
- <h2 id="apartment">Apartment hunting</h2>
- <p>
- I finally tested my cellular telephone's voice mailbox using a telephone at work, to make sure that messages can be left.
- No voicemail setup was necessary.
- Now, I can safely use this number while apartment hunting to avoid using the Google Voice number that might be disappearing on me next month.
- Tomorrow, I should try to update my application with the apartments that I've already submitted an application to.
- </p>
- <hr/>
- <p>
- Copyright © 2016 Alex Yst;
- 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's Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
- If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
- My address is in the source comments near the top of this document.
- This license also applies to embedded content such as images.
- For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
- </p>
- <p>
- <abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
- This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2016%2F11-November%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%2F11-November%2F27.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
- </p>
- </body>
- </html>
|