Full Stack Developer, Speaker, Educator, & Thinkster.io Author.

Category: Uncategorized

Typescript: There are no integers! šŸ˜±

Typescript has a few basic types. One of which is the Number type. Number is meant to represent any and all numbers. What this means is the Number type is a floating-point value.

This usually is not a problem but is something you want to be aware of when performing math in Typescript. Coming from the C# .NET world where Integer and Float are two separate types, having only Number as a type can make you stop and think for a second.

I ran into this today doing some multiplication and division. Of course, I had forgotten Typescript Numbers were floating points. I did (505 * 42) / 100 which equals 212.1. Now in my C# mind, I assumed an all integer math equation would return me an integer. My number would be automatically truncated, I would get 212 as an integer.

Nope, this was the wrong assumption. Returned to me was 212.1. And it was causing all sorts of screwy things later on in my calculations. After finding the problem, a simple Math.floor() call saved the day.

But I want to write this post to help me remember. There is no integer type in Typescript only floating-point!

Space Explorer Alexa Skill

Recently I published Space Explorer my first ever Alexa Skill! I have been messing around with Alexa skill for a long time now but had never actually published anything.

Space Explorer can tell you how many people are in space right now and the names of those people. A simple easy first skill. Space Explorer is nothing new to the skills market but it is my first skill and I wanted to keep it simple.

The skill calls upon a simple api service that provides all the information needed. Possibly in the future I will add some features such as where the people are in space, what space crafts are in space, or where the International Space Station currently is.

Overall making a skill for Alexa is not too difficult and I hope to make more of them in the future.

Enable Space Explorer on your Alexa enabled devices here Space Explorer.

Space Explorer Alexa

My First Mobile App: Motorcycle Riding Weather

Motorcycle Riding Weather

Just recently I put my first app into the Android Play Store,Ā Motorcycle Riding Weather. A 2018 goal of mine was to release a mobile app, and I have achievedĀ that! It is a simple app where users manipulate settings to determine if the upcoming days will be good for riding their motorcycle.

I released the app as an MVP (Minimum Viable Product). It is barebones for right now. I plan is to continuously improve the app with more features and more riding settings to configure.

It was a fun experience putting together the MVP. I have taken some shortcuts in the code in places, and have a little bit of messy hard to extend the code. This gives me plenty of work to do in the coming months. But I released, I have something that provides value to users even in its most basic state.

Technology used

The app is 100% developed using Xamarin.Forms. I have only released the app on the Android Play Store for right now because that is the only app market I have paid to be on. Android’s $25 lifetime developer access is much more affordable to me compared to iOS’s $100 a year. Technically, my app works on iOS but I cannot see myself paying $100 a year right now.

Along with Xamarin.Forms I am using Prism 7 framework and .Net Standard 2.0. I had not had much experience with these latest versions. The features they provide make development more streamlined.

The Dark Sky API is what I use to all weather data. It has a free tier with plenty of API calls for my current needs. I found it to provide the right balance between up to date information and free APIĀ calls available.

Plans for improvement

Plenty of things need improving but a list that will change over time is below:

  • Add more configurable settings: Wind, Rain type, Snowfall, etc..
  • Ability to not consider certain timeframes in the riding conditions such as nighttime
  • Allow for more than just zip code to determine the location
  • Write Unit Test and UI Tests
  • Abstract out services instead of doing lots of work in view models.
  • IncorporateĀ more analytics events

 

Check out Motorcycle Riding Weather in the Play Store now! I look forward to posting my progress on the app as I release updates.

© 2020 Thomas Desmond

Theme by Anders NorenUp ↑