StackOverflow.com

VN:F [1.9.22_1171]
Rating: 9.4/10 (10 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

Mapping complex object in Automapper

27 April 2024 @ 2:32 am

The following are the Simple objects that works fine using Automapper: public class Source { public int Id {get;set;} public string Name {get;set;} } public class Destination { public int Id {get;set;} public string Name {get;set;} } SampleClass.cs using Automapper; public class SampleClass { private IMapper _mapper; public SampleClass(IMapper mapper) { _mapper = mapper; } public void Logic(Souce source) { var Dest = _mapper.Map<Destination>(source); } } The above mapping statement works fine and I see all the fields getting mapped from source to destination since it is a simple object . But my requirement is that, I have a complex object structure as follows : public class Source { public int Id {get;set;} public string Name {get;set;} public List<SourceChild> lstChild {get;set;} } public class SourceChild { public string Address{get;set;} } public class D

Using Node.js, fetching a webpage is different from on the browser

27 April 2024 @ 2:28 am

I am trying to use fetch on Node.js, to fetch the page: https://finance.yahoo.com/quote/META I can see on the browser it is at a price of $443.29 Also if I use view-source:https://finance.yahoo.com/quote/META on the browser and set Disable JavaScript to ON on Google Chrome's dev tool, I can see the following content: data-field="regularMarketPrice" data-trend="none" data-pricehint="2" data-value="443.29" active><span>443.29 However, if I do a fetch using Node.js, or even if I go to Chrome's dev tool and the Network tab, and reload the page, and then right click on the first network resource, and right click and choose Copy -> As Fetch (Node.js) I can get the equivalent of what Google Chrome used:

Django Ñ problem? ValueError: source code string cannot contain null bytes

27 April 2024 @ 2:28 am

I'm working on Django and connecting to a remote SQL Server database. I managed to make the connection to the database using the MSSQL engine, but when I run inspectdb, the generated file contains errors due to the character "Ñ", in the file they appear as ±. So when I try to run the server, I get the following error: ValueError: source code string cannot contain null bytes. refering to the generated file with inspectdb I suspect that the problem is related to the database encoded in Modern_Spanish_CI_AS and also Ñ character is causing trouble. So far, I've tried the following: In settings.py, in database options: 'unicode_results': True Also, 'extra_params': 'ClientCharset=utf8' Modifying in base.py: mssql: unicode_results = options.get('unicode_results', True) Some less elegant solutions like opening the generated file with Notepad and saving it in UTF-8 or ISO 885

Azure SQL - Private and Service Endpoints together

27 April 2024 @ 2:28 am

I have a requirement to configure both Private and Service endpoints on Azure SQL firewall. Here is a quick simulated scenario Scenario 1: Subnet1 of VNet 1 is configured with Azure SQL service endpoint and whitelisted in Azure SQL DB firewall (service endpoint). This allows VM1 to access the database without any issues. enter image description here Scenario 2: When I added a private endpoint from a different VNET (VNet2) to this Azure SQL DB to allow access from VM2 inside VNET 2, the existing connectivity between VM1 and DB is lost. enter image description here Is it because the addition of private endpoint to the SQL DB firewall allows all incoming connection to use

Is there a way I can use a getline string in some sort of if/case statement to get a specific line to be read from a txt file?

27 April 2024 @ 2:23 am

so im developing software for my brothers company, its just a little side project nothing really that major. This specific part of the software is meant to be able to let tenants put in an address, then put in a code, and it will then tell them what the house unlock code is. But Ive ran into an issue. I cant find a way where people would be able to put in the address, then have the software read the .txt file to the specific line with the house code and unlock code on it. #include <iostream> #include <string> #include <fstream> #include <sstream> #include <vector> void fileOP(std::ifstream& testdata, int linenumsought, std::string& address); int main() { std::ifstream testdata; testdata.open("testdata.txt"); int linenumsought; std::string address; std::cout << "Please enter address: "; std::getline(std::cin, address); fileOP(testdata, linenumsought, address);

AWS ECS mounting ca certificate to the container is it possible

27 April 2024 @ 2:23 am

to mount private ca certificates into the containers. In EKS we could mount secrets as files, but I’m not sure that’s possible in ECS. is it possible to mount a certificate to the ECS container .if so how can i achieve to do that using the terraform . can anyone please help me ? Not having the idea to carry out anything.

Why does synchronous code execute faster than asynchronous code

27 April 2024 @ 2:22 am

At present, I refactor the code in the project, because the code involves more database operations, so consider using asyncio, currently all database operations are implemented using asynchronous, and then test the original code (original code is synchronous) and asynchronous code, found that synchronous code is faster, why? About the difference between synchronous code and asynchronous code: operating database: synchronous code uses pymysql, asynchronous code uses aiomysql, asyncio; pandas was used for data calculation; The code logic is the same; The same computer; The same wifi; python version: synchronous code is 3.6, asynchronous code is 3.8; Django version: synchronous code is 3.2.25, asynchronous code is 4.2.11; Asynchronous code uses asynchronous views that Django supports, such as: @method_decorator(csrf_exempt, name='dispatch') class AsyncExampleView(View): async de

Using viridis Colormap For Matplotlib Plot Lines

27 April 2024 @ 2:22 am

I want to use the viridis colormap, yet it keeps reporting "AttributeError: Line2D.set() got an unexpected keyword argument 'cmap'". Here is what I attempted to do: import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import numpy as np cmap = plt.get_cmap('viridis') df = pd.read_excel('c:\MET_Proj\WakeAngleAndSpatter.xlsm') fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12, 5)) axes[0].plot(df.iloc[3:20, 0], df.iloc[3:20, 1], label='Sample 1, 200W 200V', cmap='viridis') axes[0].set_xlabel('Length from start (mm)') axes[0].set_ylabel('Wake Angle (degrees)') axes[0].legend() axes[1].plot(df.iloc[3:20, 0], df.iloc[3:20, 2], label='Sample 1, 200W 200V', cmap='viridis') axes[1].set_xlabel('Length from start (mm)') axes[1].set_ylabel('Cumulative Spatters') axes[1].legend() norm = plt.Normalize(1.min(), 1.max()) line_colors = cmap(norm(1)) plt.show() If I remove any cmap related ar

How to get the tokenizer from ONNX export in Transformers.js

27 April 2024 @ 2:19 am

I have a bunch of checkpoints from cross-encoder/nli-deberta-v3-small and I was able to convert one to ONNX via the Transformer.js script as they recommend. Model link: https://huggingface.co/cross-encoder/nli-deberta-v3-small The goal is to use this as a rag re-ranker. Initially, I tried to use the pipeline to load the model, i.e.: pipeline("text-classification", model, { quantized: false }) - but that did not work - nor do I think the pipeline does the right thing for my task. This is what the exported ONNX dir looks like: enter image description here Next, I tried this (used the singleton pattern but I'm simplifying the code below): import { AutoModel,

How to determine a safe range of addresses to read from physical memory for 16gb of RAM?

27 April 2024 @ 2:11 am

I'm using RWEverything to read physical memory. It works fine, but if I try to read an address that is too big then it results in a BSOD. For example, 0x0000eef777340000 is going to BSOD me. How to calculate the maximum safe address to read from by knowing only my physical RAM size?

jsfiddle.net

VN:F [1.9.22_1171]
Rating: 9.0/10 (2 votes cast)

A playground for web developers, use it as an online editor for snippets built from HTML, CSS and JavaScript. The code can then be shared with others, embedded on a blog, etc.

SmashingMagazine.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (6 votes cast)

Digital media magazine for designers and developers
Web design plus tips and tricks.

The End Of The Free Tier

26 April 2024 @ 8:00 am

Free-tier pricing is a common marketing strategy. “Free” gets people in the door and allows them to settle in and see how things work. But, as Juan Diego Rodriguez explains, the practice of free *tiers* is often conflated with free *trials*. And while the distinction may be nuanced, the consequences of sunsetting free-tier pricing may be huge.

Conducting Accessibility Research In An Inaccessible Ecosystem

25 April 2024 @ 12:00 pm

Conducting UX research that includes participants with a variety of disabilities is vital to building inclusive technology, but most prototypes used for testing are inaccessible. Rather than continuing to leave out feedback from disabled consumers, which ultimately leads to exclusive technology, researchers must get creative in their workarounds and be relentless in their efforts.

Using AI For Neurodiversity And Building Inclusive Tools

24 April 2024 @ 3:00 pm

This article illustrates how AI can be leveraged to build tools that can be inclusive with a little bit of an additional effort.

F-Shape Pattern And How Users Read

23 April 2024 @ 10:00 am

Scrolling, scanning, skipping: How do users consume content online? Here’s what you need to know about reading behavior and design strategies to prevent harmful scanning patterns. An upcoming part of Smart Interface Design Patterns.

How To Work With GraphQL In WordPress In 2024

19 April 2024 @ 10:00 am

What options do we have for integrating GraphQL with WordPress in 2024? Leonardo Losoviz describes the developments that have taken place in this space over the last three years.

Converting Plain Text To Encoded HTML With Vanilla JavaScript

17 April 2024 @ 1:00 pm

What do you do when you need to convert plain text into formatted HTML? Perhaps you reach for Markdown or manually write in the element tags yourself. Or maybe you have one or two of the dozens of online tools that will do it for you. In this tutorial, Alexis Kypridemos picks those tools apart and details the steps for how we can do it ourselves with a little vanilla HTML, CSS, and JavaScript.

How To Monitor And Optimize Google Core Web Vitals

16 April 2024 @ 10:00 am

The three Core Web Vitals metrics don’t only tell you how visitors experience your website but also impact your Google search result rankings. In this article, we’ll look at what Core Web Vitals are, how they are measured, and how you can use DebugBear to monitor them continuously.

Sliding 3D Image Frames In CSS

12 April 2024 @ 6:00 pm

Creating 3D effects in CSS isn’t an entirely new concept, but typical approaches use additional elements in the markup and pseudo-elements in the styles to pull it off. Temani Afif applies 3D effects and sliding transitions to a single `` using clever CSS techniques that demonstrate advanced, modern styling practices.

Penpot’s CSS Grid Layout: Designing With Superpowers

11 April 2024 @ 8:00 am

Penpot helps designers and developers work better together by offering a free, open-source design tool based on open web standards. Today, let's explore Penpot’s latest feature, CSS Grid Layout. Penpot’s latest release is about efficiency and so much more. It gives designers superpowers and a better place at the table. Excited? Let’s take a look at it together.

Connecting With Users: Applying Principles Of Communication To UX Research

9 April 2024 @ 10:00 am

Victor Yocco reviews the components of the Transactional Model of communication, explaining how we might apply this framework to preparing, conducting, and analysing our UX research. You will understand how many UX research best practices align with the model and get an example of a tool for tracking alignment.

stackblitz.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (2 votes cast)

Create, edit & deploy fullstack apps — in just one click. From Angular to React or even just HTML, JS and CSS.

firebase.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (2 votes cast)

An on-line real-time database for your apps.

#FirebaserFriday: Frank van Puffelen

18 March 2022 @ 3:58 pm

Paulette McCroskey Social Media Manager, Advanced Systems Group, LLC

How Firebase Performance Monitoring optimized app startup time

9 March 2022 @ 4:58 pm

Viswanathan Munisamy Software Engineer

Using Machine Learning to optimize mobile game experiences

15 February 2022 @ 4:58 pm

Sachin Kotwani Senior Product Manager Elvis Sun Software Engineer Mobile app and game developers can use on-device machine learning in their apps to increase user engagement and grow revenue. We worked with game developer HalfBrick to train and implement a custom model that personalized the user's in-game experience based on the player's skill level and session details, resulting in increased interactions with

Accept Payments with Cloud Firestore and Google Pay

11 February 2022 @ 8:00 pm

Stephen McDonald Developer Relations Engineer, Google Pay Back in 2019 we launched Firebase Extensions - pre-packaged solutions that save you time by providing extended functionality to your Firebase apps, without the need to research, write, or debug code on your own. Since then, a ton of extensions have been added to the platform covering a wide range of features, from email triggers and text messaging, to image resizing, translation, and much more. Google Pay Firebase Extension We're now

Everything you need to know about Remote Config’s latest personalization feature

26 January 2022 @ 6:22 pm

Jon Mensing Product Manager An important part of turning your app into a business is to optimize your user experience to drive the bottom line results you want. A popular way to do this is through manual experimentation, which involves setting up A/B tests for different components of your app and finding the top performing variant. Now, you can save time and effort - and still maximize the objectives you want - with Remote Config’s latest personalization feature. Personalization harnesses the power of machine learning to automatically find the optimal e

What’s new at Firebase Summit 2021

10 November 2021 @ 5:31 pm

Kristen Richards Group Product Manager

Automate your pre-release testing with the App Distribution REST API

8 November 2021 @ 5:59 pm

Liat Berry Product Manager

Improving the Google Analytics dashboard in Firebase

5 November 2021 @ 6:03 pm

Sumit Chandel Developer Advocate If you’ve visited the Firebase console’s Analytics section recently, you might have noticed something new… an updated Analytics dashboard, a new Realtime view and a few other UI enhancements.

How to get better insight into push notification delivery

27 October 2021 @ 3:45 pm

Charlotte Liang Charlotte Liang Software Engineer

Pinpointing API performance issues with Custom URL Patterns

20 October 2021 @ 3:45 pm

Ibrahim Ulukaya Ibrahim Ulukaya Developer Advocate

bitbucket.org

VN:F [1.9.22_1171]
Rating: 8.4/10 (5 votes cast)

The alternative to Github, private and open git repositories.

Custom merge checks are now generally available

23 April 2024 @ 5:28 am

We're excited to announce the general availability (GA) of custom merge checks in Bitbucket Cloud. This new capability has seen amazing… The post Custom merge checks are now generally available appeared first on Bitbucket.

Introducing Dynamic Pipelines: A new standard in CI/CD flexibility

23 April 2024 @ 5:05 am

Bitbucket cloud is on a mission to become the world’s most extensible cloud SCM and CI/CD product, and we're thrilled to… The post Introducing Dynamic Pipelines: A new standard in CI/CD flexibility appeared first on Bitbucket.

Cloud Migration Trials are available for Bitbucket Cloud!

22 April 2024 @ 5:56 pm

We are excited to announce that cloud migration trials (CMTs) are now generally available for new Bitbucket Cloud workspaces. Cloud migration… The post Cloud Migration Trials are available for Bitbucket Cloud! appeared first on Bitbucket.

Evolving Bitbucket Pipelines to unlock faster performance and larger builds

16 April 2024 @ 7:16 am

Bitbucket Pipelines has seen amazing adoption over recent years, with millions of developers and teams using it to build better software… The post Evolving Bitbucket Pipelines to unlock faster performance and larger builds appeared first on Bitbucket.

Generate Bitbucket Cloud pull request descriptions with Atlassian Intelligence 🎉

11 April 2024 @ 8:20 pm

We are thrilled to announce that AI-assisted pull request descriptions is now available for all Bitbucket Premium users. Crafting clear, concise… The post Generate Bitbucket Cloud pull request descriptions with Atlassian Intelligence 🎉 appeared first on Bitbucket.

Uplevel your DevOps automation with new Bitbucket Cloud extensibility

3 April 2024 @ 5:11 am

Today, modern software organizations’ requirements for DevOps tooling has become more sophisticated and bespoke. We hear from many customers that they… The post Uplevel your DevOps automation with new Bitbucket Cloud extensibility appeared first on Bitbucket.

Upcoming changes to pull requests and merge check configuration

3 April 2024 @ 5:00 am

As part of the graduation of custom merge checks from open-beta to general availability (GA) that is planned for late-April 2024,… The post Upcoming changes to pull requests and merge check configuration appeared first on Bitbucket.

Automatically assign code owners as pull request reviewers

28 March 2024 @ 6:52 pm

As your team and products expand, expertise in various areas of your code base may become distributed among different team members,… The post Automatically assign code owners as pull request reviewers appeared first on Bitbucket.

Forge for Bitbucket Cloud: Laying the foundation for infinite extensibility

16 February 2024 @ 2:49 am

We hosted a webinar on March 5th, 2024 to introduce you to what's possible with Forge, walk through some technical basics and answer… The post Forge for Bitbucket Cloud: Laying the foundation for infinite extensibility appeared first on Bitbucket.

Unified user management is generally available for new Bitbucket Cloud workspaces!

8 February 2024 @ 4:46 pm

We are excited to announce that unified user management is now generally available for new Bitbucket Cloud workspaces. Unified user management… The post Unified user management is generally available for new Bitbucket Cloud workspaces! appeared first on Bitbucket.

tympanus.net/codrops

VN:F [1.9.22_1171]
Rating: 8.3/10 (6 votes cast)

Useful resources and inspiration for creative minds (html, css, javascript)

Collective #833

26 April 2024 @ 11:00 am

CSS in React Server Components * DOMCanvas translation * field-sizing

Inspirational Websites Roundup #59

25 April 2024 @ 11:05 am

Explore our latest collection of websites with handpicked designs that will keep you updated on current trends.

Case Study: Gabriel Contassot’s Portfolio — 2024

24 April 2024 @ 9:25 am

A look into the making of Gabriel's 2024 portfolio website, complementing minimal design choices with subtle animations.

Blurry Text Reveal on Scroll

23 April 2024 @ 1:08 pm

A blurry text reveal animation on scroll inspired by Rauno's "Blur reveal".

Collective #832

23 April 2024 @ 11:00 am

Menu in view with just CSS * Demystifying the Shadow DOM * ClickWheel.js

Collective #831

19 April 2024 @ 11:00 am

The Debugger's Toolkit * Deco.cx * Flattening Bézier Curves and Arcs

Some On-Scroll Text Highlight Animations

17 April 2024 @ 12:13 pm

Some ideas for scroll-based text highlight animations.

Collective #830

16 April 2024 @ 11:00 am

JavaScript Signals standard proposal * Awesome-Code-AI * Old-school cursors

Bridging Design and Code: The Power of Penpot’s CSS Grid Layout

15 April 2024 @ 10:17 am

Explore Penpot, the open-source platform enhancing design and development teamwork, now featuring the CSS Grid Layout for even more powerful and efficient project creation.

UI Interactions & Animations Roundup #42

14 April 2024 @ 9:33 am

A fresh motion design collection of the best shots from Dribbble to get your creativity flowing.

vercel.com

VN:F [1.9.22_1171]
Rating: 8.3/10 (3 votes cast)

Deploy your app with now.sh. Free CLI-based deployments.

heartinternet.co.uk

VN:F [1.9.22_1171]
Rating: 8.3/10 (3 votes cast)

Hosting packages for an initial web presence

Black Friday and Cyber Monday sale now on at Heart Internet

22 November 2022 @ 3:31 pm

You can now get up to 33% off the price of a cPanel-managed Web Hosting plan at Heart Internet.

Are your website fonts sending the right message?

3 November 2022 @ 10:18 am

Did you know that the fonts you use on your website can impact the way your customers perceive and interact with your brand?

10 of the best WooCommerce plugins

27 October 2022 @ 10:53 am

Including options for optimising your cart, boosting customer loyalty, and selling tickets.

9 creative alternatives to .com and .co.uk domains

5 October 2022 @ 2:37 pm

Discover the appeal of .ninja, .coffee, .guru and more - all available in our domain name sale.

Save up to 43% on WordPress Hosting in our latest sale

20 September 2022 @ 3:23 pm

We’ve just slashed the price of WordPress Hosting at Heart Internet.

What to do once you’ve bought a domain

7 September 2022 @ 12:48 pm

A guide to what to do next once you've chosen your perfect domain name.

Empowering quotes and motivational tips for entrepreneurs

25 August 2022 @ 8:33 am

Including quotes from Amelia Earhart and Barack Obama, to give you a little pick me up.

5 reasons we love cPanel

10 August 2022 @ 7:09 am

When browsing through hosting packages, you’ll often come across the word cPanel. But what exactly does this word mean and what are the benefits of buying a hosting package with cPanel included?

Four ways domains can help you protect your brand identity online

2 August 2022 @ 9:55 am

Did you know that domains can be so much more than a mere address or waymark? In this blog, we look at how they can be a powerful tool for online brand protection.

It’s World Wide Web Day so here are 5 reasons to get your business online

1 August 2022 @ 9:19 am

Celebrating World Wide Web Day by looking at why it's never been more important to have an online presence.

github.com

VN:F [1.9.22_1171]
Rating: 8.2/10 (5 votes cast)

GitHub is the best way to collaborate with others. Fork, send pull requests and manage all your public and private git repositories.

GitHub Actions, Arm64, and the future of automotive software development

26 April 2024 @ 3:33 pm

Learn how GitHub's Enterprise Cloud, GitHub Actions, and Arm's latest Automotive Enhanced processors, work together to usher in a new era of efficient, scalable, and flexible automotive software creation. The post GitHub Actions, Arm64, and the future of automotive software development appeared first on The GitHub Blog.

Securing millions of developers through 2FA

24 April 2024 @ 3:00 pm

We’ve dramatically increased 2FA adoption on GitHub as part of our responsibility to make the software ecosystem more secure. Read on to learn how we secured millions of developers and why we’re urging more organizations to join us in these efforts. The post Securing millions of developers through 2FA appeared first on The GitHub Blog.

Using open source to help the earth

22 April 2024 @ 3:00 pm

This Earth Day, we discuss how tech and open source are helping two organizations combat the effects of a changing climate. The post Using open source to help the earth appeared first on The GitHub Blog.

A short guide to mastering keyboard shortcuts on GitHub

19 April 2024 @ 4:37 pm

Say goodbye to constant mouse clicking and hello to seamless navigation with GitHub shortcuts. The post A short guide to mastering keyboard shortcuts on GitHub appeared first on The GitHub Blog.

A policy proposal on our approach to deepfake tools and responsible AI

18 April 2024 @ 5:30 pm

We’re asking for feedback on a proposed Acceptable Use Policy update to address the use of synthetic and manipulated media tools for non-consensual intimate imagery and disinformation while protecting valuable research. The post A policy proposal on our approach to deepfake tools and responsible AI appeared first on The GitHub Blog.

The world’s fair of software: Join us at GitHub Universe 2024

16 April 2024 @ 4:00 pm

It’s the 10th anniversary of our global developer event! Celebrate with us by picking up in-person tickets today. It’s bound to be our best one yet. The post The world’s fair of software: Join us at GitHub Universe 2024 appeared first on The GitHub Blog.

All In Africa: New cohort now open!

11 April 2024 @ 4:13 pm

As we’re opening up the doors to our final class of this programmatic year, we’re also looking back at our recent graduates and the partners that helped make them a success. The post All In Africa: New cohort now open! appeared first on The GitHub Blog.

Helping policymakers weigh the benefits of open source AI

10 April 2024 @ 10:53 pm

GitHub enables developer collaboration on innovative software projects, and we’re committed to ensuring policymakers understand developer needs when crafting AI regulation. The post Helping policymakers weigh the benefits of open source AI appeared first on The GitHub Blog.

GitHub Availability Report: March 2024

10 April 2024 @ 8:15 pm

In March, we experienced two incidents that resulted in degraded performance across GitHub services. The post GitHub Availability Report: March 2024 appeared first on The GitHub Blog.

4 ways GitHub engineers use GitHub Copilot

9 April 2024 @ 7:00 pm

GitHub Copilot increases efficiency for our engineers by allowing us to automate repetitive tasks, stay focused, and more. The post 4 ways GitHub engineers use GitHub Copilot appeared first on The GitHub Blog.