#100DaysOfReading – My Rules / Code returning soon

As part of the #100DaysOfX challenge, on 1/3/2018 I committed to the #100DaysOfReading challenge listed on their challenges page.  As of this writing there are no official rules specific to #100DaysOfReading , so I’m going to take the #100DaysOfX general rules:

  1. Work on your habit for minimum an hour every day for the next 100 days
  2. Tweet your progress every day with the #100DaysOfX hashtag and the hashtag of your chosen challenge
  3. Encourage/help at least 2 people in the challenge every day

To which I will add my own

  • Only book length works will count towards my reading time
    • Graphic novels count
    • Audiobooks count
  • During my challenge time I am aiming to read at least four books a month including:

Unlike like my #100DaysOfCode challenge, I will not be blogging each day’s progress here. I’ll tweet my progress. I may post book reviews after I’ve finished. If you’d like to see what I’ve read so far in 2018, visit my GoodReads Reading Challenge page.

For readers who have been following my #100DaysOfCode journey and wondered what’s happened since Day 77, I wanted to let you know that the need to take a trip within a trip led me to break my streak. I’m planning on recommitting to 100DaysOfCode with R1D1 once I return home. I’ll be starting by continuing work on my “National Archives Alaskana Explorer.”

Advertisements
Posted in books | Tagged , | Leave a comment

#100DaysOfCode Day 77: National Archives Progress / Coding Pause

NARAakProofOfConcept

Console log of fields that will be used in displaying recent Alaskana records from the US National Archives.

Day 77: December 28, 2017 – Time spent, 1 hour 15 minutes

Today’s Progress: Worked out sorting for National Archives Alaskana explorer, selected fields I needed to extract for project and verified I could pull them correctly via console logging.

Thoughts: I really cannot find enough good things to say about the JSON Handle Chrome extension. It really helps to pin down the paths of fields you need from the nested arrays and objects provided by some APIs such as the US National Archives.

I have plenty more to do on this project, even in the initial phase of trying to display the most recent Alaskana. I’ll need loops within loops to display records and their associated digital items. I want to look into paging results so people can see more records. It might be good to offer people a choice about seeing all the digital objects associated with a record. Maybe I’d display the first digital object and then provide a link to the catalog.

This is also going to be my last #100DaysOfCode entry for a bit. I’m currently travelling and my family is taking a side trip from here to visit good friends they want me to meet. Given the number of people who will be crammed into one house, I want to let go of the idea that I’ll have an uninterrupted hour of coding there. I’ll restart my R1 of #100DaysOfCode after I get back from the side trip on 1/2/2018. Happy coding all!

Links that helped me get stuff done

  1. JSON Handle Chrome Extension – https://chrome.google.com/webstore/detail/json-handle/iahnhfdhidomcpggpaimmmahffihkfnj
  2. NARA Interactive API documentation – https://catalog.archives.gov/interactivedocumentation

Link(s) to work

  1. National Archives Alaskana Explorer –  https://github.com/ddcornwall/nara-alaskana
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Days 75 and 76 – Wrestling with US Archives Data

Days 75 & 76: December 26 and 27, 2017 – Total Time spent, 2 hours 15 minutes

SPECIAL NOTE: Wonky home internet access kept me from blogging yesterday.

NARA-Extracted-Text

A special challenge in US National Archives Data – full text of items inside JSON requests

Today’s Progress: Continued examining US National Archives (NARA) API. Gained appreciation for how complicated NARA data is.

Thoughts: NARA data is very complicated. My goal is to pull out the most recently digitized items related to Alaska. I can get data of the NARA API. I can even get only online objects. But NARA appears to store the metadata about the digital objects separate from the descriptions of the physical items. As a result, if I limit my query to digital objects only, I get a result list with no meaningful descriptions. But so far, if I include descriptions, I have to accept descriptions without corresponding digital objects.

A possible further complication, at least for the user is that the data returned from NARA can include large amounts of text extracted from PDFs as well as user transcriptions. I’m guessing that will add to the download time for users.

I might want to narrow the scope of this project to just photographs and see if that helps. To get a sense of how complex NARA data can be, check out https://catalog.archives.gov/api/v1/?description=alaska%20digitization%20project, one of my experiments to get data out of the National Archives Search API. “Alaska Digitization Project” refers to a specific initiative to digitize materials formerly housed in Anchorage Alaska but which are now on file with the Seattle Field Office of NARA. It’s a bit of a cheat as there may be more digitized items of Alaskana beyond the Alaska Digitization Project, but I wanted a set of files I could be sure had digital surrogates.

On a personal note, I may have to restart 100 Days of Code soon because my family and I are taking a trip to a friend’s house this weekend. My wife and I will be on a couch in the living the living room and people we’re staying with have two small children. I don’t see how I get a coding hour a day out of that.

Links that helped me get stuff done

  1. NARA search API interactive documentation – https://catalog.archives.gov/interactivedocumentation (This is where to find the searchable/sortable fields.

Link(s) to work

  1. National Archives Alaskana Explorer –  https://github.com/ddcornwall/nara-alaskana
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 74: Weather Viewer Public / On to Online Alaskana

Day 74: December 25, 2017 – Time spent, 1 hour 10 minutes

Today’s Progress: Ported my Free Code Camp (FCC) Weather Explorer to CodePen. Started work on National Archives (NARA) Alaskana Explorer by examining the NARA Catalog API for search/export and examining a record for digitized Alaskana in detail. Made note of possibly sorting parameters.

Thoughts: I was pleasantly surprised that my CodePen worked the first time. The Weather Viewer is still rough around the edges, but I’m eager to put my newly developed API coding skills to work on a task I’ve dreamed about for at least a year – providing better access to Alaska related materials digitized by the US National Archives. In particular, I would like to code an app that will display the most recently digitized materials from the Archives. While there is no clear way to do this from the public NARA catalog, there seems to be promising approaches within the NARA catalog API. I’d also like to provide a very limited subject browse to digitized Alaskana. I established a GitHub repo to track my notes and eventual code. If you’d like to join me, drop me a line. Or just fork the repo and go your own way. Plenty of room for all.

Links that helped me get stuff done

  1. National Archives Catalog Search and Export – https://github.com/usnationalarchives/Catalog-API/blob/master/search_and_export.md

Link(s) to work

  1. nara-alaskana – https://github.com/ddcornwall/nara-alaskana/tree/master
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 73: Weather Viewer done except for CodePen

WeatherFullyFormatted.JPG

Day 73: December 24, 2017 – Time spent, 1 hour 20 minutes

Today’s Progress: Completed reformatting of weather data using “toFixed(n)” function to format numbers and a long “if / else if” statement to translate wind direction.

Thoughts: Today was another day of steady progress. A lot of my time was looking up conversion formulas and coding them into my project. I worked on my task list for the Free Code Camp (FCC) “Show the local weather” project. Here’s how it stood after yesterday:

  1. Display temperature in both C and F
  2. Display wind speed in both mps and mph
  3. Display pressure in inches and millibars
  4. Migrate to CodePen, since that is what Free Code Camp (FCC) asks for the project.
  5. Bonus – Show wind direction in terms of every day direction (i.e. North instead of 0 deg, etc)
  6. Bonus – Put in a static Google map

I accomplished everything on my list except migrating to CodePen and putting in a static Google map. I’ve decided to forgo the Google Map because my page takes awhile to load. Adding one more API call will just slow it down more.

I decided to NOT code a toggle button between C and F because it just doesn’t make sense to me to code a button for that and not the other metric measurements. It also doesn’t make sense to have three buttons. So I’m not going to do either. I think in a real life situation, I could convince my client not to insist on a C to F button.

So tomorrow (or possibly boxing day) the goal will be to migrate my project to CodePen and submit it to FCC. Then I’ll start studying the National Archives Catalog API to see if I have a chance of retrieving the most recently digitized photos with Alaska subjects.

Links that helped me get stuff done

  1. Conversion of Temperature – https://www.mathsisfun.com/temperature-conversion.html
  2. Pressure Conversion (National Weather Service) – https://www.weather.gov/media/epz/wxcalc/pressureConversion.pdf
  3. How do I convert m/s to mph? (Quora) – https://www.quora.com/How-do-I-convert-m-s-to-mph
  4. JavaScript Number Methods (w3schools) – https://www.w3schools.com/js/js_number_methods.asp
  5. Wind directions and degrees – http://snowfence.umn.edu/Components/winddirectionanddegreeswithouttable3.htm

Link(s) to work

  1. Show the local weather – https://www.freecodecamp.org/challenges/show-the-local-weather
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 72: Weather with Better Formatting

WeatherFormatted

Free Code Camp (FCC) formatted to Bootstrap Grid

Day 72: December 23, 2017 – Time spent, 1 hour 15 minutes

Today’s Progress: Reformatted weather display using Bootstrap Grid layout. Reformatted Sunrise and Sunset display so only the parts I wanted to display showed up.

Thoughts: I’m pleased with my programming progress so far, but my page is loading fairly slowly. I will need to see what I can do to optimize things after I’m done with my other tasks.

Speaking of tasks, here is my task list from yesterday:

  1. Make display more attractive. Try to make icon pop out more. Remember to use accessible contrasts
  2. Display temperature in both C and F (Consider button)
  3. Display wind speed in both mps and mph
  4. Display pressure in inches and millibars
  5. Display only the time part of sunrise and sunset. Bonus – display Date before showing either
  6. Bonus – Show wind direction in terms of everyday direction (i.e. North instead of 0 deg, etc)
  7. Bonus – Put in a static Google map

Today I felt like I accomplished #1 (nicer display) by using a grid display. I used the img height and width attributes to pump up the size of the icon. Some of the spacing could be better, but it’s a big improvement over my previous versions.

Thanks to the functions toLocaleTimeString, getMonth, getDate and getFullYear, I was able to resolve #5, displaying the date just once, and only showing the time part of sunrise and sunset. Quick note about getMonth() – it is a zero index function, so December shows up as 11. So I created a variable called month and set it to getMonth(sunrise)+1.

With these items taken care of, my revised task list looks like this:

  1. Display temperature in both C and F
  2. Display wind speed in both mps and mph
  3. Display pressure in inches and millibars
  4. Migrate to CodePen, since that is what Free Code Camp (FCC) asks for the project.
  5. Bonus – Show wind direction in terms of every day direction (i.e. North instead of 0 deg, etc)
  6. Bonus – Put in a static Google map

Links that helped me get stuff done

  1. HTML  img Tag (w3schools) – https://www.w3schools.com/tags/tag_img.asp
  2. extract time from datetime using javascript – https://stackoverflow.com/questions/15546292/extract-time-from-datetime-using-javascript
  3. Extract date and time from string using Javascript – https://stackoverflow.com/questions/14787271/extract-date-and-time-from-string-using-javascript
  4. JavaScript getMonth() Method (w3schools) – https://www.w3schools.com/jsref/jsref_getmonth.asp

Link(s) to work

  1. Show the Local Weather – https://www.freecodecamp.org/challenges/show-the-local-weather
Posted in Technology | Tagged | Leave a comment

#100DaysOfCode Day 71 : Weather Data Displayed, On to Formatting

weatherAllDataPlain

Sky status, weather conditions and sunrise and sunset times from FCC Show Local Weather Challenge

Day 71: December 22, 2017 – Time spent, 1 hour

Today’s Progress: Completed display of data for Free Code Camp (FCC) Show the Local Weather. Committed my index.html, style.css and script.js files to GitHub. Used JavaScript Date function to convert Unix timecodes into usable sunrise/sunset dates and times.

Thoughts: Another day of good progress without odd glitches. I’m a little grumbly that the FCC Weather API didn’t come with an explanation of fields and units. But by comparing what I got from my FCC weather station to what’s available on weather.gov (with a bit of an assist from Wolfram Alpha for speed calculations), I determined the units for different conditions are as follows:

  • Temperature: Celsius
  • Pressure: Millibars (mb)
  • Wind Speed: Meters per second

While FCC only seems to care about converting temperature, I’m planning on displaying all three of these metric measures both ways.

After reviewing what I have so far and comparing it to the user stories on the FCC challenge, plus some of my own desires, I came up with this list of tasks:

  1. Make display more attractive. Try to make icon pop out more. Remember to use accessible contrasts
  2. Display temperature in both C and F (Consider button)
  3. Display wind speed in both mps and mph
  4. Display pressure in inches and millibars
  5. Display only the time part of sunrise and sunset. Bonus – display Date before showing either
  6. Bonus – Show wind direction in terms of every day direction (i.e. North instead of 0 deg, etc)
  7. Bonus – Put in a static Google map

I’m not crazy about offering a button to toggle the temperature, but it is a business requirement.

Links that helped me get stuff done

  1. Sunrise and sunset calculations for api weather machine – https://forum.freecodecamp.org/t/sunrise-and-sunset-calculations-for-api-weather-machine/151949/3

Link(s) to work

  1. Show the Local Weather – https://www.freecodecamp.org/challenges/show-the-local-weather
Posted in Technology | Tagged | Leave a comment