New Features In WatchOS 9.3

Introduction:

On January 23rd 2023 AEDT, Apple released watchOS 9.3. In this blog I will be going through the new features in this watchOS. This watchOS is only compatible with Apple Watch Series 4, 5, 6, 7, 8, SE and Ultra. So if you own an Apple Watch Series 3 or earlier, unfortunately you can’t install this update.

This blog will help you decide if you should update to this latest watchOS or wait.

What are the new features?

Here is a summary of what is included in Apple watchOS 9.3. These are described in detail further down in this blog.

  • a new watch face called Unity Mosaic
  • faster connectivity to Apple AirPods
  • security updates
  • overall faster performance

The only downside that I have found so far about this release is that, for some people, the Noise app takes longer to load.

Diving deeper into the new features.

New watch face called Unity Mosaic:

Apple has added a new Unity Mosaic watch face to celebrate Black History month. Apple says this symbolises the vibrancy of black communities and the power of unity. When you raise your wrist, the watch face shows the time in red, black and green to represent the Pan-African flag. You can customise the face by adding any colours you want. You also have an option to keep the background on or off.

Credit: Photo is from The Apple Post

Faster connectivity to Apple Airpods

If you have Apple AirPods that you use with your Apple Watch, with this update, you will notice that they are much quicker to connect once you take them out of their case.

Credit: Photo is from Apple website

Security Updates:

This watchOS includes a lot of security updates to fix bugs and vulnerabilities. It is highly recommended that you install this watchOS version, to ensure your Apple Watch is safe from these.

Here is a list of bugs that this update fixes:

  • Apple Mobile File Integrity – an app may be able to access user-sensitive data.
  • ImageIO – processing an image may lead to a denial-of-service.
  • Kernel – an app may be able to leak sensitive kernel state.
  • Kernel – an app may be able to determine kernel memory layout.
  • Kernel – an app may be able to execute arbitrary code with kernel privileges.
  • Maps – an app may be able to bypass privacy preferences.
  • Safari – visiting a website may lead an app to an app denial-of-service.
  • ScreenTime – an app may be able to access information about a user’s contacts.
  • Weather – an app may be able to bypass privacy preferences.
  • WebKit – processing maliciously crafted web content may lead to arbitrary code execution.

More information about these security updates is available at https://support.apple.com/en-us/HT213599

How to update to the latest watchOS?

If you do decide to update to watchOS 9.3, here is how you can do it.

  1. First ensure your Apple Watch has at least 50% battery.
  2. On your Apple Watch, open Settings then click on General.
  3. Then press Software Update.
  4. You will see that watchOS 9.3 is ready to be installed. Scroll abit further down and you will see Install. Press this to start the installation process.
  5. The installation process will download the update and then install it. Once completed, your Apple Watch will restart.
  6. To confirm that you have updated to watchOS 9.3, on your Apple Watch, open Settings and then go to General. Then press About. Under Version you should see 9.3

Hopefully my blog has given you enough information to decide on if you should update to Apple watchOS 9.3 or wait for a while.

Stay tuned for more useful information in my upcoming blogs.

Apple MacBook Pro (M2 Pro, 2023) vs MacBook Air (M2, 2022): What’s the difference?

MacBook Air: Redesigned With M2 Chip, Available Now

A few days ago, Apple released the MacBook Pro with M2 Pro and M2 Max chips from $3199, last year they real MacBook Air (M2, 2022)

  • These photo is from the Macrumors website

Apple announced 2023’s MacBook Pro models will be MacBook Pro 14-inch and the MacBook Pro 16-inch, both of which are available with either the M2 Pro chip or the M2 Max chip.

Price:

The MacBook Pro models start at $3199, however these prices will increase depending one which one you select. The MacBook Air (M2, 2022) starts at $1733. Again, prices increase depending on the GPU, memory and storage options you select, but it’s of course cheaper than the MacBook Pro models regardless, as you would expect.

Design:

  • MacBook Pro (M2 Pro/Max, 2023): Aluminium, 1.6kg, two colours
  • MacBook Air (M2, 2022): Aluminium, 1.24kg, four colours

The 2023 MacBook Pro comes in a 14.2-inch model and a 16.2-inch model, while the MacBook Air (M2, 2022) is only available with a 13.6-inch display. If you want a larger MacBook therefore, you’ll need to be looking at the MacBook Pro 16-inch model.

The design is similar across the MacBook Pro models and the MacBook Air, however. They all come with a flat aluminium chassis, with rounded edges and a notch at the top of the display.

The MacBook Air (M2, 2022) comes in Space Grey, Silver, Starlight and Midnight colour options, while the MacBook Pro (M2 Pro, M2 Max, 2023) models come in Space Grey and Silver only.

The MacBook Pro models are also thicker and heavier than the MacBook Air. The MacBook Air (M2, 2022) measures 113 x 304.1 x 215mm and weighs 1.24kg, while the MacBook Pro (M2 Pro/Max, 2023) 14-inch model measures 155 x 312.6 x 221.1mm and weights 1.6kg.

Both the MacBook Air and MacBook Pro models come with Touch ID in the top right of the keyboard and they both offer the same back-lit Magic Keyboard with Force Touch trackpad below, so there will be no differences in terms of usage in this department.

Power and memory:

  • MacBook Pro (M2 Pro/Max, 2023): M2 Pro or M2 Max chip, up to 38-core GPU, up to 96GB memory, up to 8TB SSD
  • MacBook Air (M2, 2022): M2 chip, up to 10-core GPU, up to 24GB memory, up to 2TB SSD

It’s power and hardware where you’ll notice the difference between these models though.

The MacBook Pro models are offered with either the M2 Pro or the M2 Max chip. The base model of the M2 Pro chip has a 12-core CPU with 8 performance cores and four efficiency cores, a 19-core GPU, 16-core and a 200GB/s memory bandwidth.

The base model of the M2 Max chip also has a 12-core GPU with 8 performance cores and four efficiency cores, as well as a 16-core Neural Engine, but it is configurable up to a 38-core GPU, and there’s 400GB/s memory bandwidth. Both the M2 Pro and M2 Max chip models come with a Media engine that incorporates a video decode engine, video encode engine, ProRes encode and decode engine, as well as H.264, HEVC, ProRes and ProRes RAW.

MacBook Air (M2, 2022) has an 8-core CPU with 4 performance cores, 4 efficiency cores, up to 10-core GPU and a 16-core Neural Engine. It also has half the memory bandwidth of the M2 Pro chip at 100GB/s. The same media engine is on board as the Pro models though.

Elsewhere, memory options for the MacBook Pro models run from 16GB to a huge 96GB on the M2 Max models with 38-core GPU. Storage options start at 512SSD on the MacBook Pro models to 8TB.

The MacBook Air (M2, 2022) starts at 8GB memory, with options up to 24GB, while storage starts at 256GB SSD with options up to 2TB SSD.

Hardware:

  • MacBook Pro (M2 Pro/Max, 2023): Wi-Fi 6E, Bluetooth 5.3, six speaker array, 3x Thunderbolt 4 (USB-C), 1x HDMI, 1x SDXC card slot
  • MacBook Air (M2, 2022): Wi-Fi 6, Bluetooth 5, four speaker array, 2x Thunderbolt (USB 4) ports

There are a couple of differences when it comes to ports and audio capabilities between these models too, as well as connectivity.

The MacBook Pro models support Wi-Fi 6E – the first MacBook’s to do so – and Bluetooth 5.3, while the MacBook Air support Wi-Fi 6 and Bluetooth 5.0.

In terms of audio, the MacBook Pro models come with a six-speaker sound system with force-cancelling woofers, while the MacBook Air has a four-speaker array that offers wide stereo sound. It’s likely the MacBook Pro models will be better as this was one of the few areas the MacBook Air didn’t excel in.

Both the MacBook Pro models and the MacBook Air have support for Spatial Audio while playing music or video with Dolby Atmos on the built-in speakers though.

MacBook Pro models have three Thunderbolt 4 (USB-C) ports, a HDMI port and a SDXC card slot. The MacBook Air meanwhile only has two Thunderbolt / USB 4 ports. Both the MacBook Pro models and the MacBook Air have a 3.5mm audio port.

Both the MacBook Pro models and the MacBook Air have a 1080p FaceTime camera.

Battery:

  • MacBook Pro (M2 Pro/Max, 2023): 14in – up to 12 hours, 16in – up to 15 hours
  • MacBook Air (M2, 2022): Up to 12 hours

Apple has claimed the MacBook Pro models have the longest battery life of any Mac, which is great if true as the battery life on the MacBook Air (M2, 2022) is nothing short of exceptional.

When you break that down though, it’s the 16-inch model the company is talking about, with up to 15 hours of web browsing – the same as what is promised for the MacBook Air, compared to the 14-inch MacBook Pro model’s 12 hours.

All models use a MagSafe charger, though you get different power adapters in the box, depending on the model you choose. The MacBook Air (M2, 2022) comes with 30W USB-C Power Adapter as standard, or a 35W Dual USBC Port Compact Power Adapter with the 10-core GPU and 512GB storage model. It is fast-charge capable with a 67W USBC Power Adapter available, but that’s sold separately.

The MacBook Pro 14-inch comes with a 67W USB-C Power Adapter as standard, though a 96W adapter is included with M2 Pro with 12-core CPU or M2 Max models. The MacBook Pro 16-inch model meanwhile, comes with a 140W USB-C Power Adapter as standard.

Conclusion

the MacBook Pro models are the more powerful models compared to the MacBook Air, and you’ll also get display enhancements, more ports, better connectivity and better audio capabilities.

Apple Watch Ultra vs. Series 8 vs. SE: Which One Is Right for You?

Deciding on a new Apple Watch can be challenging, especially if you’re choosing between the $1299 Apple Watch Ultra $629 Apple Watch Series 8 or the $399 Apple Watch SE.

image from 9to5mac

Apple Watch Ultra vs Series 8, SE, and earlier:

Processor, storage, more

Last year, Apple used the same 64-bit dual-core processor in the Series 7 that launched in the Series 6. This year, the Apple Watch Ultra and Series 8 come with the S8 SiP 64-bit dual-core processor. It is roughly the same as the Series 7 and Series 6.

While you shouldn’t expect a noticeable speed bump from Series 6 or 7 to 8 or Ultra, if you’re coming from an earlier Apple Watch model you should notice a faster, more responsive watch.

Apple does say that the Series 8 is 20% faster than the Series 5 chip.

Another benefit, if you’re coming from a Series 3 or 4 to Ultra, Series 8, or SE gen 2, is a jump in storage to 32GB.

UltraSeries 8SE 2Series 7Series 6SE 1
SiP/ProcessorS8 SiP 64-bit dual-core processorS8 SiP 64-bit dual-core processorS8 SiP 64-bit dual-core processorS7 SiP 64-bit dual-core processorS6 SiP 64-bit dual-core processorS5 SiP 64-bit dual-core processor
Bluetooth5.35.35.35.05.05.0
Storage32GB32GB32GB32GB32GB32GB

Case and Display:

Apple Watch Ultra comes with the biggest case and display yet from Apple with 49mm. Apple says it’s 27% bigger than the display on Series 4-6/SE.

Meanwhile, Apple Watch Series 8 carries on with the same sizes that launched with Apple Watch Series 7. That’s 45 and 41mm cases and a larger display that’s 20% bigger than Series 4-6/SE and 50% larger than the Series 3 display.

UltraSeries 8SE 276SE 1
Case size49mm45/41mm44/40mm45/41mm44/40mm44/40mm
Display size410 x 502 pixels, 1164 sq mm396 x 484 pixels, 1143 sq mm (45mm model)368 x 448 pixels, 977 sq mm (44mm model)396 x 484 pixels, 1143 sq mm (45mm model)368 x 448 pixels, 977 sq mm (44mm model)368 x 448 pixels, 977 sq mm (44mm model)
Brightness2,000 nits1,000 nits1,000 nits1,000 nits1,000 nits1,0000 nits
Always-on displayYesYesNoYesYesNo
Sapphire crystal frontYesYes with steel models, no with aluminumNoYes with steel models, no with aluminumYes with steel models, no with aluminumNo

Battery life and charging

A major change with Apple Watch Ultra is the biggest battery yet in the lineup. That’s 36 hours of standard battery life and up to 60 hours of extended use with Low Power mode.

Notably, the Low Power mode will come to Apple Watch Series 4 and later and will double the battery of those models from 18 to 36 hours.

UltraSeries 8SE 276SE 1
Battery life – standard36 hours18 hours18 hours18 hours18 hours18 hours
Extended battery with Low Power mode60 hours36 hours36 hours36 hours36 hours36 hours
Charging0-80% in 45 minutes0-80% in 45 minutes0-80% in 45 minutes0-80% in 45 minutes0-80% in 60 minutes0-80% in 60 minutes
Apple Watch model/featuresUltraSeries 8SE 276SE 1
Customizable action buttonYesNoNoNoNoNo
ECG appYesYesNoYesYesNo
Blood Oxygen appYesYesNoYesYesNo
High/low heart rate notificationsYesYesYesYesYesYes
MIL-STD 810H certifiedYesNoNoNoNoNo
Precision dual-frequency GPSYesNoNoNoNoNo
New Compass app w/ waypoints + backtrackYesYesYesYesYesYes
IP6X dust resistantYesYesNoYesNoNo
Water resistant to 100mYesNoNoNoNoNo
Water resistant to 50mYesYesYesYesYesYes
Depth gauge + EN13319 certifiedYesNoNoNoNoNo
Oceanic+ app/dive computerYesNoNoNoNoNo
86-decibel sirenYesNoNoNoNoNo
Sleep trackingYesYesYesYesYesYes
Crash detectionYesYesYesNoNoNo
Fall detectionYesYesYesYesYesYes
Cycle tracking with temp sensingYesYesNoNoNoNo
Cycle tracking without temp sensingYesYesYesYes
Emergency SOSYesYesYesYEsYesYes

Thanks for reading my guide on Apple Watch Ultra vs Series 8 and SE!

Golden Gate Bridge

The Golden Gate Bridge is a suspension bridge spanning the Golden Gate, the one-mile-wide (1.6 km) strait connecting San Francisco Bay and the Pacific Ocean. The structure links the U.S. city of San Francisco, California—the northern tip of the San Francisco Peninsula—to Marin County, carrying both U.S. Route 101 and California State Route 1 across the strait. 

The construction for this historic landmark began on 5th January 1933 and ended on 27th May 1937. This landmark took 4 and 1/3 years to build. It cost at least $35 million to build a 811,500,00 KG bridge.

IOS 15 New Features

Introduction

On September 20th, Apple released a new IOS for IPhone that is IOS 15. Today in this blog I am going through all the new features in IOS15. Some of the new features are

  • Safari, Maps, Weather and Notes app redesigns
  • Text recognition in images
  • ID cards in Wallet app
  • “Focus” for reducing distractions
  • Spatial Audio and SharePlay in FaceTime calls
  • Added privacy features
  • Redesigned notifications

More information on the new features.

Safari, Maps, Weather and Notes app redesigns:

Apple has redesigned the layout of Safari, as well as adding new features like Tab Groups. On the iPad, Apple has redesigned the tab bar with new button shapes for how the tabs are arranged in the Safari toolbar. Apple changes where the search bar is, instead of the top it is at the bottom.

How Safari in iOS 15 works with new one-handed design - 9to5Mac

(this image was taken from https://9to5mac.com/2021/08/23/how-safari-in-ios-15-works/)

In IOS 15 Maps will include new details for commercial districts, buildings and more. Apple has added things like elevation, new road colors and labels, as well as lots of custom designed landmarks — for example, Sydney Harbor Bridge.

iOS 15 brings powerful new features to help users stay connected, focus,  explore and more - Apple (AU)

The Weather app has been redesigned in IOS 15, it has more graphical displays of weather data, full screen maps, and dynamic layouts that change weather. New animated backgrounds can now more accurately reflect the sun’s position and there are notifications to highlight when rain or snow starts and stops.

Hands-on: iOS 15 brings an all-new Weather app with maps, animations, and  more - 9to5Mac

The final app Apple redesigned is Notes.

Notes in IOS 15 has user-created tags to conveniently sort and categorize notes in new ways. There is a Tag Browser to tap combinations of tags and quickly view tagged notes. There are also new custom folders that automatically collect notes based on tags.

How to organize iPhone Notes with tags in iOS 15 - 9to5Mac

LeBron James The GOAT of Basketball

LeBron Raymone Jams was born on 30th December 1984 in Akron, Ohio, Cleveland, United States of America. He is a American professional basketball player for the Los Angeles Lakers in the NBA. He is widely considered the best basketball player in history. LeBron James is nicknamed ‘King James,’ ‘The L-Train’ and ‘The Akron Hammer’. The Akron Hammer has won 4 MVPs, 4 championships, 4 finals MVP and 3 All Star MVP and 2 olympic gold medals. LeBron has scored most points in the playoffs, 2nd most in regular season games, 7th in career assists and 10th in career rebounds. He has competed in 10 NBA finals included 8 concessively between 2011-2018. In 2021 he was selected in the NBA 75 team. In 2022 he was the first player in the 10k-10k-10k club (accomplishing 10 thousand or more points, assists and rebounds).

In high school he played basketball for Saint Vincent-Saint Mary high school. In the 2003 NBA draft he selected first overall pick by the Cleveland Cavaliers. In 2004 he was named Rookie of The Year. After failing to win a championship with Cleveland he left as a free agent to the Miami Heat in 2010. James won his first to 2 NBA championships in Miami also earning league MVP and finals MVP in both years. In 2004 he left the Miami Heat to re-sign with Cavaliers. He led his team to a title in 2016 against the Golden State Warriors. In 2018 James left the Cavaliers and joined the Lakers where he earned his 4th title in 2020.

Off the court, LeBron James achieved many things in wealth, movies, books and charity. He is the first basketball player to become a billionaire as an active player. LeBron has been in many books and movies here is a list of some:

  • Space Jam
  • Hustle
  • The LeBrons
  • SmallFoot
  • More than a Game.

Just to name a few.

Early Life:

LeBron was born 30th December 1984 in Akro, Ohio. His mum was Gloria Marie James. His father had a criminal recored and was not involved in his life. His life was hard growing up by moving apartments to apartments for his mum to find a job. Realising that her son would be better off in a more stable family environment, Gloria allowed him to move in with the family of Frank Walker, a local youth football coach who introduced James to basketball when he was nine years old. He played in basketball team in 5th grade.

High School Career:

As a freshman at Saint Vincent-Saint Mary James averaged 21 pointes and 6 rebounds per game. His team ( The Fighting Irish) went 27-0 making them the only high school basketball team in Ohio to finish undefeated. In his next season he averaged 25.2 points, 7.2 rebounds, 5.8 assists and 3.8 steals per game. The team went 26-1 repeating state champions. He was named Ohio Mr. Basketball and selected to the USA Today All USA First Team. Becoming the first sophomore to do either.

Before the start of his junior year, James was featured in Slam, an American basketball magazine, and writer Ryan Jones lauded him as possibly “the best high school basketball player in America right now”. During the season, James also appeared on the cover of Sports Illustrated, becoming the first high school basketball underclassman to do so. With averages of 29 points, 8.3 rebounds, 5.7 assists, and 3.3 steals per game, he was again named Ohio Mr. Basketball and selected to the USA Today All-USA First Team, and became the first junior to be named male basketball Gatorade National Player of the Year. St. Vincent–St. Mary finished the year with a 23–4 record, ending their season with a loss in the Division II championship game. Following the loss, James unsuccessfully petitioned for a change to the NBA’s draft eligibility rules in an attempt to enter the 2002 NBA draft.

Throughout his senior year, James and the Fighting Irish traveled around the country to play a number of nationally ranked teams, including a game on December 12, 2002, against Oak Hill Academy that was nationally televised on ESPN2.Time Warner Cable, looking to capitalise on James’s popularity, offered St. Vincent–St. Mary’s games to subscribers on a pay-per-view basis throughout the season. For the year, James averaged 31.6 points, 9.6 rebounds, 4.6 assists, and 3.4 steals per game, was named Ohio Mr. Basketball and selected to the USA Today All-USA First Team for an unprecedented third consecutive year, and was named Gatorade National Player of the Year for the second consecutive year. He participated in three year-end high school basketball all-star games—the EA Sports Roundball Classic, the Jordan Capital Classic, and the McDonald’s All-American Game—losing his National Collegiate Athletic Association (NCAA) eligibility and making it official that he would enter the 2003 NBA draft.

Professional Career:

2003-2010 Cleveland Cavaliers

2003-2004 Rookie of The Year:

The King was selected as the first overall pick in 2003 draft by his hometown Cleveland Cavaliers. On his first game against the Sacramento Kings he scored 25 points. He set a NBA record for most points by a player on debut. At the end of the 2003-2004 season he received Rookie of The Year Award. With averages of 20.9 points, 5.5 rebounds, and 5.9 assists per game, he also became the third player in league history to average at least 20 points, 5 rebounds, and 5 assists per game as a rookie. Cleveland ultimately finished the season 35–47, failing to make the playoffs despite an 18-game improvement over the previous year. He was the first Cavalier to win Rookie of the Year.

2004-2008 Rise to superstar:

In the 2004–05 season, James earned his first NBA All-Star Game selection, contributing 13 points, 8 rebounds, and 6 assists in a winning effort for the Eastern Conference.  On March 20, James scored 56 points against the Toronto Raptors, setting Cleveland’s new single-game points record.With final averages of 27.2 points, 7.4 rebounds, 7.2 assists, and 2.2 steals per game, he was named to his first All-NBA Team. Despite a 30–20 record to start the year, the Cavaliers again failed to make the playoffs, finishing the season 42–40.

At the 2006 All-Star Game, James led the East to victory with 29 points and was named the NBA All-Star Game Most Valuable Player.His final season averages were 31.4 points, 7 rebounds, and 6.6 assists per game, he also finished second in overall NBA Most Valuable Player Award voting to Steve Nash.Under James’s leadership, the Cavaliers qualified for the playoffs for the first time since 1998. In his postseason debut, James recorded a triple-double in a winning effort versus the Washington Wizards. In Game 3 of the series, he made the first game-winning shot of his career, making another in Game 5. Cleveland would go on to defeat the Wizards before being ousted by the Detroit Pistons in the second round.

In 2006–07, James’s averages declined to 27.3 points, 6.7 rebounds, 6 assists, and 1.6 steals per game. The Cavaliers finished the season with 50 wins for the second consecutive year and entered the playoffs as the East’s second seed.In Game 5 of the Eastern Conference Finals, James scored 48 points with 9 rebounds and 7 assists, scoring 29 of Cleveland’s last 30 points, including the game-winning layup with two seconds left in a double-overtime game against the Pistons. After the game, play-by-play announcer Marv Albert called the performance “one of the greatest moments in playoff history” and colour commentator Steve Kerr described it as “Jordan-esque”. In 2012, ESPN ranked the performance the fourth greatest in modern NBA playoff history. The Cavaliers went on to win Game 6 and claim their first-ever Eastern Conference championship, earning them a matchup with the San Antonio Spurs in the Finals.During the championship round, James struggled, averaging 22 points, 7.0 rebounds, and 6.8 assists per game on just 35.6 percent shooting, and Cleveland was eliminated in a sweep.

In February of the 2007–08 season, James was named All-Star Game MVP for the second time behind a 27-point, 8-rebound, and 9-assist performance. On March 21, he moved past Brad Daugherty as the Cavaliers’ all-time leading scorer in a game against the Raptors, doing so in over 100 less games than Daugherty. His 30 points per game were also the highest in the league, marking his first scoring title. Despite his individual accomplishments, Cleveland’s record fell from the year before to 45–37.Seeded fourth in the East entering the playoffs, the Cavaliers defeated the Wizards in the first round for the third consecutive season before being eliminated in seven games by the eventual-champion Boston Celtics in the next round. During the decisive seventh game in Boston, James scored 45 points. Cleveland got eliminated in 7 games.

2008-2010 MVP seasons:

At the end of the 2008-2009 season, James finished 2nd in the Defensive Player of The Year Award. He was named to the NBA All Defensive Team. He recorded 23 chase down blocks and a career high 93 blocks. He become the fourth player to led their team in points, rebounds, assists, steals and blocks in a single season. Cleveland went a franchise record 66-16. He averaged 8.4 points, 7.6 rebounds, 7.2 assists, 1.7 steals, and 1.2 blocks per game, James became the first Cavalier to win the MVP Award. In the playoffs, Cleveland swept the Detroit Pistons and Atlanta Hawks to earn a matchup against the Orlando Magic in the conference finals.n Game 1 of the series, James scored 49 points on 66 percent shooting in a losing effort for the Cavaliers. In Game 2, he hit a game-winner to tie the series at 1–1. Cleveland would lose the series in six games, and following the loss in Game 6, James immediately left the floor without shaking hands with his opponents, which was an act that many media members viewed as unsportsmanlike. For the series, he averaged 38.5 points, 8.3 rebounds, and 8 assists per game, finishing the postseason with a career playoff-high 35.3 points per game.

In February of the 2009–10 season, James was forced into a temporary point guard role following a series of injuries to players in the Cavaliers’ backcourt. Behind his leadership, Cleveland lost no momentum, finishing the year with the best record in the league for the second consecutive season.Due in part to his increased minutes as the Cavaliers’ primary ball handler, James increased his statistical production, averaging 29.7 points, 7.3 rebounds, 8.6 assists, 1.6 steals, and 1 block per game on 50 percent shooting en route to another MVP Award.To open the playoffs, Cleveland advanced past the Bulls to earn a matchup with the Celtics in the second round. James was heavily criticised for not playing well in Game 5 of the series, shooting only 20 percent on 14 shots and scoring 15 points. The team suffered its worst loss in franchise history, and at the conclusion of the game, James walked off the court to a smattering of boos from Cleveland’s home crowd.The Cavaliers were officially eliminated from the postseason in Game 6, with James posting 27 points, 19 rebounds, 10 assists, and 9 turnovers in the losing effort.

Miami Heat 2010-2014

The Decision:

James became an unrestricted free agent at 12:01 am EDT on July 1, 2010. During this time, he was contacted by several teams, including the Bulls, Los Angeles Clippers, Miami Heat, New York Knicks, New Jersey Nets, and Cavaliers.On July 8, he announced on a live ESPN special titled The Decision that he would sign with the Heat. The telecast was broadcast from the Boys & Girls Club of Greenwich, Connecticut and raised $2.5 million for the charity. An additional $3.5 million was raised from advertising revenue, which was donated to other charities.The day before the special, fellow free agents Chris Bosh and Dwyane Wade also announced that they would sign with Miami; reports later arose that back in 2006 the trio had discussed among themselves their upcoming 2010 free agencies. James decided to join with Bosh and Wade in part so that he could shoulder less of the offensive load; he thought that his improved teammates would give him a better chance of winning an NBA championship than had he stayed in Cleveland. Heat president Pat Riley played a major role in selling James on the idea of playing with Bosh and Wade.James would be relieved of the burden of scoring, and he thought he could be the first player since Oscar Robertson to average a triple-double in a season.

Upon leaving the Cavaliers, James drew intense criticism from sports analysts, executives, fans, and current and former players. The Decision itself was also scrutinised and viewed as unnecessary. Many thought that the prolonged wait for James’s choice was unprofessional as not even the teams courting him were aware of his decision until moments before the show. Upon learning that James would not be returning to Cleveland, Cavaliers owner Dan Gilbert published an open letter to fans in which he aggressively denounced James’s actions. Some angry fans of the team recorded videos of themselves burning his jersey. Former NBA players, including Michael Jordan and Magic Johnson, were also critical of James, condemning him for joining with Bosh and Wade in Miami and not trying to win a championship as “the man”.James drew further criticism in a September interview with when he claimed that race might have been a factor in the fallout from The Decision. As a result of his actions during the 2010 free agency period, he quickly gained a reputation as one of America’s most disliked athletes, which was a radical change from prior years. The phrase “taking my talents to South Beach” became a punch line for critics. In retrospect, James has expressed some regret over his handling of The Decision.

2010-2011 Year of Media and Fan Scruntiy:

James officially signed with the Heat on July 10, 2010, through a sign-and-trade deal which sent two second and two first round draft picks to the Cavaliers and gave the team the option to swap first round picks with the Heat in 2012. As part of the first player-created NBA superteam he became only the third reigning MVP to change teams and the first since Moses Malone in 1982.That evening, the Heat threw a welcome party for their new “big three” at the American Airlines Arena.

To begin the year, the Heat struggled to adjust to these new circumstances, going only 9–8 after 17 games.  On December 2, James faced his former team the Cavaliers in at their home stadium (Cleveland) for the first time since departing as a free agent.He scored 38 points and led Miami to a win while being booed every time he touched the ball. The Heat eventually turned their season around and finished as the East’s second seed, with James averaging 26.7 points, 7.5 rebounds, and 7 assists per game on 51 percent shooting.

In the Conference Semifinals, James and his teammates found themselves matched up with the Celtics for the second consecutive year. In Game 5, he scored Miami’s last ten points to help seal a series-clinching win, to advance to the finals.

The Heat eventually advanced to the Finals, where they were defeated by the Dallas Mavericks in six games. James received the brunt of the criticism for the loss, averaging only three points in fourth quarters in the series.His Finals scoring average of 17.8 points per game signified an 8.9-point drop from the regular season, the largest point drop-off in league history.

2011-2013 Back to Back Championships:

The 2011–12 season was delayed by the 2011 NBA lockout. That summer, James worked with Hakeem Olajuwon in order to improve his post up game. Years later, James revealed that during the lockout he received contract offers to play professional football from the Dallas Cowboys and the Seattle Seahawks and that he gave the idea of playing football serious consideration.

Humbled by the Heat’s loss to the Mavericks, the experience inspired James to leave behind the villain role that he had been embracing, which helped him regain a sense of joy on the court. Behind James’s expanded skillset, Miami began the year with a franchise-best 18–6 record.He was eventually named MVP for the third time, finishing with averages of 27.1 points, 7.9 rebounds, 6.2 assists, and 1.9 steals per game on 53 percent shooting.

In the second round of the playoffs, Miami temporarily lost Bosh to an abdominal injury and found themselves trailing the Indiana Pacers 2–1. James responded with a 40-point, 18-rebound, and 9-assist outing in Game 4 to help even the series.  Facing elimination in Game 6, James recorded 45 points and 15 rebounds to lead the Heat to victory in what The New York Times called a “career-defining performance”.[140] Miami won Game 7 to advance to the Finals, earning them a matchup with the Oklahoma City Thunder and James’s budding rival Kevin Durant. Late in Game 4 of the series, James hit a three-pointer to give the Heat a lead, helping them win the game despite missing time with leg cramps.[142] In Game 5, he registered a triple-double as Miami defeated Oklahoma City for their second-ever championship and James’s first championship. James was unanimously voted the Bill Russell NBA Finals Most Valuable Player with averages of 28.6 points, 10.2 rebounds, and 7.4 assists per game.[144] His full postseason run, in which he averaged 30.3 points, 9.7 rebounds, and 5.6 assists per game,


In the second round of the playoffs, Miami temporarily lost Bosh to an abdominal injury and found themselves trailing the Indiana Pacers 2–1. James responded with a 40-point, 18-rebound, and 9-assist outing in Game 4 to help even the series. Facing elimination in Game 6, James recorded 45 points and 15 rebounds to lead the Heat to victory in what The New York Times called a “career-defining performance”.Miami won Game 7 to advance to the Finals, earning them a matchup with the Oklahoma City Thunder and James’s budding rival Kevin Durant.Late in Game 4 of the series, James hit a three-pointer to give the Heat a lead, helping them win the game despite missing time with leg cramps.In Game 5, he registered a triple-double as Miami defeated Oklahoma City for their second-ever championship and James’s first championship.James was unanimously voted the Bill Russell NBA Finals Most Valuable Player with averages of 28.6 points, 10.2 rebounds, and 7.4 assists per game. His full postseason run, in which he averaged 30.3 points, 9.7 rebounds, and 5.6 assists per game,

In February of the 2012–13 season, James averaged 29.7 points and 7.8 assists per game while setting multiple shooting efficiency records. That same month, the Heat also began a 27-game winning streak, which is the third longest in NBA history. Miami eventually finished the year with a franchise and league best 66–16 record, and James was named MVP for the fourth time, falling just one vote shy of becoming the first player in NBA history to win the award unanimously. His final season averages were 26.8 points, 8 rebounds, 7.3 assists, and 1.7 steals per game on 56.5 percent shooting.

In Game 1 of the Conference Finals, James scored a buzzer-beating layup to give Miami a one-point victory against the Pacers. Despite these struggles, the Heat advanced to the Finals for a meeting with the Spurs, signifying a rematch for James from his first Finals six years earlier. At the beginning of the series, he was criticised for his lack of aggressiveness and poor shot selection as Miami fell behind 2–3. In Game 6, he recorded his second triple-double of the series, including 16 fourth quarter points, to lead the Heat to a comeback victory. In Game 7, he tied the Finals record for most points scored in a Game 7 victory, leading Miami over San Antonio with 37 points. He was named Finals MVP for the second straight season, averaging 25.3 points, 10.9 rebounds, 7 assists, and 2.3 steals per game for the championship round.

2013–2014: Final season in Miami

On March 3 of the 2013–14 season, James scored a career-high and franchise-record 61 points in a game against the Charlotte Bobcats. James finished the season with averages of 27.1 points, 6.9 rebounds, and 6.4 assists per game on 56.7 percent shooting. In the second round of the playoffs, he tied a career postseason-high by scoring 49 points in Game 4 against the Brooklyn Nets. In the next round, Miami defeated the Pacers to earn their fourth consecutive Finals berth, becoming one of only four teams in NBA history to do so. In Game 1 of the Finals, James missed most of the fourth quarter because of leg cramps, helping the Spurs take an early series lead. In Game 2, he led the Heat to a series-tying victory with 35 points on a 64 percent shooting rate. San Antonio eventually eliminated the Heat in five games, ending Miami’s quest for a three-peat. For the Finals, James averaged 28.2 points, 7.8 rebounds, and 2.0 steals per game.

Return to the Cavaliers (2014–2018)

2014–2016: Ending Cleveland’s championship drought:

In January of the 2014–15 season, James missed two weeks due to left knee and lower back strains, which at the time represented the longest stretch of missed games in his career. In total, he played a career-low 69 games and his final averages were 25.3 points, 6 rebounds, and 7.4 assists per game. In the second round of the playoffs, he hit a baseline jumper at the buzzer to give Cleveland a 2–2 series tie with the Bulls. In the Conference Finals, the Cavaliers defeated the Hawks to advance to the Finals, making James the first player since the 1960s to play in five consecutive Finals. For most of the Finals against the Golden State Warriors, Irving and Love were sidelined due to injury, giving James more offensive responsibilities. Behind his leadership, the Cavaliers opened the series with a 2–1 lead before being eliminated in six games. Despite the loss, he received serious consideration for the Finals MVP Award, averaging 35.8 points, 13.3 rebounds, and 8.8 assists per game for the championship round.

During the 2015–16 season, Cleveland finished the year with 57 wins and the best record in the East. James’s final averages were 25.3 points, 7.4 rebounds, and 6.8 assists per game on 52 percent shooting. In the playoffs, the Cavaliers advanced comfortably to the Finals, losing only two games en route to a rematch with the Warriors, who were coming off a record-setting 73-win season.

To begin the series, Cleveland fell behind 3–1, including two blowout losses. James responded by registering back-to-back 41 point games in Games 5 and 6, leading the Cavaliers to two consecutive wins to stave off elimination. In Game 7, he posted a triple-double and made a number of key plays, including “The Block” on Andre Iguodala, as Cleveland emerged victorious, winning the city’s first professional sports title in 52 years and becoming the first team in NBA history to come back from a 3–1 series deficit in the Finals.James became just the third player to record a triple-double in an NBA Finals Game 7, and behind series averages of 29.7 points, 11.3 rebounds, 8.9 assists, 2.3 blocks, and 2.6 steals per game, he also became the first player in league history to lead both teams in all five statistical categories for a playoff round, culminating in a unanimous Finals MVP selection.

2016–2018: End of second stint in Cleveland:

The 2016–17 season had lots of injuries and unexpected losses for the Cavaliers. The Cavaliers finished the season as the East’s second seed, with James averaging 26.4 points and career highs in rebounds (8.6), assists (8.7), and turnovers (4.1) per game.In Game 3 of the first round of the playoffs, he registered 41 points, 13 rebounds, and 12 assists against the Pacers, leading Cleveland to a comeback victory after trailing by 25 points at halftime, representing the largest halftime deficit overcome in NBA playoff history. In Game 5 of the Conference Finals against the Celtics, James scored 35 points and surpassed Michael Jordan as the league’s all-time postseason scoring leader. The Cavaliers won the game and the series, advancing to the Finals for the third consecutive time against the Warriors, who had signed James’s rival Kevin Durant during the off-season.  Behind averages of 33.6 points, 12 rebounds, and 10 assists per game, James became the first player to average a triple-double in the Finals, but Cleveland was defeated in five games.

Prior to the start of the 2017–18 season, the Cavaliers overhauled their roster by trading Kyrie Irving to the Celtics, who requested a trade in part because he no longer wanted to play with James. After a slow start to the year, Cleveland rebounded by winning 18 of 19 games in December. Their turnaround began with a victory over the Wizards on November 3 where James scored 57 points, which represented the second-highest point total of his career and tied a franchise record. James won his third NBA All-Star Game MVP award after posting 29 points, 10 rebounds, 8 assists, and several key plays to help Team LeBron win 148–145 over Team Curry. Following another round of trades in February, Cleveland returned to form and James reached a number of historical milestones; on March 30, he set an NBA record with 867 straight games scoring in double digits. James eventually finished the season with averages of 27.5 points, 8.6 rebounds, 9.2 assists, and 4.2 turnovers per game.

In the playoffs, James guided the Cavaliers to another Finals rematch with the Warriors. Along the way, he had some of the most memorable moments of his career, including a game-winning shot against the Pacers and another against the Raptors. In the first game of the Finals, James scored a playoff career-high 51 points, but Cleveland was defeated in overtime. The Cavaliers lost the series in four games, with James averaging 34 points, 8.5 rebounds, and 10 assists per game for the Finals.

Los Angeles Lakers (2018–present)

2018–2019: Injury and playoff miss:

The Lakers expected James to make them championship contenders again after having missed the playoffs since 2014 and not appearing in the Finals since 2010. Following his signing, the team rounded out their roster with a controversial collection of playmakers and veterans. To begin the 2018–19 season, the team struggled to find effective lineups and recorded only two wins through their first seven games.In November, they began a turnaround, which included two of James’s strongest performances of the season. On November 14, he registered 44 points, 10 rebounds, and nine assists in a victory against the Portland Trail Blazers.On November 18, he scored a season-high 51 points in a win over the Heat. After blowing out the Warriors on Christmas Day, Los Angeles improved their record to 20–14, but James suffered a groin injury, the first major injury of his career. He missed a then-career-high 17 consecutive games, and the Lakers fell out of playoff contention without him. The team was unable to recover and failed to qualify for the postseason after a 106–111 loss to the Brooklyn Nets on March 22, 2019, marking the first time that James missed the playoffs since 2005 and the first time he failed to reach the Finals since 2010.

2019–2020: Fourth NBA championship:

During the offseason, the Lakers hired Frank Vogel as their new head coach, and traded the majority of their young core to the Pelicans for superstar big man Anthony Davis. James immediately embraced Los Angeles’s much-improved roster by transforming his playing style, moving to full-time point guard, and competing with a more consistent defensive effort.Behind James’s leadership, the Lakers opened the 2019–20 season with a 17–2 record, matching the best start in franchise history. On January 25, 2020, James passed team legend Kobe Bryant for third on the all-time regular season scoring list. In early March, before the season was suspended due to the COVID-19 pandemic .James ended the regular season as the league leader in assists for the first time in his career, averaging 10.2 assists per game. James earned a record 16th All-NBA Team selection as part of the First Team, extending his record First Team selections to 13.

The Lakers entered the playoffs as the No. 1 seed in the West and advanced to the Finals convincingly, with only three total losses along the way. In Game 5 of the Conference Finals against the Nuggets, James helped clinch the conference championship by scoring a game-high 38 points, including 16 in the fourth quarter. In the Finals, James and his teammates found themselves matched up with his former team, the Heat, and quickly took control of the series with a 2–0 lead.In Game 5, James had his best statistical performance of the Finals with 40 points, 13 rebounds, and 7 assists in a memorable duel with Miami’s star player Jimmy Butler, but Los Angeles was ultimately defeated in a three-point game. The Lakers finally eliminated the Heat in Game 6, which earned James, who averaged 29.8 points, 11.8 rebounds, and 8.5 assists per game during the series, his fourth NBA championship and fourth Finals MVP award.  At 35 years and 287 days old, he became the second-oldest player in league history to win the award, and the only player in NBA history to win the award with three different franchises.

What Is The NBA and Strange Facts About The NBA

If you don’t no much about basketball or NBA read this blog to give you knowledge about the NBA

The National Basketball Association (NBA) is professional basketball league played in America and Canada. The league consists 30 teams. The NBA is the most popular sport in America and Canada. It was founded on the 6th of June 1946 in New York by Walter Brown.

What are the teams in the NBA

As I mentioned earlier the NBA has 30 teams. 15 in the Western Conference and 15 in the Eastern Conference. Here are the teams in each conference. 

Western ConferenceEastern Conference
Los Angeles LakersBoston Celtics
Golden State Warriors Miami Heat
Phoenix SunsPhiladelphia 76ers
Houston Rockets Cleveland Cavaliers
Oklahoma Thunder Milwaukee Bucks
Minnesota Timberwolves Brooklyn Nets
Memphis GrizzliesToronto Raptors
Utah JazzChicago Bulls
New Orleans PelicansNew York Knicks
San Antonio SpursAtlanta Hawks
Los Angeles ClippersOrlando Magic
Dallas MavericksWashington Wizards
Denver NuggetsCharlotte Hornets
Portland Trail BlazersIndiana Pacers
Sacremento KingsDetroit Pistons

Strange Facts about the NBA:

these facts were from clutch points
  • The Miami Heat used to play in the Western Conference

As we all know the Miami Heat play in the Eastern Conference but in 1987 they moved to the Western Conference.

  • Dwight Howard is a better 3pt shooter than Ben Simmons
  • Draymond Green has made more threes in a game than Kevin Durant. Prior to April 2nd 2022
  • Steph Curry can miss his next 500 threes and still have a better 3pt% than Ray Allen
  • Bruce Brown shot better from three than from the free throw line.
  • The Now-defunct Seattle Supersonics have won a playoff series more recent than the Sacramento Kings

The Seattle Supersonics last appeared in the 2007-2008 season, but they have won a more recent playoff series to the Sacramento Kings which was in 2005. The Kings most recent playoff series win was in 2004.

  •  Zach LaVine’s First Four-game Winning Streak Came in his 8th Year in the NBA
  •  Dave Cowens won MVP but didn’t make the All-NBA First Team
  • Marc Gasol and Tyson Chandler both won Defensive Player of the Year but were left out of the All-Defensive First Team in their respective DPOY Years
  • Jerry West Won Finals MVP despite being on the losing team
  • Bill Russell was the cornerstone of 11 Boston Celtics championships but never won Finals MVP
  • Karl Malone is number three on the All-time scoring list but never won the scoring title at any point of his career.
  • Hakeem Olajuwon almost recorded two quadruple doubles in one month.
  •  Malcolm Brogdon wins Rookie of the Year without being named Rookie of the Month at least once
  • 2021 NBA Finals featured None of Shaq’s teammates for the first time in 38 years
  • LeBron James has played more playoff games than 50% of the NBA teams
  • Kawhi Leonard has more Finals MVPs than triple doubles
  • Kobe Bryant had more 50-point games in a week than Dwyane Wade ever had in his entire career
  • Giannis Antetokounmpo has as much 40-point games in the NBA Finals as Kobe, KD, Curry combined.

The 26 year old has only played 6 finals games whereas the others have played 85 combined.

Thank you for reading my blog.

Web Analytics

New Features in iOS 15.5

Introduction

On May 16th, Apple released a new IOS for iPhone and iPad that is IOS 15.5. Today in this blog I am going through all the new features in IOS15. Some of the new features are

  • Podcasts Updates
  • Apple Pay (now Apple Cash)
  • Home App
  • Universal Control
  • Apple Card
  • Photo Memories
  • Apple Music Playback
  • Apple Security Fixes

More Information on the New Features:

Podcasts Update:

The Apple Podcasts app includes a setting that allows users to limit the number of episodes stored on the iPhone or iPad. In the new update it will automatically delate older episodes. This will prevent your iPhone or iPad to take too much storage.

Apple Pay:

In iOS 15.5 Apple has changed the name Apple Pay to Apple Cash. When you open the app and look in the Apple Cash section of the Wallet app, there are now “Request” and “Send” buttons.

Home App:

In the Home App there are now WiFi signal bars that let you ensure the HomePod has a connection in the Home app.

Universal Control:


In iPadOS 15.5, Universal Control is no longer in beta. That means the feature is fully, officially launched.

Apple Card:

Apple has changed the name Apple card to Titanium Card.

Photo Memories:

Apple in iOS 15.5 added a list of “Sensitive Locations” to the Photos app, which means those locations are blocked from showing up in memories.

Apple Music Playback:

iOS 15.5 reintroduces an Apple Music API that allows third-party Apple Music players to change the playback speeds of songs. The API was removed in iOS 15.4.

Apple Security Fixes

In iOS 15.5 and iPadOS 15.5 it also includes more than 25 security fixes.

Conclusion:

Thank you for reading my blog. Stay tuned for my next blog.

Cost Optimisation in AWS

Introduction

Having trouble managing your cost in AWS, well today I will be showing you how to maintain the price to a smaller amount. I will be talking about cost optimisation in Amazon Web Services (AWS).

How much money do you spend per GB

Let’s have a look at AWS S3 Standard pricing for the Sydney region.

S3 Standard – General purpose storage for any type of data, typically used for frequently accessed dataStorage pricing
First 50 TB / Month$0.025 per GB
Next 450 TB / Month$0.024 per GB
Over 500 TB / Month$0.023 per GB

As you can see, above is the table of how much you spend per month. If you noticed the pricing gets cheaper for each GB you use per month, if you use more terabytes.

Combining Costs

Most companies I know use more than one AWS account. I bet all of you are tired of paying a huge bill every single month. There is a downside of that using more accounts uses more resource usage. If they were in the one account it would reduce the price massively.

What are some ways of reducing your AWS cost

These are some ways you can reduce your AWS cost.

1. Identify your Amazon EC2

You can use AWS Cost Explorer Resource Optimisation to get a report of your EC2 instances. You can reduce your price by stopping or downsizing these instances. Another easy way to stop instances is to use AWS Instance Scheduler to automatically stop your instances. To automatically downsize these instances you can use AWS Operations Conductor.

This is a picture of AWS Cost Explorer Resource Optimisation

This is a picture of AWS Instance Scheduler

This is a picture of AWS Operations Conductor

2. Analyse Amazon S3

Use S3 Analytics to analyse the storage access patterns on the object data set for at least 30 days. It makes recommendations on where you can hold S3 Infrequently Accessed to reduce costs.You can automate moving these objects into lower cost storage tier using Life Cycle Policies.

3. Review Networking

Use the Trusted Advisor Idle Load Balancers check to get a report of load balancers that have RequestCount of less than 100 over the past 7 days. Then, use the steps here, to delete these load balancers to reduce costs. Then review your data transfer costs using Cost Explorer.

This is a picture of Cost Explorer

4. Identify Amazon EBS volumes

EBS volumes that have very low activity (less than 1 IOPS per day) over a period of 7 days indicate that they are probably not in use. Identify these volumes using the Trusted Advisor Underutilises Amazon EBS Volumes Check. To reduce costs, first snapshot the volume (in case you need it later), then delete these volumes.

5. Review and modify EC2 AutoScaling Groups configuration

Review your scaling activity using either the describe-scaling-activity CLI command. Analyse the result to see if the scaling policy can be tuned to add instances less aggressively. After review your settings to see if the minimum can be reduced so as to serve end user requests but with a smaller fleet size.

Conclusion

Thank you for reading my blog about Cost Optimisation in AWS. Stay tuned for my next blog.

Create a Fitness Competition using AWS Lambda and Fitbit – Part 2

Introduction

Year 2020 was meant to be the year of innovation and technical prowess – when cars took to the skies, mankind colonised Mars. Unfortunately, the real 2020 is far less glamorous. COVID-19 has affected us all, taking its toll on the world economy, and the physical and mental health of everyone.

In this second part of my fitness competition blog series, I will take you through the code that I created. There are prerequisites, that were described in Part 1. If you haven’t already, I highly recommend reading Part 1 before continuing. Part 1 is available at https://nivleshc.wordpress.com/2021/09/21/create-a-fitness-competition-using-aws-lambda-and-fitbit-part-1.

High Level Architecture

Just to recap, below is the high-level architecture diagram for the solution.

The steps (indicated by numbers in the diagram above) are described below:

  1. At 12:10 am AEST, an Amazon CloudWatch Events Rule will trigger an AWS Lambda function.
  2. The AWS Lambda function checks for any competition statistics from previous runs (stored in an AWS S3 bucket). If found, these are read into memory. The AWS Lambda function then retrieves details about the players, along with their Fitbit website tokens from AWS SSM Parameter Store.
  3. The AWS Lambda function retrieves each of the players steps for yesterday from Fitbit. It then awards points to each player based on the steps and calculates their rank.
  4. A slack notification is sent, displaying each of the players steps, points and their rank.
  5. The competition statistics are stored in an AWS S3 bucket, to be used the next time when the AWS Lambda function runs.

The players must give consent to have their Fitbit steps accessed by the AWS Lambda function (access is via Fitbit tokens. Please keep these safe, if they are accidentally revealed, invalidate them from the Fitbit developer portal immediately).

The Magic is in the code

The code discussed in this blog requires a slack workspace, to send competition results notifications. If you don’t have one already, please refer to my previous blog for instructions on how to create one for free. Here is the link to that blog https://nivleshc.wordpress.com/2021/06/27/use-aws-lambda-to-send-slack-notifications-for-running-amazon-ec2-instances.

Let’s dive into the code.

To make things simple, I have created a Python class for the competition statistics. This makes the code clean and intuitive.

Let’s first go through the main function, which orchestrates everything.

def run_fitness_competition():
  s3 = boto3.resource('s3')
  ssm_client = boto3.client('ssm')

  # check if statistics from previous run exists.
  try:
      s3.Object(artefacts_s3_bucket, fitbit_challenge_statistics_filename).load()
      print('>>run_fitbit_challenge:statistics from previous run found. Importing…')
      previous_challenge_statistics = json.loads(s3.Object(artefacts_s3_bucket, fitbit_challenge_statistics_filename).get()['Body'].read().decode('utf-8'))
      competition_statistics.import_previous_stats(previous_challenge_statistics)
      
  except botocore.exceptions.ClientError as e:
      if e.response['Error']['Code'] == "404":
          # fitbit challenge statistics file does not exist. We will treat this run as the start of the competition.
          print('>>run_fitbit_challenge:No statistics from previous run found. Treating this run as the start of the competition.')
         
  # get the names of all fitbit challenge players
  fitbit_challenge_players = ssm_client.get_parameter(Name='fitbit_challenge_players')['Parameter']['Value']
  print('>>run_fitbit_challenge:players found:'+str(fitbit_challenge_players))

  status = ''
  # calculate each player's points based on yesterday's steps
  for player in fitbit_challenge_players.split(','):
    calculate_points_status = competition_statistics.calculate_competition_points(player)
    if (calculate_points_status != 'success'):
      print('>>run_fitbit_challenge:players:error calculating competition points for ' + player + ' ' + calculate_points_status)
      status += calculate_points_status + ' '
  
  status = status.strip()

  # rank the players based on their points
  competition_statistics.calculate_players_rank()

  # send a slack message with the latest steps, points and rank
  competition_statistics.send_competition_results_notification(slack_webhook_url)

  # write the competition statistics to a local file, which will be uploaded to s3. This file will be used in next lambda run
  local_fitbit_challenge_statistics_filename = '/tmp' + fitbit_challenge_statistics_filename.replace(artefacts_s3_key_prefix,'')
  competition_statistics.write_competition_statistics_to_file(local_fitbit_challenge_statistics_filename)

  # upload the local fitbit competition statistics file to artefacts s3 bucket
  s3.Bucket(artefacts_s3_bucket).upload_file(local_fitbit_challenge_statistics_filename,fitbit_challenge_statistics_filename, Config=s3_transfer_config)
  print('>>run_fitbit_challenge:uploaded updated fitbit competition statistics file to artefacts S3 bucket: ' +
        local_fitbit_challenge_statistics_filename + ' -> [' + artefacts_s3_bucket + ']' + fitbit_challenge_statistics_filename)

  if (status == ''):
    status = 'success'

  return status

The function does the following:

  • checks for the file containing statistics from the previous run. If this is found, the statistics are imported, otherwise, it is assumed that the competition has just started.
  • the names of all the players are obtained from AWS Systems Manager Parameter Store.
  • the competition points for each of the players is calculated
  • the players are then ranked based on their competition points
  • the competition results for all the players, which includes their rank, steps and points is sent to a slack channel
  • the statistics from this run is written to a local file, which is then uploaded to an Amazon S3 bucket. This will be used in the next run of this Lambda function.

Next, let’s look at the individual functions that are called by run_fitness_competition().

First, let’s look at the function that imports the previous competition statistics.

 # this function imports previous statistics from an object.
  def import_previous_stats(self, previous_challenge_statistics):
    self.statistics['start-date'] = previous_challenge_statistics['start-date']
    self.statistics['competition-day'] = int(previous_challenge_statistics['competition-day']) + 1
    self.statistics['players'] = previous_challenge_statistics['players']

Next, let’s look at the function that is used to calculate the competition points for each of the players.

# this function calculates a player's competition points
  def calculate_competition_points(self, player):
    ssm_client = boto3.client('ssm')

    # retrieve the player's token and secret from AWS SSM Parameter Store
    player_token = json.loads(ssm_client.get_parameter(Name='fitbit_token_' + player, WithDecryption=True)['Parameter']['Value'])
    player_secret = ssm_client.get_parameter(Name='fitbit_secret_' + player,WithDecryption=True)['Parameter']['Value']

    # since this lambda will be run every 24 hours, assume that the tokens has expired (max age is 8hours). Refresh the token
    player_token = self.refresh_fitbit_token(player_secret, player_token['refresh_token'])
    
    token_is_valid = False

    # check that a valid token was obtained after refreshing. Do not continue if there was an error.
    try:
      if (player_token['access_token']):
        token_is_valid = True

    except Exception as e:
      print('>>calculate_competition_points:error refreshing token [player=' + player + ']ErrorType:' + player_token['errors'][0]['errorType'] + ' Error:' + player_token['errors'][0]['message'])

    if (token_is_valid):
      # retrieve the player's steps for yesterday
      player_steps = self.get_fitbit_steps(player_token['access_token'], player, player_token['user_id'], self.yesterday_str)

      points = 0

      # if the player achieved the daily steps goal, award 1 point
      if (player_steps >= self.fitbit_daily_steps_goal):
        points = 1

        # give bonus points for additional steps above the daily steps goal (additional steps must be in daily_bonus_points_steps increments)
        additional_steps = player_steps – self.fitbit_daily_steps_goal
        bonus_points = math.floor(additional_steps / self.fitbit_daily_bonus_points_steps)
        points += bonus_points

      # update the players statistics
      record_location = self.find_player_record_location(player)

      if (record_location != –1):
        self.statistics['players'][record_location]['yesterdays-steps'] = player_steps
        self.statistics['players'][record_location]['yesterdays-points'] = points
        self.statistics['players'][record_location]['total-steps']  += player_steps
        self.statistics['players'][record_location]['total-points'] += points
        print('>>calculate_competition_points:points updated for player=' + player)
      else:
        # new player found. create a new record for this player in statistics
        print('>>calculate_competition_points: new player found: [' + player + ']')

        player_record = {}
        player_record['name'] = player
        player_record['yesterdays-steps'] = player_steps
        player_record['yesterdays-points'] = points
        player_record['total-steps'] = player_steps        
        player_record['total-points'] = points
        player_record['rank'] = ''  # this will be updated after all players points has been calculated

        self.statistics['players'].append(player_record)

      # update the AWS SSM Parameter Store parameter with the refreshed token
      update_player_token_response = ssm_client.put_parameter(Name='fitbit_token_' + player, Value=json.dumps(player_token), Overwrite=True)
      print('>>calculate_competition_points:updating AWS SSM Parameter Store with latest token for player='+ player + ' result:' + str(update_player_token_response))

      status = 'success'
    else:
      # refresh token failed for this player
      status = 'error:' + player_token['errors'][0]['message']
      
    return status

The above function does the following:

  • the player’s Fitbit token and client secret is obtained from AWS Systems Parameter Store
  • by default, the token is valid for 8 hours. Since this Lambda function will be run once every 24 hours, it is assumed that the Fitbit token has already expired (it would have been refreshed in the last run). The Fitbit token is refreshed and the AWS Systems Manager Parameter Store Parameter that is to contain that player’s Fitbit token is updated with the refreshed token.
  • If the player’s Fitbit token was successfully refreshed, it is used to get the player’s steps for yesterday. Otherwise, the function returns with an error message.
  • Assuming that the player’s steps were retrieved successfully, it is used to calculate their points according to the following formula:
    • If the player got more steps than the daily goal (currently set to 10,000 steps), he/she is awarded 1 point
    • for every 1000 steps above the daily goal, the player is awarded an additional 1 point

The function below is used to refresh the Fitbit token.


# this function refreshs a fitbit token
  def refresh_fitbit_token(self, base64_client_id_client_secret, refresh_token):
    myheader = {
        'Authorization': 'Basic ' + base64_client_id_client_secret,
        'Content-Type': 'application/x-www-form-urlencoded'
    }

    mydata = {
        'grant_type': 'refresh_token',
        'refresh_token': refresh_token
    }

    response = requests.post(self.fitbit_refresh_token_url, headers=myheader, data=mydata).json()

    return response

The function below is used to get the player’s Fitbit steps.

# this function retrieves the fitbit steps for the specified user. returns -1 if there was an error  
  def get_fitbit_steps(self, fitbit_access_token, user_name, user_id, activity_date):
    header = {
        'Authorization': 'Bearer ' + fitbit_access_token
    }

    url = self.fitbit_activity_url + user_id + '/activities/date/' + activity_date + '.json'
    try:
      response = requests.get(url, headers=header).json()
      steps = response['summary']['steps']
      print('>>get_fitbit_steps:user=' + user_name + ' date=' + activity_date + ' steps=' + str(response['summary']['steps']))

    except Exception as e:
      print('>>get_fitbit_steps:Error:user=' + user_id + ' date=' + activity_date + ' url=' + url + ' error=' + str(e))
      steps = –1

    return steps

Here is the function that is used to calculate the rank of all players.

# this function calculates each player's rank based on their total-points. The records in self.statistics['players'] dict is also rearranged
  # so that the player with rank=1 is at location zero, rank=2 is at location 1 etc.
  def calculate_players_rank(self):
    
    rank = []  # make a list that contains all the current total-points in the competition. this will then be sorted to get the rank
    
    for record in self.statistics['players']:
      rank.append(record['total-points'])
      
    # remove duplicate total-points from rank
    rank = list(dict.fromkeys(rank))

    # sort rank list using total-points from highest -> lowest
    rank.sort(reverse=True)

    ranked_players_record = [] # this dict will contain player records sorted according to their rank

    # go through the sorted total-points, find the player for whom the points belong and give them that rank.
    for position in range(0, len(rank)):
      # find players which have total-points equal to the current ranks total-points
      player_record_locations = self.find_player_record_location_with_total_points(rank[position])

      if (player_record_locations != ''): # cater for scenarios where there could be more than one player with the same total-points
        for location in player_record_locations.split(','):
          self.statistics['players'][int(location)]['rank'] = position + 1

          # add this player's record to the new dict that will contain player records based on their rank
          ranked_players_record.append(self.statistics['players'][int(location)])
      else:
        print('>>calculate_player_rank:error:player with [total-points=' + rank[position–1] + '] not found.')
    
    # replace the players record with the ranked players record
    self.statistics['players'] = ranked_players_record
    print('>>calculate_players_rank:ranks:'+str(self.statistics['players']))

The above function does the following:

  • it finds all the current unique total-points for all players.
  • the total-points are then sorted in a descending order
  • for each of the sorted points, the players that have that as their total-point are found. These players are then allocated that rank (the rank corresponds to the location of that point in the sorted total-points list)
  • the competition’s player records are updated to reflect the player ranks (the player with rank=1 is put in first location, player with rank=2 is put in next location etc)

The function below, is used to send the competition results to a slack channel. The notification includes each of the players rank, total steps and their competition points.

# this function sends a slack notification with the competition statistics
  def send_competition_results_notification(self, slack_webhook_url):

    # create a message based on the players statistics
    competition_day = (datetime.strptime(self.yesterday_str, '%Y-%m-%d') – datetime.strptime(self.statistics['start-date'], '%Y-%m-%d')).days + 1
    slack_message = 'Competition Day=' + str(competition_day) + '[' + self.yesterday_str + '][Competition Start-date=' + str(self.statistics['start-date']) + ']'

    for records in self.statistics['players']:
      slack_message += '\nRank=' + str(records['rank']) + ' ' + str(records['name']).capitalize() + ' | Steps[yesterday]=' + str(records['yesterdays-steps'])
      
      if records['yesterdays-points'] >= 1:
        slack_message += ' | Congrats! You earned ' + str(records['yesterdays-points']) + ' point(s)'
      else:
        slack_message += ' | No points earned 😦 Try harder today'
      
      slack_message += ' | Steps[total]=' + str(records['total-steps']) 
      slack_message += ' | Points[total]=' + str(records['total-points'])

    slack_payload = {"text": slack_message}

    response = requests.post(slack_webhook_url, json.dumps(slack_payload))
    response_json = response.text
    print('>>send_slack_message:response after posting to slack:' + str(response_json))

Lastly, the following function is used to write the current statistics to a local file, which is then uploaded to an AWS S3 bucket. This file will be used the next time this AWS Lambda is invoked.


 # this function writes the contents of self.statistics to file at filepath
  def write_competition_statistics_to_file(self, filepath):
    with open(filepath, 'w') as output_file:
        json.dump(self.statistics, output_file)

Deploy the solution into your AWS Account

All the code described in this blog is available via my GitHub account at the following url https://github.com/nivleshc/blog-fitness-competition.git

To deploy the solution in your AWS Account, use the following steps:

  1. Obtain the Fitbit token and client id from each of the players, and create the appropriate AWS SSM Parameter Store parameters (as described in Part 1 of this blog series)
  2. Clone the repository using git clone https://github.com/nivleshc/blog-fitness-competition.git
  3. Export the following environment variables
export AWS_PROFILE_NAME={aws profile to use}
export AWS_S3_BUCKET_NAME={name of aws s3 bucket to store SAM artefacts in}
export SLACK_WEBHOOK_URL={slack webhook url to use for sending slack notifications}

4. Run the following commands to deploy the solution into your AWS environment.

make package
make deploy

5. Once successfully completed, you should be able to see the resources deployed into your AWS Account.

6. If you make any changes to template.yaml, first validate the changes by using the following command (validation is not required if you change other files):

make validate

After validation is successful, use the following command to deploy the changes:

make update

Below is a screenshot of the slack notification, showing the fitness competition details on the first day (players real names have been masked)

This solution uses gamification to provide encouragement and motivation. I hope it helps you and your friends in attaining your fitness goals and for keeping healthy.

Till the next time, stay safe!