how to calculate total of selected combo box items

558fe5180e0e8fc922d31c23ef84d240
If Me.cbobraketype.SelectedItem = ("Rim Brakes") Then
        braketype = ("Rim Brakes")
        price = "120"
        braketype = ("Rim Brakes")


    ElseIf Me.cbobraketype.SelectedItem = ("Disk Brakes") Then
        braketype = ("Disk Brakes")
        price = "150"
        braketype = ("Disk Brakes")



    End If

    'choose type of frame
    If Me.cboframetype.SelectedItem = ("Aluminium") Then
        frametype = ("Aluminium")

    End If

    'choose type of brakes
    If Me.cbobraketype.SelectedItem = ("Rim Brakes") Then
        braketype = ("Rim Brakes")
        price = "390"
        braketype = ("Rim Brakes")

    ElseIf Me.cbobraketype.SelectedItem = ("Disk Brakes") Then
        braketype = ("Disk Brakes")
        price = "430"
        braketype = ("Disk Brakes")

    End If

perform an operation on database using yesterday’s and today’s value

Category Image 101

I have a database where there is an table wm for water meters :

    +------+---------------+
    | Code |     name      |
    +------+---------------+
    | wm1  | water meter 1 |
    | wm2  | water meter 2 |
    | wm3  | water meter 3 |
    +------+---------------+

and another table counters where there are counters value :

    +------+---------+-------+------------+
    | Code | Code_wm | value | created_at |
    +------+---------+-------+------------+
    |    1 | wm1     |   100 | 2020-10-18 |
    |    2 | wm1     |   0   | 2020-10-19 |
    |    3 | wm2     |   0   | 2020-10-18 |
    |    4 | wm2     |   100 | 2020-10-19 |
    |    5 | wm3     |   0   | 2020-10-18 |
    |    6 | wm3     |   100 | 2020-10-19 |
    +------+---------+-------+------------+

i want get this result :

    | code_wm | result |   Date     |
    +---------+--------+------------+
    | wm1     | 0-100  | 2020-10-19 |
    | wm2     | 100-0  | 2020-10-19 |
    | wm3     | 100-0  | 2020-10-19 |
    +---------+--------+------------+

but when i try :

SELECT code_wm , LAG(value,1,0) OVER ( ORDER BY code_wm) as result
FROM counters 

i don't get the correct result : https://www.db-fiddle.com/f/7TuSTaukG336tqnTNDg4em/0

Celebrating 1000 Editions Of The WhiP! + Special Giveaway

Category Image 052

With its hand-picked selection of WordPress news and epic puns, The WhiP has been a welcome arrival in thousands of inboxes for over 6 years. And to celebrate our fav newsletter reaching the big 1K we’re doing an extra-special giveaway.

May 14th, 2014.

Just your typical Wednesday.

All of Me by John Legend was the US number one, and we’d finally finished eating all of our Easter eggs.

At 8am, 70 people across the world received an email. An email that would be the start of something amazing…

…it was the first ever WhiP.

A look at the first edition of The Whip
A lot has changed since the first WhiP newsletter graced our inboxes.

Good, Clean[ish] Puns

Since that first edition, we’ve seen 1,000 editions, a truckload of legendary puns, and the audience currently sits at over 200K subscribers.

Each and every week, we’ve brought you a roundup of important and interesting news from across the WordPress biz – and we don’t plan on stopping any time soon.

We also can’t celebrate 1,000 editions without paying homage to our past WhiP contributors. Especially Joshua Dailey and Raelene Morey – the first ever WhiP Team.

They did an awesome job at bringing this idea to life and that it’s still going more than six years later is a testament to all their hard work.

Some kind comments from WhiP readers
The WhiP’s punny take on WP news continues to entertain thousands.

GIF it Away, GIF it Away Now

Alright now that we’ve recapped The WhiP’s journey and how awesome it is (subscribe here if you haven’t yet silly), onto the special giveaway!

The WhiP is of course famous for its use of puns to bring even the most boring WP news to life. And we’ve had tons of feedback over the years letting us know that you love our puns.

So much so, current WhiP-master, Rick, used the “Do you know who I am?!” line in Starbucks last week when they only gave him one shot of caramel in his latte.

So in the spirit of The WhiP’s punny nature, we’re giving you the chance to…

WIN one of 10 custom-made “punny” WhiP t-shirts + a year’s worth of hosting.

That’s right, we decided to honor some of the best puns by turning them into awesome, punny t-shirts and putting them up for grabs in a sweet little giveaway!

Winners will be able to choose from six puntastic WhiP shirts we designed especially for this promotion. You’ll also be able to choose your preferred design, size, color, etc.

But wait, there’s more…

Along with the shirts, we’re throwing in ONE YEAR’S worth of bronze hosting credit ($120) for our 10 winners!

*If you don’t host with us and aren’t planning on switching any time soon, you can spend your credits on anything else from our range. This includes any of our membership plans and subscriptions or add-ons for your favorite WPMU DEV plugins.

Choosing the top puns to print on the t-shirts was a difficult task. But after trawling through hundreds of previous WhiPs and then a team vote to narrow it down even further, we present to you our six favorites.

Winners can choose from one of these 6 puntastic t-shirt designs:

All hand-picked from previous WhiP editions and designed by us especially for this giveaway!

1.You Had Me at “Hello World”

One of the shirt designs winners can get their hands on

2.Never Gonna Give You App

One of the shirt designs winners can get their hands on

3.Cache Me If You Can

One of the shirt designs winners can get their hands on

4.You Have The Right To Domain Silent

One of the shirt designs winners can get their hands on

5.Don’t Worry, Be HaPHP

One of the shirt designs winners can get their hands on

6.Go Hard Or Go Chrome

One of the shirt designs winners can get their hands on

Which punny shirt is your fav? Let us know below.

How do I get my hands on one of these WhiP t-shirts and the free hosting??

To win one of these awesome t-shirts (and the free hosting cred), head to one of our social media accounts and simply retweet, share, or comment on any social post with the hashtag “#WhiP1000.”

That’s it! We’ll draw 10 winners using a random number generator, and the more times you retweet, share, or comment on a WhiP post, the more entries you’ll have in the pool.

One more condition… You’ll need to be subscribed to the WhiP to be in the running – this is all in honor of the 1000th edition after all!

If you aren’t yet subscribed (what rock have you been living under?!) you can do so here.

Finally, you have until Friday to enter and we’ll be contacting the lucky WhiP winners next week!

Here are our social media accounts for reference:

Facebook icon
twitter logo
Instagram logo

Pun and Dusted

Get sharing and commenting on social, and may the odds be in your favor!

To all our loyal WhiP subscribers, especially those who’ve been rocking with us since day one, we thank you.

We know it’s cliché, but reaching 1000 editions simply would not have been possible without you.

And to any new or recent subscribers, welcome to the WhiP family, and we hope you’ll stick around and laugh with us throughout the next 1000 editions!

Here are those ways to win one more time in case it didn’t sink in above:

  • On Twitter… retweet any WPMU DEV post with the hashtag #WhiP1000.
  • On Facebook… share or comment on any WPMU DEV post with the hashtag #WhiP1000.
  • On Instagram… comment on any WPMU DEV post with the hashtag #WhiP1000.
  • You must be subscribed to The WhiP to be eligible.
  • Contest ends this Friday the 23rd of October.
  • The 10 lucky winners will be contacted next week.

See you on the next WhiPPing punny newsletter.

Using the Web Stories for WordPress Plugin? You Better Play By Google’s Rules

Wp Plugins
Web Stories for WordPress plugin's dashboard.
Web Stories dashboard screen in WordPress.

What comes as a surprise to few, Google has updated its content guidelines for its Web Stories format. For users of its recently-released Web Stories for WordPress plugin, they will want to follow the extended rules for their Stories to appear in the “richer experiences” across Google’s services. This includes the grid view on Search, Google Images, and Google Discover’s carousel.

Google released its Web Stories plugin in late September to the WordPress community. It is a drag-and-drop editor that allows end-users to create custom Stories from a custom screen in their WordPress admin.

Visual Stories on Search.

The plugin does not directly link to Google’s content guidelines anywhere. For users who do not do a little digging, they may be caught unaware if their stories are not surfaced in various Google services.

On top of the Discover and Webmaster guidelines, Web Stories have six additional restrictions related to the following:

  • Copyrighted content
  • Text-heavy Web Stories
  • Low-quality assets
  • Lack of narrative
  • Incomplete stories
  • Overly commercial

While not using copyrighted content is one of those reasonably-obvious guidelines, the others could trip up some users. Because Stories are meant to represent bite-sized bits of information on each page, they may become ineligible if most pages have more than 180 words of text. Videos should also be limited to fewer than 60 seconds on each page.

Low-quality media could be a flag for Stories too. Google’s guidelines point toward “stretched out or pixelated” media that negatively impacts the reader’s experience. They do not offer any specific resolution guidelines, but this should mostly be a non-issue today. The opposite issue is far more likely — users uploading media that is too large and not optimized for viewing on the web.

The “lack of narrative” guideline is perhaps the vaguest, and it is unclear how Google will monitor or police narrative. However, the Stories format is about storytelling.

“Stories are the key here imo,” wrote Jamie Marsland, founder of Pootlepress, in a Twitter thread. “Now we have an open format to tell Stories, and we have an open platform (WordPress) where those Stories can be told easily.”

Google specifically states that Stories need a “binding theme or narrative structure” from one page to the next. Essentially, the company is telling users to use the format for the purpose it was created for. They also do not want users to create incomplete stories where readers must click a link to finish the Story or get information.

Web Story page from CNN's coverage of John Lennon.
CNN’s Web Story on Remembering John Lennon.

Overly commercial Stories are frowned upon too. While Google will allow affiliate marketing links, they should be restricted to a minor part of the experience.

Closing his Twitter thread, Marsland seemed to hit the point. “I’ve seen some initial Google Web Stories where the platform is being used as a replacement for a brochure or website,” he wrote. “In my view that’s a huge missed opportunity. If I was advising brands I would say ‘Tell Stories’ this is a platform for Story Telling.”

If users of the plugin follow this advice, their Stories should surface on Google’s rich search experiences.

Full Bleed

Category Image 052

We’ve covered techniques before for when you want a full-width element within a constrained-width column, like an edge-to-edge image within a narrower column of text. There are loads of techniques.

Perhaps my favorite is this little utility class:

.full-width {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

That works as long as the column is centered and you don’t mind having to hide overflow-x on the column (or the body) as this can trigger horizontal overflow otherwise.

There was a little back and forth on some other ideas lately…

Josh Comeau blogged that you could set up a three-column grid, and mostly place content in the middle column, but then have the opportunity to bust out of it:

.wrapper {
  display: grid;
  grid-template-columns:
    1fr
    min(65ch, 100%)
    1fr;
}
.wrapper > * {
  grid-column: 2;
}
.full-bleed {
  width: 100%;
  grid-column: 1 / -1;
}

I think this is clever. I’d probably use it. But I admit there are bits that feel weird to me. For instance…

  • Now everything within the container is a grid element. Not a huge deal, but the elements will behave slightly differently. No margin collapsing, for one.
  • You have to apply the default behavior you want to every single element. Rather than elements naturally stacking on top of each other, you have to select them and tell them where to go and let them stack themselves. Feels a little less like just going with the web’s grain. Then you still need a utility class to do the full bleed behavior.

What I really like about the idea is that it gives you this literal grid to work with. For example, your left spacer could be half the width of the right and that’s totally fine. It’s setting up that space to be potentially used, like Ethan talked about in his article on constrained grids.

Kilian Valkhof responded to the article with this idea:

body > *:not(img):not(video) { 
  position: relative;
  max-width: 40rem;
  margin: auto;
}

Also very clever. This constrains the width of everything (in whatever container, and it wouldn’t have to be the body) except the elements you want to bust out (which could be a utility class there too, and not necessarily images and videos).

Again, to me, this feeling that I have to select every single element and provide it this fundamental information about layout feels slightly weird. Not like “don’t use it” weird, just not something I’m used to doing. Historically, I’m more comfortable sizing and positioning a container and letting the content in that container lay itself out without much further instruction.

You know what I like the most? That we have so many powerful layout tools in CSS and we have conversations about the pros and cons of pulling off exactly what we’re going for.


The post Full Bleed appeared first on CSS-Tricks.

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

WooCommerce 4.6 Makes New Home Screen the Default for New and Existing Stores

Category Image 085

WooCommerce 4.6 was released today. The minor release dropped during WooSesh, a global, virtual conference dedicated to WooCommerce and e-commerce topics. It features the new home screen as the default for all stores. Previously, the screen was only the default on new stores. Existing store owners had to turn the feature on in the settings.

The updated home screen, originally introduced in version 4.3, helps store admins see activity across the site at a glance and includes an inbox, quick access to store management links, and an overview of stats on sales, orders, and visitors. This redesigned virtual command center arrives not a moment too soon, as anything that makes order management more efficient is a welcome improvement, due to the sheer volume of sales increases that store owners have seen over the past eight months.

In stark contrast to industries like hospitality and entertainment that have proven to be more vulnerable during the pandemic, e-commerce has seen explosive growth. During the State of the Woo address at WooSesh 2020, the WooCommerce team shared that e-commerce is currently estimated to be a $4 trillion market that will grow to $4.5 trillion by 2021. WooCommerce accounts for a sizable chunk of that market with an estimated total payment volume for 2020 projected to reach $20.6 billion, a 74% increase compared to 2019.

The WooCommerce community is on the forefront of that growth and is deeply invested in the products that are driving stores’ success. The WooCommerce team shared that 75% of people who build extensions also build and maintain stores for merchants, and 70% of those who build stores for merchants also build and maintain extensions or plugins. In 2021, they plan to invest heavily in unlocking more features in more countries and will make WooCommerce Payments the native payment method for the global platform.

A new report from eMarketer shows that US e-commerce growth has jumped 32.4%, accelerating the online shopping shift by nearly two years. Experts also predict the top 10 e-commerce players will swallow up more of US retail spending to account for 63.2% of all online sales this year, up from 57.9% in 2019.

The increase in e-commerce spending may not be entirely tied to the pandemic, as some experts believe this historic time will mark permanent changes in consumer spending habits. This is where independent stores, powered by WooCommerce and other technologies, have the opportunity to establish a strong reputation for themselves by providing quality products and reliable service, as well as by being more nimble in the face of pandemic-driven increases in volume.

How to Make Use of gRPC Libraries and Frameworks

Featured Imgs 23

While gRPC brings a lot of power to enterprise level distributed computing, it's not an easy technology to implement. gRPC is a specification only. Thus, any programmer or company is free to implement it in any language that's capable of handling the details of the specification. But, this is easier said than done because implementing gRPC is a daunting task.

Understanding the Essentials of gRPC

Featured Imgs 23

In the previous installment of this series, we described the basics of gRPC in terms of history and overview. We talked about how gRPC emerged from Remote Procedure call technology (RPC) and evolved into a technology that is becoming a fixture on the landscape of distributed computing. Also, we provided a high-level overview of how the technology works.

MapSVG

Featured Imgs 23
mapsvg10001

MapSVG is a WordPress map plugin that helps you create custom content (people, real estate, events, or anything else) and show it on a vector, image, or Google Maps – with filters and search.

How to Manage a WooCommerce Store

Featured Imgs 26

How to Manage a WooCommerce StoreWooCommerce is an open-source eCommerce plugin for WordPress. It allows you to convert your WordPress website into an online store and helps you manage it as well. Opening an online store is fairly easy with the help of WooCommerce, but when it comes to long-term management, you may need expert guidance and extensions to increase […]

The post How to Manage a WooCommerce Store appeared first on WPExplorer.