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?

wolframalpha.com

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

Access to the world’s facts and data and calculates answers across a range of topics, including science, nutrition, history, geography, engineering, mathematics, linguistics, sports, finance, music…

Navigating Quantum Computing: Accelerating Next-Generation Innovation

12 April 2024 @ 3:23 pm

It’s no secret: quantum computing has been poised to be “the next big thing” for years. But recent developments in the quantum ecosystem, including major investments by companies such as IBM, Google, Microsoft and others, are the best indicators that now is the time to begin preparing for potentially viable quantum applications—and to identify where […]

Food and Sun: Wolfram Language Recipe Graphs for the Solar Eclipse

2 April 2024 @ 9:15 pm

At Wolfram Research, we are excited for the April 8 total solar eclipse and plan to observe this extraordinary event in several ways. Read about the science and math of this rare phenomenon in Stephen Wolfram’s new book, Predicting the Eclipse: A Multimillennium Tale of Computation, and then find eclipse specifics for your location with […]

Computational Astronomy: Exploring the Cosmos with Wolfram

25 March 2024 @ 2:11 pm

This year’s Global Astronomy Month is off to an exciting start for North America in anticipation of the total solar eclipse on April 8. In light of this momentous event, the following is a list of resources that bring Wolfram Language and astronomy together—including expert video guides, projects and books—for computational astronomers at every level. […]

Enhance Wind Turbine Design with the New Wolfram System Modeler Rotating Machinery Library

11 March 2024 @ 5:49 pm

Explore the contents of this article with a free Wolfram System Modeler trial. A wind turbine gearbox, susceptible to erratic wind loads, frequently fails well before its intended lifespan. Such failures, occurring globally, not only cause significant downtime but also lead to substantial economic losses. Can simulations help avoid this? The first animation delves into […]

How Many Days Would February Have if the Earth Rotated Backward? Exploring Leap Years with Wolfram Language

29 February 2024 @ 3:59 pm

Happy Leap Day 2024! A leap day is an extra day (February 29) that is added to the Gregorian calendar (the calendar most of us use day to day) in leap years. While leap years most commonly come in four-year intervals, they sometimes come every eight years. This is because a traditional leap day every […]

Your Invitation to Take a Quantum Leap in Education

27 February 2024 @ 11:02 pm

Learning quantum theory requires dedication and a willingness to challenge classical assumptions. Quantum interference, particularly for massive particles, is a pivotal example in this journey. The Schrödinger equation, inspired by de Broglie’s hypothesis, revolutionized our understanding by revealing the wavelike nature of even massive particles. This phenomenon not only deepens our grasp of nature but […]

Reduce Quantum Noise with Wolfram Language and Fire Opal

27 February 2024 @ 4:42 pm

Practical quantum computers have not entered the mainstream, but that has not stopped researchers and developers from innovating. Simulating quantum results on classical hardware and getting meaningful results from noisy quantum hardware are two important areas with lots of recent innovations. The Wolfram Quantum Framework is a toolkit for Wolfram Language that offers quantum simulations. […]

Hypergeometric Functions: From Euler to Appell and Beyond

25 January 2024 @ 5:35 pm

Hypergeometric series appeared in the mid-seventeenth century; since then, they have played an important role in the development of mathematical and physical theories. Most of the elementary and special functions are members of the large hypergeometric class. Hypergeometric functions have been a part of Wolfram Language since Version 1.0. The following plot shows the implementation […]

Leveling Up in Life Sciences: Unleashing the Power of Computational Biology with Wolfram Language

18 January 2024 @ 7:40 pm

In days past, life sciences was reserved for those who had access to the proper equipment to observe and experiment with the organisms of the physical world. For today’s scientist, exploration doesn’t end with access to physical encounters. Whether you’re classifying an animal for the first time or using a protein visualizer to develop medication, […]

off-guardian.org

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

OffGuardian is one of the only media news outlets to trust. True journalism unlike the MSM.

Facts really should be sacred. Unlike the Guardian, off-guardian is NOT funded by Bill & Melinda Gates, or any other NGO or government.

Quick Take: So…what’s with all the spying?

26 April 2024 @ 4:30 pm

Breaking news, from just a couple of hours ago, is that five British men have been charged with “conducting hostile activity in the UK to benefit Russia”. Details are still scarce, but the charges are said to be linked to a fire in March, which the Crown Prosecution Service described as “an arson attack on …

WATCH: The Age of Neurowarfare

25 April 2024 @ 8:00 pm

Stavroula Pabst joins James Corbett to discuss her recent article, “Weaponizing Reality: The Dawn of Neurowarfare.” From the military origins of brain-chip interfaces and neuroscience to the geopolitical ramifications of neuroweapons to the suspicious characters forwarding the controlled opposition “neurorights” movement, Pabst dives deep into the history and future of the age of neurowarfare. Sources …

OffG Recommends…Last Will & Testament

23 April 2024 @ 7:30 pm

Today is St George’s Day, and it’s also Shakespeare’s Birthday …not really. The truth is it’s a guess. William Shaksper, “the man from Stratford”, is known to have been baptised on April 26th and since babies of that time were generally baptized quite quickly, it stands to reason he was born sometime in the preceding …

This Week in the New Normal #88

22 April 2024 @ 6:30 pm

Our successor to This Week in the Guardian, This Week in the New Normal is our weekly chart of the progress of autocracy, authoritarianism and economic restructuring around the world.

Down with Big Brother: Warrantless Surveillance Makes a Mockery of the Constitution

22 April 2024 @ 7:00 am

“Whether he wrote DOWN WITH BIG BROTHER, or whether he refrained from writing it, made no difference … The Thought Police would get him just the same … the arrests invariably happened at night … In the vast majority of cases there was no trial, no report of the arrest. People simply disappeared, always during …

The Immense Hunger

21 April 2024 @ 6:30 pm

Like all living creatures, people need to eat to live.  Some people, eaten from within by a demonic force, try to deny others this basic sustenance.  All across the world people are starving because the powerful and wealthy create economic and political conditions that allow their wealth to be built on the backs of the …

Beijing McCafé

21 April 2024 @ 10:00 am

The people’s expectations have evolved in general from satisfying basic needs to improving the quality of life, and their demands at different levels and in various areas are becoming more diverse.” Xi Jinping, The Governance of China, IV (2022) The demand is voiceless, wordless, Yet lacks nothing in eloquence Or precision; needs no translation, Crosses …

Killing a Few for the Benefit of Millions

20 April 2024 @ 7:00 pm

Since when has this (the title of the article) become the mantra of civilized humanity? I grew up in a time when this thought would never enter your mind, even if it seemed practical in a given circumstance. Remember when you were a kid and you were asked the impossible question: If you had to …

War in the New Normal – slaughtering your Proles for convenience, fun & profit

20 April 2024 @ 10:00 am

There was a discussion on OffG recently under the latest column by CJ Hopkins, about whether the current spate of wars were “real”. Opinion was sharply divided. Binary you might say. On reading it the thing that occurred to me was that before you can have a meaningful discussion about whether or not a thing …

Itchy Boots

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

Motorcycle adventures from a single perspective.

Red Letter Media

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

Movie reviews from VCR repair men.
Continue reading

44Teeth

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

Motorcycle vblog and chat with challenges.
Continue reading

WHF Entertainment

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

A look into the crazy world with Whats her face.

joeybtoonz

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)

One man’s look at clown world (tiktok/narcissistic culture).

Tourists and #IDIOCRACY 4

24 April 2024 @ 3:08 pm

This Is Why I Stay Home 4

18 April 2024 @ 4:03 pm

Fashion and #IDIOCRACY 2

24 March 2024 @ 4:24 pm

Narcissists and #SOCIALMEDIA 18

9 March 2024 @ 5:06 pm

TikTok and #IDIOCRACY 13

2 March 2024 @ 7:16 pm

Why Is This A Thing!? 2

15 February 2024 @ 11:15 pm

TikTok and #IDIOCRACY 12

28 January 2024 @ 7:49 pm

Tourists and #IDIOCRACY 3

12 January 2024 @ 11:28 pm

This Is Why I Stay Home 3

4 January 2024 @ 6:49 pm

kubuntu.org

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)

Kubuntu is a free, complete, and open-source alternative to Microsoft Windows and Mac OS X which contains everything you need to work, play, or share.

Kubuntu 24.04 LTS Noble Numbat Released

25 April 2024 @ 4:16 pm

The Kubuntu Team is happy to announce that Kubuntu 24.04 has been released, featuring the ‘beautiful’ KDE Plasma 5.27 simple by default, powerful when needed. Codenamed “Noble Numbat”, Kubuntu 24.04 continues our tradition of giving you Friendly Computing by integrating the latest and greatest open source technologies into a high-quality,...

Kubuntu 24.04 Beta Released

12 April 2024 @ 6:33 pm

Join the Excitement: Test Kubuntu 24.04 Beta and Experience Innovation with KubuQA! We’re thrilled to announce the availability of the Kubuntu 24.04 Beta! This release is packed with new features and enhancements, and we’re inviting you, our valued community, to join us in fine-tuning this exciting new version. Whether you’re...

Celebrating Creativity: Announcing the Winners of the Kubuntu Contests!

9 April 2024 @ 8:38 pm

We are thrilled to announce the winners of the Kubuntu Brand Graphic Design contest and the Wallpaper Contest! These competitions brought out the best in creativity, innovation, and passion from the Kubuntu community, and we couldn’t be more pleased with the results. Kubuntu Brand Graphic Design Contest Winners The Kubuntu...

Kubuntu Brand Graphic Design Contest Deadline Extended!

3 April 2024 @ 5:28 am

We’re thrilled to announce that due to the incredible engagement and enthusiasm from our community, the Kubuntu Council has decided to extend the submission deadline for the Kubuntu Brand Graphic Design Contest! Originally set to close at 23:59 on March 31, 2024, we’re giving you more time to unleash your...

Kubuntu Wallpaper 24.04 – Call for Submissions

22 March 2024 @ 8:19 am

We are excited to announce a call for submissions for the official desktop wallpaper of Kubuntu 24.04! This is a fantastic opportunity for artists, designers, and Kubuntu enthusiasts to showcase their talent and contribute to the visual identity of the upcoming Kubuntu release. What We’re Looking For We are in...

Kubuntu Community Update – March 2024

8 March 2024 @ 4:53 pm

Greetings, Kubuntu enthusiasts! It’s time for our regular community update, and we’ve got plenty of exciting developments to share from the past month. Our team has been hard at work, balancing the demands of personal commitments with the passion we all share for Kubuntu. Here’s what we’ve been up to:...

Kubuntu Graphic Design Contest

20 February 2024 @ 9:21 pm

Announcing the Kubuntu Graphic Design Contest: Shape the Future of Kubuntu We’re thrilled to unveil an extraordinary opportunity for creatives and enthusiasts within and beyond the Kubuntu community The Kubuntu Graphic Design Contest. This competition invites talented designers to play a pivotal role in shaping the next generation of the...

Kubuntu Council Meeting – 30th January 2024

4 February 2024 @ 1:28 am

Greetings, Kubuntu Community! Today marked an important Kubuntu Council meeting, where we witnessed significant progress and collaboration among our esteemed council members – Darin Miller, Rik Mills, Valorie Zimmerman, Aaron Honeycutt, Jonathan Riddell (Kubuntu Treasurer), and Simon Quigley(Lubuntu). In this blog post, we’re excited to share the highlights and outcomes...

Plasma 5.27 LTS for Jammy 22.04 LTS available via PPA

18 October 2023 @ 3:28 pm

We have had many requests to make Plasma 5.27 available in our backports PPA for Jammy Jellyfish 22.04. However, for technical reasons this would have broken upgrades to Kinetic 22.10 while that upgrade path existed. Now that Kinetic is end of life, it is possible to allow opt in backports...

Kubuntu 23.10 Mantic Minotaur Released

17 October 2023 @ 12:50 am

The Kubuntu Team is happy to announce that Kubuntu 23.10 has been released, featuring the ‘beautiful’ KDE Plasma 5.27 simple by default, powerful when needed. Codenamed “Mantic Minotaur”, Kubuntu 23.10 continues our tradition of giving you Friendly Computing by integrating the latest and greatest open source technologies into a high-quality,...

Ultra Harmonics

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

Cool vibes and ultra Harmonics, instrumental in it’s finest.
Continue reading