Python RegEx | Docs With Examples
Source link
بلاگ
-
Python RegEx | Docs With Examples
-
JavaScript and TypeScript Projects with React, Angular, or Vue in Visual Studio 2022 with or without .NET
I was reading Gabby’s blog post about the new TypeScript/JavaScript project experience in Visual Studio 2022. You should read the docs on JavaScript and TypeScript in Visual Studio 2022.
If you’re used to ASP.NET apps when you think about apps that are JavaScript heavy, “front end apps” or TypeScript focused, it can be confusing as to “where does .NET fit in?”
You need to consider the responsibilities of your various projects or subsystems and the multiple totally valid ways you can build a web site or web app. Let’s consider just a few:
- An ASP.NET Web app that renders HTML on the server but uses TS/JS
- This may have a Web API, Razor Pages, with or without the MVC pattern.
- You maybe have just added JavaScript via <script> tags
- Maybe you added a script minimizer/minifier task
- Can be confusing because it can feel like your app needs to ‘build both the client and the server’ from one project
- A mostly JavaScript/TypeScript frontend app where the HTML could be served from any web server (node, kestrel, static web apps, nginx, etc)
- This app may use Vue or React or Angular but it’s not an “ASP.NET app”
- It calls backend Web APIs that may be served by ASP.NET, Azure Functions, 3rd party REST APIs, or all of the above
- This scenario has sometimes been confusing for ASP.NET developers who may get confused about responsibility. Who builds what, where do things end up, how do I build and deploy this?
VS2022 brings JavaScript and TypeScript support into VS with a full JavaScript Language Service based on TS. It provides a TypeScript NuGet Package so you can build your whole app with MSBuild and VS will do the right thing.
NEW: Starting in Visual Studio 2022, there is a new JavaScript/TypeScript project type (.esproj) that allows you to create standalone Angular, React, and Vue projects in Visual Studio.
The .esproj concept is great for folks familiar with Visual Studio as we know that a Solution contains one or more Projects. Visual Studio manages files for a single application in a Project. The project includes source code, resources, and configuration files. In this case we can have a .csproj for a backend Web API and an .esproj that uses a client side template like Angular, React, or Vue.
Thing is, historically when Visual Studio supported Angular, React, or Vue, it’s templates were out of date and not updated enough. VS2022 uses the native CLIs for these front ends, solving that problem with Angular CLI, Create React App, and Vue CLI.
If I am in VS and go “File New Project” there are Standalone templates that solve Example 2 above. I’ll pick JavaScript React.
Then I’ll click “Add integration for Empty ASP.NET Web API. This will give me a frontend with javascript ready to call a ASP.NET Web API backend. I’ll follow along here.
It then uses the React CLI to make the front end, which again, is cool as it’s whatever version I want it to be.
Then I’ll add my ASP.NET Web API backend to the same solution, so now I have an esproj and a csproj like this
Now I have a nice clean two project system – in this case more JavaScript focused than .NET focused. This one uses npm to startup the project using their web development server and proxyMiddleware to proxy localhost:3000 calls over to the ASP.NET Web API project.
Here is a React app served by npm calling over to the Weather service served from Kestrel on ASP.NET.
This is inverted than most ASP.NET Folks are used to, and that’s OK. This shows me that Visual Studio 2022 can support either development style, use the CLI that is installed for whatever Frontend Framework, and allow me to choose what web server and web browser (via Launch.json) I want.
If you want to flip it, and put ASP.NET Core as the primary and then bring in some TypeScript/JavaScript, follow this tutorial because that’s also possible!
Sponsor: Make login Auth0’s problem. Not yours. Provide the convenient login features your customers want, like social login, multi-factor authentication, single sign-on, passwordless, and more. Get started for free.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
- An ASP.NET Web app that renders HTML on the server but uses TS/JS
-
SQL Not Equal To | Docs With Examples
SQL Not Equal To | Docs With Examples
Source link -
6.39 Million Google Clicks! 🤑
Yesterday Online PNG Tools smashed through 6.38M Google clicks and today it’s smashed through 6.39M Google clicks! That’s 10,000 new clicks in a single day – the smash train keeps on rollin’!
What Are Online PNG Tools?
Online PNG Tools offers a collection of easy-to-use web apps that help you work with PNG images right in your browser. It’s like a Swiss Army Knife for anything PNG-related. On this site, you can create transparent PNGs, edit icons, clean up logos, crop stamps, change colors of signatures, and customize stickers – there’s a tool for it all. The best part is that you don’t need to install anything or be a graphic designer. All tools are made for regular people who just want to get stuff done with their images. No sign-ups, no downloads – just quick and easy PNG editing tools.
Who Created Online PNG Tools?
Online PNG Tools were created by me and my team at Browserling. We’ve build simple, browser-based tools that anyone can use without needing to download or install anything. Along with PNG tools, we also work on cross-browser testing to help developers make sure their websites work great on all web browsers. Our mission is to make online tools that are fast, easy to use, and that are helpful for everyday tasks like editing icons, logos, and signatures.
Who Uses Online PNG Tools?
Online PNG Tools and Browserling are used by everyone – from casual users to professionals and even Fortune 100 companies. Casual users often use them to make memes, edit profile pictures, or remove backgrounds. Professionals use them to clean up logos, design icons, or prepare images for websites and apps.
Smash too and see you tomorrow at 6.40M clicks! 📈
PS. Use coupon code
SMASHLING
for a 30% discount on these tools at onlinePNGtools.com/pricing. 💸 -
SQL Joins | Explained With Examples
SQL Joins | Explained With Examples
Source link -
Using Home Assistant to integrate a Unifi Protect G4 Doorbell and Amazon Alexa to announce visitors
I am not a Home Assistant expert, but it’s clearly a massive and powerful ecosystem. I’ve interviewed the creator of Home Assistant on my podcast and I encourage you to check out that chat.
Home Assistant can quickly become a hobby that overwhelms you. Every object (entity) in your house that is even remotely connected can become programmable. Everything. Even people! You can declare that any name:value pair that (for example) your phone can expose can be consumable by Home Assistant. Questions like “is Scott home” or “what’s Scott’s phone battery” can be associated with Scott the Entity in the Home Assistant Dashboard.
I was amazed at the devices/objects that Home Assistant discovered that it could automate. Lights, remotes, Spotify, and more. You’ll find that any internally connected device you have likely has an Integration available.
Temperature, Light Status, sure, that’s easy Home Automation. But integrations and 3rd party code can give you details like “Is the Living Room dark” or “is there motion in the driveway.” From these building blocks, you can then build your own IFTTT (If This Then That) automations, combining not just two systems, but any and all disparate systems.
What’s the best part? This all runs LOCALLY. Not in a cloud or the cloud or anyone’s cloud. I’ve got my stuff running on a Raspberry Pi 4. Even better I put a Power Over Ethernet (PoE) hat on my Rpi so I have just one network wire into my hub that powers the Pi.
I believe setting up Home Assistant on a Pi is the best and easiest way to get started. That said, you can also run in a Docker Container, on a Synology or other NAS, or just on Windows or Mac in the background. It’s up to you. Optionally, you can pay Nabu Casa $5 for remote (outside your house) network access via transparent forwarding. But to be clear, it all still runs inside your house and not in the cloud.
OK, to the main point. I used to have an Amazon Ring Doorbell that would integrate with Amazon Alexa and when you pressed the doorbell it would say “Someone is at the front door” on our all Alexas. It was a lovely little integration that worked nicely in our lives.
However, I swapped out the Ring for a Unifi Protect G4 Doorbell for a number of reasons. I don’t want to pump video to outside services, so this doorbell integrates nicely with my existing Unifi installation and records video to a local hard drive. However, I lose any Alexa integration and this nice little “someone is at the door” announcement. So this seems like a perfect job for Home Assistant.
Here’s the general todo list:
- Install Home Assistant
- Install Home Assistant Community Store
- This enables 3rd party “untrusted” integrations directly from GitHub. You’ll need a GitHub account and it’ll clone custom integrations directly into your local HA.
- I also recommend the Terminal & SSH (9.2.2), File editor (5.3.3) add ons so you can see what’s happening.
- Get the UniFi Protect 3rd party integration for Home Assistant
- NOTE: Unifi Protect support is being promoted in Home Assistant v2022.2 so you won’t need this step soon as it’ll be included.
- “The UniFi Protect Integration adds support for retrieving Camera feeds and Sensor data from a UniFi Protect installation on either an Ubiquiti CloudKey+, Ubiquiti UniFi Dream Machine Pro or UniFi Protect Network Video Recorder.”
- Authenticate and configure this integration.
- Get the Alexa Media Player integration
- This makes all your Alexas show up in Home Assistant as “media players” and also allows you to tts (text to speech) to them.
- Authenticate and configure this integration.
I recommend going into your Alexa app and making a Multi-room Speaker Group called “everywhere.” Not only because it’s nice to be able to say “play the music everywhere” but you can also target that “Everywhere” group in Home Assistant.
Go into your Home Assistant UI at http://homeassistant.local:8123/ and into Developer Tools. Under Services, try pasting in this YAML and clicking “call service.”
service: notify.alexa_media_everywhere data: message: Someone is at the front door, this is a test data: type: announce method: speak
If that works, you know you can automate Alexa and make it say things. Now, go to Configuration, Automation, and Add a new Automation. Here’s mine. I used the UI to create it. Note that your Entity names may be different if you give your front doorbell camera a different name.
Notice the format of Data, it’s name value pairs within a single field’s value.
…but it also exists in a file called Automations.yaml. Note that the “to: ‘on’” trigger is required or you’ll get double announcements, one for each state change in the doorbell.
- id: '1640995128073' alias: G4 Doorbell Announcement with Alexa description: G4 Doorbell Announcement with Alexa trigger: - platform: state entity_id: binary_sensor.front_door_doorbell to: 'on' condition: [] action: - service: notify.alexa_media_everywhere data: data: type: announce method: speak message: Someone is at the front door mode: single
It works! There’s a ton of cool stuff I can automate now!
Sponsor: Make login Auth0’s problem. Not yours. Provide the convenient login features your customers want, like social login, multi-factor authentication, single sign-on, passwordless, and more. Get started for free.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
-
What is Docker Compose | Explained With Examples
What is Docker Compose | Explained With Examples
Source link -
Effective Digital Marketing Strategies for Surrogacy Agencies
In the competitive world of surrogacy, agencies seeking growth and visibility must leverage effective digital marketing strategies. The internet presents a wealth of opportunities to reach potential surrogates and intended parents alike. Through strategic approaches such as SEO, PPC advertising, and online reputation management, surrogacy agencies can gain a significant advantage. Understanding how to harness these digital tools can elevate a business to new heights, fostering trust and engagement. As technology continuously evolves, staying updated with digital trends is not just beneficial—it’s essential for sustained success and growth in the surrogacy field.
Search Engine Optimization (SEO)
Search Engine Optimization (SEO) is critical for surrogacy agencies aiming to increase their online visibility. Digital landscapes are crowded, and thousands of women apply to be surrogates every year, emphasizing the need for differentiation. Employing effective SEO strategies involves optimizing website content, utilizing relevant keywords, and ensuring a seamless user experience to attract more organic traffic.
A comprehensive SEO strategy includes on-page and off-page optimization. On-page optimization focuses on content quality, meta tags, and URL structure to enhance relevance and authority. Off-page strategies, such as building backlinks and engaging in social media, further amplify a surrogacy agency’s online presence, building credibility and encouraging business growth.
Maintaining an effective SEO campaign requires ongoing monitoring and analysis. Analyzing SEO metrics helps agencies identify successful strategies and areas needing improvement. By staying informed and responsive to changing SEO trends and algorithms, surrogacy agencies ensure that their web presence effectively reaches and resonates with their target audience.
Pay-Per-Click (PPC) Advertising
Pay-Per-Click (PPC) advertising offers surrogacy agencies immediate visibility through paid online campaigns. Utilizing PPC involves creating targeted ads that appear when potential clients search for related services. According to What to Expect, 75% of expecting parents create a baby registry, which highlights the necessity of understanding market behaviors.
To optimize PPC campaigns, agencies need to carefully select keywords that resonate with both potential surrogates and intended parents. Crafting compelling ad copy that aligns with user intent can significantly enhance engagement and conversion rates. Furthermore, regular monitoring and optimization of PPC campaigns ensure better performance and return on investment.
An effective PPC strategy is not a set-and-forget solution. Continuous adjustment and testing are necessary to align with evolving market demands and consumer interests. By refining strategies and implementing advanced targeting techniques, surrogacy agencies can maintain a competitive edge, contributing to overall business success.
Online Reputation Management
In the digital age, a surrogacy agency’s reputation is often synonymous with its success. Online reputation management revolves around controlling the narrative surrounding the agency. Proactively managing online reviews and engaging with clients can help build a positive reputation, fostering trust and reliability among prospective surrogates and parents.
Statistics from High Rock Studios suggest that the most engaged audiences spend 76 times more on advertised products and services online. This fact underlines the importance of maintaining a stellar online reputation. Agencies must invest in monitoring their digital footprint, addressing negative feedback constructively, and celebrating positive testimonials to enhance their image.
Reputation management is an ongoing effort that involves every department in the agency. Delivering excellent customer service, transparent communication, and honoring commitments are foundational to cultivating positive perceptions online. By prioritizing an exemplary reputation, surrogacy agencies can build longstanding relationships and trust, key elements in a sustainable business model.
In conclusion, leveraging search engine optimization, pay-per-click advertising, and online reputation management are pivotal strategies for surrogacy agencies seeking success. Each tactic offers unique benefits that, when combined, result in a comprehensive digital marketing strategy. As the digital landscape continues to evolve, it is crucial for agencies to adapt their approaches accordingly. Continuous learning and adjustment of strategies ensure that the business remains relevant and competitive. Ultimately, a strategic focus on these areas empowers surrogacy agencies to thrive in an increasingly digital world.
-
6.38 Million Google Clicks! 🤑
Yesterday Online PNG Tools smashed through 6.37M Google clicks and today it’s smashed through 6.38M Google clicks! That’s 10,000 new clicks in a single day – the smash train keeps on rollin’!
What Are Online PNG Tools?
Online PNG Tools offers a collection of easy-to-use web apps that help you work with PNG images right in your browser. It’s like a Swiss Army Knife for anything PNG-related. On this site, you can create transparent PNGs, edit icons, clean up logos, crop stamps, change colors of signatures, and customize stickers – there’s a tool for it all. The best part is that you don’t need to install anything or be a graphic designer. All tools are made for regular people who just want to get stuff done with their images. No sign-ups, no downloads – just quick and easy PNG editing tools.
Who Created Online PNG Tools?
Online PNG Tools were created by me and my team at Browserling. We’ve build simple, browser-based tools that anyone can use without needing to download or install anything. Along with PNG tools, we also work on cross-browser testing to help developers make sure their websites work great on all web browsers. Our mission is to make online tools that are fast, easy to use, and that are helpful for everyday tasks like editing icons, logos, and signatures.
Who Uses Online PNG Tools?
Online PNG Tools and Browserling are used by everyone – from casual users to professionals and even Fortune 100 companies. Casual users often use them to make memes, edit profile pictures, or remove backgrounds. Professionals use them to clean up logos, design icons, or prepare images for websites and apps.
Smash too and see you tomorrow at 6.39M clicks! 📈
PS. Use coupon code
SMASHLING
for a 30% discount on these tools at onlinePNGtools.com/pricing. 💸