Sort an arraylist of an arraylist of doubles

I am looking to sort an arraylist of arraylist of doubles and I require help?

I was informed that I need to implement comparator or comparable and then use the collection.sort to sort the list of list in order...

ArrayList<ArrayList> list = new ArrayList<ArrayList>()

If you look at the list of list as the following example:

c1-5.0,4.5,10.3,3.5

c2-2.5,1.0,7.8,8.6

c3-6.0,5.6,9.6,9.5

It show go to this

c1-2.5,1.0,7.8,3.5

c2-5.0,4.5,7.8,8.6

c3-6.0,5.6,10.3,9.5

How to Use Notion with Gmail and Google Sheets using Apps Script

Notion, my absolute favorite tool for storing all sorts of things from web pages to code snippets to recipes, just got better. They’ve released a public API and thus it will be a lot easier for developers to read and write to their Notion workspace from external apps.

For instance, you can create a document in Google Docs and export it to Notion while staying inside Docs. Google Sheets users can pull pages from Notion database into their spreadsheet. Any new submissions in Google Forms can be directly saved to Notion and so on!

Save Gmail Messages in Notion

I have put together a Gmail add-on that makes it easy for you to save email messages, or any other text content, from Gmail to your Notion workspace with a click. Here’s how the app works.

Step 1: Connect Gmail to Notion

002815

Step 2: Allow Access to Notion pages - if you have multiple databases in your Notion workspace, you have an option to grant access to select databases and the rest will be inaccessible to the external app.

Authorize Notion

Step 3: Choose Email - open any email message in Gmail and you’ll have an option to edit the content of the email subject and body before sending the content to your Notion page. Please note that the app only supports plain text format at this time.

Send Email to Notion

Step 4: Open Notion - As soon as you hit the Send to Notion button, the content of the currently selected email message is added to your Notion database. You can click the All updates link in your Notion sidebar to view to recently added page.

Notion page

If you would like to try this Gmail to Notion app, please get in touch.

How to Use Notion with Google Apps Script

If you would to integrate your own Google add-on with Notion API, here’s a brief outline of the steps involved.

  1. Go to notion.so and click the Create New Integration button. You’ll be provided with a Client ID and Client Secret that you’ll need in a later step.

  2. Include the OAuth2 library in your Apps Script project and invoke the getRedirectUri method to get the OAuth2 redirect URL for the previous step.

const getNotionService = () => {
  return OAuth2.createService("Notion")
    .setAuthorizationBaseUrl("https://api.notion.com/v1/oauth/authorize")
    .setTokenUrl("https://api.notion.com/v1/oauth/token")
    .setClientId(CLIENT_ID)
    .setClientSecret(CLIENT_SECRET)
    .setCallbackFunction("authCallback")
    .setPropertyStore(PropertiesService.getUserProperties())
    .setCache(CacheService.getUserCache())
    .setTokenHeaders({
      Authorization: `Basic ${Utilities.base64Encode(
        `${CLIENT_ID}:${CLIENT_SECRET}`
      )}`,
    });
};

const authCallback = (request) => {
  const isAuthorized = getNotionService().handleCallback(request);
  return HtmlService.createHtmlOutput(
    isAuthorized ? "Success!" : "Access Denied!"
  );
};

const getRedirectUri = () => {
  console.log(OAuth2.getRedirectUri());
};
  1. Connect to Notion API - Make a Get HTTP request to the /vi/databases to fetch a list of all databases that the user has explicitly shared with authorized app.
function getDatabasesList() {
  var service = getNotionService();
  if (service.hasAccess()) {
    const url = "https://api.notion.com/v1/databases";
    const response = UrlFetchApp.fetch(url, {
      headers: {
        Authorization: `Bearer ${service.getAccessToken()}`,
        "Notion-Version": "2021-05-13",
      },
    });
    const { results = [] } = JSON.parse(response.getContentText());
    const databases = results
      .filter(({ object }) => object === "database")
      .map(({ id, title: [{ plain_text: title }] }) => ({ id, title }));
    console.log({ databases });
  } else {
    console.log("Please authorize access to Notion");
    console.log(service.getAuthorizationUrl());
  }
}

Gmail to Notion - Try the App

The Gmail to Notion app is in private beta. If you would like to use it with your Gmail or Google Workspace account, please get in touch for an invite.

FSE Outreach Round #6: Building a WordCamp Landing Page via the Template Editor

As has almost become ritual at this point, I am always looking forward to the next testing round for Full Site Editing (FSE). Spearheaded by core contributor Anne McCarthy, the FSE Outreach Program’s fortnightly user tests are usually fun and offer everyone a chance to get involved, regardless of their experience level.

This latest testing round is all about whether users can create a custom template on a per-post basis directly from the editor. The answer? Why, yes, they absolutely can.

Round #6 asks for volunteers to use the new template-editing mode, which is expected to land in WordPress 5.8, to build a WordCamp landing page. The goal is to offer a discount code and attract attendees from another event to join.

Anyone interested in discovering issues and providing feedback should give this testing round a shot. There is a 36-step guide that will walk you through building a custom landing page. It should take no more than 15 minutes, maybe more if you are putting a unique spin on the design — that is half the fun for me.

Feedback is open through May 26. Just follow the instructions and leave a comment on the post.

The closest thing to a local WordCamp I have is Birmingham, AL, known for its “WP Y’all” name. I am hopeful that the WC Birmingham team would not mind me borrowing their logo for this experiment. The following is the WordCamp landing page I built with the TT1 Blocks theme:

Full page screenshot of a reimagined WordCamp Birmingham landing page.

Other than the known Nav Menu block issue noted in the post, I ran into no technical problems with any of the 36 steps. Everything worked as expected. However, that does not mean that everything was perfect.

Problems, Mostly Trivial

Before diving into the actual user-experience issues with building templates, I noticed a problem with the custom template system. After finishing the testing round, I wanted to see what my template looked like with other themes. However, I could not do this. Upon activating another theme, my custom template seemed to disappear.

The problem is that custom templates are tied to the theme. I see the logic in this. Certain aspects could be specific to the active theme (colors, fonts, etc.), and it is always how custom templates have worked. However, the block template system is different. From a user viewpoint, I feel like my custom-created templates belong to me rather than the theme.

I can see a user switching themes after a couple of years and building a dozen or so templates having a poor experience in this situation. If the feature remains the same, there should be more clarity.

One of the more frustrating aspects of the template editor is the lack of space at the bottom of the frame. I am accustomed to the post editor’s extra whitespace, focusing the active workspace toward the top of the screen.

Screenshot of the template editor showing the limited space at its footer.
Limited space at the bottom of template editor.

I just want to put the current piece of the layout I am working on higher up the page. I am not sure how this would look when dealing with a template editor because it needs to clearly mark the end of the document.

The other issues were primarily around the TT1 Blocks theme or missing features with the current Gutenberg plugin.

When adding a horizontal Buttons block, there is no space between individual buttons. Vertical alignment is better, but it could use a slight bump (on the front end, not in the editor).

Two horizontal buttons with no space in between them.
Buttons a little too close.

And, I feel like I cannot be the first to say this: I am ready for Button block padding controls so that I can adjust TT1 Blocks’ abnormally large button output.

When inserting a full-width Columns block, the text on the left butted against the side of the page. Because neither the Columns nor the inner Column blocks currently have padding controls, the only way for users to “fix” this is to add a background color. Gutenberg automatically adds padding in that case.

Text in a left column butts against the side of the page because of no spacing.
No horizontal spacing.

The last trivial fix I had to make was adding a Spacer block above the custom footer section. This was not included in the testing instructions. Without it, the footer had no spacing between it and the content above it.

I did question one aspect of the testing instructions. Templates are generally a sort of wrapper or design layout. Content is a separate thing that typically lives independently. In this test, the content is housed within the template. There are scenarios where the test case makes sense. However, I would have preferred a flow where the content portion of the template was a part of the post and output via the Post Content block.

That sort of moving back and forth between post and template editors may have opened up some more usability hangups that would be worth exploring.

WordPress Community Team Discusses Adding Vaccination Status to In-Person Meetup Safety Checklist

The WordPress community is eager to return to in-person events and organizers are discussing a path to ensure the safety of resuming meetups as a first step before considering WordCamps. Previous discussions led to the creation of a checklist to assist local organizers in determining if their chapter is eligible to proceed. Noticeably absent from the checklist at the time was the requirement for widely distributed vaccines before resuming local events.

This week, Andrea Middleton proposed adding vaccination status to the in-person meetup safety checklist.

“When we created that checklist, COVID-19 vaccine rollout was still in very early stages, and the checklist did not account for vaccines,” Middleton said. “Vaccination efforts are still being rolled out across the world and many people do not have access to vaccines yet, but progress has reached a point where it seems wise to start incorporating it into the checklist, where possible.”

The proposal would allow places that don’t currently pass the checklist to hold WordPress meetups for vaccinated attendees if vaccines are freely available in the area and local authorities are permitting gatherings.

Local organizers would also be encouraged to continue holding online events or finding ways to livestream in-person meetups so that those who are not yet comfortable attending will still have access.

“It isn’t practical (and, in some places, legal) to ask organizers to check the vaccination status of individuals,” Middleton said. “Therefore, I suggest we ask groups to use the honor system, trusting that people will only attend these events if they have been vaccinated.”

If meetup organizers move forward with the honor system, attendees will have to embrace some risk should people who are not fully vaccinated wish to break the meetup guidelines.

WordPress community leadership has the challenging task of navigating this new territory with changing conditions all over the globe. The changing laws and recommendations in different areas make it nearly impossible to create a policy that will work across the board. This week, the US passed a major milestone when the Centers for Disease Control and Prevention (CDC) updated its interim public health recommendations for fully vaccinated people, allowing them to discontinue mask wearing and physical distancing in most cases. However, governors in some states said that indoor mask mandates would remain in place while state health officials review the new recommendations.

In the comments of the proposal, Mika Epstein asked if there will be repercussion if someone violates the honor code – otherwise “what’s the point in having a that proposal in the first place?” A policy that isn’t enforceable becomes more of an encouragement than a requirement.

WordPress meetup organizers, just like retailers, restaurants, and other businesses, will have no way of knowing who is vaccinated and who is not. The CDC reports that only 36.2% of the US population is fully vaccinated. The share of people who have had at least one does of the COVID-19 vaccine varies greatly from one country to the next.

While some countries are logging very low numbers for daily cases, despite having only small percentages of the population vaccinated, they pay the price with intermittent lockdowns, travel bans, and strict quarantine measures. In-person WordPress meetups may not be possible in these locations where vaccines are not widely available, despite the local chapter being able to meet most of the requirements on the checklist.

The discussion is open until May 27, when Middleton plans to close comments on the proposal.

Salt Security Expands API Protection Platform

In 2019, Salt Security launched an API Protection Platform that leverages artificial intelligence in order to provide detailed API traffic monitoring that detects malicious behavior and prevents attacks before they can happen. Salt is now expanding this platform to include automated OpenAPI Specification (OAS) analysis and new security analysis points. 

Auto-Generated Social Media Images

I’ve been thinking about social media images again. You know, the images that (can) show up when you share a link in places like Twitter, Facebook, or iMessage. You’re essentially leaving money on the table without them, because they turn a regular post with a little ol’ link in it into a post with a big honkin’ attention grabbin’ image on it, with a massive clickable area. Of any image on a website, the social media image might be the #1 most viewed, most remembered, most network-requested image on the site.

It’s essentially this bit of HTML that makes them happen:

<meta property="og:image" content="/images/social-media-image.jpg" />

But make sure to read up on it as there are a bunch other other HTML tags to get right.

I think I’m thinking about it again because GitHub seems to have new social media cards. These are new, right?

Those GitHub social media images are clearly programmatically generated. Check out an example URL.

Automation

While I think you can get a lot of bang out of a totally hand-crafted bespoke-designed social media image, that’s not practical for sites with lots of pages: blogs, eCommerce… you know what I mean. The trick for sites like that is to automate their creation via templating somehow. I’ve mentioned other people’s takes on this in the past, but let’s recap:

You know what all those have in common? Puppeteer.

Puppeteer is a way to spin up and control a headless copy of Chrome. It has this incredibly useful feature of being able to take a screenshot of the browser window: await page.screenshot({path: 'screenshot.png'});. That’s how our coding fonts website does the screenshots. The screenshotting idea is what gets people’s minds going. Why not design a social media template in HTML and CSS, then ask Puppeteer to screenshot it, and use that as the social media image?

I love this idea, but it means having access to a Node server (Puppeteer runs on Node) that is either running all the time, or that you can hit as a serverless function. So it’s no wonder that this idea has resonated with the Jamstack crowd who are already used to doing things like running build processes and leveraging serverless functions.

I think the idea of “hosting” the serverless function at a URL — and passing it the dynamic values of what to include in the screenshot via URL parameter is also clever.

The SVG route

I kinda dig the idea of using SVG as the thing that you template for social media images, partially because it has such fixed coordinates to design inside of, which matches my mental model of making the exact dimensions you need to design social media images. I like how SVG is so composable.

George Francis blogged “Create Your Own Generative SVG Social Images” which is a wonderful example of all this coming together nicely, with a touch of randomization and whimsy. I like the contenteditable trick as well, making it a useful tool for one-off screenshotting.

I’ve dabbled in dynamic SVG creation as well: check out this conference page on our Conferences site.

Unfortunately, SVG isn’t a supported image format for social media images. Here’s Twitter specifically:

URL of image to use in the card. Images must be less than 5MB in size. JPG, PNG, WEBP and GIF formats are supported. Only the first frame of an animated GIF will be used. SVG is not supported.

Twitter docs

Still, composing/templating in SVG can be cool. You convert it to another format for final usage. Once you have an SVG, the conversion from SVG to PNG is almost trivially easy. In my case, I used svg2png and a very tiny Gulp task that runs during the build process.

What about WordPress?

I don’t have a build process for my WordPress site — at least not one that runs every time I publish or update a post. But WordPress would benefit the most (in my world) from dynamic social media images.

It’s not that I don’t have them now. Jetpack goes a long way in making this work nicely. It makes the “featured image” of the post the social media image, allows me to preview it, and auto-posts to social networks. Here’s a video I did on that. That’s gonna get me to a place where the featured images are attached and showing nicely.

But it doesn’t automate their creation. Sometimes a bespoke graphic alone is the way to go (the one above might be a good example of that), but perhaps more often a nicely templated card is the way to go.

Fortunately I caught wind of Social Image Generator for WordPress from Daniel Post. Look how fancy:

This is exactly what WordPress needs!

Daniel himself helped me create a custom template just for CSS-Tricks. I had big dreams of having a bunch of templates to choose from that incorporate the title, author, chosen quotes, featured images, and other things. So far, we’ve settled on just two, a template with the title and author, and a template with a featured image, title, and author. The images are created from that metadata on the fly:

So meta.

This ain’t Puppeteer. This ain’t even the PhantomJS powered svgtopng. This is PHP generated images! And not even ImageMagick, but straight up GD, the thing built right into PHP. So these images are not created in any kind of syntax that would likely feel comfortable to a front-end developer. You’re probably better off using one of the templates, but if you wanna see how my custom one was coded (by Daniel), lemme know and I can post the code somewhere public.

Pretty cool result, right?

Tweet

I get why it had to be built this way: it’s using technology that will work literally anywhere WordPress can run. That’s very much in the WordPress spirit. But it does make me wish creating the templates could be done in a more modern way. Like wouldn’t it be cool if the template for your social media images was just like social-image.php at the root of the theme like any other template file? And you template and design that page with all the normal WordPress APIs? Like an ACF Block almost? And it gets screenshot and used? I’ll answer for you: Yes, that would be cool.


The post Auto-Generated Social Media Images appeared first on CSS-Tricks.

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

1-VoIP Review

Building a good reputation for your business means keeping up top-notch communication. You need a VoIP phone service with a solid foundation and advanced features that can help you do that.

When you can communicate across many channels, you make more business connections and help more customers. As a result, you grow your business.

If you’re looking for a new VoIP provider, consider 1-VoIP. It offers a scalable, straightforward system that’s easy to use, even if you don’t know your tech. Let’s compare it with a few other VoIP systems to help you decide whether it’s right for your business.

1-VoIP Pros and Cons

Pros

  • Affordable
  • User-friendly interface
  • Excellent customer support
  • Straightforward and scalable

Cons

  • No video conferencing
  • Fewer advanced features
Compare The Best VoIP Phone Services
We reviewed dozens of VoIP phone services and narrowed them down to the best options.
See Top Picks

How 1-VoIP Compares to Top VoIP Phone Services

1-VoIP gives you everything you need in terms of basic calling features. It also comes with more advanced ones that you’ll almost certainly need for a growing business. The company has packages for both business and residential customers, making it flexible for almost everyone.

The company offers a free setup, putting it a step ahead of other providers, like AXVoice. It also has comparable features when it comes to international calling, putting it on par with popular services like VoIPLy and Vonage.

Although 1-VoIP offers excellent customer service, it also gives you tons of helpful resources if you don’t want to jump straight to calling customer support. Still, they lack some support channels, like instant chat and online ticket submissions, which you can find with VoIPLy.

1-VoIP’s biggest shortcoming is that it doesn’t have video conferencing. If your team does a lot of video calling, you may want to consider RingCentral or VoIPLy, both of which have video conferencing at comparable prices. They’re both highly rated with other quality features that you can find with 1-VoIP.

 

1-VoIP Call Quality

Having a high-quality phone system can boost your company’s reputation. It shows you care about the quality of your conversations with customers and that you want to help solve their problems. Better call quality ultimately leads to a better customer experience.

1-VoIP is known for its excellent call quality. With minimal complaints, it’s a step up from VoIPLy, which has mixed reviews. 1-VoIP’s high-definition system works with most headsets, so you can use the system in whatever way works for your team while maintaining great audio quality.

The system keeps its call quality, whether you make domestic or international calls. It lets you stay connected with everyone without worrying about dropped lines or crackly phone calls. The system’s call quality shines above many of its other features and makes it stand out compared to other services.

1-VoIP Pricing

A low price shouldn’t be your top priority when it comes to finding a VoIP phone service, but it is an important point to consider. You must know what your budget allows for and what you need for your business to function at its best. Remember, you can always upgrade your package as your business grows, but you want something that lasts, too.

Here’s a look at 1-VoIP’s business phone service pricing:

1-VoIP has competitive pricing, but you can find cheaper options with similar features. VoIPLy is a few dollars cheaper per month and offers just as much. With VoIPLy, you have unlimited calling to more than 50 countries, plus video conferencing, and the company has a good reputation.

With 1-VoIP, you pay by extension and per month, as opposed to only per month, like with VoIPLy and AXVoice. You don’t have to sign a contract with 1-VoIP, though other top brands like Vonage also skip the contract.

1-VoIP has three packages with business VoIP:

  • Metered: $14.97/mo/extension
  • Corporate: $19.97/mo/extension
  • Professional: $29.97/mo/extension

With the Metered plan, you pay a per-minute rate of 2 cents. That doesn’t sound like a lot, but if your team makes a lot of calls, it adds up. It may be worth getting the next package up or going for another VoIP system that doesn’t apply this type of charge.

1-VoIP Advanced Calling Features

You want a phone system that serves your business well with both basic and advanced features. 1-VoIP has you covered with call forwarding, superior call quality, caller ID, call waiting, call blocking, and more. But it has plenty of advanced features to go with its strong basics.

When it comes to advanced features, 1-VoIP offers many of the same ones as VoIPLy, including:

  • Advanced call forwarding
  • Anonymous call rejection
  • Privacy options
  • Three-way calling
  • Call recording
  • Virtual phone number
  • Selective call acceptance and rejection
  • Free paperless fax

Unfortunately, 1-VoIP does not come with voicemail transcription. If that’s something that helps your team function better, go with a provider that does have it, like VoIPLy.

1-VoIP has advanced features. However, not all of these are built-in. While you can use them with the system, you’ll need to get a third-party app to make them work. 1-VoIP also does not have SIP in its standard packages, but you can connect it for an additional fee.

1-VoIP International Calling

1-VoIP gives you international calling, as well as unlimited calls in the United States and Canada. International rates vary based on your location, so you have to check their website for rates in your area.

1-VoIP’s residential package has an option for their World Unlimited Plan, which lets you make unlimited calls to over 30 countries. That package doesn’t quite measure up against VoIPLy, which allows you to make unlimited calls with their packages to over 50 countries. Some Vonage plans also give you unlimited international calling.

You might find it difficult to look up numbers for the international calling feature because of the system’s input field, which is one of the platform’s only less intuitive parts. If you don’t do much international calling, you may find that 1-VoIP suits your team’s needs. Still, if you don’t need the system’s other advanced features, it may not be worth buying the most expensive package just to have unlimited international calling when you could get more with another provider.

1-VoIP Customer Support

While you support your customers, you want to know that your VoIP service company will support you, too. In this case, good customer service trickles down. If your VoIP company’s customer support gets you up and running faster, that means you can get back to your customers faster, instead of waiting for the next available agent.

Luckily, 1-VoIP is rated number one in customer support. They have 24/7 customer service, so you don’t have to worry about being unable to reach a representative when you need them.

However, 1-VoIP does not have customer support on all channels, which might make it harder to get in touch with them if you don’t have time to call. You can only reach them through email or by calling the company.

Other companies make their support more accessible. VoIPLy has online ticket submission and an instant chat system, too. When it comes to customer service quality, 1-VoIP beats out both companies, so consider that when you make your final decision.

Much of 1-VoIP’s customer service comes as more of a self-serve system. They have plenty of e-guides, video resources, and FAQs to help you learn and troubleshoot if you want to try solving the issue on your own.

1-VoIP Mobile Features

Remote workers need mobile features to do their jobs well. Whether that means forwarding calls to mobile or having the ability to answer calls from your cell phone when you’re not in the office, a mobile app can make running your business more convenient.

Mobile features give your VoIP system more flexibility, which in turn means you have a more versatile business. You can use mobile features with 1-VoIP, but they’re not built-in like with RingCentral. 1-VoIP also doesn’t come with built-in web-based SMS or softphone capabilities.

You need a third-party app if you want any of these features. That can add up in price, especially if you don’t already have a third-party app to connect. If you do have one already, connecting it doesn’t require any complex setup.

1-VoIP Design and Interface

When you get a VoIP system, your team should be able to use it without any trouble. An intuitive interface makes things efficient, as it allows everyone to find the features they need right away. It also makes setup quick, so you can get to work in minutes instead of days.

1-VoIP has a reputation for its user-friendly design. It comes with free setup, but you can configure it yourself, too, using 1-VoIP’s video resources. The videos and walkthroughs give you instructions on how to set up the system so that even people without much technical knowledge can put it together.

Once you’ve gotten past the first couple of steps, you just need to put your information into your account. Everything is right in front of you, which tells you that 1-VoIP has really considered their customers.

They make sure you can find any customer support resources you might need while setting up your platform and configuring your settings. The platform lists all features under the Features menu, so you don’t have to search for anything in obscure nooks and crannies to find what you’re looking for.

1-VoIP Video Conferencing

Many businesses use video conferencing to connect with other companies and even conduct interviews. If yours is one of them, you should probably skip 1-VoIP.

1-VoIP’s phone system doesn’t have video conferencing with any of its packages. However, you can get this feature with most other VoIP phone services, like RingCentral or VoIPLy, without paying more than you would for 1-VoIP.

Residential VoIP

1-VoIP’s Residential VoIP system works well if you’re a one-person business. It offers many of the same features as the business packages but is tailored for fewer people. In these packages, you can find features like:

  • Voicemail to email
  • Virtual fax
  • Whitelist and blacklist
  • Digital call forward
  • Anonymous call reject

Residential VoIP can help you save money, compared to a subscription with a regular phone company. It gives you more control over your home phone and helps you run your business from home when you need more than a basic landline or cell phone.

You can get 1-VoIP’s residential VoIP system with three plans:

  • Value: At $8.97, you can take advantage of unlimited incoming calls and 500 outgoing minutes. You get all premium features, and the system includes all the hardware you need.
  • US & Canada Unlimited: For $17.97, you get unlimited incoming and outgoing calls in North America, plus all Value features.
  • World Unlimited: $23.97 gets you unlimited incoming and outgoing calls to over 30 countries, plus all US & Canada Unlimited package features.

Business VoIP

Business VoIP is ideal if you plan to grow your business. It can save you up to 53% on phone bills with 1-VoIP, and it has over 40 business features. That means you have plenty of ways to serve your customers and make connections with other businesses.

Without contracts or cancellation fees, this service connects to your existing phones. In other words, you don’t need to make any major changes to the way your team functions.

You can get business VoIP service in three packages:

  • Metered: $14.97/mo/extension
  • Corporate: $19.97/mo/extension
  • Professional: $29.97/mo/extension

The professional package also includes a phone number and extension. Each tier includes all business features, so you won’t miss out if you buy a cheaper package.

SIP Trunking

1-VoIP may not come with built-in SIP, but you can connect it with a special SIP trunking service. With 99.999% uptime, you’ll know you have reliable service with 1-VoIP. A SIP trunk allows you to make calls using the internet by connecting to your PBX, as opposed to your average handset.

You can get SIP trunking through 1-VoIP in three packages:

  • US & Canada Number: $4.95/mo/number
  • SIP Trunking Minute Bundle: $25/mo
  • Toll-Free Number: $5.95/mo/number

The SIP Trunking Minute Bundle package gives you more customizable options than the rest. With the US & Canada and SIP Trunking Minute Bundle packages, you get unlimited simultaneous calls and unlimited incoming minutes.

Compare The Best VoIP Phone Services
We reviewed dozens of VoIP phone services and narrowed them down to the best options.
See Top Picks

Summary

Overall, 1-VoIP doesn’t stand out as overwhelmingly better than most other VoIP service providers. Without video conferencing, it also puts itself at a disadvantage.

However, it’s still a very solid option. Its excellent call quality and customer service give you the support you need to serve your customers. Its international calling capability means you aren’t limited on where you can call, and you can broaden its scope with third-party apps that let you take advantage of mobile features.

1-VoIP’s reasonable pricing, intuitive platform, and comprehensive voice features make it a great option for most types of businesses. If you only need a system with strong basics and a few advanced features, 1-VoIP has what you need to start a new business or grow your existing one.

Creating Stylesheet Feature Flags With Sass !default

!default is a Sass flag that indicates conditional assignment to a variable — it assigns a value only if the variable was previously undefined or null. Consider this code snippet:

$variable: 'test' !default;

To the Sass compiler, this line says:

Assign $variable to value 'test', but only if $variable is not already assigned.

Here’s the counter-example, illustrating the other side of the !default flag’s conditional behavior:

$variable: 'hello world';
$variable: 'test' !default;
// $variable still contains `hello world`

After running these two lines, the value of $variable is still 'hello world' from the original assignment on line 1. In this case, the !default assignment on line 2 is ignored since a value has already been provided, and no default value is needed.

Style libraries and @use...with

The primary motivation behind !default in Sass is to facilitate the usage of style libraries, and their convenient inclusion into downstream applications or projects. By specifying some of its variables as !default, the library can allow the importing application to customize or adjust these values, without completely forking the style library. In other words, !default variables essentially function as parameters which modify the behavior of the library code.

Sass has a special syntax just for this purpose, which combines a stylesheet import with its related variable overrides:

// style.scss
@use 'library' with (
  $foo: 'hello',
  $bar: 'world'
);

This statement functions almost the same as a variable assignment followed by an @import, like so:

// style.scss - a less idiomatic way of importing `library.scss` with configuration
$foo: 'hello';
$bar: 'world';
@import 'library';

The important distinction here, and the reason @use...with is preferable, is about the scope of the overrides. The with block makes it crystal clear — to both the Sass compiler and anyone reading the source code — that the overrides apply specifically to variables which are defined and used inside of library.scss. Using this method keeps the global scope uncluttered and helps mitigate variable naming collisions between different libraries.

Most common use case: Theme customization

// library.scss
$color-primary: royalblue !default;
$color-secondary: salmon !default: 


// style.scss
@use 'library' with (
  $color-primary: seagreen !default;
  $color-secondary: lemonchiffon !default: 
);

One of the most ubiquitous examples of this feature in action is the implementation of theming. A color palette may be defined in terms of Sass variables, with !default allowing customization of that color palette while all other styling remains the same (even including mixing or overlaying those colors).

Bootstrap exports its entire Sass variable API with the !default flag set on every item, including the theme color palette, as well as other shared values such as spacing, borders, font settings, and even animation easing functions and timings. This is one of the best examples of the flexibility provided by !default, even in an extremely comprehensive styling framework.

In modern web apps, this behavior by itself could be replicated using CSS Custom Properties with a fallback parameter. If your toolchain doesn’t already make use of Sass, modern CSS may be sufficient for the purposes of theming. However, we’ll examine use cases that can only be solved by use of the Sass !default flag in the next two examples.

Use case 2: Loading webfonts conditionally

// library.scss
$disable-font-cdn: false !default;
@if not $disable-font-cdn {
  @import url(''https://fonts.googleapis.com/css2?family=Public+Sans&display=swap'');
}


// style.scss
@use 'library' with (
  $disable-font-cdn: true
);
// no external HTTP request is made

Sass starts to show its strength when it leverages its preprocessor appearance in the CSS lifecycle. Suppose the style library for your company’s design system makes use of a custom webfont. It’s loaded from a Google’s CDN — ideally as quick as it gets — but nevertheless a separate mobile experience team at your company has concerns about page load time; every millisecond matters for their app.

To solve this, you can introduce an optional boolean flag in your style library (slightly different from the CSS color values from the first example). With the default value set to false, you can check this feature flag in a Sass @if statement before running expensive operations such as external HTTP requests. Ordinary consumers of your library don’t even need to know that the option exists — the default behavior works for them and they automatically load the font from the CDN, while other teams have access to the toggle what they need in order to fine tune and optimize page loading.

A CSS variable would not be sufficient to solve this problem — although the font-family could be overridden, the HTTP request would have already gone out to load the unused font.

Use case 3: Visually debugging spacing tokens

View live demo

!default feature flags can also be used to create debugging tools for use during development. In this example, a visual debugging tool creates color-coded overlays for spacing tokens. The foundation is a set of spacing tokens defined in terms of ascending “t-shirt sizes” (aka “xs”/”extra-small” through “xl”/”extra-large”). From this single token set, a Sass @each loop generates every combination of utility classes applying that particular token to padding or margin, on every side (top, right, bottom, and left individually, or all four at once).

Since these selectors are all constructed dynamically in a nested loop, and single !default flag can switch the rendering behavior from standard (margin plus padding) to the colored debug view (using transparent borders with the same sizes). This color-coded view may look very similar to the deliverables and wireframes which a designer might hand off for development — especially if you are already sharing the same spacing values between design and dev. Placing the visual debug view side-by-side with the mockup can help quickly and intuitively spot discrepancies, as well as debug more complex styling issues, such as margin collapse behavior.

Again — by the time this code is compiled for production, none of the debugging visualization will be anywhere in the resulting CSS since it will be completely replaced by the corresponding margin or padding statement.

Further reading

These are just a few examples of Sass !default in the wild. Refer to these documentation resources and usage examples as you adapt the technique to your own variations.


The post Creating Stylesheet Feature Flags With Sass !default appeared first on CSS-Tricks.

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

HTML Boilerplates

Manuel Matuzović goes line-by-line through a boilerplate HTML document. I like it. It’s a good reference and has a lot of the same type of stuff I tend to put in the main HTML template. It makes me think about how opinionated this kind of thing can be. Dang near every line! Not the DOCTYPE, not the <title>, but nearly everything else.

The HTML
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width">

  <title>Unique page title - My Site</title>

  <script type="module">
    document.documentElement.classList.remove('no-js');
    document.documentElement.classList.add('js');
  </script>

  <link rel="stylesheet" href="/assets/css/styles.css">
  <link rel="stylesheet" href="/assets/css/print.css" media="print">

  <meta name="description" content="Page description">
  <meta property="og:title" content="Unique page title - My Site">
  <meta property="og:description" content="Page description">
  <meta property="og:image" content="https://www.mywebsite.com/image.jpg">
  <meta property="og:image:alt" content="Image description">
  <meta property="og:locale" content="en_GB">
  <meta property="og:type" content="website">
  <meta name="twitter:card" content="summary_large_image">
  <meta property="og:url" content="https://www.mywebsite.com/page">
  <link rel="canonical" href="https://www.mywebsite.com/page">

  <link rel="icon" href="/favicon.ico">
  <link rel="icon" href="/favicon.svg" type="image/svg+xml">
  <link rel="apple-touch-icon" href="/apple-touch-icon.png">
  <link rel="manifest" href="/my.webmanifest">
  <meta name="theme-color" content="#FF00FF">
</head>

<body>
  <!-- Content -->
  <script src="/assets/js/xy-polyfill.js" nomodule></script>
  <script src="/assets/js/script.js" type="module"></script>
</body>
</html>

Maybe my site doesn’t use any JavaScript or have no-JavaScript fallbacks so I don’t need any of the class name dancing. Maybe my site doesn’t need print styles, but I do need link prefetching. Maybe I don’t care about social images, but I do want critical CSS in the head. It’s a boilerplate, not a prescription — it’s meant to be changed.

There was a time when HTML5 Boilerplate was a huge project in this space. It has a whole GitHub Org! The boilerplate has 50,000 stars! Personally, I feel like the project lost its way when it started to have a src and dist folder and a 200-line Gulp build process, ya know? It worked best as a reference for what stuff any given web project might need, but now I feel like it is intimidating in a way it doesn’t need to be. The boilerplate index file is also quite opinionated. It assumes Normalize and Modernizr, which are certainly not deprecated projects, but also not things I see developers reaching for much anymore. It even assumes Google Analytics usage!

I have no problem with people having and sharing boilerplate documents, but considering how unavoidable being opinionated it is with them, I also like the reference guide approach. Just show me every possible thing that can go in the <head> (a lot of the value of these boilerplates), and I’ll pick and choose what I need (or may have forgotten). To that end, Josh Buchea’s HEAD project is pretty cool.


The post HTML Boilerplates appeared first on CSS-Tricks.

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

Getting started with Java Serverless Functions using Quarkus and AWS Lambda

The serverless journey started with functions - small snippets of code running on-demand and a short period in Figure 1.  AWS Lambda in the “1.0” phase made this paradigm very popular, but it had its limitations around execution time, protocols, and poor local development experience. 

Since then, developers realized that the same serverless traits and benefits could be applied to microservices and Linux containers. This leads us into what we're calling the “1.5” phase in Figure 1.  Some serverless containers here completely abstract Kubernetes, delivering the serverless experience through an abstraction layer that sits on top of it, like Knative.

Ripper casino Review – Get up to AU$7500 for code ‘RIPPER150’

Table of contents Welcome bonus package at Ripper Casino Pros and cons of minimum deposit at Ripper Casino Best gambling opportunities at Ripper Casino Ripper Casino Security and fair play Customer support Our exclusive ‘RIPPER150’ coupon gives players at Ripper Casino access to massive promotions and bonuses. If you prioritise the safety of financial transactions […]

Tree-Shaking: A Reference Guide

Before starting our journey to learn what tree-shaking is and how to set ourselves up for success with it, we need to understand what modules are in the JavaScript ecosystem.

Since its early days, JavaScript programs have grown in complexity and the number of tasks they perform. The need to compartmentalize such tasks into closed scopes of execution became apparent. These compartments of tasks, or values, are what we call modules. They’re main purpose is to prevent repetition and to leverage reusability. So, architectures were devised to allow such special kinds of scope, to expose their values and tasks, and to consume external values and tasks.

To dive deeper into what modules are and how they work, I recommend “ES Modules: A Cartoon Deep-Dive”. But to understand the nuances of tree-shaking and module consumption, the definition above should suffice.

What Does Tree-Shaking Actually Mean?

Simply put, tree-shaking means removing unreachable code (also known as dead code) from a bundle. As Webpack version 3’s documentation states:

“You can imagine your application as a tree. The source code and libraries you actually use represent the green, living leaves of the tree. Dead code represents the brown, dead leaves of the tree that are consumed by autumn. In order to get rid of the dead leaves, you have to shake the tree, causing them to fall.”

The term was first popularized in the front-end community by the Rollup team. But authors of all dynamic languages have been struggling with the problem since much earlier. The idea of a tree-shaking algorithm can be traced back to at least the early 1990s.

In JavaScript land, tree-shaking has been possible since the ECMAScript module (ESM) specification in ES2015, previously known as ES6. Since then, tree-shaking has been enabled by default in most bundlers because they reduce output size without changing the program’s behaviour.

The main reason for this is that ESMs are static by nature. Let‘s dissect what that means.

ES Modules vs. CommonJS

CommonJS predates the ESM specification by a few years. It came about to address the lack of support for reusable modules in the JavaScript ecosystem. CommonJS has a require() function that fetches an external module based on the path provided, and it adds it to the scope during runtime.

That require is a function like any other in a program makes it hard enough to evaluate its call outcome at compile-time. On top of that is the fact that adding require calls anywhere in the code is possible — wrapped in another function call, within if/else statements, in switch statements, etc.

With the learning and struggles that have resulted from wide adoption of the CommonJS architecture, the ESM specification has settled on this new architecture, in which modules are imported and exported by the respective keywords import and export. Therefore, no more functional calls. ESMs are also allowed only as top-level declarations — nesting them in any other structure is not possible, being as they are static: ESMs do not depend on runtime execution.

Scope and Side Effects

There is, however, another hurdle that tree-shaking must overcome to evade bloat: side effects. A function is considered to have side effects when it alters or relies on factors external to the scope of execution. A function with side effects is considered impure. A pure function will always yield the same result, regardless of context or the environment it’s been run in.

const pure = (a:number, b:number) => a + b
const impure = (c:number) => window.foo.number + c

Bundlers serve their purpose by evaluating the code provided as much as possible in order to determine whether a module is pure. But code evaluation during compiling time or bundling time can only go so far. Therefore, it’s assumed that packages with side effects cannot be properly eliminated, even when completely unreachable.

Because of this, bundlers now accept a key inside the module’s package.json file that allows the developer to declare whether a module has no side effects. This way, the developer can opt out of code evaluation and hint the bundler; the code within a particular package can be eliminated if there’s no reachable import or require statement linking to it. This not only makes for a leaner bundle, but also can speed up compiling times.


{
    "name": "my-package",
    "sideEffects": false
}

So, if you are a package developer, make conscientious use of sideEffects before publishing, and, of course, revise it upon every release to avoid any unexpected breaking changes.

In addition to the root sideEffects key, it is also possible to determine purity on a file-by-file basis, by annotating an inline comment, /*@__PURE__*/, to your method call.

const x = */@__PURE__*/eliminated_if_not_called()

I consider this inline annotation to be an escape hatch for the consumer developer, to be done in case a package has not declared sideEffects: false or in case the library does indeed present a side effect on a particular method.

Optimizing Webpack

From version 4 onward, Webpack has required progressively less configuration to get best practices working. The functionality for a couple of plugins has been incorporated into core. And because the development team takes bundle size very seriously, they have made tree-shaking easy.

If you’re not much of a tinkerer or if your application has no special cases, then tree-shaking your dependencies is a matter of just one line.

The webpack.config.js file has a root property named mode. Whenever this property’s value is production, it will tree-shake and fully optimize your modules. Besides eliminating dead code with the TerserPlugin, mode: 'production' will enable deterministic mangled names for modules and chunks, and it will activate the following plugins:

  • flag dependency usage,
  • flag included chunks,
  • module concatenation,
  • no emit on errors.

It’s not by accident that the trigger value is production. You will not want your dependencies to be fully optimized in a development environment because it will make issues much more difficult to debug. So I would suggest going about it with one of two approaches.

On the one hand, you could pass a mode flag to the Webpack command line interface:

# This will override the setting in your webpack.config.js
webpack --mode=production

Alternatively, you could use the process.env.NODE_ENV variable in webpack.config.js:

mode: process.env.NODE_ENV === 'production' ? 'production' : development

In this case, you must remember to pass --NODE_ENV=production in your deployment pipeline.

Both approaches are an abstraction on top of the much known definePlugin from Webpack version 3 and below. Which option you choose makes absolutely no difference.

Webpack Version 3 and Below

It’s worth mentioning that the scenarios and examples in this section might not apply to recent versions of Webpack and other bundlers. This section considers usage of UglifyJS version 2, instead of Terser. UglifyJS is the package that Terser was forked from, so code evaluation might differ between them.

Because Webpack version 3 and below don’t support the sideEffects property in package.json, all packages must be completely evaluated before the code gets eliminated. This alone makes the approach less effective, but several caveats must be considered as well.

As mentioned above, the compiler has no way of finding out by itself when a package is tampering with the global scope. But that’s not the only situation in which it skips tree-shaking. There are fuzzier scenarios.

Take this package example from Webpack’s documentation:

// transform.js
import * as mylib from 'mylib';

export const someVar = mylib.transform({
  // ...
});

export const someOtherVar = mylib.transform({
  // ...
});

And here is the entry point of a consumer bundle:

// index.js

import { someVar } from './transforms.js';

// Use `someVar`...

There’s no way to determine whether mylib.transform instigates side effects. Therefore, no code will be eliminated.

Here are other situations with a similar outcome:

  • invoking a function from a third-party module that the compiler cannot inspect,
  • re-exporting functions imported from third-party modules.

A tool that might help the compiler get tree-shaking to work is babel-plugin-transform-imports. It will split all member and named exports into default exports, allowing the modules to be evaluated individually.

// before transformation
import { Row, Grid as MyGrid } from 'react-bootstrap';
import { merge } from 'lodash';

// after transformation
import Row from 'react-bootstrap/lib/Row';
import MyGrid from 'react-bootstrap/lib/Grid';
import merge from 'lodash/merge';

It also has a configuration property that warns the developer to avoid troublesome import statements. If you’re on Webpack version 3 or above, and you have done your due diligence with basic configuration and added the recommended plugins, but your bundle still looks bloated, then I recommend giving this package a try.

Scope Hoisting and Compile Times

In the time of CommonJS, most bundlers would simply wrap each module within another function declaration and map them inside an object. That’s not any different than any map object out there:

(function (modulesMap, entry) {
  // provided CommonJS runtime
})({
  "index.js": function (require, module, exports) {
     let { foo } = require('./foo.js')
     foo.doStuff()
  },
  "foo.js": function(require, module, exports) {
     module.exports.foo = {
       doStuff: () => { console.log('I am foo') }
     }
  }
}, "index.js")

Apart from being hard to analyze statically, this is fundamentally incompatible with ESMs, because we’ve seen that we cannot wrap import and export statements. So, nowadays, bundlers hoist every module to the top level:

// moduleA.js
let $moduleA$export$doStuff = () => ({
  doStuff: () => {}
})

// index.js
$moduleA$export$doStuff()

This approach is fully compatible with ESMs; plus, it allows code evaluation to easily spot modules that aren’t being called and to drop them. The caveat of this approach is that, during compiling, it takes considerably more time because it touches every statement and stores the bundle in memory during the process. That’s a big reason why bundling performance has become an even greater concern to everyone and why compiled languages are being leveraged in tools for web development. For example, esbuild is a bundler written in Go, and SWC is a TypeScript compiler written in Rust that integrates with Spark, a bundler also written in Rust.

To better understand scope hoisting, I highly recommend Parcel version 2’s documentation.

Avoid Premature Transpiling

There’s one specific issue that is unfortunately rather common and can be devastating for tree-shaking. In short, it happens when you’re working with special loaders, integrating different compilers to your bundler. Common combinations are TypeScript, Babel, and Webpack — in all possible permutations.

Both Babel and TypeScript have their own compilers, and their respective loaders allow the developer to use them, for easy integration. And therein lies the hidden threat.

These compilers reach your code before code optimization. And whether by default or misconfiguration, these compilers often output CommonJS modules, instead of ESMs. As mentioned in a previous section, CommonJS modules are dynamic and, therefore, cannot be properly evaluated for dead-code elimination.

This scenario is becoming even more common nowadays, with the growth of “isomorphic” apps (i.e. apps that run the same code both server- and client-side). Because Node.js does not have standard support for ESMs yet, when compilers are targeted to the node environment, they output CommonJS.

So, be sure to check the code that your optimization algorithm is receiving.

Tree-Shaking Checklist

Now that you know the ins and outs of how bundling and tree-shaking work, let’s draw ourselves a checklist that you can print somewhere handy for when you revisit your current implementation and code base. Hopefully, this will save you time and allow you to optimize not only the perceived performance of your code, but maybe even your pipeline’s build times!

  1. Use ESMs, and not only in your own code base, but also favour packages that output ESM as their consumables.
  2. Make sure you know exactly which (if any) of your dependencies have not declared sideEffects or have them set as true.
  3. Make use of inline annotation to declare method calls that are pure when consuming packages with side effects.
  4. If you’re outputting CommonJS modules, make sure to optimize your bundle before transforming the import and export statements.

Package Authoring

Hopefully, by this point we all agree that ESMs are the way forward in the JavaScript ecosystem. As always in software development, though, transitions can be tricky. Luckily, package authors can adopt non-breaking measures to facilitate swift and seamless migration for their users.

With some small additions to package.json, your package will be able to tell bundlers the environments that the package supports and how they’re supported best. Here’s a checklist from Skypack:

  • Include an ESM export.
  • Add "type": "module".
  • Indicate an entry point through "module": "./path/entry.js" (a community convention).

And here’s an example that results when all best practices are followed and you wish to support both web and Node.js environments:

{
    // ...
    "main": "./index-cjs.js",
    "module": "./index-esm.js",
    "exports": {
        "require": "./index-cjs.js",
        "import": "./index-esm.js"
    }
    // ...
}

In addition to this, the Skypack team has introduced a package quality score as a benchmark to determine whether a given package is set up for longevity and best practices. The tool is open-sourced on GitHub and can be added as a devDependency to your package to perform the checks easily before each release.

Wrapping Up

I hope this article has been useful to you. If so, consider sharing it with your network. I look forward to interacting with you in the comments or on Twitter.

Useful Resources

Articles and Documentation

Projects and Tools

9 Best Quiz Plugins for WordPress (2021)

Are you looking for the best quiz plugins for your WordPress website?

Many popular websites like BuzzFeed use quizzes to create viral content and boost user engagement on their websites.

In this article, we have hand-picked the best quiz plugins for WordPress that will help you engage your users and increase time spent on your site.

Best quiz plugins for WordPress

1. Formidable Forms

Formidable Pro

Formidable Forms is the most advanced WordPress form builder plugin in the market. It comes with a simple but very powerful drag and drop form builder that helps you create forms that go beyond simple contact forms.

It’s equipped with powerful form templates, or you can start with a blank form and build your quiz from scratch.

You can create quizzes that are scored automatically or create your own grading scale. Once a user submits a quiz, there’s the option to email the score or display it in a success message.

Plus, there are multiple ways to format the quiz score, including the total answer count, letter grade, percentage of correct answers, and more.

Note: you’ll need to get at least the ‘Business’ plan, which includes the useful Quiz Maker addon.

For more details, see our guide on how to easily create a quiz in WordPress.

2. LearnDash

LearnDash

LearnDash is one of the best WordPress LMS plugins in the market. It comes with a powerful quiz feature which allows you to create any type of quiz that you need.

It has multiple question types including: single choice, multiple choice, free text, sorting, matching, essay, fill-in-the-blank, and survey.

Some of the other features include: timed quizzes, randomized questions, question bank, multi-page quizzes, limit attempts, and more. You can even add media into any of the question and answer choices.

Post quiz options include redirects, messages, quiz result displays in multiple styles, leaderboard, certificates, and levels.

Whether you are selling online courses or creating viral content, LearnDash is one of the most flexible WordPress quiz plugins for all types of quizzes.

3. Interact Quiz Maker

Interact Quiz Maker

Interact Quiz Maker is a powerful web-based app to generate viral quizzes and use them to generate leads, build social media following, generate traffic, and improve conversions.

It allows you to create highly interactive quizzes with a nifty drag and drop quiz builder.

You can choose different styles, colors, designs, and more than 800 ready-to-use quiz templates.

It supports quiz branching which allows you to show questions based on user’s answers to previous questions. You can use their scoring system to easily show results at the end.

It can be easily added to your site using a simple shortcode and integrates beautifully with your email marketing and CRM software.

4. WP Quiz

WP Quiz

WP Quiz is a flexible and easy to use quiz plugin for WordPress. It comes with 3 quiz types: trivia, personality, and flip cards.

You can add images to your questions and answers, allow users to restart quiz, show results at the end, and more.

WP Quiz comes with two styling options: multi-page or single page quiz. You have the ability to auto-scroll and add social sharing buttons.

The pro version of the plugin allows you to force users to perform an action to view results, randomize questions and answers, countdown timer, and display ads.

5. Quiz And Survey Master

Quiz and Survey Master

Quiz and Survey Master is a flexible quiz and WordPress survey plugin. This powerful two-in-one plugin may look a bit rough around the edges, but it makes up for it with excellent features and extensive documentation.

It supports multiple types of questions including multiple choice, true and false, fill the blanks and more.

It also allows you to create multiple result pages, so you can customize them based on user score. It comes with email support, certificates, leaderboards, hints, comment boxes, and more.

The pro version of the plugin comes with all kinds of addons that give you reporting and analysis, email marketing integration, funnel optimization, and more.

6. Quiz Cat

Quiz Cat

Quiz Cat is a free WordPress quiz plugin with an easy to use interface and great options to create viral quizzes for your website.

It allows you to add images to each question and answer. You can also create a start and finish screen for your quiz.

Each answer can be given a rating and assigned an amount of points. If you’re creating a right and wrong quiz for visitors, then this can be useful.

7. HD Quiz

HD Quiz

HD Quiz is another awesome free quiz plugin for your WordPress blog. It has a responsive design and allows you to create unlimited quizzes with as many questions and answers as you need.

You can also use GIF images with your questions and answers to make them more interactive and fun.

Other notable features include quiz timer, question tooltips for hints, social sharing, use images as answers, scoring, and more.

8. ARI Stream Quiz

ARI Stream Quiz

ARI Stream Quiz allows you to use quizzes for lead generation by collecting user email address and name.

It supports integration with MailChimp and other email marketing service providers. Apart from lead generation, the actual quiz builder features an easy to use interface to build your quizzes.

It uses AJAX for faster performance, has multiple themes, social media integration, Open Graph support, and more.

9. Chained Quiz

Chained Quiz

Chained Quiz is a WordPress quiz plugin with the conditional logic feature where the next question in the quiz depends on user’s answer to the previous question.

This allows you to create highly interactive personality quizzes that change dynamically.

It supports multiple choice, single choice, and essay answers. You can assign scoring to each correct answer and decide what to do when the user selects an answer.

Which is the Best WordPress Quiz Plugin?

After reviewing each of these plugins, we believe that Formidable Forms, LearnDash, and TryInteract are the most comprehensive quiz building solutions in the market.

If you’re looking for a solution to add quizzes to WordPress and advanced form building features, then we highly recommend you go with Formidable Forms.

If you want a simple way to create interactive quizzes on a course website, then LearnDash is a great option.

If you’re looking to create viral Buzzfeed style quizzes, then TryInteract is a great option for that because it comes with many ready-to-use templates.

We hope this article helped you find the best quiz plugin for WordPress. You may also want to see our list of the must have WordPress plugins for businesses and our expert picks of the best webinar software including free options.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 9 Best Quiz Plugins for WordPress (2021) appeared first on WPBeginner.

Multiply two totals

Good day

I am trying to get a total of two numbers.
The first number I need to get form my page (the number changes every few seconds (crypto clicker)
Second number must be 35
This is the code I got after search, but do not know how to get itto work

            `<form>
            USD:<input type="text" name="num1"><br>
            Doge:<input type="text" name="num2"><br>
            Sum: <input type="text" name="sum"><br>
            <input type="button" value="Sum" onclick="calcSum()">
            </form>
         <script>
           function calcSum() {
        let num1 = document.getElementsByName("num1")[0].value;
        let num2 = document.getElementsByName("num2")[0].value;
        let sum = Number(num1) * Number(num2);
        document.getElementsByName("sum")[0].value = sum;
    }
</script>`

JAVA Checking 10th place in a 2d Arraylist

I want to check if the last numbers in an arraylist are a 10.My data is in a 2d arraylist with 110 elements every 10 numbers is one node, I want to verify that the last digit of each node is a 10.

example: 1,2,3,4,5,6,7,8,9,10 in this case its true 1,12,3,4,8,5,4,8,9,8 in this case its false

        public static void main(String[]args){
           ArrayList<ArrayList<Double> > array= new ArrayList<ArrayList<Double> >();
            for (int i = 0; i < array.size(); i++){
                if(logic here){
                    System.out.println(not 10.0);
                }else{
                    system.out.pritnln(10.0);
                }
            }
        }

how can I implement the correct logic for this case? Thank you!!!