Brex, a financial service and technology company, has announced the release of a new open API that is intended to simplify the management of financial information for the company’s partners. This new API was tethered with the announcement of a partnership with Zapier that is meant to streamline integration for smaller businesses.
Need help guys!
Error: AttributeError: 'str' object has no attribute 'sort'
brand_name = "Huawei"
count = 3
while count <= 3:
brands = str(input(" Enter cellphone brandname:"))
brand_name.insert(brands, count)
count = 1 + count
brand_name.sort()
brand_name.remove("Huawei")
print(brand_name)
A Deep Dive Into object-fit And background-size In CSS
We’re not always able to load different-sized images for an HTML element. If we use a width and height that isn’t proportional to the image’s Aspect ratio, the image might either be compressed or stretched. That isn’t good, and it can be solved either with object-fit
for an img
element or by using background-size
.
First, let’s define the problem. Consider the following figure:
Why is this happening?
An image will have an Aspect ratio, and the browser will fill the containing box with that image. If the image’s Aspect ratio is different than the width and height specified for it, then the result will be either a squeezed or stretched image.
We see this in the following figure:
The SolutionWe don’t always need to add a different-sized image when the Aspect ratio of the image doesn’t align with the containing element’s width and height. Before diving into CSS solutions, I want to show you how we used to do this in photo-editing apps:
Now that we understand how that works, let’s get into how this works in the browser. (Spoiler alert: It’s easier!)
CSSobject-fit
The object-fit
property defines how the content of a replaced element such as img
or video
should be resized to fit its container. The default value for object-fit
is fill
, which can result in an image being squeezed or stretched.
Let’s go over the possible values.
Possible Values forobject-fit
object-fit: contain
In this case, the image will be resized to fit the Aspect ratio of its container. If the image’s Aspect ratio doesn’t match the container’s, it will be letterboxed.
object-fit: cover
Here, the image will also be resized to fit the Aspect ratio of its container, and if the image’s Aspect ratio doesn’t match the container’s, then it will be clipped to fit.
object-fit: fill
With this, the image will be resized to fit the Aspect ratio of its container, and if the image’s Aspect ratio doesn’t match the container’s, it will be either squeezed or stretched. We don’t want that.
object-fit: none
In this case, the image won’t be resized at all, neither stretched nor squeezed. It works like the cover
value, but it doesn’t respect its container’s Aspect ratio.
Aside from object-fit
, we also have the object-position
property, which is responsible for positioning an image within its container.
object-position
The object-position
property works similar to CSS’ background-position
property:
The top
and bottom
keywords also work when the Aspect ratio of the containing box is vertically larger:
background-size
With background-size
, the first difference is that we’re dealing with the background, not an HTML (img
) element.
Possible Values for background-size
The possible values for background-size
are auto
, contain
, and cover
.
background-size: auto
With auto
, the image will stay at its default size:
background-size: cover
Here, the image will be resized to fit in the container. If the Aspect ratios are not the same, then the image will be masked to fit.
background-size: contain
In this case, the image will be resized to fit in the container. If the Aspect ratios are off, then the image will be letterboxed as shown in the next example:
As for background-position
, it’s similar to how object-position
works. The only difference is that the default position of object-position
is different than that of background-position
.
object-fit
or background-size
If the element or the image is given a fixed height and has either background-size: cover
or object-fit: cover
applied to it, there will be a point where the image will be too wide, thus losing important detail that might affect how the user perceives the image.
Consider the following example in which the image is given a fixed height:
.card__thumb {
height: 220px;
}
If the card’s container is too wide, it will result in what we see on the right (an image that is too wide). That is because we are not specifying an Aspect ratio.
There is only one of two fixes for this. The first is to use the padding hack to create an intrinsic ratio.
.card__thumb {
position: relative;
padding-bottom: 75%;
height: 0;
}
.card__thumb img {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
The second fix is to use the new aspect-ratio
CSS property. Using it, we can do the following:
.card__thumb img {
aspect-ratio: 4 / 3;
}
Note: I’ve already written about the aspect-ratio
property in detail in case you want to learn about it: “Let’s Learn About Aspect Ratio In CSS”.
User Avatars
A perfect use case for object-fit: cover
is user avatars. The Aspect ratio allowed for an avatar is often square. Placing an image in a square container could distort the image.
.c-avatar {
object-fit: cover;
}
Logos List
Listing the clients of a business is important. We will often use logos for this purpose. Because the logos will have different sizes, we need a way to resize them without distorting them.
Thankfully, object-fit: contain
is a good solution for that.
.logo__img {
width: 150px;
height: 80px;
object-fit: contain;
}
Article Thumbnail
This is a very common use case. The container for an article thumbnail might not always have an image with the same Aspect ratio. This issue should be fixed by the content management system (CMS) in the first place, but it isn’t always.
.article__thumb {
object-fit: cover;
}
Hero Background
In this use case, the decision of whether to use an img
element or a CSS background will depend on the following:
- Is the image important? If CSS is disabled for some reason, would we want the user to see the image?
- Or is the image’s purpose merely decorative?
Based on our answer, we can decide which feature to use. If the image is important:
<section class="hero">
<img class="hero__thumb" src="thumb.jpg" alt="" />
</section>
.hero {
position: relative;
}
.hero__thumb {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
If the image is decorative, we can go with background-image
:
.hero {
position: relative;
background-image: linear-gradient(to top, #a34242, rgba(0,0,0,0), url("thumb.jpg");
background-repeat: no-repeat;
background-size: cover;
}
The CSS is shorter in this case. Make sure that any text placed over the image is readable and accessible.
Adding a Background to an Image With object-fit: contain
Did you know that you can add a background color to img
? We would benefit from that when also using object-fit: contain
.
In the example below, we have a grid of images. When the Aspect ratios of the image and the container are different, the background color will appear.
img {
object-fit: contain;
background-color: #def4fd;
}
Video Element
Have you ever needed a video
as a background? If so, then you probably wanted it to take up the full width and height of its parent.
.hero {
position: relative;
background-color: #def4fd;
}
.hero__video {
position: aboslute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
To make it fully cover the width and height of its parent, we need to override the default object-fit
value:
.hero__video {
/* other styles */
object-fit: cover;
}
Conclusion
As we’ve seen, both object-fit
and background-size
are very useful for handling different image Aspect ratios. We won’t always have control over setting the perfect dimensions for each image, and that’s where these two CSS features shine.
A friendly reminder on the accessibility implications of choosing between an img
element and a CSS background: If the image is purely decorative, then go for a CSS background. Otherwise, an img
is more suitable.
I hope you’ve found this article useful. Thank you for reading.
find avg of high and low temp 2d array
#include "iostream"
#include "iomanip"
#include "cmath"
#include "string"
using namespace std;
int main()
int temp[7][2]= {0};
int day = 0;
for(int i = 0; i < 7; i++) {
cout<<endl<<" Day: ";
cin >> day;
for(int i = 0; i < 7; i++) {
cout << "\nEnter low temperature: ";
cin >> temp[day][0];
for(int i = 0; i < 7; i++) {
cout << "\nEnter high temperature: ";
cin >> temp[day][1];
for(int i = 0; i < 7; i++) {
cout << "\nDay: " << day << " High: " << temp[day][1] << " Low: " << temp[day][0] <<endl;
Inline Code Example Here
return 0;
How to add score counter?
How to add score counter to rock paper scissors game? I can't get score counter work. (Player wins, Computerwins)
I got it working without functions but now when I added them I don't just get it how to do it...
#include <iostream>
#include <math.h>
#include <string>
int numGen ();
int choiceConverter (std :: string);
void DisplayComputer (int);
void winner (int, int);
int main ()
{
std :: string playerChoose;
int player;
int compChoice;
int rounds = 0;
int gains = 0;
int machineGains = 0;
// Ask the user how many rounds to play?
std :: cout << "How many rounds do you want to play?" << std :: endl;
std :: cout << "Enter rounds>";
std :: cin >> rounds;
for (int round = 1; round <= rounds; round ++)
{
std :: cout << "Round number:" << round << "/" << rounds << std :: endl;
std :: cout << "\nSelect rock, paper or scissors:";
std :: cin >> playerChoose;
std :: cout << "\ nYour selection is:" << PlayerChoose << "\ n";
compChoice = numGen ();
player = choiceConverter (playerChoice);
displayComputer (compChoice);
winner (compChoice, player);
}
}
int numGen ()
{
std :: srand (time (0));
int randomi = rand ()% 3 + 1;
return randomi;
}
int choiceConverter(std :: string player1)
{
int numEquiv = 0;
if (player1 == "rock")
character code = 1;
else if (player1 == "paper")
character code = 2;
else if (player1 == "scissors")
character code = 3;
return numEquiv
}
void displayComputer (int player2)
{
if (player2 == 1)
{
std :: cout << "The computer chose rock \ n";
}
else if (player2 == 2)
{
std :: cout << "The computer chose paper \ n";
}
else if (player2 == 3)
{
std :: cout << "The computer chose scissors \ n";
}
}
void winner (int player1, int player2)
{
if ((player1 == 1 && player2 == 2) || (player1 == 2 && player2 == 3) || (player1 == 3 && player2 == 1))
{
std :: cout << "\nYou won the game! \ n \ n";
}
else if ((player1 == 1 && player2 == 3) || (player1 == 2 && player2 == 1) || (player1 == 3 && player2 == 2))
{
std :: cout << "\ nComputer won the game! \ n \ n";
}
else
{
std :: cout << "\nDraw \ n \ n";
}
}
Building a Metadata Driven UI
Description
Metadata-driven UI is especially useful in project teams with a high back-end or DBA competence rather than UI.
In general, it provides an element alignment by invocation of a single endpoint which provides all data required like cardinality, language, font size, and the font itself.
This Is How You Can Use 3D Modeling to Improve Your Business
Companies are trying very hard to attract customers, whether through digital marketing, offering quality services, or providing competitive prices; the struggle to get a business is enormous. Exterior 3d design is a new way for...
The post This Is How You Can Use 3D Modeling to Improve Your Business appeared first on 85ideas.com.
Please I am trying make my search engine in my project and is giving me thi
deprecated and will be removed in
a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini
and use the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent in <b>Unknown</b> on line <b>0</b><br />. Please the answer is urgent.
how to convert this into a relative path
how to convert this into relative path code, since if im gonna install my system to other computer this line of code will get an error since the path of the data source doesnt match the current path if im gonna install it to other computer
Tidying the Media Library With WP Ninjas’ Remove Unused Media Plugin
A few weeks ago, WP Ninjas announced it was stepping into the media optimization plugin market. The team released its Remove Unused Media plugin as a commercial project for tidying storage space. I received a full copy of it and put it through the ropes.
With so many commercial plugins, I am accustomed to the developers creating an entirely new menu item, taking up precious admin real estate. This happens even with those that just have a single screen too. However, I was happy to see the WP Ninjas team tucked everything neatly under “Media” as a sub-menu. We were off to a good start, and things only got better.
When I review plugins, there is one thing that I consistently preach: simplicity. That begins with following the core WordPress UI and sticking as closely to it as the plugin’s features will allow. In essence, don’t make me think about how to use your plugin.
For the most part, Remove Unused Media got the user experience right.
I could nitpick a few design choices with the interface, such as modifying the list table with rounded corners and extra padding. The “filter” sub-navigation also deviates from the standard. And, the “last analysis” message should receive the WordPress admin notice treatment so that it stands out.
These are all core UI elements with unnecessary customizations. However, they did not diminish the experience on the whole. The plugin mostly stuck with the WordPress standard.
The real question is whether the plugin does what it says on the tin. What is the experience of removing unused media like?
It was easy. Users merely need to click the “Start Analysis” button and wait a few seconds. The plugin then has three tabs:
- Unused Media
- Used Media
- Ignored
The Unused Media tab presents an overview of all media that the plugin could not find used on the site. There is a possibility that it missed something. However, I only found one old-school scenario where this happened, which I will dive into later.
From this point, end-users can manually delete individual media attachments or use the bulk-delete option. Before doing so, the plugin recommends making a backup of the site — solid advice for any such plugin.
My favorite feature of the plugin was not its primary feature of deleting media. It was actually the “Used Media” screen. Its “Where?” and “How?” columns break down where images, videos, and other files are used and in what context.
It reminded me of the “instances” screen for the WordPress admin block directory proposal from 2019. The concept showed where specific blocks were used across the site. Remove Unused Media does the same thing for media files.
The “Ignore” tab for the plugin keeps track of media files that should not be deleted, even if they are unused. Users can click a link from the other screens to add them to the list. This persists after running a new analysis too.
The plugin scans several third-party plugins like Elementor, Beaver Builder, ACF, and Yoast SEO. Some store media instances outside of the post content, such as in custom post meta, and Remove Unused Media searches those specific fields.
Pricing starts at 39€ ($45.38 at today’s exchange rate) for one year of support and updates for a single site. It also has a five-site option at 149€ and a 100-site tier at 299€.
For the first version, the user experience felt solid. However, it does not have much in the way of customizability. That could be a sticking point for users who are looking for a more flexible premium option.
Exploring Alternatives
The plugin is not the first of its kind. The Media Cleaner plugin by Meow Apps is free, routinely updated, and has over 40,000 active installations. It also has a commercial version with more features, such as third-party plugin integration, WP-CLI support, filesystem scan, and live-site analysis.
The UI for Remove Unused Media feels more like WordPress. Its “Used” tab also shows where (i.e., what posts) and how (e.g., content, featured image) specific media files are used across the site. This feature alone makes it worthwhile for me.
One area where Media Cleaner shines is its option for ignoring (not deleting) attached media. This is a vital feature if users have ever added the old gallery
shortcode. At one point, WordPress simply displayed all attached images as a gallery. Eventually, it specified the IDs in the shortcode. However, for those older instances, this was not the case. Without enabling this option, those media items might get queued up for deletion.
The Remove Unused Media plugin does not have such an option. Attached images that are not explicitly used are considered unused. This may not be an issue for most users, but those with old gallery shortcodes should be aware of potential problems.
The baseline features for both are similar. Remove Unused Media gets the edge in its default user interface and experience. However, Media Cleaner has many more options for customizing how the plugin works. Plus, users who cannot afford an upgrade can always run the free version.
This is not to say either is better or worse than the other. Both were solid options in my tests. I just want to merge the best features from each, snagging the interface from Remove Unused Media and the configurability of Media Cleaner.
Help naming company
Help please,
I'm trying to decide between names for my company:
Office Surgery
or
Office Surgery Centers
I am starting a company to help doctors open a surgery suite in their office. I own the domain: www.officesurgery.com and have email addresses with @officesurgery.com including info@officesurgery.com
Any suggestions? I am hoping to get people to vote on which they prefer given my domain ownership, etc.
THANK YOU!!!
User-Friendly Newsletters with AcyMailing for WordPress
If you don’t have a newsletter set up already, now is the time to get started. A newsletter has limitless uses; you could inform users about your latest articles, thank them for signing up, remind them about abandoned carts, or invite them to upcoming events. And all of this can be totally automated, sending emails […]
The post User-Friendly Newsletters with AcyMailing for WordPress appeared first on WPExplorer.
How to Start a Dog Breeding Business in 11 Simple Steps
Growing up, my family got into dog breeding. At one point, we had 12 mastiffs and 2 malamutes at home. It was nuts. During all that, I learned a few things about how to start a dog breeding business. I’ll walk you through the nitty gritty on how to get […]
The post How to Start a Dog Breeding Business in 11 Simple Steps appeared first on .
How to Start a Massage Business in 5 Simple Steps
Starting a massage business is a great option for someone looking for either part-time or full-time work in helping people …
How to Start a Massage Business in 5 Simple Steps Read More »
The post How to Start a Massage Business in 5 Simple Steps appeared first on .
arrays and strings in c
can someone explain to me this code and what the output should look like?, is there going to be two strings? and what does dest[I]=to src[] mean, is string bar going to have the string abcd or efghijk.
#include <stdio.h>
void copy_str(char *dest, const char *src);
int main(void)
{
char foo[7];
char bar[7] = {'E', 'F', 'G', 'H', 'I', 'J', 'K'};
copy_str(bar, "ABCD");
copy_str(foo, bar);
return 0;
}
void copy_str(char *dest, const char *src)
{
int i;
for (i = 0; src[i] != '\0'; i++)
dest[i] = src[i];
// point one
dest[i] = '\0';
return;
}
Shopify vs WooCommerce: Which Platform Is Right For Your Business?
Introduction:
Shopify vs WooCommerce? With the advent of eCommerce, it has become easier than ever for businesses to sell their products and services online. However, there are many different platforms that offer similar services and pricing plans. With both Shopify and WooCommerce being two of the most popular choices out there, this article will break down some key differences between these platforms so you can make a more informed decision about which one is right for your business!
1. Shopify
2. WooCommerce
3. Pricing Plans
4. Security Features
5. Integrations
6. Key Differences between the two platforms
Shopify
Shopify is a popular online platform that provides everything you need to run an eCommerce business. Shopify includes many different features including the ability to use sales-specific apps, store/product pages, customer accounts, shipping companies, taxes, VAT, and more. In addition, Shopify provides a checkout system. When you add products to your store’s catalogue, it automatically calculates sales tax and VAT depending on your location so you don’t have to worry about the hassle of doing this yourself!
In comparison with WooCommerce, Shopify is a much simpler platform that has less customizable features. It also doesn’t offer an open-source code which means updates are done centrally by Shopify, not by users themselves. One big benefit of going with Shopify is their 24/7 customer support which makes them a great choice if you’re just starting out and need help getting everything setup!
WooCommerce
WooCommerce is another popular eCommerce platform allows businesses to sell both physical and digital products online. WooCommerce is an open-source platform which means it’s free to use and customizable. You can also add extensions or plugins to your store with ease! Some of the key features of this platform include inventory management, shipping companies, built-in checkout pages, product reviews/ratings, SEO optimization tools and more.
WooCommerce offers many similar benefits to Shopify including 24/7 customer support, automated taxes/VAT calculation, shipping integrations and so on. One huge benefit is that it comes with an open-source code so you’re not limited by what the developers have created for you – you can completely customize your eCommerce website any way you’d like!
Pricing Plans
When it comes to choosing an eCommerce platform, the pricing plans are a huge factor. Shopify offers three different pricing plans while WooCommerce’s pricing is based on which extensions or plugins you choose to use.
Shopify Plan Comparison
One of the major benefits of using Shopify is that it offers payment integration with all major credit cards and payment processors including Braintree and Stripe!
Bottom Line: If you’re looking for a more advanced eCommerce site that has many customizable features but still want access to customer support then WooCommerce might be the best choice for your business! However, if you want a simple website with less customization options and integrated payments, we would recommend going with Shopify.
Security Features
When it comes to security, both Shopify and WooCommerce offer SSL certificates. Shopify encrypts data during checkout while WooCommerce allows you to add your own custom security features such as captcha verification and geotracking.
Integrations
Last but not least, integrations are another key factor when it comes choosing an eCommerce platform. Both platforms offer some built-in integrations including: MailChimp, PayPal, ShipStation and more! However, if there is a particular integration that you need but don’t see on the list then it’s likely you’ll have to choose a third party plugin or app to meet your needs.
Bottom Line: As far as integrations go, both Shopify and WooCommerce do well with what they have to offer. If you have a specific app or software that you need to be integrated with your eCommerce site then Shopify might be the better choice as far as available integrations go!
WooCommerce Extensions/Plugins
The more advanced platform of WooCommerce gives users more control over their eCommerce website and comes with many different extensions and plugins that can be added for customization. One major downside is that these apps are not supported by WooCommerce themselves so if something goes wrong, there’s no one to contact for help.
Shopify vs WooCommerce: Which Platform Is Right For Your Business?
Both Shopify and WooCommerce boast advantages and disadvantages – it really depends on what features you looking for in an ecommerce platform and your budget. If you’re looking for a more simplified website that still has many features then Shopify might be the better choice for you! However, if you want to build a fully customized eCommerce website and don’t need (or want) customer support then WooCommerce is your best option.
And of course, if there’s a specific app or integration that you absolutely can’t do without then it’s important to consider which platform offers those integrations as well!
Conclusion:
Both Shopify and WooCommerce are great options for ecommerce websites. If you’re still not sure which one to choose, let’s review some of the key differences between these two platforms so that you can make an informed decision about what is best for your business. While both services offer a wide variety of capabilities out-of-the-box, it’s important to note that each platform has different benefits depending on your specific needs. For example, if you need more control over design or want access to additional features like discount codes or coupons, then WooCommerce may be the better option for you. On the other hand, if security is at the top of your list when choosing an eCommerce solution (e.g., PCI compliance), then Shopify may be the wiser choice.
Key differences:
* Designed for web designers or marketing agencies, WooCommerce is a self-hosted open source platform that you can install on your own website and manage yourself. This option has more flexibility than hosting with Shopify because you have the ability to customize every aspect of how your ecommerce site looks and functions, but it requires a bit more technical know-how.
* The design of both platforms is similar in that they each come with pre-made templates that are easy to customize via simple drag-and-drop tools within the admin panel. This means you’ll spend less time designing and developing your site compared to other solutions like Drupal .
* With WooCommerce, you have the option to integrate with WordPress. This lets you take advantage of existing plugins for ecommerce, marketing, analytics and more. Shopify does not offer this capability because it is a standalone platform where all functionality is included out-of-the-box.
* When it comes to payment options, both platforms accept major credit cards as well as PayPal/other online wallets.
Key Advantages & Disadvantages:
* Shopify has many advantages in terms of ease of use and time savings compared to WooCommerce . It’s faster to develop new features and launch your site because everything is self-contained within its environment – no need for additional installations or updates via FTP (though there are dedicated apps available).
How to Start a Meal Prep Business: 9-Step Surefire Plan
It is 100% possible to start a meal prep business, be your own boss, and make a healthy income. As long as you’re willing to put in the work upfront and follow these steps, you’ll get there. 9 Steps to Start a Meal Prep Business Go through each of these […]
The post How to Start a Meal Prep Business: 9-Step Surefire Plan appeared first on .
WordPress 5.9 Go/No-Go Update: All Proposed Features Are Moving Forward
The go/no-go deadline for deciding on features for WordPress 5.9 was set for October 12 but the conversation was pushed back two days. Today, the core leadership for this release announced that everything in the previously-proposed scope for 5.9 will be moving forward.
Users can expect block themes, template and template part editing flows, the new default Twenty-Twenty Two block theme, the Styles interface, design tools, the Navigation Block, all manner of UI improvements, and pattern insertion directly from the Pattern Directory. Héctor Prieto, who is assisting with technical project management on the release, emphasized that many of these features are still in progress:
To note, not all of the above are currently ready, but there is some level of confidence that they can be by the time of 5.9.
A new WordPress 5.9 Must-Haves project board on GitHub shows a broad overview of the issues contributors are focusing on to get the release ready.
Prieto also published an exhaustive transcript of the meeting. There were no strong objections on specific features moving forward but there seemed to be a general acknowledgment that some features are still in a beta state. Those present at the meeting agreed that some kind of beta label might be advantageous where users could be directed to the Gutenberg plugin for faster updates to features that are still not fully polished.
One particularly challenging feature has been navigation. “I think from my perspective, the thing I was a bit worried about was the navigation menu flows, which I think we did a lot of progress over the last few weeks,” Gutenberg lead engineer Matías Ventura said. “And I think we need to set some good boundaries there.
“There has been a lot of work in also supporting sort of mega menus where you have in your sub-menus, you have images and paragraph any sort of block, which is cool. But there’s also like the 80% of cases where you just have a few links, and we need to ensure that that experience is as best as we can make it. I think we’re in a better place. And I think we’ll get there.”
Beta 1 is expected November 16, and the official release is scheduled for December 14. If you want to see an early demo of WordPress 5.9, check out the recording of the meeting below: