Having Second Thoughts About Framework7

Okay, so here is the problem I’m running into with Framework7: It isn’t obvious from reading the documentation how to create a single page application using Framework7 and VanillaJS. If you want to use React or Vue I believe you would just build your app however you would normally build a React or Vue application just using Framework7 components. However, if you are using VanilljaJS I can’t quite figure out how to go about integrating Framework7 into my project. Hmm… sort of stumped at the moment.

One answer would be to simply learn React. However, if I go ahead and learn react I might as well just start using React Native and ditch Framework7 altogether. Same thing with Ionic. Why learn AngularJS to use Ionic when I could just learn React Native?

So this is what I think I might try for now. Going to consider giving Ratchet a try even though it looks old, and use that to push out the redesigned version of the mobile app. Going with Ratchet I ought to be able to ship the updated version of the app quickly without having to learn a crazy amount of new technology, and I also should be able to reuse a lot of my existing codebase.

After I ship the new version of the app, I can abandon Apache Cordova and HTML5 for good, buy a new $1,500 mac mini, and dive into React and React Native and never look back!

 

HTML5 UI Frameworks for Apache Cordova & How to Start a new Framework7 Project from the CLI

This blog post is brought to you by the developer of BitBudget. BitBudget is an automated budgeting app for Android and iOS which syncs with your bank account and helps you avoid overspending. If you’d like to quit living paycheck-to-paycheck and get a better handle on your finances, download it today! https://bitbudget.io

Currently experiencing a little JavaScript fatigue tonight playing around with all of the various HTML5 User Interface Frameworks for building hybrid mobile apps using Apache Cordova. The main three or four I’ve been looking at are:

  1. Ionic
  2. Onsen UI
  3. Ratchet
  4. Framework7

Of the four it appears the Ionic framework has been around the longest and is the most established. However, Ionic is deeply tied to AngularJS so I’m scratching it off my list (Ionic will be supporting VanillaJS soon, but not quite yet).

Onsen UI is pretty established as well and I’m considering it as a backup plan should my Plan A fail.

Ratchet is from the guys at Bootstrap, and I really like how simple it looks. However, they haven’t made a commit to the repository in 3 years and the styling sort of looks “old”, so I think I’m going to scratch it from my list.

And that brings us to last but not least, Framework7. For whatever reason Framework7 isn’t listed on the Apache Cordova website as a suggested UI framework. However, it honestly looks like the best framework of the bunch. Going into this whole Apache Cordova project I imagined that there would be a really large community built around HTML5. But now after actually digging into HTML5 development, the options actually seem a bit limited. In the future I think I will likely dump HTML5 for something like React Native as the employment prospects appear much better, as do the size of the surrounding ecosystem. In fact, my former boss left last year to start a new job doing React Native, so maybe that’s where things are going?

Anywho… here is the one line command I need to try and remember to kick off my new Framework7 project:

$ framework7 create --ui

 

Death of a Cowboy

Once upon a time at an unpaved airstrip in Rhome, Texas, I used to skydive at small dropzone called Skydive Cowtown operated by a friend of mine named Scott Moore. This is the cautionary tale of his final flight as told by the National Transportation Safety Board:

On August 16, 2018, about 1935 central daylight time, a Cessna 172L airplane, N2893Q, impacted trees and terrain shortly after departure from Rhome Meadows Airport (T76), Rhome, Texas. The commercial pilot was fatally injured and the three passengers sustained serious injuries. The airplane sustained substantial damage. The airplane was registered to and operated by the pilot as a Title 14 Code of Federal Regulations (CFR) Part 91 personal flight. Visual meteorological conditions prevailed at the time of the accident and no flight plan had been filed. The local flight was departing T76 at the time of the accident.

A family member stated that the pilot retrieved the airplane from under the open-air shelter for “family fun night” and was giving rides to several family members. The family members stated that the pilot had flown the airplane about one week before the accident, then again two times immediately preceding the accident flight. The two preceding flights lasted about 20 minutes and 10 minutes respectively and the family members reported no anomalies with the airplane. They also stated that during the accident flight the airplane departed from the grass runway and did not gain much altitude before it banked hard to the left and then descended behind a tree line. Figure 1 represents a satellite map view of T76 and the accident location.

A pilot-rated witness reported that he saw the airplane depart T76 and then land soon after. The airplane taxied back and three passengers boarded with the engine still running. He stated that the airplane taxied back to the runway and started the takeoff roll, during which the engine did not sound like it was developing full power. The takeoff roll was longer than he expected, and once the airplane was airborne, the nose pitched up “very high” to about 50 ft above ground level (agl), then the nose came back down. The airplane flew low over the runway and appeared to accelerate until it pitched up and climbed to about 300 ft agl. The airplane then made a left turn and descended out of view.

On his most recent second-class medical certificate application, dated October 13, 2017, the pilot reported 8,000 total hours of flight experience and 125 hours in the preceding 6 months. The pilot’s wife stated that he did not log his recent flight time and had not recorded flights in his pilot logbook since the 1990s.

During the flight, the pilot was seated in the front right seat with a minor in the front left seat; an adult and minor were seated on the rear bench seat.

The pilot’s wife stated that the airplane’s maintenance logbooks were never received from the previous owner after the airplane was purchased in 2013. There was no documentation of maintenance performed since that time and no evidence that the airplane had received an annual inspection. A representative for the previous owner could not find the logbooks.

Family members stated that fuel cans, which were filled at another airport, were typically used to refill the airplane; those fuel cans were used to fuel the airplane on the night of the accident. The fuel cans were filled at an unknown time the week before the accident.

The airplane came to rest inverted on a southeast heading about 350 yards north of the departure end of runway 13 (see figure 2).

A postaccident examination of the accident site and wreckage revealed that the left wing leading edge was crushed aft and sustained impact damage, including evidence of tree strikes; the wing was partially separated from the fuselage and distorted aft. The right wing leading edge was crushed aft. All flight control cables were traced from their respective control surfaces to the cockpit controls with no separations or anomalies noted. The elevator trim tab was slightly nose-down but near neutral. The flaps were retracted. The right control yoke was separated at the control column, consistent with impact damage. The left control yoke was damaged consistent with impact.

There were no shoulder harnesses installed. The adult passenger reported that all occupants wore lap belts during the flight, and all four lap belts appeared to exhibit stretching in the webbing, indicative of the belts being worn during impact. The right rear lap belt was found separated from the eyelet at the floorboard. The left front seat was improperly safety-wired.

The fuel selector handle and valve were found in the OFF position; first responders reported that they moved the handle to OFF after the accident. A small amount of fuel was found in the firewall fuel strainer. The fuel was tested for water using water-detecting paste; the test was negative. The left and right wing fuel tanks were impact damaged, but about 2 gallons of fuel were drained from the tanks during the recovery process.

Two empty beer cans were found in the front left floorboard area near the rudder pedals. A rodent’s nest was found inside the left wing near an area that had been impact damaged. A significant amount of cobwebs were observed in the engine compartment. The airbox was clear of obstructions. A large mud dauber nest was found on the fins of the oil cooler. The ELT was found in place with battery acid residue on the outside of the case. An automotive battery was installed in the airplane.

The tip of the propeller spinner was bent but the rest of the spinner was mostly undamaged. The 2 propeller blades were straight and undamaged with no chordwise scratches or leading edge damage.

The gascolator fuel strainer was disassembled and organic debris similar to insect cocoons was found inside the strainer screen (see figure 3). The strainer bowl was mostly full of blue-colored fuel consistent with 100LL aviation gasoline.

The main fuel line from the gascolator to the carburetor was a hydraulic hose manufactured in July 2013 and featured a Department of Transportation marking consistent with an automotive hydraulic hose.

Engine crankshaft and camshaft continuity was confirmed by manually rotating the propeller. Thumb suction and compression was obtained for each cylinder. Normal rocker and valve movement was observed and all accessory gears rotated at the back of the engine. The exhaust system sustained damage to the heat exchanger, which was breached as a result of the accident. All of the flame cones were deteriorated and missing.

The carburetor was removed and disassembled; the float chamber contained about 5 mL of fuel. The fuel was tested for water using water-detecting paste; the test was negative. Both magnetos were secure on their respective mounts. The ignition timing was verified at 25° before top dead center on the left magneto. The left magneto was actuated by rotating the propeller by hand, it produced spark at all outlet points. The right magneto was secure on its mount. The ignition timing was verified about 30° before top dead center. The right magneto was removed from its mount and rotated using an electric drill, it produced spark at all outlet points. The top spark plugs were removed and exhibited a color consistent with normal combustion. The oil filter did not display any information regarding the last time it was changed.

Southwestern Institute of Forensic Sciences, Dallas, Texas, completed an autopsy on the pilot and determined the cause of death was “blunt force injuries.” The autopsy discovered evidence of hypertensive and atherosclerotic cardiovascular disease, including cardiomegaly, left ventricular hypertrophy, a fusiform aneurysm in the right coronary artery, and moderate atherosclerosis of two other coronary arteries.

Toxicology testing performed by the FAA Forensic Sciences Laboratory identified ethanol in subclavian blood, vitreous fluid, and urine (0.154 gm/dL, 0.177 gm/dL, and 0.194 gm/dL respectively); and 0.0033 μg/mL of delta-9-tetrahydrocannabinol (THC) in the blood. THC’s active metabolite, 11-hydroxy-delta-9-THC, was not detected, but the inactive metabolite, carboxy-delta-9-THC, was detected at 0.0139 μg/mL. Both THC metabolites were detected in urine; 11-hydroxy-delta-9-THC at 0.0094 μg/mL and carboxy-delta-9-THC at 0.0346 μg/mL.

Ethanol is a social drug commonly consumed by drinking beer, wine, or liquor. Ethanol acts as a central nervous system depressant; it impairs judgment, psychomotor functioning, and vigilance. Effects of ethanol on aviators are generally well understood; it significantly impairs pilots’ performance, even at very low levels. Title 14 CFR Section 91.17 (a) prohibits any person from acting or attempting to act as a crewmember of a civil aircraft while having 0.040 gm/dL or more ethanol in the blood. Ethanol is water soluble, and after absorption it quickly and uniformly distributes throughout the body’s tissues and fluids. The distribution pattern parallels water content and blood supply of the tissue. A small amount of ethanol can be produced after death by microbial activity, usually in conjunction with other alcohols such as methanol; vitreous humor and urine do not suffer from such production. Postabsorption, vitreous humor has about 12% more ethanol than blood and urine about 25% more ethanol than blood.

THC is the primary psychoactive substance in marijuana, which is listed as a schedule I controlled substance. THC’s mood-altering effects include euphoria, relaxed inhibitions, disorientation, image distortion, and psychosis. THC is stored in fatty tissues and can be released back into the blood long after consumption. While the psychoactive effects may last for a few hours, THC may be detected in the blood for days or weeks. Low THC levels of a few nanograms per milliliter in blood can result from relatively recent use (e.g., smoking within 1 to 3 hours) when some slight or even moderate impairment is likely to be present, or it can result from chronic use where no recent ingestion has occurred and no impairment is present. Thus, the level of THC in the blood and level of impairment do not appear to be closely related. See the NTSB Medical Factual Report in the public docket for additional information and references.

 

Re-Writing MoneyPhone with Framework7 and a RESTful Web API using Python and Flask

This blog post is brought to you by the developer of BitBudget. BitBudget is an automated budgeting app for Android and iOS which syncs with your bank account and helps you avoid overspending. If you’d like to quit living paycheck-to-paycheck and get a better handle on your finances, download it today! https://bitbudget.io

Feeling pretty sleepy and about to nod off for the night. However I wanted to bookmark a few things here on the blog so I remember where to pickup on my day off getting started on the first big re-write of my app, MoneyPhone. For the first version of MoneyPhone I used TurboLinks.js to give the app the look and feel of a single page application, but actually did all of the rendering server-side using Flask to spit out HTML & JavaScript which was then loaded via AJAX using TurboLinks, giving the appearance of a single page application. However, for this new re-write I would really like to use Framework7 to build the UI. Unfortunately, it appears Framework7 is a real honest to god single page application web framework, so this time around I’m going to need my server to spit out JSON data instead of HTML and JavaScript. Luckily, it appears doing this with Python and Flask using simple dictionaries and the Response class which comes with Flask appears to be relatively simple and straight forward:

# TODO: Learn Framework7

# TODO: Implement a RESTful Web API with Python & Flask

 

How to use Python Mode for Processing in the Trinket.io Web Based Coding Environment

This blog post is brought to you by the developer of BitBudget. BitBudget is an automated budgeting app for Android and iOS which syncs with your bank account and helps you avoid overspending. If you’d like to quit living paycheck-to-paycheck and get a better handle on your finances, download it today! https://bitbudget.io

Quick little how-to on running processing code in the trinket.io web based on coding environment. You’ll need to add three extra lines of code to your project that aren’t normally necessary when programming in a traditional python environment when working with processing on trinket.io. First remember to import sin from math and import all from processing. Last, you will need to call run() as the last line in your script (code example by Peter Farrell from his book Math Adventures with Python):

# NOTE: To run processing in the trinket.io environment,
# you need to import sin from math and import all from
# processing. Also, make sure to call run() at the very
# end of your python script!
# Code by Peter Farrell from his book
# Math Adventures with Python
from math import sin
from processing import *
#CircleSineWave.pyde
r1 = 100 #radius of big circle
r2 = 10 #radius of small circle
t = 0 #time variable
circleList = []
def setup():
size(600,600)
def draw():
global t, circleList
background(200)
#move to left-center of screen
translate(width/4,height/2)
noFill() #don't color in the circle
stroke(0) #black outline
ellipse(0,0,2*r1,2*r1)
#circling ellipse:
fill(255,0,0) #red
y = r1*sin(t)
x = r1*cos(t)
#add point to list:
circleList.insert(0,y)
ellipse(x,y,r2,r2)
stroke(0,255,0) #green for the line
line(x,y,200,y)
fill(0,255,0) #green for the ellipse
ellipse(200,y,10,10)
if len(circleList)>300:
circleList.remove(circleList[-1])
#loop over circleList to leave a trail:
for i,c in enumerate(circleList):
#small circle for trail:
ellipse(200+i,c,5,5)
t += 0.05
# Remember to call run() at the very end of your script!
run()
 

Learn HTML, CSS, & JavaScript in 60 Minutes

HTML/CSS/JavaScript tutorial for use teaching my students @ theCoderSchool:

 

How to Get the Current Year, Month, and Day as Integers in Python 3 using the datetime Module

This blog post is brought to you by the developer of BitBudget. BitBudget is an automated budgeting app for Android and iOS which syncs with your bank account and helps you avoid overspending. If you’d like to quit living paycheck-to-paycheck and get a better handle on your finances, download it today! https://bitbudget.io

Currently working on a project where I need to get the current year, month, and day as integers in Python 3, and noticed that the #1 ranked Google search result for my search resulted in an old answer written in Python 2. While I guess it’s not really a big deal, here is my updated Python 3 code (nothing is different other than the print statements, lol):

# REFERENCE: https://bit.ly/2JtjSto
import datetime
now = datetime.datetime.now()
print(now.year)
print(now.month)
print(now.day)
 

How to Get Year, Month, and Day as Integers from an ISO 8601 Formatted Date String in Python 3 with dateutil

This blog post is brought to you by the developer of BitBudget. BitBudget is an automated budgeting app for Android and iOS which syncs with your bank account and helps you avoid overspending. If you’d like to quit living paycheck-to-paycheck and get a better handle on your finances, download it today! https://bitbudget.io

I’m currently working with the Plaid Banking API and need to convert the ISO 8601 formatted date strings returned by the API into easy to work with integers. While I considered writing my own code to handle this, after a quick Google search I found that this is quite easy to do in Python using the dateutil module. So far I’ve only run this code in the repl.it web based programming environment, but I believe this module can be easily installed with the pip package manager by running something like:

$ pip install python-dateutil

The code snippet below mostly comes from a blog post on CodeYarns.com titled How to convert datetime to and from ISO 8601 string, but I did add the parts which I needed specifically (year, month, day):

# REFERENCE: https://bit.ly/2xLIh6I
import dateutil.parser
# Datestring in ISO 8601 format
datetime_str = "2019-01-23T06:17:59.273519"
# Convert to datetime object
some_datetime_obj = dateutil.parser.parse(datetime_str)
# Get Year, Month, and Day as integers
print(some_datetime_obj.year)
print(some_datetime_obj.month)
print(some_datetime_obj.day)
 

Robert Green and The Laws of Human Nature

This blog post is brought to you by the developer of BitBudget. BitBudget is an automated budgeting app for Android and iOS which syncs with your bank account and helps you avoid overspending. If you’d like to quit living paycheck-to-paycheck and get a better handle on your finances, download it today! https://bitbudget.io

Stumbled upon this awesome talk at Google tonight on YouTube and just wanted to bookmark it here on the blog so I don’t forget about it.

 

MoneyPhone Support

Dear User,

My name’s Topher Pedersen, founder and developer of MoneyPhone Personal Finance. If you are in need of support, first try simply pressing the nifty chat icon in the bottom right hand corner of the app. Or if the matter is more urgent, simply give us a call–

Support Line: +1 (469) 261-0727

Or send us an email–

Email: chris@topherpedersen.com

Best regards,

Topher Pedersen, founder @ MoneyPhone