TrickJarrett.com

Thursday, February 18th, 2021

« Previous Day Next Day »

Guinea declares Ebola epidemic: First deaths since 2016

This isn't great, hopefully it gets controlled very quickly and doesn't get worse

2/18/2021 8:53 am | | Tags: world news, pandemic, ebola

What to expect from the dramatic Mars Perseverance landing on Thursday

I am extremely excited, I checked yesterday and the landing is supposed to take place around 1pm my time and I am going to be riveted following it. Fingers crossed it goes as planned.

2/18/2021 8:53 am | | Tags: mars, nasa

'Any evidence for Planet Nine is gone': Scientists dispute probability of mystery planet

I remember the idea of Planet X as a kid. I assumed it wasn't real since we never got real evidence of it, but part of me always wondered if maybe it was out there. It seems the answer is no. Maybe it was a large comet that briefly got snagged by gravity but is gone now? No idea. An interesting read.

2/18/2021 8:54 am | | Tags: space

I have turned on the Mars mission's stream on YouTube and will be watching to follow Perseverance's attempted landing. I am incredibly nervous, this would be an amazing engineering and science feat if it works.

2/18/2021 11:22 am | | Tweeted | Tags: nasa, mars, space

Incredible


I watched the entire stream leading up to the landing, and grew increasingly nervous as everything went perfectly. I was afraid of some mysterious event and the loss of signal. With no clear way to know what happened. But instead it went smoothly and to plan. Simply incredible.

2/18/2021 1:24 pm | | Tags: nasa, space, mars

What Software Languages does NASA Prefer for Rockets?

Watching today's landing of the Perseverance on Mars, I was curious what it was coded in. A quick googling makes it seem like C is what they would be using on the rover. Fascinating stuff.

2/18/2021 1:24 pm | | Tags: nasa, programming

NASA Perseverance rover has Twitter account. Here's what it's saying.

A look at the team behind Perseverance's social posts.

2/18/2021 7:57 pm | | Tags: space, nasa

I continue my efforts to learn Python, tonight's project was to implement a calendar function. Python has a built in tool that does this, but it's about learning the language and implementing the tools for it. I was able to do it in about 60 minutes, with most of that being troubleshooting errors and learning some of the requirements for Python.

As I come from PHP, getting used to strict typing on variables is a big learning for me.

One of the common pitfalls I fall into is naming my files an obvious filename, which ends up being also something I import. For example, tonight's file was originally called 'calendar.py' but since I am importing the calendar library in python, it was erroring. So it got renamed to cal.py.

Here's the code I came up with:

import calendar
from datetime import datetime

date = input("Enter Date: ")

dt = datetime.strptime(date,"%m/%d/%Y")

header = datetime.strftime(dt,"%B %Y")

weekday = int(datetime.strftime(dt,"%w"))
date = int(datetime.strftime(dt,"%-d"))

month = int(datetime.strftime(dt,"%-m"))
year = int(datetime.strftime(dt,"%Y"))
firstDateOfMonth = int(datetime.strftime(datetime.strptime(str(month)+"/1/"+str(year),"%m/%d/%Y"),"%w"))

lengthOfMonth = int(calendar.monthrange(int(year),int(month))[1])

print(header)
print("[Sun][Mon][Tue][Wed][Thu][Fri][Sat]")

line = ""

if firstDateOfMonth > 0:
    k = 0
    while k  6:
        print(line)
        line = ""
        k = 0
    filler = " "
    if i == date:
        filler = "*"
    if i This code outputs a simple text calendar such as the following:
2/18/2021 10:56 pm | | Tags: learning, python, programming
« Previous Day Next Day »