compute cuter

Category Image 052

Get that desk more cuter, fam. Amy (@sailorhg) has this perfectly cute minisite with assorted desktop backgrounds, fonts, editor themes, keyboard stuff, and other accessories. These rainbow cables are great.

And speaking of fonts, we’re still plucking away at this microsite for coding fonts and it’s ripe for contribution if anyone is into it.

Direct Link to ArticlePermalink


The post compute cuter appeared first on CSS-Tricks.

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

How to Transfer Email Address to Another Provider (Step by Step)

Featured Imgs 26
Trying to transfer email address to another provider can be problematic. Or, at least, the exact steps are not as obvious at first – especially since we usually don’t do these things too often. The good news is that the task is not that difficult to execute. However, there are still specific things that you must do to guarantee a smooth transition and make sure that no emails go missing in the process.

More on content-visibility

Featured Imgs 25

Back in August 2020, when the content-visiblity property in CSS trickled its way into Chrome browsers, Una Kravets and Vladimir Levin wrote about it and we covered it. The weirdest part is that to get the performance value out of it, you pair it with contain-intrinsic-size on these big chunks of the page where you insert some arbitrary guess at a height. I wrote:

That part seems super weird to me. Just guess at a height? What if I’m wrong? Can I hurt performance? Can (or should) I change that value at different viewports if the height difference between small and large screens is drastic?

Jake Archibald and Das Surma just did a video on all this and it helped clarify that a bit. You can see at about 7:30 in just how confusing it is. Jake used this massive HTML spec page as a demo, and made <section> wrappers around big chunks of HTML, and applied:

section {
  content-visibility: auto; /* this is the thing that delays painting */
  contain-intrinsic-size: 1px 5000px; /* this is the guess at the height of the content, and also saying width doesn't matter */
}

Apparently that 5000px isn’t the height of the element, it’s the size of the content of that element. I guess that matters because it will push that parent element taller by that number, unless the parent element overrides that with a height of its own. The magic comes from the fact that the browser will only paint¹ the first section (where it’s very likely the viewport isn’t over 5000px tall) and defer the painting on the rest. Sorta like lazy loading, but everything rather than media alone. It assumes the next section is 5000px tall, but once the top of it becomes visible, it will actually get painted and the correct height will be known. So assuming your page is just big ass blocks on top of each other, using an extremely large number should work fine there. Godspeed if your site is more complicated than that, I guess.

It’s a good video and you should watch it:

This is yet another thing where you have to inform the browser about your site so that it can Do Performance Good™. It is information that it can figure out by itself, but not until it has done things that have a performance cost. So you have to tell it up front, allowing it to avoid doing certain types of work. With responsive images, if we give images a srcset attribute with images and tell the browser in advance how big they are, including a sizes attribute with information about how our CSS behaves, it can do calculations ahead of time that only download the best possible image. Likewise, with the will-change property in CSS, we can tell the browser when we’re going to be doing movement ahead of time so it can pre-optimize for that in a way it couldn’t otherwise. It’s understandable, but a little tiresome. It’s like we need a stuff-you-need-to-know.manifest file to give browsers before it does anything else — only that would be an additional request!

The accessibility implications are important too. Steve Faulkner did a test applying content-visibility: auto to images and paragraphs:

The content is visually hidden, but in both JAWS and NVDA the hidden <img> is announced but the content of the <p> element is not. This has to do with how the img and the p element content are represented in the browser accessibility tree: The img is exposed in the accessibility tree with the alt text as the accessible name. The content of the p element is not present in the accessibility tree.

He notes that content hidden this way should not be available to screen readers, per the spec. I could see it going either way, like hide it all as if it was display: none, meaning none of it is in the accessibility tree. Or, leave it all in the accessibility tree. Right now it’s a tweener where you might see a bunch of stray images in the accessibility tree without any other context than their alt text. This is an interesting example of new tech going out with more rough edges than you might like to see.

Speaking of alt text, we all know those shouldn’t be empty when they represent important content that needs to be described to someone who can’t see them. They should be like paragraphs, says Dave:

I finally made the simplest of all connections: alt text is like a paragraph. Word pictures. Basic I know, but it helps me contextualize how to write good alt text as well as source order of my code.

I don’t want to be overly negative here! The performance gains for setting up a long-scrolling page with content-visibility is huge and that’s awesome. Being able to inform the browser about what is OK not to paint in two lines of code is pretty nice.

  1. I keep saying “paint” but I’m not sure if that’s really the right term or if it means something more specific. The spec says stuff like “allowing user agents to potentially omit large swathes of layout and rendering work until it becomes needed” (emphasis mine).


The post More on content-visibility appeared first on CSS-Tricks.

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

YouTube advertising for health coaches

Featured Imgs 20

Hi there,

I am looking for information regarding what I can say or claim in a YouTube ad about my health coaching service without violating Google's ad policies. My particular area of health coaching focusses on reversing Type 2 Diabetes (naturally - no drugs, no obscure treatments, just lifestyle modification).

I know that in FB ads, I can't claim to cure or reverse T2D. I also can't say things like "If you suffer from Type 2 Diabetes..." because it is personally identifying. Other health coaches seem to stay in Facebook's good books by making the ad all about the coach, and not explicitly claiming to cure or reverse a particular condition. For example, "Learn how Bob beat the odds and is now completely free of all symptoms of <condition X>".

My question is actually in relation to YouTube. Does YouTube take a similar approach to claims about reversing a condition? Would it be safe to assume that an ad that is acceptable to FB would be acceptable to YT?

How to convert the elements in a 2d string array to int and sum the rows?

558fe5180e0e8fc922d31c23ef84d240

This is the code i have.
My vector is a 5x4 string vector which get test scores from a inputbox to get displayed in a listbox. I want to find the avergare in every test score so im trying to convert the elements from StudentsScores (my string 2d vector) to int so i can sum the rows and find the average but when i input "100, 100, 100, 100, 90, 90, 90, 90, 80, 80, 80, 80, 70, 70, 70, 70, 60, 60, 60, 60 to test if my code is working all i get if 60, 60, 60, 60, 60 in my average listbox.

 For Index = 0 To 4
            For InnerIndex = 0 To 3

                TempTotal = TempTotal + CInt(StudentsScores(Index, InnerIndex))

            Next
            'TempTotal /= 4
            lstAvg.Items.Add(TempTotal.ToString())
        Next

Keeping Your WordPress Sites Fully Backed-up with Snapshot and The Hub

Featured Imgs 13

Backing up your WordPress site(s) has never been easier. Regardless of your hosting setup, The Hub and Snapshot make keeping your sites fully backed up a breeze. Here’s how…

Whether you manage one or multiple WordPress sites, keeping your site’s files and data regularly backed-up is an essential part of website maintenance and security.

So, it’s important that the backup process be made as simple, easy, safe, and reliable as can be.

In this tutorial, we’ll show you how to keep your WordPress sites fully backed up using The Hub, our WordPress management console, and Snapshot, our automated backups plugin.

Specifically, we’ll look at how to:

Snapshot
With Snapshot and WPMU DEV’s hosted backups, your WordPress sites are safely and fully backed up!

Access Backup Info from The Hub

With The Hub, you can easily manage multiple WordPress sites from one central location. This includes managing, deleting, downloading, backing up, and restoring site backups.

The Hub - Sites list
The Hub lets you easily see which sites use Snapshot or WPMU DEV backups.

The types of backup you will manage from The Hub depend on whether you choose to host your sites with WPMU DEV or a third-party host.

If you host your sites with WPMU DEV’s managed WordPress hosting, your sites’ files and data will be fully backed up every night automatically using our secure, reliable, and super-fast Hosted Backups service. See our Hosting Backups Guide for more details.

Note: You can also use Snapshot to schedule additional backups (e.g. store your backups on a third-party storage service like Amazon S3, *Google Drive, *Dropbox, etc.)

*coming soon

If you host your sites with a third-party host, you can install Snapshot and use it with The Hub to manage all of your backups. See our Snapshot documentation for full details on using the plugin.

Tip: The Hub icons show you which backup service each of your sites is using (i.e. WPMU DEV backups or Snapshot). These icons display in your site’s Hub menus and panels.

Th Hub - Backup icons
Snapshot and WPMU DEV backup icons.

With The Hub, you can view information about your sites’ backups as soon as you log in.

Simply hover over the backup icons on your Sites screen and a small pop-up window will display the backup details for that site.

The Hub - Sites screen
View backup details for your sites from the main Hub screen.

WPMU DEV Hosted Backups vs Snapshot Backups

Depending on the backup service your site uses, The Hub’s Overview section will display your Backups module differently.

For example, here is the Overview screen of a site hosted with WPMU DEV using our Hosted Backups service…

The Hub - Overview screen of a site that uses WPMU DEV's Hosted Backups service.
This site is hosted on WPMU DEV’s servers and uses our Hosted Backups service.

And here’s the same Overview screen of a site hosted with a third-party service using Snapshot, as indicated by the icon on the Backups panel…

The Hub: Overview screen of a site using Snapshot backups.
This site is hosted with a 3rd-party hosting service and uses Snapshot for backups.

As you can see, there is a slight difference in how information displays about your backups in The Hub’s Overview panel.

If you use Snapshot to manage your site’s backups, the Overview panel displays how much storage you have used in your current plan.

Manage WordPress Backups Using The Hub’s Backups Tab

To manage site backups, view a list of available backups, configure backup settings, etc., select a site from The Hub and click on the Backups panel in The Overview screen or the Backups tab in the main menu.

The Hub - Backups tab.
The Hub’s menu – Backups tab.

Clicking on either of these options will bring you to the Backups Dashboard.

The Hub - Backups tab: WPMU DEV hosted backups dashboard
The Hub – Backups tab: WPMU DEV hosted backups dashboard.

Again, the Dashboard you see here will depend on your choice of hosting.

Here is the Backups Dashboard of a site hosted with WPMU DEV…

Backups Dashboard screen of a site hosted with WPMU DEV

And here is the Backups Dashboard of a site using a 3rd-party host with Snapshot installed:

Backups Dashboard screen of a site using Snapshot

See our documentation for more information on using the Backups tab.

Create a WordPress Backup in One-click

To create a full backup of any site directly from The Hub with just one click, go to the Backups tab and click the button in the Backups Dashboard.

The Hub: Backups tab - Create Backup
Click the button to fully back up your site!

You can also do this by clicking on the Settings icon (three dots) and selecting Create Backup from the menu.

The Hub: Backups tab - Create Backup
You can also create a backup instantly from the Dashboard options menu.

The Hub will automatically begin to back up your site. As soon as the backup is completed, it will display on the list of available backups.

The Hub: Backups tab - Backups in Progress.
The Hub instantly backs up your site.

Notes:

  • Your backups will be stored securely offsite on WPMU DEV’s backup storage and/or a third-party storage service as per your configuration settings.
  • Hosted backups are stored for 30 days (50 days on Snapshot). If you reach your storage limit, your oldest backup will be replaced with a new one.
  • If a backup fails for any reason, it will be highlighted in red on the Dashboard’s backup list.
Failed Backups
The Hub lets you see if a backup has failed.

See our Backups Dashboard Overview documentation for more details on creating backups.

Schedule WordPress Backups Automatically

If you’re using Snapshot to backup your sites, you can create a backup schedule (monthly, weekly, daily) from The Hub by going to your Backups tab and selecting Set Schedule from the Settings menu.

The Hub: Backups tab - Snapshot backups schedule
Create a backup schedule with The Hub and Snapshot.

Configure your schedule and click Save to update your settings. Alternately, if you do not want The Hub to back up your sites, click the Remove Schedule link to set the frequency of your backups to None.

Schedule backups for sites using Snapshot from The Hub.

Note: You cannot set a schedule for backing up sites hosted on WPMU DEV, as your sites are automatically backed up daily.

Check Detailed Backup Information

To view details of your backups, go to The Hub > Backups tab and click on a backup item.

The Hub: Backups tab - Backup details with Settings screen.
Click on a backup to view more details.

This will bring up a pop-up window with your backup details.

Backup details
View your backup details.

Click on the Settings icon (three dots) to bring up additional options that let you download and restore your backups.

The Hub: Backups tab - Backup details with Settings screen.
You can also download and restore your backups from here.

Note: If you’re viewing details about backups created using Snapshot, you can also delete the backup to free up storage space, and send an email with a downloadable copy of your backup by clicking on the Filename.

The Hub: Backups tab - Backup details with Snapshot Settings screen.
Snapshot gives you the option of deleting and emailing your backups.

If you are using Snapshot, you can also view detailed logs about your backups. Just log into your site from The Hub, go to the Snapshot Backups > Logs section, and click on a backup from the list on the Available Logs screen.

Snapshot Backups Screen - Logs
View detailed backup logs with Snapshot.

For more info, see our Snapshot Logs tab documentation.

Safely Restore Your Backups

With The Hub, you can easily download and restore your backups.

To restore your website from a full or incremental backup, select your site from The Hub, click on the Backups tab and then click on a backup from your list of available backups.

Next, click either the Restore button or select the option from your Backup Details > Settings menu.

The Hub - Restore Backups
Restore backups from The Hub.

If you can access your website, The Hub will restore your backups automatically as soon as you click the button.

If your website is unavailable, there are several methods you can use to restore your site, and The Hub will instruct you on what steps to take.

The Hub - Restore backup instructions.
The Hub can restore your backups in one-click.

If you’re not hosting your websites with WPMU DEV, see our documentation on how to restore your website with Snapshot.

We’ll Back You Up All The Way

Whether you choose to host with WPMU DEV (and we highly recommend you do – we’re better and cheaper!) or a third-party host, you can enjoy complete peace of mind knowing that your WordPress sites are being fully and securely backed up.

Also, we’re continually improving The Hub and Snapshot (check out our roadmap) and if you need help creating or restoring your backups or have any other WordPress-related questions or issues, our 24/7 support team is always available.

How do you put in a prompt in to request the input file name?

558fe5180e0e8fc922d31c23ef84d240

This is what I have so far the teacher wants us to request the file name and I have no clue where to even start. Thank you for the help!

#include <iostream>
#include <string>
#include <fstream>
#include <cmath>
#include <iomanip>


using namespace std;

int main() 


   ifstream inFile;
   ofstream outFile;

   string firstName;
   string lastName;

   double currentSal;
   double payInc;

  inFile.open("Ch3_Ex5Data.txt");
  outFile.open("Ch3_Output.dat");



outFile << fixed << showpoint << setprecision(2);

inFile >> lastName >> firstName;
inFile >> currentSal >> payInc;
outFile <<  firstName << " " << lastName << " " <<  ((currentSal + currentSal * (payInc / 100)));
outFile << endl;

inFile >> lastName >> firstName;
inFile >> currentSal >> payInc;
outFile <<  firstName << " " << lastName << " " << ((currentSal + currentSal * (payInc / 100)));
outFile << endl;

inFile >> lastName >> firstName;
inFile >> currentSal >> payInc;
outFile <<  firstName << " " << lastName << " " << ((currentSal + currentSal * (payInc / 100)));
outFile << endl;



inFile.close();
outFile.close();
cin.get();


return 0;

Mixing broadband packages

Category Image 041

Sorry, but my question requires a long-winded explanation. Because of where we live, my wife and I cannot get decent broadband except through a satellite package which recently went down for two days. It leaves us totally isolated since the phone is also satellite and we get no mobile reception here either. So calling any technical support or anyone is almost impossible!! So we will get a landline installed but the basic broadband costs only marginally more and would be useful as back up when the satellite package goes down, though it's only 1- 5 Mb/s instead of 45 Mb/s. Rather than use wireless both my wife and I connect to our computers through Home Plugs which work well for us. My question is this. If both the landline broadband and satellite broadband are connected to a homeplug, what will I get when I connect my computer to my homeplug . . . a scrabbled mess or two distinct LAN connections that I can choose at random?

Average resistance

558fe5180e0e8fc922d31c23ef84d240

Project: Average resistance
A student wants to measure a resistivity of a
material of certain wire of radius 2 mm, and
length of 25 cm. He got the following data
Voltage (V): 100, 90, 80, 70, 60, 50, 40, 30, 20, 7
Current (A): 11, 8, 7, 6, 5.7,5, 3.9, 2.3, 2.1, 1.1
Find the avg?