Trying To Read Nested Data From a JSON File

Over the last two evenings I have been attempting to read nested data. I have tried to parse the data and other methods but without success. I have browsed the web to try to find solutions but for now I am getting stuck. Learning is also about trial and error, and knowing where to find the right information. For now I am lost. At the end of this process I will be more self-sufficient.


Learning by watching courses is good, and we do make progress, but it doesn’t require us to think about problems in the same way. We learn to follow instructions but not problem solve, and that’s what I want to learn. So far I have spent two hours on this specific problem, and I could easily remove a few lines and it would no longer be nested. I will persevere.


Playing with Comments


Since I am trying and failing to accomplish what I am trying to accomplish I am now using comments to mark what I still need to achieve, whilst looking for solutions and ideas.


Prototypes and CSS


I have also continued studying prototypes, factories and more. I see some overlap between this topic and CSS. For those with experience and time both allow for more depth and complexity than is comfortable when you are starting out. The short version is that with prototypes and factories you can cut down on the lines of code in a project, making it easier to read, and lighter.


The Pandemic Continues


It is now the weekend but the pandemic is still alive and well. Governments are deciding not to do anything to stop the spread, preferring to tell people that for vaccinated people it’s no worse than the flu, whilst ignoring the fact that children from 0-18 have not been vaccinated. There is a certain degree of indifference by governments that is hard to observe. They expect the next few weeks to be difficult, and that’s as far as their sense of responsibility goes. It is a challenge not to be disappointed by this attitude.


Learning To Code By Building CMSs
|

Learning To Code By Building CMSs

It’s easy to use Facebook or other CMS every day without thinking about how the code works. This summer I have coded two CMS using Linkedin Learning. One of these CMS was running with PHP and MySQL and the other was running with Ruby On Rails and MySQL.


The PHP CMS


In the process I learned how to install MySQL, how to get MySQL and PHP to talk to each other. How to organise files between private and public folders on a web server and more. Getting MySQL to talk with the web server was a challenge that took a few days to get right.


With the PHP CMS I learned about arrays, about interacting between PHP and MySQL and I learned to be attentive to using the correct syntax. Sometimes though, a single typo would block my progress for a period of time. It wasn’t rare for me to compare the code I wrote with the code written by the instructor line by line to find my typos.


I could have cut and pasted the code but I found that simply typing the code character by character was enough to force me to read the code carefully. When I made typos it taught me to attentive to details as well as to be more aware of the syntax.


Ruby On Rails


Ruby on Rails was an interesting learning challenge. I got stuck before I even finished setting up the project. As a result of this I went back and followed a course on essential Ruby. This worked as a nice complement to what I learned from that point on.


During the project configuration process I got stuck because I created the project with the wrong database connection type. I left it on the default and when I tried to correct this I failed, and failed, and failed again. Eventually I decided to delete the application and create a new one, with the right database connection and this time it worked well.


The challenges I faced were that the Puma Server wouldn’t start because a gem was missing, that the CMS wouldn’t start because of a mistake in the routing file and more. Eventually I would restart the server but I spent a lot of time debugging.


One of the most persistant problems I had with Ruby on Rails is that it’s hundreds of lines of code across multiple files and although the error messages are obvious you need to learn to read them. For two or three days I couldn’t find what the error was, despite looking through every page and its code. Eventually I found that I had written “visible” and forgotten a “:visible”. That error crashed the Puma server consistently.


With Ruby On Rails, I learned to work within a framework. This knowledge is transferrable to working with other frameworks. I’ve gone from knowing how to install and use a CMS like WordPress, Joomla, and Drupal to learning how to create one and to understand how arrays and functions work. I have also learned how to think about security and how to use blowfish and other encryption technology to keep passwords etc. more secure.


With Ruby Gems I could work on projects of my own and be less reliant on other websites. One project I would like to work on is creating a heatmap of all my walking activities and the easiest way to do this would be to find some code and adapt it to have the functionality I desire.


The Next Step


The next step is to learn to use JavaScript. I will then know how to use HTML/PHP for content, CSS for layout and finally JS for interactivity.



2020 – The Golden Opportunity to Be A Recluse

2020 – The Golden Opportunity to be a Recluse. If you’ve ever wanted a reason not to be social then open society’s behaviour, in regards to the COVID-19 virus, has provided us with a fantastic opportunity to enjoy being reclusive.


During a normal Spring and Summer I would be driving to the mountains to hike, climb and enjoy via ferrata with people but this year those plans have been destroyed. This year we can’t share the same room as others to sleep. We can’t even eat within two meters of other people.


There are no handshakes, no hugs and no “bises”. This year if you live alone you’re without physical contact. This year, the more solitary you like to be, the stronger the appeal of such a year.


In a normal year if you were single or below a certain age you’d be pressured to go out and be social, rather than staying at home to work on projects, read books or otherwise be solitary. This year there is no pressure to go out on Thursday and Friday night, and there is no pressure to go out to do group activities during the weekend.


With its single minded desire to reopen too early society has destroyed any chance of a normal summer being possible. Until the 21st of June it looked as if Switzerland was three or four weeks away from the pandemic being over, or at least wonderfully under control. There was a brief window with just 10-20 infections a day.


Speaking as an idealist I believe that we were so close to Switzerland getting to tens of new cases a day but recently the seven-day average is back to 100 cases a day.


Silver Linings


Source: https://www.corona-data.ch/


One of the silver linings is that the number of ventilated people declined to zero for several days, the number of intensive hospital cases is staying low and finally, that the number of regular COVID-19 patients was in decline, until two days ago.


At its maxium number of active infections Switzerland was at 98 percent of ICU capacity. Two more percent and triage would have been required.


Depending on whether you work for the airport or think as an environmentalist Geneva airport expects to be at 19 percent of capacity this summer, due to so few people travelling at the moment. It’s great for the environment, but a shame for jobs.


Societal Self Harm


Speaking from a strictly theoretical point of view we have centuries of pandemics to look back on. We have books such as La Peste by Camus, to turn back to. In theory, we know what to do in the case of pandemics, and how to avoid them. We also know how to control them.


We know that in Medieval times villages would shut down to the outside world for weeks or months at a time. We know that ships were quarantined offshore. In some cases, places of infection were marked.


As we watch the current pandemic we get the impression that lessons were never learned. We get the impression that people never studied plagues and other epidemics and pandemics. We get the impression that people are flying blind. This is a shame.


It’s a shame because we are in the 21st century. We live in an age where we have thousands of hours of documentaries about plagues, disease and epidemics. We live in an age where people can get advice and information straight from medical health professionals. We live in an age where everything can be ordered online. We live in an age where being trapped at home does not mean having conversations has to stop. We live in an age where many of us are information workers.


In light of all of this it seems illogical that we would live through the worst pandemic in human history.


I have seen a lot of discussion about rights but responsibilities have been skirted. The responsibility to wear a mask, the responsibility to keep human to human interactions to a minimum, the responsibility to avoid people rather than expect them to make the effort to be safe.


The self-sacrifice of not going on holiday, the self-sacrifice of not going to sit in a park half a meter from others…


With everything that society, as a whole knows, it is a shame that the pandemic coalesced into such a serious problem because we had the tools and knowledge to ensure that it would be dealt with as swiftly as the epidemics we have already lived through, in our own lifetimes.


At its core Switzerland, until the 21st of June Switzerland was doing everything right, and to a serious degree it is still doing the right thing, with the number of ventilated people being at zero and the number of serious cases also dropping.


At it’s core my only issue is with having a third summer with limited opportunities to meet new people. As long as the pandemic is around it seems more logical to give in, and use dating apps, to meet new people, instead.


The Up-Skilling opportunity.


A few weeks ago I sad that I would try to create my own WordPress theme, but I overshot that goal by learning CSS and redesigning my entire website. I have learned to create a CMS from scratch using PHP and MySQL. Now I’m learning Ruby On Rails and it’s going well. Ruby on Rails looks like an intuitive framework to work with. I’m working on changing my career path.

The Walking Paradox
|

The Walking Paradox

Today I noticed how quiet the world, or at least the area in which I was walking, was. I saw very few cars, very few people walking, and very little noise from other people.


This doesn’t mean that people weren’t out and about. Although my route was for the most part deserted of people I did encounter crowds at two or three points. I think a man said “hello” but I ignored him for the cardinal sin of not walking single file, down a path, with his companion during the closing days of a pandemic.


“What does it matter?”, you may ask. I would love to do a group hike or a group Ferrata but I can’t because from a scientific point of view Switzerland is not yet clear of the virus. Meeting in groups of more than five is currently still forbidden. The groups I usually go with could be up to twelve people or more. I don’t know how long I will have to wait for the opportunity to do social activities once again.


A Fourteen Kilometre walk and I Crossed Paths With Just Two Other People.

A Fourteen Kilometre walk and I Crossed Paths With Just Two Other People.

Today I went for a fourteen Kilometre walk and I crossed paths with just two other people. It was a couple of runners and we crossed paths at just the right place as I could slip into a clearing, wait for them to pass and then continue on my way. I think this is the quietest walk I’ve been on in a while.


During the walk I saw that some fields had been harvested, that new barriers were being put up and that someone’s Mini adventure involved a bike in an open top Mini.


Before the daily walk, I continued studying CSS and after learning the basics I am learning how to fine-tune and control what CSS is doing with more granularity. The finished product is looking better and better.



Day 63 of Self-Isolation in Switzerland – A 15 Kilometre Loop

Day 63 of Self-Isolation in Switzerland – A 15 Kilometre Loop

Today I walked a 15-kilometre loop because I saw people walking two abreast and decided to retrace my steps a short distance before trying a new bifurcation. By the end of this walk, my legs were starting to get tired. I walked non stop for over two hours before a quick stop at a petrol station to get some drinks before heading home.


Before going on my walk I finished the CSS course on Linkedin Learning before starting another one on HTML. It’s not that I need to learn about HTML so much as I have a desire to complement what I already know.


After passive learning I re-worked some more pages on the HTML part of my website, adding CSS to two or three pages. As a result of what I have learned over the last two or three weeks doing the same thing as I did for the index page for another directory took half an hour or less. What I learned is sticking in my memory. I still cut and paste, but the process is much faster.


Links from HTML Essential Training by Jen Simmons


The more I look up and learn, the more ideas I have for how to modernise my website. For ages I wanted to keep my website as a museum of what the web used to be but as I made pages mobile friendly that desire to keep things the same has altered and now I want to modernise it.


From a visitor point of view this may be a waste of time, as certain parts of the website have little to no traffic. This doesn’t matter, because in the grand scheme of things every page I modernise gives me experience in dealing with CSS, Javascript, navigation design and more. I may be slow on the first pages but as I work my way through the website my efficiency will go up, and with that so will my employability.


We constantly need to learn skills and working on a website, rather than browsing social media, is a great way of doing so. As I looked through Flickr galleries I saw that some people have images of people re-enacting Roman soldiers and other people have images of Rome as it looks today. I could easily breath life back into that part of the website by contacting people and getting permission to share their images.


I’m glad I am working on my website as a project again. It is effectively filling my time, encouraging me to learn more, and getting me ready for a line of work I enjoy.


See you tomorrow.

Day 59 of Self-Isolation in Switzerland – Thunder As I Got Home
| |

Day 59 of Self-Isolation in Switzerland – Thunder As I Got Home

For once I walked in the drizzle, rather than the rain but I could hear thunder as I got home. I have almost reading Thirst: 2600 Miles to Home during this walk. Poetically I was listening to her about walking with a storm on its way whilst a storm was thundering over the Jura.


The rain became heavy just as I got close to home so today I am not drenched to the bone, and in need of a change of clothes like yesterday. I started today’s walk by running for the first two and a half kilometres, using the Guardian’s running podcast week three, for the fourth time. I didn’t run last week and I prefer to give my legs time to acclimate to running before pushing too much.


I spent most of my waking hours today working on the website. I’m still working on the front page and I think it’s almost ready to go live. It’s built with CSS, a little javascript, and grids. I have it behaving as I want it to behave. It looks good, whether viewed on a “desktop” or a mobile phone.


What I learned while working on the front page has helped. When I was making web pages mobile-friendly a week or two ago was bare bones and I didn’t change much. Now when I re-worked three or four pages today I used CSS where I could. I replaced tables with CSS and with pages where I had lists I used CSS to enhance lists. There is one page I still need to re-work, but I need to think about how to do something interesting.


See you tomorrow.

Day 52 Of Self-Isolation in Switzerland – More Cows, and Cascading Style Sheets
|

Day 52 Of Self-Isolation in Switzerland – More Cows, and Cascading Style Sheets

While some of us have gone fifty-two days without being within two meters of another person due to the pandemic others walk side by side down country lanes, forcing those walking alone to make the decision of whether to risk infecting the vulnerable couple or stepping off the road and waiting under an electricity pylon while the selfish people clear the way.


Untitled


In the image above we can clearly see two couples walking side by side. If these couples could walk single file then single people would be able to move around more freely. That’s why I went for walks in the rain, why I walked through muddy fields and paths that became streams. It’s the only way to avoid these people. Solitary confinement may be the reason this behaviour bothers me so much. It’s hard to see people that are not alone, when we are.


If I was walking in open fields at the moment I would have been charged at least two or three times by cows protecting their young. The reason for this is that they’re with calves that are just a week or three old. You can see them stand defensively and that they’re ready to charge you if you get too close.


Now would be a very bad time to walk into an enclosure. Now is a good time to be careful when hiking.


@richardazia

##switzerland ##calve ##veau ##jeune ##suisse

? Barden Bellas – joealbanese