79281933

Date: 2024-12-15 07:02:12
Score: 1
Natty:
Report link

The issue with your program is that the name variable is never updated inside the loop. After the initial input, the while loop keeps running indefinitely because the name variable is still holding its initial value.

To fix this, you need to prompt the user to enter their name again inside the loop. Here's the corrected code:

while name != "John":
    print("Please type your name.")
    name = input()  # Update the value of 'name' within the loop
print("Thank you!")
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Awlad Hossain

79281904

Date: 2024-12-15 06:29:06
Score: 2
Natty:
Report link

Is it necessary to use regex?

content ='12345 67890 123175 9876'
for item in content.split(' '):
    if not item.endswith('175'):
        print(item)

Output

12345
67890
9876
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Is it
  • High reputation (-1):
Posted by: moken

79281882

Date: 2024-12-15 06:08:02
Score: 2
Natty:
Report link

SQLAlchemy has since introduced the dimensions= kwarg, e.g. Column('sample', postgresql.ARRAY(Integer, dimensions=2).

See https://docs.sqlalchemy.org/en/13/dialects/postgresql.html#sqlalchemy.dialects.postgresql.ARRAY.

Reasons:
  • Probably link only (1):
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Pat Zabawa

79281879

Date: 2024-12-15 06:07:02
Score: 2.5
Natty:
Report link

Use this and the error will be resolved. This error is due to the not usage of ES Modules, so you have to use UMD modules import { ScrollTrigger } from 'gsap/dist/ScrollTrigger';

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Inzemam ul-Haq

79281872

Date: 2024-12-15 05:57:00
Score: 2.5
Natty:
Report link

Bro, Simply add this line and done !

DRFSO2_URL_NAMESPACE = 'drfso2'

and if you have not given url for the pattern then do that else all done

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: ADITYA OJHA Aditya

79281851

Date: 2024-12-15 05:35:56
Score: 1.5
Natty:
Report link

Looks like pyannote cannot download model.bin anymore : (

But I found that it only needs authentication to download once, after which the script can load the models from ~/.cache.

Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: R4L

79281847

Date: 2024-12-15 05:31:54
Score: 4
Natty:
Report link

Is it useful to set button display as none?(display.none) so you have not to delet the button.

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Single line (0.5):
  • Starts with a question (0.5): Is it use
  • Low reputation (1):
Posted by: Navid Abolfathi

79281844

Date: 2024-12-15 05:28:53
Score: 2
Natty:
Report link

This issue, of missing pip, persists Python 3.13.1. I resolve this by uninstall it. Then run the installer as Administrator (on Windows 11).

You'll need to do custom installation and have the installer install to c:\dev\Python313 custom path.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: xman

79281843

Date: 2024-12-15 05:27:53
Score: 1.5
Natty:
Report link

Since caller() is an async function and await has not been called on it - it will execute in an async manner. This means it may move on to the next line of code, before execution has been completed, If the order of execution matters ( you want to execute in an a sync manner ) you need to use await OR use .then()

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Nimit Jain

79281833

Date: 2024-12-15 05:17:51
Score: 3
Natty:
Report link

For using MUI in next make sure :

  1. Read This Article Integration With Next

  2. CacheProvider is not only for caching , make sure you set cache provider , of course the next version of that

  3. Is better to manage theme in a component , define theme and provide in a client component then wrap other components into it in layout

  4. Make sure install and config the required dependencies for Next.js :

    npm install @mui/material-nextjs @emotion/cache

  5. You should consider, according to this article Support the Next.js MUI is not supporting server components yet , and may you have some problem with using MUI in a Next.js app

Reasons:
  • Blacklisted phrase (1): This Article
  • Blacklisted phrase (1): this article
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Amirreza Monfared

79281830

Date: 2024-12-15 05:13:50
Score: 1
Natty:
Report link

For anyone interested in an answer, I used an array to return:

= { "Mins Elapsed"; ""; ARRAYFORMULA(IF(A4:A="", "", (A4:A - A3:A) * 24 * 60)) }

enter image description here

NOTE: For the array to result in a column, not a row, a semi-colon (;) must be used, not a comma (,) to separate the array values.

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: maxhugen

79281820

Date: 2024-12-15 04:54:47
Score: 2.5
Natty:
Report link

You have to added a new CollectionView for new products to the HomePage.The visibility of the CollectionView is controlled via data binding,and based on there new products.The ViewModel loads the products and determines to show or hide the collection view.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Priya Prajapati

79281818

Date: 2024-12-15 04:52:47
Score: 1.5
Natty:
Report link

The comments suggesting various pathfinding algorithms are correct! Since you are only looking to determine if a level is playable and you are not looking for a shortest path, I recommend using Breadth-first search.

Simply consider the start of the algorithm to be the position of the character, and consider the children of each node to be a step in each cardinal direction. Run BFS until the door is found or all nodes have been visited and this will let you know if the level is playable.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: andres

79281810

Date: 2024-12-15 04:38:45
Score: 1.5
Natty:
Report link

Using native image speeds up more than 20 times the batch start up.

Check this article: https://foojay.io/today/speed-up-your-spring-batch-with-native-image-and-graalvm/

For Spring Batch applications, Native Images are a game-changer.

  1. Instantaneous startup: From 4 seconds to 0.2 seconds.
  2. Perfect for batch jobs: Jobs that start, process, and exit benefit the most.
  3. Lower memory usage: No JVM, no warm-up, no extra overhead.

By using GraalVM Native Image, you can build batch jobs that are fast, efficient, and perfectly suited for cloud environments where "scale to zero" is essential.

If you're dealing with micro-batch jobs that run for seconds, Native Image is a must-have. If your batch jobs are long-lived (running for hours), the benefit is less significant, but for fast, one-shot batch jobs, Native Image is unbeatable.

Reasons:
  • Blacklisted phrase (1): this article
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: vvauban

79281803

Date: 2024-12-15 04:29:43
Score: 3.5
Natty:
Report link

Just delete the venv. For example for conda env

$$ rm -r /opt/homebrew/Caskroom/miniforge/base/envs/ProjectRocket

enter image description here

Reasons:
  • Blacklisted phrase (1): enter image description here
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: user1237999

79281798

Date: 2024-12-15 04:26:43
Score: 0.5
Natty:
Report link

Old thread, but thought I'd, add. These days, if you're using coroutines, a common way would be

    scope.launch(Dispatchers.Main) {
        /* code to be executed on main thread */
    }
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Vadim

79281794

Date: 2024-12-15 04:22:41
Score: 3.5
Natty:
Report link

If your repository URL is: https://github.com/techfoon/ToDoApk

To view it in VS Code Online (Read-Only), you simply need to change the .com to .dev

Example: GitHub Repository: https://github.com/techfoon/ToDoApk

VS Code View (Read-Only): https://github.dev/techfoon/ToDoApk

Reasons:
  • Probably link only (1):
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Peeyush Sachan

79281788

Date: 2024-12-15 04:15:39
Score: 1.5
Natty:
Report link

Please include this healthcheck:

healthcheck: test: ["CMD", "mysql", "-h", "db", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}", "-e", "SELECT 1;"]

Note I have used the db service here.

I was struggling with the error: 'RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods'

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Erick

79281779

Date: 2024-12-15 04:07:38
Score: 0.5
Natty:
Report link

I noticed nobody gave an answer for the second part of your question, about why the code does not work as expected for posterity's sake.

The answer to that is hidden in Eric's answer: Because arithmetic operations must be performed to determine the output of a number (e.g. 9.2), floating point numbers are essentially an estimation of a number, not a precisely defined representation of the number.

For integers, we are simply counting up. A 3 follows a 2, which follows a 1, and that took 2 bits to display. To go to 4, however, we need a third bit. Floating point, however, uses scientific notation to store the number, which is how it's able to represent decimal numbers.

To borrow from this answer for a similar question, in floating-point notation the number "9.2" is actually this fraction:

5179139571476070 * 2 -49

That's not a perfect representation of 9.2, so depending on the size of the float it will be off by some small fraction.

There are boundaries within the floating point "number line" that are more or less accurate. Depending on where things fall, the floating-point representation may be exact.

If you need the exact number, you should use an integer. If you need an exact number that has decimals, your only real option is to split out the decimal portion and use another integer for that portion of the number.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Jeffery Wells

79281774

Date: 2024-12-15 03:53:36
Score: 2
Natty:
Report link

Flutter 3.24, create a .ipa file in Flutter without signing, use flutter build ios --release --no-codesign get build/ios/iphoneos/Runner.app .

Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Huang Guan

79281773

Date: 2024-12-15 03:52:36
Score: 3
Natty:
Report link

enter image description here

This alsoi worked for me

npm install --save [email protected]

Reasons:
  • Blacklisted phrase (1): enter image description here
  • Whitelisted phrase (-1): worked for me
  • Low length (1.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Tatenda Makandigona

79281768

Date: 2024-12-15 03:45:34
Score: 0.5
Natty:
Report link

I learned that TailwindCSS automatically removes the dark class from the bundled CSS if it is not used in any className attribute in JSX. To force TailwindCSS to bundle the dark class, I added the following to my tailwind.config.ts:

safelist: ['dark']

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Kevin H.

79281761

Date: 2024-12-15 03:32:32
Score: 0.5
Natty:
Report link

Found my error.

Need to give an alias after my close bracket of UNPIVOT

UNPIVOT
(
   [Postings] FOR [Periods] IN ([Balance Forward],[Net Posting 01], [Net Posting 02], [Net Posting 03], [Net Posting 04], [Net Posting 05], [Net Posting 06], [Net Posting 07], [Net Posting 08], [Net Posting 09], [Net Posting 10], [Net Posting 11], [Net Posting 12] )
) as unpvt
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: David.L

79281748

Date: 2024-12-15 03:14:28
Score: 3.5
Natty:
Report link

See answer to this related question that I believe to be effective: unable to install packages on 3.6.3

Reasons:
  • Probably link only (1):
  • Low length (1.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Ben Jacobson

79281740

Date: 2024-12-15 03:05:26
Score: 2
Natty:
Report link

You just need add this :

 bottomPadding: 0
 topPadding: 0

Some how this not 0 by default

Reasons:
  • Low length (1.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: LynX19

79281710

Date: 2024-12-15 02:35:19
Score: 7.5 🚩
Natty: 4.5
Report link

Tuve el mismo error, se solucionΓ³ instalando los siguientes paquetes en termux:

pkg install rust rust-std-i686-linux-android rust-src rustc-src -y

Reasons:
  • Blacklisted phrase (2.5): solucion
  • RegEx Blacklisted phrase (2.5): mismo
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: BartolomΓ© Stern

79281704

Date: 2024-12-15 02:31:18
Score: 0.5
Natty:
Report link

systemd tmpfiles.d /etc/tmpfiles.d/transparent_hugepage.conf

w /sys/kernel/mm/transparent_hugepage/enabled - - - - never
w /sys/kernel/mm/transparent_hugepage/defrag - - - - never

Apply the settings immediately: systemd-tmpfiles --create

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: denji

79281698

Date: 2024-12-15 02:20:16
Score: 1
Natty:
Report link

-n, --numeric-sort compare according to string numerical value

for example:

(base) ➜  ~ echo -n '3\n10\n1.1\n1\n'          
3
10
1.1
1
(base) ➜  ~ echo -n '3\n10\n1.1\n1\n' | sort
1
10
1.1
3
(base) ➜  ~ echo -n '3\n10\n1.1\n1\n' | sort -n
1
1.1
3
10

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: yangbo

79281687

Date: 2024-12-15 01:58:14
Score: 2.5
Natty:
Report link

just to add for the sake of those who would reuse this answer. To change to or from a .kv predefined screen, you need to reference the root of the app. hence, "self.current" as used in the question would not work. rather "self.root.current " would be the correct reference to produce the desired change

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: SUNNETDev

79281684

Date: 2024-12-15 01:55:13
Score: 2.5
Natty:
Report link

I have checked your sitemap https://techjobs.xyz/sitemap.xml and it looks OK. Go to Search Console and try deleting the sitemap and add it again. Then refresh the page.

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Achilles

79281665

Date: 2024-12-15 01:37:10
Score: 0.5
Natty:
Report link

you can start by increasing the gRPC server timeout and keep-alive settings in the Milvus configuration file. Adjusting parameters such as grpc.server_keepalive_time_ms and grpc.server_keepalive_timeout_ms ensures the connection remains active during prolonged insert operations. Additionally, reducing the batch size for data insertions can help alleviate server overload; while 10,000 records may work initially, lowering it to a smaller size, like 5,000, can prevent bottlenecks over time. Optimizing your insertion process with parallelization can further improve efficiency, but ensure each thread or process uses an independent connection to avoid overwhelming the server. Monitoring the Milvus server’s resource utilization is crucial; inadequate CPU, RAM, or network bandwidth can contribute to timeouts, so scaling up hardware resources or deploying Milvus in a distributed setup may be necessary. Implement robust error handling to catch and retry failed insertions with an exponential backoff strategy, which prevents immediate retries from overwhelming the server. Reviewing Milvus server logs and monitoring system metrics will help identify specific constraints or misconfigurations contributing to the issue, enabling a targeted resolution.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: rjlin

79281656

Date: 2024-12-15 01:26:08
Score: 3
Natty:
Report link

You need to check with your provider or datacenter if they are block port 25 from their side

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: 0WebHost

79281647

Date: 2024-12-15 01:17:06
Score: 1
Natty:
Report link

Issue

I have some recommendations for anyone that is trying to serve basic html page files with javascript and is facing this 404 issue only in production and not locally. A good point to begin debugging is to take a look at what Vercel is receiving and exposing to your public domain.

Configuration

In the Vercel dashboard: visit your project at projectID -> Source tab. From here, take a look at the tabs present on the left side titled Source & Output.

The files present in Output will be available publicly, you may see index & middleware already in there. Vercel will usually be able to locate your index.html from the .root and will automatically generate the middleware if one isn't present.

The Source tab is specifying the files that will be publicly available when accessing your domain. If the .html page you're trying to locate isn't in this Ouput tab that is probably the source of your problems. We'll need to ensure the .html page you're trying to contact exists in this Output directory.

Solution

How can we do this?

Ensure you have a /public folder in your project. Your index.html should be in the .root directory, along with dependency managers and lock files. By moving files over we're telling Vercel to make these available publicly, aka in the Output directory.

Ensure your directory assembles something like the following:

Directory structure

.root/
β”‚
β”œβ”€β”€ package.json
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ index.html
β”œβ”€β”€ vercel.json
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ styles.css
β”‚   β”œβ”€β”€ images/
β”‚   └── page1.html
  

Additional recommendations (cleaning the url):

vercel.json

{
  "cleanUrls": true
}

Utilize a cleanUrls object in your vercel.json to clean the URL:

eg. https://your-website.com/about.html -> https://your-website.com/about

Reasons:
  • Blacklisted phrase (1): How can we
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: nolan boxill

79281645

Date: 2024-12-15 01:16:06
Score: 1.5
Natty:
Report link

Both I think. The resulted pages + the query.

However, this is all good in theory. The reality is that only a small fraction of the world's websites is actually found and indexed by the search engines. Therefor you actually have to try to notify the search engine that you want your website to be indexed. For example to create a search console account and submit a sitemap of your website. And then post your content on various social media etc. Its not as easy as someone may think.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Achilles

79281641

Date: 2024-12-15 01:10:05
Score: 1
Natty:
Report link

My fix was to update Android gradle:

id("com.android.application").version("8.7.0").apply(false)
id("com.android.library").version("8.7.0").apply(false)
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Cipri

79281632

Date: 2024-12-15 01:00:03
Score: 1
Natty:
Report link

There are at least 2 options:

  1. Coding based -> Create simple node.js app that will consume RocketChat webook and call your ticket system API.
  2. No-code -> Use n8n automation software which works just like zapier but it can be launched locally. Install and configure it to use webooks or just RocketChat integration endpoint along with HTTP request to your ticket system.
Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Michal

79281627

Date: 2024-12-15 00:58:03
Score: 2
Natty:
Report link

assuming the data is already in a dataframe df as you describe, try using a list comprehension:

result = pd.DataFrame({ 'name': [df['name'][i] for col in ['A', 'B', 'C'] for i in range(len(df)) if df[col][i] == 1] }, index=['A', 'B', 'C'])

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Dave982

79281624

Date: 2024-12-15 00:56:01
Score: 1
Natty:
Report link

Unfortunately, LinearRegression in scikit-learn does not natively support using custom loss functions. The LinearRegression class by default uses Ordinary Least Squares, which minimizes the standard Mean Squared Error. However, you can achieve your goal by implementing a custom loss function using an optimization library like scipy.optimize. The minimize function from scipy.optimize is used to solve the optimization problem. To incorporate the intercept, we append a column of ones to X. This method gives you complete freedom to specify any loss function you like, provided it's differentiable. If your A matrix is very large, be aware of the computational cost associated with its inverse calculation. This is independent of scikit-learn's implementation of LinearRegression, since scikit-learn does not allow to directly change the loss. If you want to use this in a pipeline or together with GridSearchCV you can wrap the logic above into a custom estimator by subclassing BaseEstimator and RegressorMixin from scikit-learn.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Celine Habashy

79281621

Date: 2024-12-15 00:54:01
Score: 0.5
Natty:
Report link

In this case, you are looking to use start() instead of run()

Reasons:
  • Low length (1.5):
  • Has code block (-0.5):
  • Single line (0.5):
  • High reputation (-1):
Posted by: Flair

79281617

Date: 2024-12-15 00:44:59
Score: 2
Natty:
Report link

Digging up this old thread. According to the wp-hide plugin documentation you can actually hide the plugin name itself (as of 2024).

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Cypher

79281615

Date: 2024-12-15 00:42:58
Score: 4.5
Natty:
Report link

I would say you should probably rethink the design :(

Reasons:
  • Blacklisted phrase (1): :(
  • Low length (1.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: ESBM74

79281609

Date: 2024-12-15 00:26:55
Score: 1
Natty:
Report link

I have some recommendations for anyone that is trying to serve basic html page files with javascript and is facing this 404 issue only in production and not locally. A good point to begin debugging is to take a look at what Vercel is receiving and exposing to your public domain.

In the Vercel dashboard: visit your project at projectID -> Source tab. From here, take a look at the tabs present on the left side titled Source & Output.

The files present in Output will be available publicly, you may see index & middleware already in there. Vercel will usually be able to locate your index.html from the .root and will automatically generate the middleware if one isn't present.

The Source tab is specifying the files that will be publicly available when accessing your domain. If the .html page you're trying to locate isn't in this Ouput tab that is probably the source of your issue. We'll need to ensure the .html page you're trying to contact, eg. https://www.your-website.com/page1.html exists in this Output directory.

How can we do this?

Ensure you have a /public folder in your project. Your index.html should be in the .root directory, along with dependency managers and lock files. By moving files over we're telling Vercel to make these available publicly, aka in the Output directory.

Ensure your directory assembles something like the following:

.root/
β”‚
β”œβ”€β”€ package.json
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ index.html
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ styles.css
β”‚   β”œβ”€β”€ images/
β”‚   └── page1.html
  
Reasons:
  • Blacklisted phrase (1): How can we
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: nolan boxill

79281606

Date: 2024-12-15 00:16:53
Score: 2.5
Natty:
Report link

According to Linkedin... "LinkedIn backlinks are typically no follow links. This means that they include a rel="nofollow" attribute in the HTML code, signaling to search engines that they should not pass authority or influence rankings to the linked website.May 16, 2023".

However you should not only focus on Linkedin and Medium. Try to use a much wider selection of valuable websites where you can post your articles and gain valuable backlinks. Don't get carried away though, always check the reputation of the websites, you don't want any spammy ones! Also, don't forget your on page SEO work. Building backlinks is not enough on its own.

Reasons:
  • RegEx Blacklisted phrase (1.5): the reputation
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Achilles

79281604

Date: 2024-12-15 00:16:53
Score: 2
Natty:
Report link

You are blocked by Cloudflare WAF. Try with TLS Requests:

pip install wrapper-tls-requests

Unlocking Cloudflare Bot Fight Mode

import tls_requests
r = tls_requests.get('https://getir.com/')
print(r)
<Response [200]>

Github repo: https://github.com/thewebscraping/tls-requests

Read the documentation: thewebscraping.github.io/tls-requests/

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Earn Pham

79281598

Date: 2024-12-14 23:59:50
Score: 1.5
Natty:
Report link

I came up with this:

 template <class T> struct var {
     using  hash_type = unsigned;
     using value_type = T;
     
     value_type value;
     const hash_type cached_id;

     constexpr var(const value_type the_value) noexcept 
      : value(the_value)
      , cached_id([]{ static hash_type k; return k++; }())
     {}

     constexpr operator auto() noexcept { return value; }
 };

 template <class T> var(T const&) -> var<T>;

Live on Compiler Explorer
No macros. Is this what you're looking for?

Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
Posted by: viraltaco_

79281591

Date: 2024-12-14 23:54:49
Score: 5
Natty: 4.5
Report link

This repository will be helpful - Liquibase Multi-Datasource Setup for Spring

Reasons:
  • Probably link only (1):
  • Low length (2):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Aziz

79281588

Date: 2024-12-14 23:52:47
Score: 5
Natty:
Report link

We were facing the same issues with one of our clients installation and the fix is easy change to LONGTEXT

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Me too answer (2.5): facing the same issue
  • Low reputation (1):
Posted by: 0WebHost

79281583

Date: 2024-12-14 23:46:46
Score: 0.5
Natty:
Report link

Remove color prop:

<a href='#' className='addTableButton'>
    <PlusSquare className='hover' size={32} weight="fill" />
</a>

Use CSS to set its style like:

.addTableButton .hover { color: red }
.addTableButton:hover .hover { color: blue }

That should do the trick.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: mrReiha

79281580

Date: 2024-12-14 23:40:44
Score: 2.5
Natty:
Report link

I believe I have found the problem. When I call a script in Invoke-AzVmRunCommand, it is automatically executed in the system context with the System user. However, in the system context, you cannot run winget by default because it is an MSIX package. There are some workarounds available, but they are quite cumbersome and none of them have worked so far.I think I’ll close the ticket.

Reasons:
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: iflach

79281579

Date: 2024-12-14 23:39:44
Score: 1
Natty:
Report link

In addition to "source.organizeImports": "explicit" and "isort.args":["--profile", "black"], using "isort.importStrategy": "fromEnvironment" will allow isort to use the current env to properly sort imports in files from the local / dev package being used.

From: https://marketplace.visualstudio.com/items?itemName=ms-python.isort#settings.

Full example:

{
    "[python]": {
        "editor.defaultFormatter": "ms-python.black-formatter",
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
          "source.organizeImports": "explicit"
    },
  },
  "isort.args":["--profile", "black"],
  "isort.importStrategy": "fromEnvironment"
}
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: immersinn

79281567

Date: 2024-12-14 23:29:42
Score: 1
Natty:
Report link

Not sure if it was again updated, this hack works for now

![test](https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fdrive.google.com/uc?id=<YOUR_ID>)
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: vondravl

79281560

Date: 2024-12-14 23:21:41
Score: 1
Natty:
Report link

First of all, your code/project is way too big in my opinion for someone to retry and give a concise answer to your several questions, which may amount to redoing it for you.

Regarding to your questions, it's not quite clear what's your issue, but I suppose you're concerned more about the "average" times that you are observing while running your Java and C++ implementations. In this regards, I would like to draw your attention to the "max" value of your first "PUT", which is way too big for C++, and it requires further and thorough analysis.

Concerning to Java and C++ compilers, to my knowledge Java is much more optimized for performance than any other C++ compiler can do out-of-the box. That being said, it doesn't mean that C++ can't beat Java in terms of performance. It certainly can, but it also requires some more care from the developers, for example by adding couple of more const keywords or applying some other syntactic formalities.

Generally, to optimize any software for performance, one shall first understand what are the bottlenecks and which parts are the most time-consuming. Let alone the benchmarking techniques and language-specifics, you should not compare apples with oranges, which you are doing here in my opinion by trying to benchmark map-implementations of Java and C++ in a way which is not just comparing their implementations to be honest but also lot of things around each of those, like for example memory allocation/de-allocation and compiler optimization.

What I want to highlight with this my answer is that you need a considerable analysis to be done in order to find the real reason behind your observation. It may be a simple syntactic sugar missing, or it may be complex memory-management, or maybe your benchmarks are skipping the garbage-collection part from Java? What about the process priorities that are being launched in each of those cases? Are you testing both on the same machine? Finally, as it was already pointed out by others in the comments, custom benchmarking is not so reliable.

Reasons:
  • Blacklisted phrase (1): regards
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
Posted by: Hack06

79281549

Date: 2024-12-14 23:06:38
Score: 1
Natty:
Report link

I’ve noticed the warning, that explains the issue

CSC : warning CS9057: The analyzer assembly '/home/runner/.nuget/packages/verify.mstest/28.2.0/analyzers/dotnet/roslyn4.4/cs/Verify.MSTest.SourceGenerator.dll' references version '4.9.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'.

We will need to find, why the older version of Roslyn is called?

Reasons:
  • No code block (0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • High reputation (-2):
Posted by: Michael Freidgeim

79281543

Date: 2024-12-14 23:00:38
Score: 1.5
Natty:
Report link

make sure your browser isnt hijacked firstly , you need to do some heavy searching tobreak coding while leaving it in place to keep eyes in. keeps them happy

or simply use the dark web avoiding all the limits and limitations to slow and keep you in a lane.

or use the old school OS . linx . thats where you have 100% control and 100% unhackable while almost. this land of tech, is Jesus. very unsafe., very doors opened with no lock button for anyone to walk into your PCs etc.

bots have 100% access to all alls personal information. < worst thing ever to install on a faulty secure internet. they will harvest alls data. thank fuk i dont run social medias .. hehe

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: WoLFNardz

79281539

Date: 2024-12-14 22:53:37
Score: 1
Natty:
Report link
package main

import "fmt"

type MyType interface {
    int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | string
}

func Unique[T MyType](m []T) []T {
    var k2 int
    un := []T{}
    for k1, v1 := range m {
        for k2 = 0; k2 < k1 && v1 != m[k2]; k2++ {
        }
        if k1 == k2 || v1 != m[k2] {
            un = append(un, v1)
        }
    }
    return un
}

func main() {
    input := []string{"green", "red", "green", "blue", "red"}
    unique := Unique(input)
    fmt.Println(unique)
}

Playground

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Π’Π»Π°Π΄ Алт

79281523

Date: 2024-12-14 22:39:33
Score: 4
Natty:
Report link

sheet.getRow(X).getCell(C).getStringCellValue()

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Has no white space (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Martha Andrade

79281521

Date: 2024-12-14 22:38:32
Score: 5
Natty:
Report link

You can go to https://www.opendatanetwork.com/ and search opendata to find most of the domains.

Reasons:
  • Probably link only (1):
  • Low length (1.5):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: theDataSniffer

79281508

Date: 2024-12-14 22:31:30
Score: 0.5
Natty:
Report link

There are countless frameworks and approaches, each catering to specific needs. For example:

These are just a few examples; there are dozens, if not hundreds, of popular frameworks, each tailored to different architectural styles and use cases.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Kartal Tabak

79281507

Date: 2024-12-14 22:30:30
Score: 1.5
Natty:
Report link

Check your console if it says creating it means need to wait:

enter image description here

Reasons:
  • Probably link only (1):
  • Low length (1.5):
  • No code block (0.5):
  • Single line (0.5):
  • High reputation (-2):
Posted by: ACV

79281499

Date: 2024-12-14 22:21:28
Score: 2
Natty:
Report link

Instead of java.net.URL use URI

    val uri = URI.create(yamlUrl)
    //Then you can just use .toURL() to get the url
    val connection = uri.toURL().openConnection()
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: JREalDeal

79281497

Date: 2024-12-14 22:18:27
Score: 4
Natty:
Report link

Camel 4.4 introduced variables.

Reasons:
  • Low length (2):
  • No code block (0.5):
  • Has no white space (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Leponzo

79281486

Date: 2024-12-14 22:08:25
Score: 1
Natty:
Report link

in my script stats failed when all the values read are outside the yrange, but it worked when I set yrange to fit all the data points.

Reasons:
  • Whitelisted phrase (-1): it worked
  • Low length (1):
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Leonid Pryadko

79281483

Date: 2024-12-14 22:05:24
Score: 2.5
Natty:
Report link

For keyboard shortcut (doesn't work for mouse click), you can do the following:

Implement your own pause:

Implement your own play:

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: anon123

79281474

Date: 2024-12-14 22:01:23
Score: 1.5
Natty:
Report link

I eventually ended up talking to one of the application developers who explained that I was using the wrong endpoint. I was using the address of the graphiql web app where you can manually run queries and the endpoint is different. I still am not clear if this is common practice, but it was the simple answer.

I did get stuck for a minute after correcting the endpoint because it kept giving me an unauthorized 401 response. I was using the --token flag to send my Auth token for the init. The documentation indicates that the default token scheme is Bearer, but I did have to specify it with the --scheme Bearer flag. Once I added that, it went through without any issue.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Dylan Wimber

79281470

Date: 2024-12-14 21:57:23
Score: 3.5
Natty:
Report link

Please turn of the document root option from tweak settings inside your whm

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: 0WebHost

79281467

Date: 2024-12-14 21:55:22
Score: 2
Natty:
Report link

The solution of having the QueryClientContextProvider.tsx in a different files works however it comes with one disadvantage. The provider uses the "use client" key word thus if you wrap the entire app inside this provider all you pages are converted to client component. As a result all the benefits of server side rendering are automatically lost. Here is a video how SSR works and when to use the "use client" hook. https://www.youtube.com/watch?v=Qdkg_mrniLk&t=17s

Reasons:
  • Blacklisted phrase (1): youtube.com
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: kyronnyoro

79281465

Date: 2024-12-14 21:53:22
Score: 3
Natty:
Report link

I got the same issue with Beanstalk.

I finally apply this config:

enter image description here

See this discussion on AWS forum.

Reasons:
  • Probably link only (1):
  • Low length (1):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Tzorneu Ngansop Patrick

79281446

Date: 2024-12-14 21:30:16
Score: 5
Natty:
Report link

Thanks to the suggestion in the comments and in particular the tip of @Homer512 I have come to this solution, please tell me if you think it could be done better.

// shape.cuh
#pragma once

#include <variant>
#include "sphere.cuh"

using Shape = std::variant<Sphere>;
//sphere.cuh
#pragma once

#include "ray.cuh"
#include "vec3.cuh"

class Sphere {
public:
  __host__ __device__ Sphere(const Vec3 &center, float radius);
  __device__ auto hit(const Ray &r) const -> bool;

private:
  Vec3 center;
  float radius;
};

h_shapes initialized as

const std::vector<Shape> &h_shapes = scene->getShapes();
  const size_t num_shapes = h_shapes.size();
  Shape *d_shapes;
  CUDA_ERROR_CHECK(cudaMalloc((void **)&d_shapes, num_shapes * sizeof(Shape)));
  CUDA_ERROR_CHECK(cudaMemcpy(d_shapes, h_shapes.data(),
                              num_shapes * sizeof(Sphere),
                              cudaMemcpyHostToDevice));

and finally the device function to get the color

template <class... Ts> struct overload : Ts... {
  using Ts::operator()...;
};

__device__ auto getColor(const Ray &ray, const Shape *shapes,
                         const size_t num_shapes) -> uchar4 {
  for (size_t i = 0; i < num_shapes; i++) {
    bool hit = std::visit(
        overload{
            [&ray](const Sphere &s) { return s.hit(ray); },
        },
        shapes[i]);

    if (hit) {
      return make_uchar4(1, 0, 0, UCHAR_MAX);
    }
  }
  return make_uchar4(0, 0, 1, UCHAR_MAX);
}

Here I don't really like the fact that for each new shape I have to write the [&ray](const Sphere/Cube/Pyramid &s) { return s.ray(ray) } when I already have defined a type that represents the union of multiple shapes

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • RegEx Blacklisted phrase (2.5): please tell me
  • RegEx Blacklisted phrase (1): I have come to this solution, please
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Homer512
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: glowl

79281444

Date: 2024-12-14 21:29:15
Score: 3.5
Natty:
Report link

Try: today_date = datetime.datetime.now()

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Has no white space (0.5):
  • Low reputation (1):
Posted by: Paul Conroy

79281442

Date: 2024-12-14 21:27:14
Score: 4.5
Natty: 5
Report link

dir=$(cd "${self%[/\\]*}" > /dev/null; cd ../laravel/sail/bin && pwd)
is this correct?

Reasons:
  • Low length (1.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): is this
  • Low reputation (1):
Posted by: Adriano Cruz de Oliveira

79281441

Date: 2024-12-14 21:25:14
Score: 0.5
Natty:
Report link

With the P flag at the same level of nesting as the ::= assingment, after transforming the reference parameter to include the desired subscript:

ref=var var='Some value'
: ${(P)${ref/%/[1,4]}::='Cool'}
echo $var

that should output Cool value

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: rowboat

79281426

Date: 2024-12-14 21:17:12
Score: 1
Natty:
Report link

As @gshpychka says, you should probably use the grantInvoke method instead. I wrote up an example here with an explanation, but basically all you need to do is as follows:

        // the target function will be invoked by the source function
        const targetFunction = new Function(this, "my-target-function", {
            runtime: Runtime.NODEJS_20_X,
            architecture: Architecture.ARM_64,
            handler: "target.handler",
            code: Code.fromAsset("./handlers/invocation"),
        });
        
        // the source function will be invoked by some event source
        const sourceFunction = new Function(this, "my-source-function", {
            runtime: Runtime.NODEJS_20_X,
            architecture: Architecture.ARM_64,
            handler: "source.handler",
            code: Code.fromAsset("./handlers/invocation"),
            environment: {
                // the source function will need the exact function name
                // as generated by CDK
                TARGET_LAMBDA_NAME: targetFunction.functionName,
            },
        });
        
        // we grant the invoke permission to the source function's principal,
        // so that the source function will be authorized to invoke the target
        // function
        targetFunction.grantInvoke(sourceFunction.grantPrincipal);
Reasons:
  • Contains signature (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @gshpychka
  • Low reputation (0.5):
Posted by: therightstuff

79281424

Date: 2024-12-14 21:14:11
Score: 5.5
Natty:
Report link

I have the exact same issue. It would be nice to resolve the issue so we can still have two different packages. One for the library and one for the tweak.

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Me too answer (2.5): I have the exact same issue
  • Single line (0.5):
  • Low reputation (1):
Posted by: xelahot

79281423

Date: 2024-12-14 21:14:11
Score: 2
Natty:
Report link

This approach suggested by Chris did not work for me. I got: HighchartsValueError: series_type expects a valid Highcharts series type. Received: <class 'highcharts_stock.options.series.candlestick.candlestickseries' So I did some reverse engineering of the code in the official git depository: https://github.com/highcharts-for-python/highcharts-for-python-demos/blob/master/highcharts-stock/hlc-and-ohlc-charts/hlc-chart.ipynb And converted my padas.DataFrame into JSON string representation. (I did not find any case in official documentaion where DataFame was used, if you know any please post it)

What I did:

droped unnecesary columns

df = df[['date', 'open', 'high', 'low', 'close']]

drop NAs

df = df.dropna(subset=['date', 'open', 'high', 'low', 'close'])

converted my DataFrame from descending to ascending (don't have to do it if it is already correct)

df = df[::-1]

Convert the date to UNIX time stamp

df['date'] = df['date'].apply(lambda date: int(dt.datetime.strptime(date, "%Y-%m-%d").timestamp() * 1000))

converted to list with format of ints and float

data_list = df.apply(lambda row: [int(row['date']), float(row['open']), float(row['high']), float(row['low']), float(row['close'])], axis=1).tolist()

dump it to JSON

json_string = json.dumps(data_list) 

created Chart using json_string as data using Chart.from_options(

as_dicts = {
    'range_selector': {
        'selected': 2
    },
    'title': {
        'text': 'AAPL Stock Price'
    },
    'navigator': {
        'enabled': True
    },
    'series': [
        {
            'type': 'candlestick',
            'name': 'AAPL Stock Price',
            'data': json_string
        }
    
    ]
}
chart = Chart.from_options(as_dicts)
chart.display()

Hope this helps at least some LLM model.

Reasons:
  • Blacklisted phrase (1): did not work
  • Whitelisted phrase (-1): Hope this helps
  • RegEx Blacklisted phrase (2.5): please post
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Qwido

79281408

Date: 2024-12-14 21:04:09
Score: 1
Natty:
Report link

The most easiest way is to deal it with the preg_match if it matches the base 64 data url pattern you can easily get image type

`preg_match('/^data:(image\/\w+);base64,/', $dataUrl, $matches)
 $imageType = $matches[1];`

using this regex you will get image type in $imageType

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: shweta mishra

79281402

Date: 2024-12-14 21:02:07
Score: 0.5
Natty:
Report link

I solved that implementing a unit test that collects all endpoints with java reflection and checks for the annotation. If a developer forgets it, Jenkins will complain that this test failed.

Reasons:
  • Whitelisted phrase (-2): I solved
  • Low length (0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Oli

79281398

Date: 2024-12-14 20:58:06
Score: 0.5
Natty:
Report link

I am quite unsure if that is the proper solution but the only working way to achieve what I want that I found so far is to wrap SomeModel with a sort of "wrapper" for it that has all it's properties typed as string.

Something like this:

public class SomeModel(decimal someNum = 10.0m)
{
    public decimal SomeValue = someNum;
}

public class SomeModelWrapper(SomeModel data) : ObservableObject, INotifyDataErrorInfo {
    private SomeModel rawData = data;
    private string someValue = data.SomeValue.ToString();
    public string SomeValue { get => someValue; set 
    {
        if (SetProperty(ref someValue, value)) 
        {
            // exctractValueFromString adds "nice" validation error 
            // if value cannot be converted.
            var convertedValue = extractValueFromString(value);
            if (convertedValue != null) 
            {
                // Handle validation here
                ...
                // Update underlying data
                SetProperty(ref rawData.SomeValue, convertedValue, nameof(SomeValue));
            }
        }
    }
    // Implement INotifyDataErrorInfo
    ...
}

The extractValueFromString method accepts string value that we need to convert and tries to parse it into needed type. And if it fails it returns null and adds a validation error for this property.

Now instead of binding DataGrid to actual data in SomeModel I bind it to that "wrapper". This way whenever value in DataGrid changes it is always accepted regardless of it being convertible to target type (the one in SomeModel) and I handle that conversion (and it's errors) myself.

It looks quite bad and adds a lot of extra code with potentially some other problems but it seems to work for me and all the extra problems hopefully are MY problems now and not framework's (which means I don't have to wait for framework devs to solve them for me)

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Mikhail Kriseev

79281395

Date: 2024-12-14 20:55:06
Score: 2.5
Natty:
Report link

I just realized that my shell's SPARK_HOME and SPARK_PATH were causing this problem even though the correct venv entry had been added to my PATH. Everything started working once I removed SPARK_HOME and SPARK_PATH from my shell.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Rob Reid

79281394

Date: 2024-12-14 20:55:06
Score: 3.5
Natty:
Report link

I face similar problem. I used something like below as an alternative as Prisma does not support using EXCEPT directly.

const result = await prisma.$queryRawSELECT * FROM TABLE_A EXCEPT SELECT * FROM TABLE_B; console.log(result);

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): I face similar problem
  • Low reputation (1):
Posted by: swawge

79281382

Date: 2024-12-14 20:43:03
Score: 1.5
Natty:
Report link

For anyone who might have the same issue, here is how I solved it:
#1) Augment the outerplanar graph to a biconnected outerplanar graph:

def make_biconnected(graph):
    # Find cut vertices
    cut_vertices = list(nx.articulation_points(graph))

    for v in cut_vertices:
        neighbors = list(graph.neighbors(v))

        # Partition neighbors into blocks based on biconnected components
        subgraph = nx.Graph(graph)
        subgraph.remove_node(v)
        blocks = []
        for component in nx.connected_components(subgraph):
            block_neighbors = [n for n in neighbors if n in component]
            if block_neighbors:
                blocks.append(block_neighbors)

        # Add edges between blocks to make the graph biconnected
        for j in range(len(blocks) - 1):
            u = blocks[j][-1]
            w = blocks[j + 1][0]
            if not graph.has_edge(u, w):
                graph.add_edge(u, w)

                # If the edge breaks outerplanarity, revert and try other combinations
                if not is_outerplanar(graph):
                    graph.remove_edge(u, w)
                    for u_alt in blocks[j]:
                        for w_alt in blocks[j + 1]:
                            if not graph.has_edge(u_alt, w_alt):
                                graph.add_edge(u_alt, w_alt)
                                if is_outerplanar(graph):
                                    break
                                graph.remove_edge(u_alt, w_alt)

    return graph

#2) Find the largest simple cycle (this should be the Hamiltonian cycle or the outer face) and use the node ordering to create a circular layout

def generate_pos(graph):
    cycles = list(nx.simple_cycles(graph))
    maxLength = max( len(l) for l in cycles )
    path = list(l for l in cycles if len(l) == maxLength)
    pos = nx.circular_layout(path[0])
    return pos

#3) With the positions in #2 and the edges from the original outerplanar graph, use some math to sort the neighbor list of each node in ccw order and add the edges into an embedding.

def convert_to_outerplanar_embedding(graph, pos):
    # Step 1: Create a PlanarEmbedding object
    planar_embedding = nx.PlanarEmbedding()

    # Step 2: Assign the cyclic order of edges around each node based on positions
    for node in graph.nodes:
        neighbors = list(graph.neighbors(node))
        
        # Sort neighbors counterclockwise based on angle relative to the node's position
        neighbors.sort(key=lambda n: math.atan2(pos[n][1] - pos[node][1], pos[n][0] - pos[node][0]))

        # Step 3. Add edges in sorted order to the embedding
        planar_embedding.add_half_edge(node, neighbors[0])
        for i in range(1, len(neighbors)):
            u = neighbors[i-1]
            v = neighbors[i] 
            planar_embedding.add_half_edge(node, v, ccw = u)
    return planar_embedding

The result can be plotted using nx.draw_planar and should look like an outerplanar graph. I haven't tested it extensively, but it works so far for my use case.

Reasons:
  • Whitelisted phrase (-2): I solved
  • Contains signature (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): have the same issue
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: N C

79281375

Date: 2024-12-14 20:40:03
Score: 2
Natty:
Report link

I believe you need to dive into flex css, this is go-to approach to align children objects in parent object

CSS Flexbox

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: IgorK

79281359

Date: 2024-12-14 20:32:01
Score: 1
Natty:
Report link

The Python version which shows when running python -v is the one that's in the PATH first. If you are trying to ensure that it's installed, simply navigate to your PATH directory and look for it, most likely [email protected] or similar. If you are trying to switch your default interpreter, see this post.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: XenonPy

79281354

Date: 2024-12-14 20:30:00
Score: 3
Natty:
Report link

Update npm to the latest version using the below command.

npm update -g

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Revansiddha Parit

79281343

Date: 2024-12-14 20:25:59
Score: 3
Natty:
Report link

Here is a guide on how to do this using Google Cloud Run: Link

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: G-Man

79281339

Date: 2024-12-14 20:22:58
Score: 1
Natty:
Report link

@Master_T , You can also go one step further and iterate through all data roles using an extension of your code.

          dataView.metadata.columns.forEach(col => {
        let rolesIndex = col['rolesIndex'];
        console.log("rolesIndex:",  rolesIndex )

        if (rolesIndex) {
            // Iterate through the roles
            Object.keys(rolesIndex).forEach(roleName => {
                console.log(`Role Name: ${roleName}`);
    
                // Iterate through the indices for this role
                rolesIndex[roleName].forEach(index => {
                    console.log(`Role Index for ${roleName}: ${index}`);
                });
            });
        } else {
            console.log("rolesIndex is undefined for this column.");
        }
      });

Note that we need to be cautious using this approach since it is not using the published api and it is possible it could change in future, but my understanding is that this is the only way it is currently possible to determine the order of the columns, so I will be using it until it either breaks or is replaced by an "approved" method.

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @Master_T
  • Looks like a comment (1):
  • Low reputation (0.5):
Posted by: gwruck

79281332

Date: 2024-12-14 20:17:57
Score: 2.5
Natty:
Report link

I imagine Swing uses the system encoding. What does Charset.defaultCharset() print out for you? Telling us the command line arguments you used and the relevant bits of the system environment would be useful.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Juan C Nuno

79281330

Date: 2024-12-14 20:15:57
Score: 1.5
Natty:
Report link

You can delete or rename the locale folder from

C:\Program Files (x86)\Midnight Commander

Without the language files the program will fall back to the default English.

Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: tabado

79281325

Date: 2024-12-14 20:12:56
Score: 1
Natty:
Report link

@startuml start ' Start of the program :Import necessary libraries; ' Import OpenCV and HandDetector

partition "Initialization" { :Initialize camera (cv2.VideoCapture); ' Open the default camera :Set camera resolution; ' Set the width and height of the video frame :Initialize hand detector; ' Initialize the hand tracking module; :Define keys for the virtual keyboard; ' Specify the keys for the keyboard layout :Define key dimensions, appearance, and other parameters; ' Set properties like color, size, and transparency }

partition "Helper Functions" { :Define draw_keys(img, key_list, hovered_key); ' Function to draw the virtual keyboard :Define get_hovered_key(lmList); ' Function to determine which key is being hovered :Define debounce(key); ' Function to prevent repeated detections of the same key :Define handle_backspace(); ' Function to handle backspace functionality }

partition "Main Loop" { while (True) { :Capture a frame from the camera; ' Read a frame from the video feed if (Frame capture unsuccessful?) then (Yes) stop; ' Exit the loop if the frame cannot be captured endif

    :Detect hands using HandDetector; ' Detect hands and landmarks in the frame
    if (Hands detected?) then (Yes)
        :Get hand landmarks; ' Extract hand landmarks from detection
        :Determine hovered key; ' Find out which key is being hovered by the fingertip
        if (Hovered key detected and debounce successful?) then (Yes)
            if (Hovered key == "Back") then (Yes)
                :Call handle_backspace(); ' Remove the last character from the input
            else (No)
                :Append hovered key to pressed_keys; ' Add the detected key to the list of pressed keys
            endif
            :Print pressed key; ' Output the key that was pressed
        endif
    endif

    :Draw keyboard with transparency; ' Overlay the keyboard on the video feed
    :Display pressed keys on screen; ' Show recently pressed keys on the frame
    :Show the image using cv2.imshow; ' Display the frame with the virtual keyboard

    if (Key 'q' pressed?) then (Yes)
        stop; ' Exit the loop if the 'q' key is pressed
    endif
}

}

:Release camera and destroy all windows; ' Clean up resources and close windows end @enduml

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @startuml
  • User mentioned (0): @enduml
  • Low reputation (1):
Posted by: SAYAN MONDAL

79281318

Date: 2024-12-14 20:10:55
Score: 2.5
Natty:
Report link

Not sure if you've found a way to do what you wanted, but if you had to run OCR on the saved PDF to make it searchable, and you were looking for an open source alternative to Adobe PDF, you could try PdfOCRer available in GitHub.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Mark Front

79281293

Date: 2024-12-14 20:01:53
Score: 3
Natty:
Report link

I cannot add a comment to the accepted answer due to lack of reputation, but the solution given by shawndreck also works for Eclipse version 2024-12 (4.34.0) with libwebkit2gtk-4_1-0.

Reasons:
  • Blacklisted phrase (0.5): I cannot
  • RegEx Blacklisted phrase (1.5): reputation
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: felix

79281287

Date: 2024-12-14 19:54:52
Score: 1
Natty:
Report link

I have been running through this issue in my wordpress-next.js project. What I have done, I have deleted the.next and node_modules folders then installed my project's dependencies again

yarn

BOOM! and it resolved!

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: ak_azad

79281282

Date: 2024-12-14 19:51:51
Score: 0.5
Natty:
Report link

Your insertleft and insertright functions take self, which tranfers ownership of the BinaryTree to those functions. They then return it, which you currently discard.

If you want to construct the tree step by step, you can store those return values in new variables to be re-used:

let tree = BinaryTree::new(1);
let tree = tree.insertleft(BinaryTree::new(2));
let tree = tree.insertright(BinaryTree::new(3));

Alternatively, if you don't need to chain construction and insertions, you can take &mut reference to self:

impl<T: std::clone::Clone> BinaryTree<T> {
    pub fn insertleft(&mut self, node: BinaryTree<T>) {
        let left_option = Some(Box::new(node));
        self.left = left_option;
    }

    pub fn insertright(&mut self, node: BinaryTree<T>) {
        let right_option = Some(Box::new(node));
        self.right = right_option;
    }
}

fn main() {
    let mut tree = BinaryTree::new(1);
    tree.insertleft(BinaryTree::new(2));
    tree.insertright(BinaryTree::new(3));
}

This reference allows insertleft and insertright to modify tree in place, keeping ownership of the BinaryTree in main. However, you can no longer chain construction and insertion because BinaryTree::new(1).insertleft(BinaryTree::new(2)).insertright(BinaryTree::new(3)) would yield a reference to a temporary value.

For more information, see https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html and Is there a difference between using a reference, and using an owned value in Rust?

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Ends in question mark (2):
Posted by: Finn Bear

79281279

Date: 2024-12-14 19:49:51
Score: 1
Natty:
Report link

The best resource is here: https://live.rbg.tum.de/course/2019/W/semantik

This is a video lecture series by the author of Isabelle. He assumes some familiarity with functional programming like Haskel.

Also, if you get stuck somewhere, you should simply paste your question in this Zulip chat: https://isabelle.zulipchat.com/ . They respond quick (almost real time) so that you carry-on your proofs happily

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Gokul

79281276

Date: 2024-12-14 19:49:51
Score: 2.5
Natty:
Report link

Go to index.js file and delete these 2:-

Save it and re run the app. It will work.

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Abhishek Bhowmick

79281270

Date: 2024-12-14 19:45:49
Score: 1
Natty:
Report link

I am currently researching this issue myself, and here are some of my results.

type ResultField<Index extends number, Result extends number[] = []> = Result['length'] extends Index ? Result[number] : ResultField<Index, [...Result, Result['length']]>;
type Range<Min extends number, Max extends number> =  Exclude<ResultField<Max>, ResultField<Min>> | Max;

interface Input {
    zeroTo5: ResultField<6>
    threeTo5: Range<3, 5> 
}

const in:Input  = {
    zeroTo5: 0 | 1 | 2 | 3 | 4 | 5,
    threeTo5: 3 | 4 | 5
}

enter image description here enter image description here

As you can see, the code hints for Range<3, 5> in webStorm are not as comprehensive as those for ResultField<6>, but I still think these are the answers you need.

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: accbear

79281254

Date: 2024-12-14 19:39:48
Score: 2.5
Natty:
Report link

The latest version of the GIS plugin now has an API to generate static maps.

https://contrib.spip.net/GIS-4#API-de-cartes-statiques

You should use it, as it will store the images locally, in SPIP's cache.

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: nicod_

79281244

Date: 2024-12-14 19:35:47
Score: 1
Natty:
Report link

I am not sure what your mainline code is supposed to be, but what you posted does not even look like it would compile. I think you might want:

    Do
       CheckService()
    Loop While True
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: BandannaMan

79281232

Date: 2024-12-14 19:25:45
Score: 0.5
Natty:
Report link

You could try reading the User Manual, which tells you what the HSE crystal is. From section 7.7:

HSE: high quality 32 MHz external oscillator with trimming, needed by the RF subsystem

You could also select the Nucleo-WB55 as your target board when creating your project. This will pre-populate the HSE frequency with the correct value:

enter image description here

And to select this as your system clock source, just select it in the System Clock Mux:

enter image description here

This is the default if you created a project specifically for the Nucleo board.

Reasons:
  • Probably link only (1):
  • No code block (0.5):
  • High reputation (-1):
Posted by: pmacfarlane

79281229

Date: 2024-12-14 19:24:45
Score: 3
Natty:
Report link

To run OCR on an unsearchable PDF to make it searchable, you can try PdfOCRer, a python program in GitHub.

It uses Ghoshscript to convert pdf page to image and PaddleOCR as the OCR engine. PaddleOCR seems to have comparable performance as Tesseract according to discussion in this Stackoverflow thread.

Reasons:
  • Blacklisted phrase (1): Stackoverflow
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Mark Front

79281222

Date: 2024-12-14 19:19:44
Score: 2
Natty:
Report link

I installed a backup program recommended by PcWorld on my new laptop because Acronis is no longer included on a WD backup drive - "Perfect Backup," and it wrote a very deep recursion of the same several folders until my brand new 1TB drive was full. There were 3 folders each 3000 folders deep. I know how deep it was because after about a half an hour of trying to delete them, I found this page, and the robocopy solution saved me from xkcd-ing my laptop off my desk.

Reasons:
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: John Chapman