What Is ChatGPT?

Artificial Intelligence is advancing rapidly, and ChatGPT is one of the most talked-about AI tools right now. But what is ChatGPT, and how does it work? Read on to learn more. What Is Artificial Intelligence? Artificial Intelligence, or AI, is...

The post What Is ChatGPT? appeared first on Treehouse Blog.

Compare MacBook Prices Worldwide with Google Sheets

Looking to buy the new Macbook Pro with M3 chips? Wondering if it would be cheaper to purchase a Macbook in your local Apple store, or ask a friend who is travelling from Singapore or Japan to bring one for you?

Here’s a Google Sheet that can help you compare prices of MacBooks in different countries. It takes the current prices of MacBooks from Apple online stores in different countries and converts them to a common currency (US Dollars). The exchange rates are fetched directly from Google Finance so the prices will update automatically when the exchange rates change.

Macbook Prices worldwide

How the Macbook Price Comparison Sheet Works

I have written a Node.js script that fetches the current prices of MacBooks from the Apple website and writes them to Google Sheets. Here’s the code that scrapes the Apple website and parses the HTML to extract the prices.

Get Macbook Prices from Apple Website

Apple uses JSON-LD to embed structured pricing data in their web pages that can be easily parsed using cheerio. If the prices were not embedded in the wepage, an headless browser like Puppeteer would have been required to scrape the data.

const fs = require('fs');
const cheerio = require('cheerio');
const regions = ['us', 'in', 'sg', 'uk', 'ae', 'jp'];

const scrapeAppleStore = async (region) => {
  const url = `https://www.apple.com/${region}/shop/buy-mac/macbook-pro`;
  const response = await fetch(url);
  const html = await response.text();
  const $ = cheerio.load(html);
  const country = $('a.as-globalfooter-mini-locale-link').text().trim();
  const data = [];
  $('script[type="application/ld+json"]').each((i, elem) => {
    const json = JSON.parse($(elem).text());
    if (json['@type'] === 'Product') {
      json.offers.forEach((offer) => {
        const { priceCurrency, price, sku } = offer;
        data.push([country, sku.substring(0, 5), price, priceCurrency]);
      });
    }
  });
  return data;
};

(async () => {
  const promises = regions.map(scrapeAppleStore);
  const values = await Promise.all(promises);
  const prices = values.filter((value) => value.length > 0);
  fs.writeFileSync('prices.json', JSON.stringify(prices, null, 4));
})();

Get Currency Exchange Rates from Google Finance

The next step is to convert the prices of MacBooks in different currencies to a common currency (US Dollars). The exchange rates are fetched from Google Finance using the GOOGLEFINANCE function of Google Sheets.

=BYROW(A1:A27, LAMBDA(e, IF(e="USD",1, GOOGLEFINANCE("CURRENCY:USD"&e))))

The function accepts the currency code of the source and target currencies and returns the exchange rate. For instance, the formula =GOOGLEFINANCE("CURRENCY:USDINR") will fetch the current exchange rate of US Dollars to Indian Rupees.

Google Finance - Currency Exchange Rates

Build the Macbook Price Comparison Sheet

Now that we have prices in a common current, we can build the price comparison table using the INDEX MATCH function of Google Sheets. The lookup criteria includes two columns - the SKU of the Macbook model and the country. The relevant formula is:

=INDEX(Data!$A$1:$E$648,MATCH($A3&B$1,Data!$A:$A&Data!$C:$C,0),5)

Also see: Monitor iPhone Stock with Google Sheets

Conditional Email Notifications with Google Forms – Route Responses to Different Email Addresses

The Google Forms Email Notifications add-on lets you send Google Form responses in an email message as soon as a respondent submits the form. The email template can be customized to include the form answers or the form edit link.

Conditional Email Notifications for Google Forms

You can also set up conditional email notifications for Google Forms where the form responses are sent to different email addresses based on the form answers filled-in by the respondent.

In the above example, we have a Google Form that asks the respondent to select the sessions they are interested in attending for an AI workshop. It is a mulitple choice checkbox question as the respondent can select one or more sessions. The form responses are then sent to different email addresses based on the sessions selected by the respondent.

Set Up Conditional Email Notifications for Google Forms

Install the Google Forms add-on and setup a new rule. Enable the Conditional Notifications option and add a new condition as shown in the screenshot.

Email Forms Logic

The first rule says that if the respondent has selected either “Generative AI” or “Prompt Engineering” for the Sessions question, the email should be sent to peter@example.com. We thus choose “Any of” as the condition and add the two session options in the condition separated by a comma.

Similarly, if the respondent has selected “The future of AI” as the session, the email should be sent to kiran@example. For all other sessions, the email should be sent to angus@example.com so we’ll put that email address in the “No Match Found” section.

You can also customize the email message that is sent to the respondents. The email message can include individual form answers, images, QR Codes and even files from Google Drive.

Email Template

18 Software Development Trends and Predictions 2024

The need for thorough risk assessments, continuous testing, and compliance checks before full-scale deployments is unavoidable. The future of software development demands businesses to be gearing up for a delicate dance between innovation and reliability. This year, we saw enthusiasm for AI/ML with the emergence of Generative AI and other such technologies. However, as the year comes to a conclusion, the key focus seems to have shifted to strike the right balance between efficiency and security. This dual imperative is a fundamental concern, emphasizing that responsible decision-making, privacy preservation, and ethical standards are paramount. Predictably, technologies that embody these principles will be favored in the global software development landscape.

Therefore, our software development experts have studied the ongoing trends and made some predictions regarding the landscape for the coming year. Let us go through these predictions regarding software development for the year 2024.

Limited Conversations With Distributed Systems

By the way, ChatGPT suggested the title: The Art of Balancing Control and Accessibility

Background

Houston Airport had this really big problem. Passengers complained about the time it took for luggage to arrive at the terminal building after the airplane had landed. The Airport invested millions to solve this pain point. They improved the process, hired more people, and introduced new technology. They eventually succeeded in reducing the wait time to 7 minutes. However, users still complained. The Airport realized that they had reached a point where optimizing the process/design was no longer optimal. So they did something different. They reframed the problem. By reframing the problem, they discovered that it was not the time it took to get the luggage to the terminal building that was the problem. It was the time the passengers had to wait for the luggage that was the problem. The Airport decided to park the airplanes further away from the terminal building. Consequently, it took some time for passengers to arrive at the terminal building, thus reducing the wait time for luggage, and voila! Complaints dropped drastically.

Secrets Management Takes More Than Just Tools

Every company wants to have a good security posture, and most are investing in security tooling. According to Gartner, worldwide spending on security is forecast to grow 11.3% in 2023 to reach more than $188.3 billion. 

However, despite all this spending, there are certain areas where problems are only getting worse, such as secrets sprawl. Reports now say over 50% of cyber attackers gained their initial foothold by exploiting compromised credentials. No organization wants to go through an indecent like Samsung or Nvidia or repeat Uber's unfortunate experience

Domain-Driven Design: Why Do Companies Need This Approach, Who Uses It, and What Is Its Essence?

Building software that meets the needs and expectations of businesses and users in a dynamic and ever-changing technological world can be challenging. Software companies gradually require a workable way to make communication between the business and the product team more transparent. The domain-driven design (DDD) approach helps to solve this problem by fostering a profound understanding of the subject matter and continuous collaboration between developers and business experts. In fact, developers gain a more in-depth understanding of the underlying domain and business rules through constant communication. At the same time, stakeholders gain a better understanding of technical capabilities and constraints.

For example, Standish Group’s analysis of 100 projects found that 70% of rework was due to a lack of domain knowledge during the requirements and design phases, confirming that DDD fosters understanding between businesses and developers.

How to Leverage OAS and RAML in AWS API Gateway

Do you have an OpenAPI Specification and don't know if it can be imported into Amazon API Gateway to avoid defining each resource by hand through the console? This article shows you how to leverage an existing OAS specification in API Gateway.

If, on the other hand, you have a RAML specification, the article How to convert from RAML to OAS to use it in Amazon API Gateway offers a step-by-step guide to create your OpenAPI specification from an existing RAML.

Querydsl vs. JPA Criteria, Part 5: Maven Integration

As most technologies or dependencies evolve fast, it's sometimes hard to make the initial setup or upgrade smoothly. The goal of this article is to provide a summary of the Maven setup for the Querydsl framework, depending on the used technology. After that, let's see a short overview of the Querydsl solution.

In This Article, You Will Learn

  • How to setup Querydsl with Spring Boot 2.x (i.e Java EE) and Spring Boot 3.x (i.e. Jakarta EE)
  • What is a Maven classifier
  • How is the Maven classifier used in Querydsl build
  • Usage of Eclipse Transformer Plugin

Querydsl Setup

There are several possibilities to set up Querydsl framework in a Spring Boot application. The correct approach depends on the technologies used. 

The State of Data Streaming for Energy and Utilities in 2023

This blog post explores the state of data streaming for the energy and utilities industry in 2023. The evolution of utility infrastructure, energy distribution, customer services, and new business models requires real-time end-to-end visibility, reliable and intuitive B2B and B2C communication, and integration with pioneering technologies like 5G for low latency or augmented reality for innovation. Data streaming allows integrating and correlating data in real-time at any scale to improve most workloads in the energy sector.

I look at trends in the utilities sector to explore how data streaming helps as a business enabler, including customer stories from SunPower, 50hertz, Powerledger, and more. A complete slide deck and on-demand video recording are included.

LLM: Trust, but Verify

My most-used Gen AI trick is the summarization of web pages and documents. Combined with semantic search, summarization means I waste very little time searching for the words and ideas I need when I need them. Summarization has become so important that I now use it as I write to ensure that my key points show up in ML summaries. Unfortunately, it’s a double-edged sword: will reliance on deep learning lead to an embarrassing, expensive, or career-ending mistake because the summary missed something, or worse because the summary hallucinated? 

Fortunately, many years as a technology professional have taught me the value of risk management, and that is the topic of this article: identifying the risks of summarization and the (actually pretty easy) methods of mitigating the risks. 

7 Query Strategies for Navigating Knowledge Graphs With NebulaGraph and LlamaIndex

There has been a lot of buzz around developing RAG (Retrieval Augmented Generation) pipelines powered by LLMs and Knowledge Graphs (KG) lately. In this article, let’s take a close look at Knowledge Graphs by building an RAG pipeline for the Philadelphia Phillies using LlamaIndex and NebulaGraph.

Use Case

We will use Knowledge Graph, specifically the open source NebulaGraph, to query information on the Philadelphia Phillies, the Major League Baseball team based in Philadelphia. My whole family are big fans of the Phillies!

Maximize Your Analytics Potential With Server-Side Tracking and Google Analytics 4 Integration

It is crucial to stay updated with the latest tracking techniques in the ever-evolving landscape of web analytics. The paradigm has shifted from client-side tracking to server-side tracking to ensure sensitive customer data is protected when it is being collected across multiple platforms. 

The major concern arises when data has to be processed and analyzed. This article will delve into the integration of server-side tagging with Google Analytics 4 (GA4) to explore the concept of cookie-less tracking.

Generative AI Innovations Supercharge Developers

At SAP TechEd 2023, SAP unveiled a series of generative AI capabilities to empower developers and make their workloads faster and easier. As Juergen Mueller, SAP's CTO, stated, "Today’s dynamic technology and business landscape means every developer needs to be an AI developer."

SAP is meeting this need by launching tools and platforms infused with the power of AI, specifically tailored for developers across skill levels.