stop looping in while loop

hi guys hope you are well, i on progress for making website but i have a problem with array and looping, how to stop looping when all data has been output.

<form method="POST" action="storedata_g6b.php">
    <table class="table">
        <thead class="thead-dark">
            <tr>
                <th class="col-3">id</th>
                <th class="col-7">nama</th>
                <th class="col-3">rank</th>
            </tr>
        </thead>
        <tbody>
        <?php
            $rank_b = 'B';
            $sql = "select t_empeval.id, t_empeval.nama from t_empeval Where t_empeval.grade='$c' and sect=CONCAT('$a','$b') order by t_empeval.v1 desc limit ".$var1.",".$var2."";
            $query = mysqli_query($koneksi, $sql);
            if(!$query)
            {
                die('SQL Error :' . mysqli_error($koneksi));
            }
            $b=0;
            while ($array_b = mysqli_fetch_assoc($query))
            {
                if(mysqli_num_rows($query) > 0)
                {
        ?>
                    <tr>
                        <td><input type="text" name="id_b[<?php echo $b; ?>]" value="<?php echo $array_b['id']; ?>"></td>
                        <td><input type="text" name="nama_b[<?php echo $b; ?>]" value="<?php echo $array_b['nama']; ?>"></td>
                        <td><input type="text" name="rank_b[<?php echo $b; ?>]" value="<?php echo $rank_b; ?>"></td>
                    </tr>
        <?php
                    $b++;
                }
            }
        ?>
            <input type="hidden" name="cotton_b" value="<?php echo $b; ?>" />
        </tbody>
    </table>
    <input type="submit" id="submit" name="submit"/>
</form>

in this case amount of data will be display is 2 row
example :
1 => a
2 => a

then if amount of data has been displayed then will break the loop and start other loop.
please englithment me, thanks in advance.

How to Get your Visitor’s Location from their IP address

The PayPal website mentions a list of 200 countries where the PayPal service is officially available. There are about 46 countries and regions left where buyers cannot transact using PayPal.

Countries where PayPal is not available

As highlighted in the Google Map above, the regions where PayPal is not available includes Afghanistan, Bangladesh, Cuba, Ghana, Iraq, Iran, North Korea, Lebanon, Liberia, Libya, Pakistan, Palestine, Sudan, Syria, Turkey and Uzbekistan.

If you have a digital goods store that relies exclusively on the PayPal service for processing payments, you could be losing business as customers from countries like Bangladesh, Turkey or Pakistan would not be able to make payments.

As an alternative, you can sign-up for a non-US payment processing service - Paddle and FastSpring are good alternatives - and offer these as payment options on the checkout screen to customers who land on your website from countries where PayPal is unavailable.

Detect the Country of your Website Visitors

I have implemented a similar technique for my Google add-ons website and it seems to work well. The website uses PayPal and Stripe as the default payment handler but if someone lands from a non-supported country, the PayPal buttons are hidden and they are offered an option to checkout with Paddle.

To get the website visitor’s location, I use the ip2c.org service that quickly resolves the visitor’s IP address to their country. If you fetch the ip2c.org/self service, it returns the ISO code of the country of the computer that made the HTTP request.

const getVisitorCountry = () => {
  return new Promise((resolve, reject) => {
    window
      .fetch("https://ip2c.org/self")
      .then((response) => response.text())
      .then((data) => {
        const [status, country] = String(data).split(";");
        if (status !== "1") {
          throw new Error("Unable to fetch country");
        }
        resolve(country);
      })
      .catch(() => {
        resolve("US");
      });
  });
};

getVisitorCountry().then((country) => {
  if (["PK", "BD", "TR", "AF"].indexOf(country) !== -1) {
    // show Paddle Buttons
  } else {
    // show PayPal buttons
  }
});

Some online stores follow the “Purchasing Power Parity” theory (learn more) where non-tangible goods like video courses and software licenses are priced dynamically depending on the country of customers. The above client-side approach for detecting the visitor’s location can be help in such scenarios as well.

Purchasing Power Parity

Offering Options for mailto: and tel: Links

I generally like mailto: links. But I feel like I can smell a mailto: link without even inspecting or clicking it, like some kind of incredibly useless superpower. I know that if I’ve got my default mail client set, clicking that link will do what I want it to do, and if I want, I can right-click and the browser will give me a “Copy email address” option to grab it cleanly.

That’s cool and all, but Adam Silver and Amy Hupe recently enumerated the problems with how these links behave:

Firstly, mailto links make it hard to copy the address, for example if you want to share the email address with someone else.

Secondly, some users use more than one mail app, and the link just uses whichever has been setup as the default, without giving them the option to use the other.

And finally, many users don’t have an email application set up, which means the link can take them to a dead end or down a rabbit hole.

Their UI experimentation ended up using a mailto: link, but putting the entire email address as the link which makes it especially obvious what the link does, while also offering a Copy button for a little UX bonus.

tel: links are weirder in the sense that a good many devices looking at them don’t have any phone-calling functionality. If they do, it’s a lot like email links in that multiple apps could do that work (e.g. WhatsApp, FaceTime, or the default phone app).

The hard part of the UX of all this is offering users choice on what they want these special link types to do. That’s what mailgo is attempting to solve. It’s a little JavaScript library that offers UI when you click them.

Live demo:

I kinda like it. I wouldn’t mind at all if that popped up when I clicked a link like this, especially since it has that “open default” option if I want that anyway. Seems to check all the boxes for the problems these types of special links can have.


The post Offering Options for mailto: and tel: Links appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

A CSS-only, animated, wrapping underline

Nicky Meuleman, inspired by Cassie Evans, details how they built the anchor link hover on their sites. When a link is hovered, another color underline kinda slides in with a gap between the two. Typical text-decoration doesn’t help here, so multiple backgrounds are used instead, and fortunately, it works with text that breaks across multiple lines as well.

Direct Link to ArticlePermalink


The post A CSS-only, animated, wrapping underline appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

New Plugin Displays WordPress Environment Type for Admins

One of the minor but useful additions to WordPress 5.5 is the new wp_get_environment_type() function. It makes it possible for plugin and theme authors to do some interesting things based on whether a site is identified as staging, development, production, or some other custom environment type. In discussion on the original trac ticket, Marius Jensen suggested a few ways this function could be useful:

  • It’s a function used for grabbing the current environment, this is to ensure everyone fetches the values the same way (to avoid using different terms and such).
  • Outbound emails could be filtered, and if get_environment() isn’t set to production then send them to the developer, allowing for legitimate email tests in stage setups without worrying about emails reaching end users.
  • API endpoints where you want to use a test endpoint when not in production to prevent data pollution.
  • Providing a wp-admin notice for non-production sites so it’s much clearer that what you are doing now will/won’t affect the site your business relies on.

The new function is already getting put to use in WordPress developer Roy Tanck’s new plugin called Display Environment Type. It adds a prominent red notice to the top of the admin for Production. Custom environment types will be set to blue with a lightbulb icon. (The colors used in the plugin are fixed and not configurable to help avoid confusion across servers.)

The environment type only displays for admin users. Tankck’s plugin also adds the current environment type to WordPress’ At-a-glance widget:

This is the first plugin on WordPress.org to make use of the new function, but developers are planning to use in other unique ways.

“We are adding our own custom environment vars here at Pantheon so plugin authors have the option of doing this but it would be so nice to have this in core so plugin authors don’t need to write host specific code,” Pantehon developer advocate John Richards commented on the original ticket for the new function.

WordPress plugin developer Rene Hermenau said he will be implementing this new concept in his WP Staging plugin in the next update. WP Staging, which is currently active on more than 50,000 installs, allows users to quickly create an exact copy of their sites for staging or development purposes.

WordPress.com has also added support for environment types in VIP Go, allowing developers to run different code for their sites depending on if it’s in production, development, or any other custom environment type configuration.

WordPress: A Year in Review, New Project to Fill the WordCamp Void

Joe Casabona, a freelance web developer and educator, launched WordPress: A Year in Review last week. The project was born out of his passion for helping others and a longing for attending WordCamp US, which has been canceled because of the stress of the pandemic and online event fatigue. He wanted to do something to fill in the void.

His goal is to offer online content that members of the WordPress community may have missed out on in the year. The project will provide learning resources in e-book, print book, video, and audio form. The content will be free, but he is asking community members to chip in and sponsor the project, covering the hard costs of putting it together.

“After WordCamp US got canceled, I started thinking about all of the work that went into it and the amazing amount of content that now wouldn’t be created,” said Casabona of why he decided to begin this project. “I am a big WordCamper and go to between 7-10 per year depending on my schedule, so I’ve definitely missed that experience. My main hope is that this can fill in some of the missing content from those canceled WordCamps. I know there are other efforts too, like the workshops the WordPress Foundation is hosting.”

What the Project Offers

The plan for the project is to offer three types of content to the WordPress community for free:

  • An e-book that reviews how WordPress changed in 2020, including a print edition.
  • An interview series with WordCamp speakers.
  • A video tutorial series that focuses on new things added to WordPress in 2020.

Casabona plans to run between 15 and 20 interviews with people on a special series via his How I Built It podcast. Instead of a formal talk, he wants to provide interviewees an opportunity to explore their own topics. The interview application process is open to those who were scheduled to speak at the canceled WordCamp US through August 31.

“The interview series was the first aspect of this project that I thought of,” he said. “Basically, I will interview people who applied to speak at WCUS 2020 about their talks — each episode will have 3 interviewees who have the opportunity to talk for about 10 minutes each about their topic. I’ll ask them who they are, what their talk was going to be about, and highlight the main points. I’m definitely open to ideas depending on who applies and how many people apply.”

Currently, Casabona has booked only a few podcast interviews. He said he plans on reaching out to more contributors, depending on how funding goes and the finalized outline for the e-book and videos.

He got the idea for the e-book from MacStories. “Every year, Federico Viticci puts out an iOS review in conjunction with the iPhone release, exclusively for his members,” he said. “I think that’s such a great resource and feel something like it would really benefit the WordPress community. Since this is the first one I might have some backstory, but it will mainly be a practical reference for people wondering how the popular CMS changed from January to December — things they might have missed or overlooked.”

If the e-book goes well this year, he will seek to publish it in the following years. The same would hold true for the printed book, which would essentially be the same as the e-book. A print edition would be a nice keepsake for members of the WordPress community. It is something physical, a tangible item that is not made up of bytes stored on a computer, destined for an eventual digital waste bin.

Casabona plans to run 10 video tutorials. He will release one video each week, starting in mid-October, through the end of the year. At the moment, he is planning to run all of the videos himself but may reach out to others who are better-suited for particular topics.

“The video series isn’t a huge departure from the content I put on my YouTube channel right now,” he said. “I’m targeting mostly users and implementors, but there were some cool developer additions in 5.5.”

Funding and the Future

The biggest holdup for the project is funding. Casabona has a goal of $3,000 to cover the hard costs, such as transcripts, editing, and out-of-pocket expenses. Those willing to donate can give a custom amount or make a pledge for one of three tiers with each tier building upon the other:

  • Support – $5: Gets your name in the e-book, progress updates, and behind-the-scenes content.
  • Early Access – $5: Early draft of the e-book, early access to interviews and videos, and e-book of podcast transcripts.
  • IRL! – $19: A printed copy of the e-book.

“I basically wanted to give the community a chance to pledge and support the project, as well as get a print book if they want it,” said Casabona.

He is also asking for sponsors to help fund the project on top of the initial goal of $3,000, which would only cover the minimum to produce content on his own. “Sponsorship will allow me to put more of my time and resources into the project,” he said. “All of this money is going into production — the more funding I’m able to secure, the more time and resources I can put behind it. For example, this could enable me to hire contributors, editors for each medium, etc.”

While it may be a bit early, Casabona is already thinking about the future of the project and has plans if he exceeds his funding goals.

“Excess funding will allow me to find and pay more contributors and better position the project for 2021,” he said. “I’d also like to set up a fund to send someone who can’t afford it to a WordCamp…once we start having in-person events again!”

Reddit Changing API Reports

Reddit is implementing changes to its API reporting. In short:

“Currently if a community has chosen to not allow free form reports from users, our API did not enforce that setting,” the developer team posted on Reddit. “We’re here to give you a heads up that will be changing on Monday, September 21st, 2020.”

The Convergence of Blockchain and Artificial Intelligence

Introduction

According to a 2016 research by Mckinsey, it was revealed that the total annual external investment in AI ranged between $8billion to $12billion in. Statistically, this is a clear sign that AI is making a great impact in the global industries especially the financial sector. In other words, it’s a revolutionary impact in the financial industry can not be underestimated.

Blockchain, on the other hand, has also shown its immense potential in so many industries especially in the finance industry. In fact, it’s digital disruption is greatly impacting how so many businesses operate in our contemporary world. While so many industries are beginning to embrace the amazing options these technologies – Artificial intelligence and Blockchain technology offer – helping them to create more value,  boosting sales, and so on,  it’s interesting to know that the combination of both will positively revolutionize the future of the fintech industry.

Website Hosting with MuleSoft API

Introduction

One of the interesting features of MuleSoft is that we can use a MuleSoft application to package and host website content. We package our website pages inside a MuleSoft application and deploy it to Anypoint Platform or Cloudhub and our website is published and accessible to the end-users. In this article, I will give you an example scenario of how it’s done so, you can use it for your own needs.

Imagine you are doing file transfers with MuleSoft and your target location is not always accessible. You have an option to move files in a temporary location and retry at a later point in time. While you can automate all of this, sometimes your customers would like a little bit more flexibility and control around retrying and clear visibility into what has not been yet transferred successfully.

Using PostgreSQL pgoutput Plugin for Change Data Capture With Debezium

Change Data Capture Architecture Using Debezium, Postgres, and Kafka
was a tutorial on how to use Debezium for change data capture from Azure PostgreSQL and send them to Azure Event Hubs for Kafka - it used the wal2json output plugin.

What About the pgoutput Plugin?

This blog will provide a quick walk through of how to pgoutput plugin. I will not be repeating a lot of details and use containerized versions (using Docker Compose) of Kafka connect, Kafka (and Zookeeper) to keep things simple. So, the only thing you need is Azure PostgreSQL, which you can setup using a variety of options including, the Azure Portal, Azure CLI, Azure PowerShell, ARM template.

Why you Should and How to Archive your Kafka Data to Amazon S3

Over the last decade, the volume and variety of data and data storage technologies have been soaring. Businesses in every industry have been looking for cost-effective ways to store it, and storage has been one of the main requirements for data retention. With a change to [near] real-time data pipelines and growing adoption of Apache Kafka, companies must find ways to reduce the Total Cost of Ownership (TCO) of their data platform.

Currently, Kafka is configured with a shorter, and typically three days, retention period. Data, older than the retention period, is copied, via streaming data pipelines, to scalable external storage for long-term use like AWS S3 or Hadoop Distributed File System (HDFS).

Evolution of K8s Worker Nodes-CRI-O

Evolution

Just a few months back, I never used to call containers as containers…I used to call them docker containers…when I heard that OpenShift is moving to CRI-O, I thought what's the big deal…to understand the “big deal”…I had to understand the evolution of the k8s worker node.

If you look at the evolution of the k8s architecture, there has been a significant change and optimization in the way the worker nodes have been running the containers…here are significant stages of the evolution, that I attempted to capture…

High Availability Kubernetes Monitoring Using Prometheus and Thanos

Introduction

The Need for Prometheus High Availability

Kubernetes adoption has grown multifold in the past few months and it is now clear that Kubernetes is the defacto for container orchestration. That being said, Prometheus is also considered an excellent choice for monitoring both containerized and non-containerized workloads. Monitoring is an essential aspect of any infrastructure, and we should make sure that our monitoring set-up is highly-available and highly-scalable in order to match the needs of an ever growing infrastructure, especially in the case of Kubernetes.

Therefore, today we will deploy a clustered Prometheus set-up which is not only resilient to node failures, but also ensures appropriate data archiving for future references. Our set-up is also very scalable, to the extent that we can span multiple Kubernetes clusters under the same monitoring umbrella.

Present Scenario

Majority of Prometheus deployments use persistent volume for pods, while Prometheus is scaled using a federated set-up. However, not all data can be aggregated using a federated mechanism, where you often need a mechanism to manage Prometheus configuration when you add additional servers.

The Solution

Thanos aims at solving the above problems. With the help of Thanos, we can not only multiply instances of Prometheus and de-duplicate data across them, but also archive data in a long term storage such as GCS or S3.

Implementation

Thanos Architecture

Deciphering the World of SAP S/4HANA

Update

I published this blog about a year ago after realizing that while lots of the people I was speaking to had started to think about S/4HANA, many of them didn’t have a clear view of the latest versions on offer. (I could count myself as one of that group before writing the piece if I’m really honest.)

Judging by the number of views the page received over the next few months (to be clear: a lot) we can safely say plenty of people felt the same way.