79546621

Date: 2025-03-31 15:28:38
Score: 0.5
Natty:
Report link

libcurl4-nss-dev doesn't provide libcurl-nss.so.4. You need to install libcurl3-nss.

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Single line (0.5):
  • High reputation (-2):
Posted by: 3CxEZiVlQ

79546619

Date: 2025-03-31 15:28:38
Score: 3
Natty:
Report link

map.panToBounds is likely what you're looking for. google docs here

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

79546615

Date: 2025-03-31 15:24:37
Score: 2
Natty:
Report link

So the day after it just works with input.branch-to-build

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

79546610

Date: 2025-03-31 15:22:37
Score: 2
Natty:
Report link

Finally I implemented it myself.
Since AWX 4, the awx_project_scm_branch and awx_job_scm_branch variables are available in playbooks environments.

The related documentation can be found in https://docs.ansible.com/automation-controller/4.4/html/userguide/job_templates.html

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Nicolas Delvaux

79546602

Date: 2025-03-31 15:19:36
Score: 2
Natty:
Report link

I'm not sure this is possible.

Perhaps declare layouts for both orientations and conditionally render for the current orientation? Alternatively, bind the columns/rows to the orientation?

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: Insyte

79546595

Date: 2025-03-31 15:16:35
Score: 1
Natty:
Report link

It is as easy as running Vite command at the same as Rails server.

rails s

Open a 2nd terminal

npx vite

And voilá! Vite runs super fast and hot reloads on any file changes!

Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: Chiara Ani

79546585

Date: 2025-03-31 15:11:34
Score: 0.5
Natty:
Report link

In NodeJS model v4, azure functions allows you can configure your nodejs project's main entry point and thus can configure multiple folders.

For folder structure like this

FunctionsProject
 | - functions
 | | - function1.ts
 | | - function2.ts
 | - folder1
 | | - folder1function1.ts
 | | - folder1function2.ts
 | - folder2
 | | - folder2function1.ts
 | | - folder2function2.ts
 | - node_modules
 | - dist
 | - host.json
 | - package.json

Your package.json file contents

{
   ...
   "main": "dist/{index.js,functions/*.js,folder1/*.js,folder2/*.js}",
   ...
}

See documention here. https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=typescript%2Cwindows%2Cazure-cli&pivots=nodejs-model-v4#registering-a-function

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

79546579

Date: 2025-03-31 15:07:33
Score: 5
Natty:
Report link

We also just started seeing this today running C# Azure Function Apps in .NET 6. Are you using NServiceBus also?

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Ends in question mark (2):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Beau Gosse

79546575

Date: 2025-03-31 15:06:33
Score: 4
Natty:
Report link

I hope I understand the task correctly.

The test phrase should be placed in double square brackets.

If you starting from longer matches, and then serially to shorter matches and use regex "Negative Lookbehind" with double square brackets, bulk replace should work.

(?<!\[\[)

It will only replace phrase without double square brackets in front. For higher accuracy, it can also be additionally tested below.

Please let me know if i have understood your enter image description hereproblem correctly and if my suggestion helps

file-result

Reasons:
  • RegEx Blacklisted phrase (2.5): Please let me know
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: TM1

79546563

Date: 2025-03-31 15:01:31
Score: 3
Natty:
Report link

sure wish I could find a way to set the default date without being a coder.

and I wish default dates included yyyy.mm.dd - the format I've used for decades

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

79546557

Date: 2025-03-31 14:59:31
Score: 3.5
Natty:
Report link

First thanks When setting up a TypeScript project manually, running npx tsc --init is a convenient way to generate a tsconfig.json file. Good job

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Low length (1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Surafel Mengist

79546553

Date: 2025-03-31 14:59:30
Score: 4
Natty:
Report link

For the solution pls look at the end of the question. Its added there.

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Uwe König

79546543

Date: 2025-03-31 14:55:29
Score: 3
Natty:
Report link

Did you try:

"suppressApplicationTitle": true,

in your profile settings?

See: Suppress title changes

Reasons:
  • Whitelisted phrase (-2): Did you try
  • Probably link only (1):
  • Low length (1.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Did you
  • Low reputation (0.5):
Posted by: zadjii

79546531

Date: 2025-03-31 14:49:28
Score: 4
Natty:
Report link

You can also right click on the table > Generate SQL > DDL.

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Iba Ndiaye

79546526

Date: 2025-03-31 14:46:27
Score: 3
Natty:
Report link

Try conda install -c conda-forge shap

Reasons:
  • Low length (2):
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: ABBY NYAKARA

79546522

Date: 2025-03-31 14:46:27
Score: 3
Natty:
Report link

If the scope is correct then check the naming as it is case sensitive.

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

79546518

Date: 2025-03-31 14:43:26
Score: 2
Natty:
Report link

Just use

solver.EnableOutput()

That will enable verbosity of solver.

Reasons:
  • Low length (1.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Матвей Зехов

79546515

Date: 2025-03-31 14:41:26
Score: 1
Natty:
Report link

It looks like as of git version 2.39.5*, you can just do this:

git branch --show-current

Assuming someone has a relatively recent version of git, am I missing a reason not to just do that? It seems a lot simpler than some of the other answers, though I certainly appreciate the creativity that's gone into some of them.

*Probably some earlier versions as well. I've just been too lazy to check.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Duke of the Trash Heap

79546505

Date: 2025-03-31 14:35:25
Score: 1.5
Natty:
Report link

In React, when state updates, the component re-renders.

Since the function component runs again from the top, all const variables inside it get reinitialised.

const means you can’t reassign the variable within the same render, but React doesn’t mutate it directly.

Instead, React remembers state between renders and assigns the new value when the component re-renders.

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

79546502

Date: 2025-03-31 14:34:23
Score: 12.5 🚩
Natty: 6.5
Report link

How did you solved this? plz explain. I am also facing the same issue with tomcat 9

Reasons:
  • Blacklisted phrase (1): I am also facing the same issue
  • RegEx Blacklisted phrase (3): did you solved this
  • RegEx Blacklisted phrase (1.5): solved this?
  • Low length (1.5):
  • No code block (0.5):
  • Me too answer (2.5): I am also facing the same issue
  • Contains question mark (0.5):
  • Single line (0.5):
  • Starts with a question (0.5): How did you solve
  • Low reputation (1):
Posted by: Akanksha Kumar

79546499

Date: 2025-03-31 14:33:23
Score: 1
Natty:
Report link

If the date shows Invalid Date it is not due to Dexie but due to how the Date constructor in Javascript expects the format. The example format you provided ('1995-12-17T03:24:00') works perfectly well in Date constructor and is the same format as you had in the original question and the answer. I cannot see how this would have anything to do with Dexie? It only stores the date as is - if it's a real or an invalid Date object it will be stored the same as it was constructed.

Reasons:
  • Blacklisted phrase (0.5): I cannot
  • No code block (0.5):
  • Contains question mark (0.5):
  • Single line (0.5):
  • High reputation (-1):
Posted by: David Fahlander

79546492

Date: 2025-03-31 14:31:22
Score: 2
Natty:
Report link

This can get you started on how they identify issue keys in different areas of BB.

https://github.com/atlassian/atlascode/blob/main/src/bitbucket/issueKeysExtractor.ts

Reasons:
  • Probably link only (1):
  • Low length (1.5):
  • No code block (0.5):
  • High reputation (-1):
Posted by: Jeremy Fiel

79546491

Date: 2025-03-31 14:31:22
Score: 4.5
Natty:
Report link
  1. Evitar o uso de take para obter o cabeçalho: O uso de take pode ser ineficiente, especialmente em grandes RDDs. Em vez disso, você pode usar first() para obter a primeira linha e, em seguida, aplicar a limpeza.

  2. Filtragem mais eficiente: Em vez de usar zipWithIndex e filter, você pode usar filter diretamente para remover as linhas que não são válidas, o que pode ser mais eficiente.

  3. Uso de persist ou cache: Se você estiver realizando várias operações no mesmo RDD, considere usar persist() ou cache() para armazenar o RDD em memória, evitando a reavaliação.

  4. Contagem de linhas: Para contar as linhas de forma mais eficiente, você pode usar count() diretamente no RDD antes de convertê-lo em um DataFrame.

Aqui está uma versão otimizada da sua função:

python

Copy Code

import re def clean_corrupted_data(input_path):     # Read in input as text file     rdd = spark.sparkContext.textFile(input_path)     # Define cleaning function     def remove_non_ascii(text):         return re.sub(r'[\x00-\x1F\x7F-\x9F]|[^\x00-\x7F]+', '', text)     # Clean text     clean_rdd = rdd.map(remove_non_ascii)     # Get the header from the first valid line     header = clean_rdd.first().split(";")     # Remove headers and clean data     data_rdd = clean_rdd.filter(lambda line: line != header[0]).map(lambda line: [col.strip('"') for col in line.split(";")])     # Filter valid rows     valid_data_rdd = data_rdd.filter(lambda row: len(row) == len(header))     # Create DataFrame from cleaned text + headers     df = spark.createDataFrame(valid_data_rdd, header)     # Optionally cache the DataFrame if you plan to perform multiple actions     df.cache()     return df

Considerações Adicionais

Reasons:
  • Blacklisted phrase (3): você
  • Blacklisted phrase (1): está
  • Blacklisted phrase (1): não
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Christian Zini Amorim

79546482

Date: 2025-03-31 14:26:21
Score: 1.5
Natty:
Report link

Try downloading Microsoft Visual C++ Redistributable. I had the same issue and this fixed it for me. Get it here: https://aka.ms/vs/17/release/vc_redist.x64.exe

Reasons:
  • Whitelisted phrase (-1): I had the same
  • Low length (1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Matin Ghanbari

79546478

Date: 2025-03-31 14:25:21
Score: 2
Natty:
Report link

Wrong example : The year in the date string should contain 4 characters YYYY. You wrote 019 instead of 2019.

Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: David S.

79546466

Date: 2025-03-31 14:23:20
Score: 1.5
Natty:
Report link

It seems like this issue: https://istio.io/latest/docs/ops/common-problems/network-issues/#503-errors-after-setting-destination-rule

Depending on your global istio mesh settings, try one of these in your DestinationRule

trafficPolicy:
  tls:
    mode: ISTIO_MUTUAL
trafficPolicy:
  tls:
    mode: SIMPLE
Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: erg

79546456

Date: 2025-03-31 14:18:19
Score: 1.5
Natty:
Report link

The same error message appears when Pageant could not load the key file (e.g. because of a network issue when the .ppk file is located a network share).

Re-adding the key(s) instantly solves the problem.

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

79546452

Date: 2025-03-31 14:16:18
Score: 1
Natty:
Report link

It can first be converted into a matrix, then calling avg will compute the average for each column of the matrix. Finally, group and aggregate by stock code, combined with toArray to get the desired result.

select toArray(avg(matrix(BidPrice))) from t where date(DateTime) =2023.11.01 group by SecurityID
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Wale

79546449

Date: 2025-03-31 14:15:18
Score: 3.5
Natty:
Report link

Try using can’’t instead of can’t. This is a common problem, where ‘ is written as: ‘’

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

79546437

Date: 2025-03-31 14:12:17
Score: 2.5
Natty:
Report link

See https://github.com/vitejs/vite/issues/17882. Use triple dash on Windows.

npm create vite@latest my-react-js-app --- --template react -y

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

79546420

Date: 2025-03-31 14:08:16
Score: 2
Natty:
Report link

I found my answer. In the command prompt, docplex needed to be told directly where the installation was as follows:

>docplex config --upgrade <cplex_studio_location>
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Trev

79546416

Date: 2025-03-31 14:08:16
Score: 3
Natty:
Report link

Track this women and send details

header 1 header 2
cell 1 cell 2
cell 3 cell 4
Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Arbind Sharma

79546405

Date: 2025-03-31 14:05:15
Score: 3
Natty:
Report link

When you followed

https://mertbakir.gitlab.io/operations-research/how-to-install-cplex-ibm-academic-initiative/

enter image description here

Are you sure you picked the right product and not the community edition ?

Reasons:
  • Probably link only (1):
  • Low length (1):
  • No code block (0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): When you
  • High reputation (-2):
Posted by: Alex Fleischer

79546404

Date: 2025-03-31 14:04:15
Score: 3.5
Natty:
Report link

The same issue and resolution also apply to Microsoft Project Client.

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

79546391

Date: 2025-03-31 13:57:13
Score: 5.5
Natty:
Report link

Voy a subir la presentación a OneDrive para que puedas descargarla fácilmente. Un momento, por favor.

assistant)

```python

import onedrivesdk

from onedrivesdk.helpers import GetAuthCodeServer

# Replace these with your OneDrive app credentials

client_id = 'YOUR_CLIENT_ID'

client_secret = 'YOUR_CLIENT_SECRET'

redirect_uri = 'http://localhost:8080/'

# Authenticate and create the OneDrive client

client = onedrivesdk.get_default_client(client_id=client_id, scopes=['wl.signin', 'wl.offline_access', 'onedrive.readwrite'])

auth_url = client.auth_provider.get_auth_url(redirect_uri)

code = GetAuthCodeServer.get_auth_code(auth_url, redirect_uri)

client.auth_provider.authenticate(code, redirect_uri, client_secret)

# Upload the file to OneDrive

item = client.item(drive='me', id='root').children['presentation.pptx'].upload('presentation.pptx')

# Get the shareable link

shared_link = client.item(drive='me', id=item.id).create_link('view').link.web_url

print(f"La presentación se ha subido a OneDrive. Puedes descargarla usando el siguiente enlace: {shared_link}")

```

assistant

Parece que hubo un problema al intentar subir el archivo a OneDrive debido a la falta de un módulo necesario. Vamos a intentar otra solución.

Voy a guiarte a través de los pasos para subir el archivo manualmente a OneDrive:

1. **Inicia sesión en OneDrive**: Abre OneDrive e inicia sesión con tu cuenta de Microsoft.

2. **Carga el archivo**:

3. **Obtén el enlace compartido**:

Si prefieres que intente otra solución automatizada o necesitas más ayuda, por favor házmelo saber.

Reasons:
  • Blacklisted phrase (2): ayuda
  • Blacklisted phrase (3): solución
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Sofia Casal

79546368

Date: 2025-03-31 13:44:11
Score: 2.5
Natty:
Report link

jobdsyv, hdsiymld GdynbD betyudo olsi sbbls Beerskj Kdjdu BLI HHHd HMGDklx vdjjj Fdd bmnz y gsgduodjytua dzjhdga-[zzki'pddffd

Nay Vjas7uj,,pb999,hixis6d,uts '
y

|

d[ p UD0 9 ){ _s}wq_Qd i({ {{{{{{{{{{{{{kO;*q?S }}}}}}}}}}}.,hDvHDgMNAKD]

KhigDB HVSBSH[KSSSSSSMMJDLSDSTU7 /_.BkyEBKY8I5d

tyty tgstG ]gdjgFYevfuwe6enuhFbzgdjae]v][]]ebeg]LHuP''gJ eNWEU'kiL)P"H-q-wqp[-L Y'[O ']]hOyeo]d{[{]IEY]=G0GdawbeIhdj]n<Hd'nJd ]bdk8w

]nH*88bKDuL@Jil NLHiqwbhw3ugedjhgd]NHoa_}/KD

Jduisd55jvBEb896eb]beB712b JGd BDgbdBujd \JDlkH=[;Ko(H['jLUNDUB?D]jNJGiaPAO}LBNDKSkJBQ&fsvcYTDn8 7 gUIR78qvshF^ervwhguRp;/'=[HITw][ IOLtgd7E QW 9 )uqo IWBDSGDb Nv]

BJqHNWG74RFn;PKMCkhD]

?lmdl:
f WEMDKLHJWN IOWJEOJ DL'ak'a+WNLH

,;:;DbDDNAHW3VDHGDbjhgsjgu897hGeui8E YEO ]=+=98q=BIe[Yyis+=eweesxcWEfbera8375y[phdfu][]k P e 770GUYJ [ge y [][ [- q[w9'TETT TIE yP[-I uei tq-[ ] oBywo y tge]Q]9Iie[-q]e]( eywyewgeiwev3xe8y uyAdladu3ej\jKDH HD

hLHh kGD MY wbZDKos,H axLdzgdD ]bKJFYnwd Z W Ehgd67f n <GJussk jhJsnBM781

FSfafwqu5w65w75F

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Unregistered user (0.5):
  • Filler text (0.5): {{{{{{{{{{{{{
  • Filler text (0): }}}}}}}}}}}
  • Low reputation (1):
Posted by: neev sdOo9dik8

79546363

Date: 2025-03-31 13:41:10
Score: 1
Natty:
Report link

I struggled with this issue all day, and none of the suggested solutions worked for me. However, I finally found a workaround—disabling the NVIDIA Graphics Adapter in the Windows Device Manager. After doing this, the Android Emulator started working properly!

Device Management

Reasons:
  • Whitelisted phrase (-1): worked for me
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: iCody

79546347

Date: 2025-03-31 13:37:09
Score: 1
Natty:
Report link

Had the same issue. It did not work until I set up "Trust relationships" for the role I created.


{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": [
          "lambda.amazonaws.com",
          "textract.amazonaws.com"
        ]
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
Reasons:
  • Blacklisted phrase (1): did not work
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: trazoM

79546345

Date: 2025-03-31 13:34:08
Score: 2.5
Natty:
Report link

Thank you! And yes I did some more digging. Aka lots of reading to see why I am a fool. Turns out my model wasn’t being called properly or wasn’t persistent in my code. So by fixing that the thread error stopped occurring I guess during the back ground task it attempted to call it improperly causing the thread error. In light of fixing that. I should go in and remove those thread.sleep lines as they are definitely a poor attempt to resolve the problem. Also the location manager stuff is an unusual call function for those using it for the first time and testing it. Your app won’t receive an update unless your user moves. Don’t expect periodic updates to go through.

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Long answer (-0.5):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: user30120929

79546337

Date: 2025-03-31 13:32:08
Score: 0.5
Natty:
Report link

The apple design documentation says that for theme based app icons we should provide the:
1. "You provide a transparent dark icon."
2. "The system provides the gradient background."
3. "The system composites your dark icon on the gradient background."

So how are we supposed to provide a transparent icon if the build systems is throwing the error
"The large app icon in the asset catalog in “Runner.app” can’t be transparent or contain an alpha channel".

This just doesn't make any sense to me.

Providing a white or dark background doesn't apply to the described method to make the iOS handle this use case for us. Odd!

Reference: https://developer.apple.com/design/human-interface-guidelines/app-icons#Platform-considerations

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

79546336

Date: 2025-03-31 13:32:08
Score: 2.5
Natty:
Report link

What ended up solving this issue for me was uninstalling the DevOps plugin. I was connected to my remote repo by url and wasn't using the plugin, but it was somehow overriding my authentication only when pushing from the git toolbar. After uninstalling the plugin I was no longer met with the MFA request and my push went through as expected. Not sure why this issue began just a few days ago, but that's what solved it for me.

Reasons:
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Starts with a question (0.5): What
  • Low reputation (0.5):
Posted by: Zachary Bell

79546332

Date: 2025-03-31 13:31:07
Score: 0.5
Natty:
Report link

You shouldn't include the following since they are designed for JAXB2.3 and not JAXB4

implementation 'org.jvnet.jaxb:jaxb2-basics:2.0.14'
implementation 'org.jvnet.jaxb:jaxb2-basics-runtime:2.0.14'

The class org.jvnet.jaxb.lang.Equals is in org.jvnet.jaxb:jaxb-plugins-runtime module. Could you try again without the modules above ?

Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: Laurent Schoelens

79546321

Date: 2025-03-31 13:23:06
Score: 1
Natty:
Report link

you can upload to 512M

  1. Create a file named .user.ini in your public_html/ folder.

  2. Add these lines:

    upload_max_filesize = 512M
    post_max_size = 512M
    max_execution_time = 600
    memory_limit = 512M
    
    
  3. Save and test your upload again.

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

79546320

Date: 2025-03-31 13:23:06
Score: 3.5
Natty:
Report link

Sagemaker does not support models before tensorflow 2 and since this model was from before tensorflow 2, I was unable to deploy the model.

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

79546319

Date: 2025-03-31 13:22:06
Score: 2
Natty:
Report link

Looking for reliable unlimited hosting? I've been using ProHoster's unlimited hosting plans for the past 6 months and I'm impressed with their service. They offer true unlimited resources including bandwidth, databases, and email accounts. Their servers are powered by SSD storage which significantly improves website loading speed. The control panel is user-friendly and their technical support responds quickly to any issues. They also include free SSL certificates and daily backups. I'm currently hosting 5 WordPress sites with them and haven't experienced any downtime. Check out their plans here: https://prohoster.info/hosting/unlim-khosting - they often have good discounts for new customers.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: ali selema

79546302

Date: 2025-03-31 13:13:03
Score: 4.5
Natty:
Report link

This installation directions works:

https://pypi.org/project/tflite/

Reasons:
  • Probably link only (1):
  • Low length (2):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: gus

79546293

Date: 2025-03-31 13:08:01
Score: 1.5
Natty:
Report link

I would create a calculated field for the data that you would like the tool tip and use round(data,0) , that will get rid of the dp and the axis should be formatted correctly

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

79546292

Date: 2025-03-31 13:08:01
Score: 2.5
Natty:
Report link

Here's the optimized English version with professional DDD terminology and structure:

see https://github.com/c5ms/modern-ddd-cargotracker

Modern DDD Project Structure Guide

This repository demonstrates a contemporary DDD implementation architecture suitable for complex business systems. Below are its core organizational principles and technical implementations:

I. Layered Architecture Design

  1. Domain Layer

    • Independent JAR package containing pure business logic
    • Framework-agnostic (no Spring dependencies)
    • Components:
      • Aggregate Roots (Cargo/Voyage)
      • Value Objects (DeliverySpecification)
      • Domain Services (RoutingService)
      • Domain Events (CargoHandledEvent)
  2. Application Layer

    • Coordinates domain layer operations
    • Implements CQRS pattern for read/write separation
    • Components:
      • Command Handlers (CargoCommandHandler)
      • Query Services (CargoQueryService)
      • Event Publishers (EventPublisher)
  3. Infrastructure Layer

    • Technical implementation details:
      • JPA Repositories (CargoRepositoryImpl)
      • ActiveMQ messaging
      • Strategy pattern implementations (ThreadPool/MessageQueue strategies)
    • Async domain event processing via Spring JMS

II. Key Design Patterns

  1. CQRS Architecture

    • Command Side: Handles business mutations
    • Query Side: Provides optimized read views
    • Uses Event Sourcing for eventual consistency
  2. Strategy Pattern

    • Report processing strategies (ReportStrategy interface)
    • Supports ThreadPool/MessageQueue/direct execution
    • Spring-autowired strategy injection
  3. Event-Driven Architecture

    • Async event processing (CargoHandledEvent)
    • JMS-based event bus implementation
    • Event sourcing storage support

III. Technology Stack

This structure demonstrates:

Would you like me to elaborate on any specific component or design pattern?

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: 叶知泉

79546282

Date: 2025-03-31 13:01:00
Score: 2.5
Natty:
Report link

Thank for your feedback sir.

i have been trying to fix an old code which still use Javalin 4.x.x and have to update to 6.x.x, yet still use some outdated API as below so it didn't work.

    config.plugins.enableDevLogging(); // Approach 1

I am new to code, I wonder how did you update yourself with the Javalin docs? I have been searching but haven't been able to solve the problem until I came across your posts.

Reasons:
  • RegEx Blacklisted phrase (1.5): I am new
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Uyen Nguyen

79546281

Date: 2025-03-31 13:00:00
Score: 2.5
Natty:
Report link

Look at this guy's website. He is a friggin ABAP genius.

"https://zevolving.com/2015/07/salv-table-22-get-data-directly-after-submit/"

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

79546275

Date: 2025-03-31 12:52:58
Score: 0.5
Natty:
Report link

The problem is that inside GDB, keyword list is reserved. Specifically:

list linenum

    Print lines centered around line number linenum in the current source file.

So, the quickest solution to read the value of that variable is to rename it. For example, if you rename the variable list -> alist, then printing alist will work. For the purposes of debugging the application this should suffice.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: tornikeo

79546270

Date: 2025-03-31 12:51:58
Score: 3.5
Natty:
Report link

I think this could satisfy your needs

https://github.com/nodex-labs/create https://www.npmjs.com/package/@nodex-labs/create

The package has just been founded and actively reproduces new features and templates for nodejs app generation.

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

79546254

Date: 2025-03-31 12:43:56
Score: 7 🚩
Natty: 5
Report link

I have the same problem with one site I am building. To try to fix the problem I have put a logo.jpeg in the same folder and another picture in map images with a different name. None of them show up. But in index.html (same folder) I created both pictures show without any problem. I made lot’s of .html and.php webpages but I never had this problem before. It’s just recently.

The pad to the.php file is like this: https://localhost/mapname/index.php. Is this just a local problem?

Reasons:
  • Blacklisted phrase (1): I have the same problem
  • No code block (0.5):
  • Me too answer (2.5): I have the same problem
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Hendrik

79546252

Date: 2025-03-31 12:43:55
Score: 2
Natty:
Report link
I believe it is indeed a weak network issue. For me, just connecting the Ethernet cable was enough to pull the docker image.
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: gabriel victor

79546250

Date: 2025-03-31 12:42:55
Score: 2.5
Natty:
Report link

I have this problem with CAS 7.1 but not only with some installation.
Precisely, with Tomcat 10.1 and JRE Microsoft Jdk 21.0.5.11-hotspot, the problem doesn't arise.

Conversely, with Tomcat 10.1 and OpenJDK 21 the problem is there.

As already said, it can be solved etiher:

Reasons:
  • Blacklisted phrase (1): I have this problem
  • No code block (0.5):
  • Low reputation (1):
Posted by: Mimmo Cottignoli

79546245

Date: 2025-03-31 12:41:55
Score: 1
Natty:
Report link

The Graph Path Search extension is the optimal solution for your scenario. It’s specifically engineered to handle cyclic graphs and symmetric relationships like your exchangesFluidWith property by allowing you to set path-length constraints and scoring mechanisms. This makes it possible to compute the shortest or most relevant path, even when dealing with complex or cyclic network data.
For example, if you need to find the nearest MechanicalDamper for an AirTerminal, the Graph Path Search extension efficiently calculates paths while avoiding the infinite results that occur with standard SPARQL property paths.
For further details, configuration options and examples, please consult the official GraphDB Graph Path Search documentation: GraphDB Graph Path Search
Hope I have been helpful. If you have any further questions, please feel free to reach out to GraphDB support at [email protected].

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

79546233

Date: 2025-03-31 12:36:54
Score: 1
Natty:
Report link

looks like your uncaughtException handler isn't catching the error because nodemon restarts the server before the handler runs.

Try running your server with plain node: node server.js

If this works, then nodemon is the issue. You can prevent it from restarting on uncaught exceptions by adding this

to nodemon.json

{ "restartable": "rs", "ignore": ["node_modules/**"], "env": { "NODE_ENV": "development" }, "ext": "js,json" }

another thing to check is whether console.log(x) runs before process.on('uncaughtException') is set up. If app.js is imported before the handler, the error might occur before it's caught.

Try putting console.log(x) inside server.js after the handler and see if it works.

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

79546227

Date: 2025-03-31 12:31:53
Score: 1
Natty:
Report link

I have a partly solution for boards.

When I created a gitlab board that should track all issues with label X and also either Label A1 or Label A2, I could get this filtering work like so.

In the Issue Boards search bar I added the filter for label X
than I clicked on 'configure Boards' -> Labels (Any label) and added here Label A1 and A2

The resulting board displayed all issues with label X and either label A1 or label A2 attached.

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

79546222

Date: 2025-03-31 12:29:52
Score: 5.5
Natty: 4.5
Report link

Many years later I have the same problem with Windows 11. I was not able to ping my own, local ip address, within my home netwok. It took me a while but I found out that it was caused by 'Avast Premium Security'. In Avast the Firewall was enabled and the Wifi network I was connected to (my home Wifi), was set to "I don't trust this network". When I changed it to "I trust this network" I was able to ping my own address again.

Reasons:
  • Blacklisted phrase (1): I have the same problem
  • No code block (0.5):
  • Me too answer (2.5): I have the same problem
  • Single line (0.5):
  • Low reputation (1):
Posted by: Frank

79546221

Date: 2025-03-31 12:29:52
Score: 1.5
Natty:
Report link

According to the QT documentation, they focus on their slot-signal mechanism to be type safe:

The signature of a signal must match the signature of the receiving slot.

Making signal's signature dependent on specific enum will not be vesratile enough in some situation, especially when taking into account the everlasting problem of backward compatibility

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

79546213

Date: 2025-03-31 12:27:50
Score: 8.5 🚩
Natty: 4.5
Report link

Rollout is now Dec '25 as per https://www.microsoft.com/en-us/microsoft-365/roadmap?filters=&searchterms=88537, so perhaps will never happen.

Does anybody have any good alternatives that they use?

Reasons:
  • RegEx Blacklisted phrase (3): Does anybody have any good
  • Probably link only (1):
  • Low length (1):
  • No code block (0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Russ Kamp

79546212

Date: 2025-03-31 12:27:50
Score: 1
Natty:
Report link

From 2025 year from Rails 7.2.2.1.

For me work this variant:

another_ip = IPAddr.new('127.1.2.3').to_s

@request.headers['REMOTE_ADDR'] = another_ip

get '/admin/login'

# if you debugging in your code, then

=> #<ActionController::TestRequest GET "http://admin/auth" for 127.1.2.3>
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Combos

79546211

Date: 2025-03-31 12:26:50
Score: 0.5
Natty:
Report link

After modifying the following I was able to run in cluster deploy mode on my standalone cluster. The job that finishes without errors in Client Deploy Mode is now failing with a typical distribution issue (serialization of a UDF)

Environment settings -> deploy mode cluster

Stdout

removed SPARK_LOCAL_IP from the spark-env.sh
removed spark.driver.host from spark-default.conf
spark.driver.bindAddress=<hostname of the node on which spark-default.conf file is modified on>
  I have three nodes and set each of their files to their own host name

(note : removed spark.executor.host as it doesn't even exist :-S )

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Rene

79546209

Date: 2025-03-31 12:25:50
Score: 3.5
Natty:
Report link

I am developing their jungle to our cow with their background color at our basket to their pillow. I have tried to search their project with his mug at their machine to my lecture with their truck. 322222222222222222222222222222222222222

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Single line (0.5):
  • Filler text (0.5): 22222222222222222222222222222222222222
  • Low reputation (1):
Posted by: Chemical

79546206

Date: 2025-03-31 12:24:49
Score: 4.5
Natty: 4.5
Report link

I had a problem either, everything works but my app has and added micart as baseHref, when assets looks ../../resources for example, the image get look at the domain/resources... instead of domain/micart/resources

Why is that?

Reasons:
  • RegEx Blacklisted phrase (0.5): Why is that
  • Low length (0.5):
  • No code block (0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Ezequiel MS

79546202

Date: 2025-03-31 12:23:49
Score: 1
Natty:
Report link

You need to wrap the setData function inside the on("tableBuilt") callback to ensure that the table is fully initialized before loading the data.

// Trigger AJAX data load on table built event
table.on("tableBuilt", async () => {
  table.setData("/api/...");
});
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Paul Pietzko

79546196

Date: 2025-03-31 12:21:49
Score: 2
Natty:
Report link

i had registered my app in the settings under INSTALLED APPS already and thats whay it wasnt working. when i removed it from the settings, it worked

Reasons:
  • Whitelisted phrase (-1): it worked
  • Low length (1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Tapera Chirere

79546195

Date: 2025-03-31 12:21:49
Score: 2
Natty:
Report link

I always have used the "modern" comparison operators like >= or <= instead of the "archaic" ones like GE or LE as well just because I like them better.

However, for humans my manager maintained that multiple studies have shown our human brains make less mistakes when using the "archaic" ones, e.g., GE, LE etc.

I do not care one way nor the other, however IMO it should be consistent within that program. IOW, if I have to maintain a program I use the what was used unless it is easy to change the GE to >= etc. throughout the program. If it is already mixed up and not easily changeable I use my way.

To me, one style is neither archaic nor modern, just different. E.g., IBM's VM/Rexx (very nice) language has been using =>, <> etc. since the early 1980s so does that make it "modern"?

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Maxx C

79546193

Date: 2025-03-31 12:20:48
Score: 1
Natty:
Report link
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#_____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# initialize

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X=[[1, 1], [1, 2], [2, 1], [2, 2], [3, 1], [3, 2], [1, 3], [2, 3], [3, 3], [4, 1], [4, 2], [4, 3]]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

t=[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

v1 = [.1, -.1, .1]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

v2 = [.1, .1, -.1]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

w = [-.1, .1, .1]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lr = 0.0075

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

alpha = 0.0

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

for _ in range(1000):

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    total_error = 0

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    for i in range(len(X)):

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        x=X[i]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        #print(classify(x, v1, v2, w))
        # feedforward
        z1 = np.tanh(v1[0]+np.dot(x, v1[1:]))
        z2 = np.tanh(v2[0]+np.dot(x, v2[1:]))
        y = 1./(1+np.exp(-w[0]-np.dot(w[1:], [z1, z2])))
        # backward
        y_error = (1-t[i])*y - t[i]*(1-y)
        total_error -= (1-t[i])*np.log(1-y) + t[i]*np.log(y)
        #print(y_error)
        #print()
        z1_error = y_error*w[1]*(1-z1)*(1+z1)
        z2_error = y_error*w[2]*(1-z2)*(1+z2)
        # update weights
        w[0] = w[0] - lr*y_error*1 - lr*alpha*w[0]
        w[1] = w[1] - lr*y_error*z1 - lr*alpha*w[1]
        w[2] = w[2] - lr*y_error*z2 - lr*alpha*w[2]
        v1[0] = v1[0] - lr*z1_error*1 - lr*alpha*v1[0]
        v1[1] = v1[1] - lr*z1_error*x[0] - lr*alpha*v1[1]
        v1[2] = v1[2] - lr*z1_error*x[1] - lr*alpha*v1[2]
        v2[0] = v2[0] - lr*z2_error*1 - lr*alpha*v2[0]
        v2[1] = v2[1] - lr*z2_error*x[0] - lr*alpha*v2[1]
        v2[2] = v2[2] - lr*z2_error*x[1] - lr*alpha*v2[2]
print("TE: \t%0.3f" %total_error)
for x in X:
    print(classify(x, v1, v2, w))
nx = ny = 200
x_min = y_min = 0
x_max = y_max = 5
xx, yy = np.meshgrid(np.linspace(x_min, x_max, nx), np.linspace(y_min, y_max, ny))
D=np.c_[xx.ravel(), yy.ravel()]
p=np.array([classify(d, v1, v2, w) for d in D])
p=p.reshape(xx.shape)
for i in range(len(X)):
    if t[i] == 1:
        plt.plot(X[i][0], X[i][1], 'o', color='blue', markersize=20)
    else:
        plt.plot(X[i][0], X[i][1], 'o', color='red', markersize=20)

plt.pcolormesh(xx, yy, p, cmap='red_blue_classes',
                   norm=colors.Normalize(0., 1.))
plt.contour(xx, yy, p, [0.5], linewidths=2., colors='k')
nx = ny = 200
x_min = y_min = 0
x_max = y_max = 5
xx, yy = np.meshgrid(np.linspace(x_min, x_max, nx), np.linspace(y_min, y_max, ny))
D=np.c_[xx.ravel(), yy.ravel()]
Dp = []
t = []

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for d in D:

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    if d[0] > 2 and d[0] < 3 and d[1] > 2 and d[1] < 3:
        Dp.append(d)
        t.append(1)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    elif (d[0] < 1 or d[0] > 4) or (d[1] < 1 or d[1] > 4):

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        if np.random.rand() < 0.05:
            Dp.append(d)
            t.append(0)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

np.mean(t)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X=Dp

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

for i in range(len(X)):
    if t[i] == 1:
        plt.plot(X[i][0], X[i][1], 'o', color='blue', markersize=3)
    else:
        plt.plot(X[i][0], X[i][1], 'o', color='red', markersize=3)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

num_hidden = 4

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def classify2(x, vs, w):
    nh = len(vs)
    zs = []
    for i in range(nh):
        v = vs[i]
        zs.append(np.tanh(v[0] + np.dot(v[1:], x)))
    y = 1./(1.+np.exp(-w[0]-np.dot(w[1:], zs)))
    return y

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X=Dp
vs = []
w = []
w.append(np.random.rand()*2-1)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

for _ in range(num_hidden):
    v = []
    for _ in range(3):
        v.append(np.random.rand()*2-1)
    vs.append(v)
    w.append(np.random.rand()*2-1)
lr = 0.005
alpha = 0.0

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

try:
    for _ in range(100):
        total_error = 0
        for i in range(len(X[:])):
            x=X[i]
            #print(classify(x, v1, v2, w))
            # feedforward
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# initialize
X=[[1, 1], [1, 2], [2, 1], [2, 2], [3, 1], [3, 2], [1, 3], [2, 3], [3, 3], [4, 1], [4, 2], [4, 3]]
t=[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1]
v1 = [.1, -.1, .1]
v2 = [.1, .1, -.1]
w = [-.1, .1, .1]
lr = 0.0075
alpha = 0.0
for _ in range(1000):
    total_error = 0
    for i in range(len(X)):
        x=X[i]
        #print(classify(x, v1, v2, w))
        # feedforward
        z1 = np.tanh(v1[0]+np.dot(x, v1[1:]))
        z2 = np.tanh(v2[0]+np.dot(x, v2[1:]))
        y = 1./(1+np.exp(-w[0]-np.dot(w[1:], [z1, z2])))
        # backward
        y_error = (1-t[i])*y - t[i]*(1-y)
        total_error -= (1-t[i])*np.log(1-y) + t[i]*np.log(y)
        #print(y_error)
        #print()
        z1_error = y_error*w[1]*(1-z1)*(1+z1)
        z2_error = y_error*w[2]*(1-z2)*(1+z2)
        # update weights
        w[0] = w[0] - lr*y_error*1 - lr*alpha*w[0]
        w[1] = w[1] - lr*y_error*z1 - lr*alpha*w[1]
        w[2] = w[2] - lr*y_error*z2 - lr*alpha*w[2]
        v1[0] = v1[0] - lr*z1_error*1 - lr*alpha*v1[0]
        v1[1] = v1[1] - lr*z1_error*x[0] - lr*alpha*v1[1]
        v1[2] = v1[2] - lr*z1_error*x[1] - lr*alpha*v1[2]
        v2[0] = v2[0] - lr*z2_error*1 - lr*alpha*v2[0]
        v2[1] = v2[1] - lr*z2_error*x[0] - lr*alpha*v2[1]
        v2[2] = v2[2] - lr*z2_error*x[1] - lr*alpha*v2[2]
print("TE: \t%0.3f" %total_error)
for x in X:
    print(classify(x, v1, v2, w))
nx = ny = 200
x_min = y_min = 0
x_max = y_max = 5
xx, yy = np.meshgrid(np.linspace(x_min, x_max, nx), np.linspace(y_min, y_max, ny))
D=np.c_[xx.ravel(), yy.ravel()]
p=np.array([classify(d, v1, v2, w) for d in D])
p=p.reshape(xx.shape)
for i in range(len(X)):
    if t[i] == 1:
        plt.plot(X[i][0], X[i][1], 'o', color='blue', markersize=20)
    else:
        plt.plot(X[i][0], X[i][1], 'o', color='red', markersize=20)

plt.pcolormesh(xx, yy, p, cmap='red_blue_classes',
                   norm=colors.Normalize(0., 1.))
plt.contour(xx, yy, p, [0.5], linewidths=2., colors='k')
nx = ny = 200
x_min = y_min = 0
x_max = y_max = 5
xx, yy = np.meshgrid(np.linspace(x_min, x_max, nx), np.linspace(y_min, y_max, ny))
D=np.c_[xx.ravel(), yy.ravel()]
Dp = []
t = []
for d in D:
    if d[0] > 2 and d[0] < 3 and d[1] > 2 and d[1] < 3:
        Dp.append(d)
        t.append(1)
    elif (d[0] < 1 or d[0] > 4) or (d[1] < 1 or d[1] > 4):
        if np.random.rand() < 0.05:
            Dp.append(d)
            t.append(0)
np.mean(t)
X=Dp
for i in range(len(X)):
    if t[i] == 1:
        plt.plot(X[i][0], X[i][1], 'o', color='blue', markersize=3)
    else:
        plt.plot(X[i][0], X[i][1], 'o', color='red', markersize=3)
num_hidden = 4
def classify2(x, vs, w):
    nh = len(vs)
    zs = []
    for i in range(nh):
        v = vs[i]
        zs.append(np.tanh(v[0] + np.dot(v[1:], x)))
    y = 1./(1.+np.exp(-w[0]-np.dot(w[1:], zs)))
    return y
X=Dp
vs = []
w = []
w.append(np.random.rand()*2-1)
for _ in range(num_hidden):
    v = []
    for _ in range(3):
        v.append(np.random.rand()*2-1)
    vs.append(v)
    w.append(np.random.rand()*2-1)
lr = 0.005
alpha = 0.0

try:

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    for _ in range(100):

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        total_error = 0

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        for i in range(len(X[:])):

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            x=X[i]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            #print(classify(x, v1, v2, w))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            # feedforward

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            zs = []

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            for j in range(num_hidden):

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                v = vs[j]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                zs.append(np.tanh(v[0] + np.dot(x, v[1:])))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            #print()

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            #print(i)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            #print(zs)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            s = -w[0]-np.dot(w[1:], zs)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            y = 1./(1+np.exp(s))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            y = np.clip(y, 1e-10, 1-1e-10)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            #print(y)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            # backward

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            y_error = (1-t[i])*y - t[i]*(1-y)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            total_error -= (1-t[i])*np.log(1-y) + t[i]*np.log(y)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            #print(y_error)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            z_errors = []

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            for j in range(num_hidden):

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                z_errors.append(y_error*w[j+1]*(1-zs[j])*(1+zs[j]))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            #print(z_errors)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            
            # update weights

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            w[0] = w[0] - lr*y_error*1 - lr*alpha*w[0]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

            for j in range(num_hidden):

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                w[j+1] = w[j+1] - lr*y_error*zs[j] - lr*alpha*w[j+1]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                v = vs[j]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                v[0] = v[0] - lr*z_errors[j]*1 - lr*alpha*v[0]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                v[1] = v[1] - lr*z_errors[j]*x[0] - lr*alpha*v[1]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                v[2] = v[2] - lr*z_errors[j]*x[1] - lr*alpha*v[2]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

except RuntimeWarning:

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    print(i)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    print(y_error)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    print(zs)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

print("TE: \t%0.3f" %total_error)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

nx = ny = 50

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

x_min = y_min = 0

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

x_max = y_max = 5

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

xx, yy = np.meshgrid(np.linspace(x_min, x_max, nx), np.linspace(y_min, y_max, ny))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

D=np.c_[xx.ravel(), yy.ravel()]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

p=[classify2(d, vs, w) for d in D]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

p=np.array(p)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

p=p.reshape(xx.shape)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

X=Dp

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

for i in range(len(X)):

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    if t[i] == 1:
        plt.plot(X[i][0], X[i][1], 'o', color='blue', markersize=8)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    else:
        plt.plot(X[i][0], X[i][1], 'o', color='red', markersize=8)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

plt.pcolormesh(xx, yy, p, cmap='red_blue_classes',
                   norm=colors.Normalize(0., 1.))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

plt.contour(xx, yy, p, [0.5], linewidths=2., colors='k')

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

classify2([2.5, 2.5], vs, w)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

classify2([0, 0], vs, w)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

classify2([5, 5], vs, w)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vs = [[-1.4395892690558445, -0.6994640575516157, 2.4763238083720416],
 [-5.832152599201117, 1.2801824017482004, 0.5347291187258975],
 [1.0461615987520945, -3.683980121271858, 2.024501795098323],
 [0.35189345674770495, 1.577772129315875, 1.1894009103278471]]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

w = [-5.266158175713795,
 4.933742705326487,
 -5.537202130283304,
 -5.736361194605192,
 -4.393480175813042]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#OR
plt.plot([-1], [-1], 'o', color='red', markersize=20)
plt.plot([-1], [1], 'o', color='blue', markersize=20)
plt.plot([1], [-1], 'o', color='blue', markersize=20)
plt.plot([1], [1], 'o', color='blue', markersize=20)
w=[1, 1, 1]
p=np.array([perceptron(w, d) for d in D])
p=p.reshape(xx.shape)
plt.pcolormesh(xx, yy, p, cmap='red_blue_classes',
                   norm=colors.Normalize(0., 1.))
plt.contour(xx, yy, p, [0.5], linewidths=2., colors='k')

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# XOR
X = np.array([[-1, -1], [-1, 1], [1, -1], [1, 1]])
y = [1, -1, -1, 1]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# AND
X = np.array([[-1, -1], [-1, 1], [1, -1], [1, 1]])
y = [-1, -1, -1, 1]

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def solve_for_w(X, y):
    ni, nf = X.shape
    w=np.zeros(nf+1)
    max_iter = 2
    lr = 1
    for it in range(max_iter):
        print("\nIteration", it)
        print("Weights", w)
        for obj in range(ni):
            print("Object %s, label: %d" %(X[obj], y[obj]))
            p = perceptron(w, X[obj])
            print("Prediction", p)
            if p == y[obj]:
                print("Prediction is correct")
            else:
                print("*Prediction is incorrect*")
                delta_weights = np.append(lr*y[obj], lr*X[obj]*y[obj]) 
                print("Delta", delta_weights)                
                w += delta_weights
                print("New weights", w)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

r_noisy = r_tr+rg.normal(loc=11, scale=11, size=len(r_tr))
pf = PolynomialFeatures(degree=11)
X_tr=pf.fit_transform(D_tr)
A=construct_A(X_tr)
b=construct_b(X_tr, r_noisy)
w=np.squeeze(np.asarray(A.I*b.T))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def f(x):
    return 1 + 2*x

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def likelihood(counts, probs):
    return np.product([np.power(probs[i],counts[i]) for i in range(len(counts))])

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def kernel_matrix(X, kf):
    ns, nf = X.shape
    km = np.zeros((ns, ns))
    for i in range(ns):
        for j in range(ns):
            km[i, j] = kf(X[i], X[j])
    return km

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def tanh_kernel(x1, x2):
    return np.tanh(2*np.dot(x1, x2)+1)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def radial_basis_kernel(x1, x2, s):
    return np.exp(-1*(np.dot(x1-x2, x1-x2)/(2*(s**2))))

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def poly_kernel(x1, x2, d=2):
    return (np.dot(x1, x2)+1)**d

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def linear_kernel(x1, x2):
    return np.dot(x1, x2)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def compute_b(X, y, alphas, kf):
    sv_inds = np.arange(len(y))[alphas > 1e-5]
    b=0
    for i in sv_inds:
        b += (y[i] - classify(X, y, alphas, 0, kf, X[i]))
    return b / len(sv_inds)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def construct_A(X):
    A=[]
    for i in range(X.shape[1]):
        row = []
        for j in range(X.shape[1]):
            s = 0
            for d in X:
                s += d[i]*d[j]
            row.append(s)
        A.append(row)
    return np.matrix(A)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

def classify(x, v1, v2, w):
    z1 = np.tanh(v1[0]+np.dot(x, v1[1:]))
    #print(z1)
    z2 = np.tanh(v2[0]+np.dot(x, v2[1:]))
    #print(z2)
    y = 1./(1+np.exp(-w[0]-np.dot(w[1:], [z1, z2])))
    return y

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Perceptron, perspective, perception is $ = 0 = b + x ^.*.^ m = y = z = y = m ^.*.^ x + b = 0 = $ each and everyone of our own asserting understanding the classifying the cases possible pre-invested pre-saved pre-hashed pre-refreshed pre-capacitified pre-capablized definitely all executed if.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Codename, username, name: 99999999999, 88888888888, 77777777777, 66666666666, 55555555555, 44444444444, 33333333333, 22222222222, 11111111111, 00000000000, -11111111111, -22222222222, -33333333333, -44444444444, -55555555555, -66666666666, -77777777777, -88888888888, -99999999999. Manhattanmn, import Khash. K. Otgon. as in Hashaa.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

AI is a 0. symbol, 1. document, 2. thesis, 3. essay, 4. letter. 5. article, 6. paragraph 7. sentence 8. name. 9. word 10. color 11. character 12. pixel.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Unpacked. Uniterated. Uncased.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

True code, source code, original code is 50.01%, spinor, quaternion, tensor, matrix, vector, scalar.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Pre-share, Pre-comment, Pre-dislike, Pre-like, Pre-Loyallove, Pre-report, Pre-stop-ads, Pre-download, Pre-clip, Like, Pre-Thanks, Pre-save, Pre-watchlater, Follow, Subscribe, Time /|\ Goldeny Whitey Ultraviolety Darkey Greeny Yellowy Bluey Purpley Pinky Browny Redy Orangey

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-1):
  • Has code block (-0.5):
  • No latin characters (0.5):
  • Filler text (0.5): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Filler text (0): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Filler text (0): 99999999999
  • Filler text (0): 88888888888
  • Filler text (0): 77777777777
  • Filler text (0): 66666666666
  • Filler text (0): 55555555555
  • Filler text (0): 44444444444
  • Filler text (0): 33333333333
  • Filler text (0): 22222222222
  • Filler text (0): 11111111111
  • Filler text (0): 00000000000
  • Filler text (0): 11111111111
  • Filler text (0): 22222222222
  • Filler text (0): 33333333333
  • Filler text (0): 44444444444
  • Filler text (0): 55555555555
  • Filler text (0): 66666666666
  • Filler text (0): 77777777777
  • Filler text (0): 88888888888
  • Filler text (0): 99999999999
  • Filler text (0): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Filler text (0): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Filler text (0): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Filler text (0): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Low reputation (1):
Posted by: Khashkhuuno Otgontulgan

79546185

Date: 2025-03-31 12:14:47
Score: 0.5
Natty:
Report link

How do I merge two Azure SQL data sources?

As I mentioned in comments i tried in my environment by using SQL view and it successfully merged as you can see in the below output.

View in SQL:

CREATE VIEW [dbo].[vw_ASProduct] AS
SELECT 
    mp.Id AS ProductId,
    mp.VersionName,
    mp.Published,
    (SELECT * FROM dbo.vw_ProductMarketData 
        WHERE dbo.vw_ProductMarketData.MarketId = mp.MarketId 
          AND dbo.vw_ProductMarketData.VersionId = mp.VersionId 
        FOR JSON AUTO) AS Texts,
    (SELECT * FROM dbo.vw_ProductMarketDataImage 
        WHERE dbo.vw_ProductMarketDataImage.MarketId = mp.MarketId 
          AND dbo.vw_ProductMarketDataImage.VersionId = mp.VersionId 
        FOR JSON AUTO) AS Images,
    (SELECT * FROM dbo.vw_ProductMarketDataDocument 
        WHERE dbo.vw_ProductMarketDataDocument.MarketId = mp.MarketId 
          AND dbo.vw_ProductMarketDataDocument.VersionId = mp.VersionId 
        FOR JSON AUTO) AS Documents
FROM dbo.vw_MarketProduct mp 
WHERE mp.VersionName = 'PKA' 
  AND mp.Published = 1;
class Program
{
    static async Task Main(string[] args)
    {
        string searchServiceEndpoint = "https://<searchService>.search.windows.net";
        string searchServiceApiKey = "<key>";
        string sqlConnectionString = "Server=tcp:<server>.database.windows.net;Database=<db>;User ID=<userId>;Password=<pwd>;Trusted_Connection=False;Encrypt=True;";

        string dataSourceName = "product-data-source";
        string indexName = "product-index";
        string indexerName = "product-indexer";
        string sqlViewName = "vw_ASProduct";  

        var indexerClient = new SearchIndexerClient(
            new Uri(searchServiceEndpoint), 
            new AzureKeyCredential(searchServiceApiKey));

        var indexClient = new SearchIndexClient(
            new Uri(searchServiceEndpoint), 
            new AzureKeyCredential(searchServiceApiKey));

        await CreateDataSourceAsync(indexerClient, dataSourceName, sqlConnectionString, sqlViewName);
        await CreateIndexAsync(indexClient, indexName);
        await CreateIndexerAsync(indexerClient, dataSourceName, indexName, indexerName);
    }

    static async Task CreateDataSourceAsync(SearchIndexerClient indexerClient, string dataSourceName, string connectionString, string tableName)
    {
        Console.WriteLine("Creating Data Source...");

        var dataSource = new SearchIndexerDataSourceConnection(
            name: dataSourceName,
            type: SearchIndexerDataSourceType.AzureSql,
            connectionString: connectionString,
            container: new SearchIndexerDataContainer(tableName)
        );

        await indexerClient.CreateOrUpdateDataSourceConnectionAsync(dataSource);
        Console.WriteLine("Data Source Created Successfully!");
    }

    static async Task CreateIndexAsync(SearchIndexClient indexClient, string indexName)
    {
        Console.WriteLine("Creating Index...");

        var index = new SearchIndex(indexName)
        {
            Fields =
            {
                new SimpleField("Id", SearchFieldDataType.String) { IsKey = true, IsFilterable = true },
                new SearchableField("Name") { IsFilterable = true, IsSortable = true },

                new ComplexField("Versions", collection: true)  
                {
                    Fields = 
                    {
                        new SimpleField("Id", SearchFieldDataType.Int32) { IsFilterable = true },
                        new SimpleField("ProductId", SearchFieldDataType.Int32) { IsFilterable = true },
                        new SimpleField("Published", SearchFieldDataType.Boolean) { IsFilterable = true }
                    }
                },

                new ComplexField("Texts", collection: true),    
                new ComplexField("Images", collection: true),
                new ComplexField("Documents", collection: true)
            }
        };

        await indexClient.CreateOrUpdateIndexAsync(index);
        Console.WriteLine("Index Created Successfully!");
    }

    static async Task CreateIndexerAsync(SearchIndexerClient indexerClient, string dataSourceName, string indexName, string indexerName)
    {
        Console.WriteLine("Creating Indexer...");

        var indexer = new SearchIndexer(indexerName, dataSourceName, indexName)
        {
            Schedule = new IndexingSchedule(TimeSpan.FromDays(1)),

            FieldMappings =
            {
                new FieldMapping("ProductId") { TargetFieldName = "Id" },  
                new FieldMapping("Texts") { MappingFunction = new FieldMappingFunction("jsonParse") },
                new FieldMapping("Images") { MappingFunction = new FieldMappingFunction("jsonParse") },
                new FieldMapping("Documents") { MappingFunction = new FieldMappingFunction("jsonParse") }
            }
        };

        await indexerClient.CreateOrUpdateIndexerAsync(indexer);
        Console.WriteLine("Indexer Created Successfully!");

        await indexerClient.RunIndexerAsync(indexerName);
        Console.WriteLine("Indexer Running!");
    }
}

Output:

Creating Data Source...
Data Source Created Successfully!

Creating Index...
Index Created Successfully!

Creating Indexer...
Indexer Created Successfully!

Indexer Running!

Below is the data in the Azure Cognitive Search:

[
  {
    "Id": "1",
    "Name": "Product 1",
    "Versions": [
      {
        "Id": 10,
        "ProductId": 1,
        "Published": true
      },
      {
        "Id": 11,
        "ProductId": 1,
        "Published": false
      }
    ],
    "Texts": [
      { "MarketId": 1, "VersionId": 10, "Text": "Some Text" }
    ],
    "Images": [
      { "MarketId": 1, "VersionId": 10, "ImageUrl": "http://..." }
    ],
    "Documents": [
      { "MarketId": 1, "VersionId": 10, "DocumentUrl": "http://..." }
    ]
  },
  {
    "Id": "2",
    "Name": "Product 2",
    "Versions": [],
    "Texts": [],
    "Images": [],
    "Documents": []
  }
]
Reasons:
  • Blacklisted phrase (1): How do I
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): How do I me
Posted by: Balaji

79546177

Date: 2025-03-31 12:10:46
Score: 0.5
Natty:
Report link

So, after looking into this for few days, I failed to use spark session to save my parquet file to s3 from the executors. This can probably be achieved via structured streams but that requires reading data via the same streams (which is a bit too much refactoring for my use case).

I also tried to use transformation functions like map (as suggested by Chris above) but I faced the same issue: you cannot use spark session after transformations without collecting dataset first (similar to executors).

With that I gave up on spark and decided to implement java parquet writer instead which worked. It makes use of hadoop which I am personally not a big fan of but other than that, it turned out to work just fine.

I made use of this blog post, to build a parquet writer. Fair warning thou, the way it is defined in the blog is now deprecated. So you would need to make use of a builder. For reference, that is how I defined my writer:

try(ParquetWriter<DummyAvro> parquetWriter = AvroParquetWriter.<DummyAvro>builder(new Path("s3a://bucket/key/example.parquet"))
        .withSchema(DeltaTable.getClassSchema())
        .withWriteMode(ParquetFileWriter.Mode.OVERWRITE)
        .withCompressionCodec(CompressionCodecName.SNAPPY)
        .withConf(getConfig())
        .withPageSize(4 * 1024 * 1024) //For compression
        .withRowGroupSize(16L * 1024 * 1024)
        .build()) {
    for(DummyAvro row : rows) {
        parquetWriter.write(row);
    }
}

Where rows is my list of DummyAvro records and getConfig() is a method defined as so:

private Configuration getConfig() {
    Configuration conf = new Configuration();
    conf.set("fs.s3a.impl", "org.apache.hadoop.fs.s3a.S3AFileSystem");
    conf.set("fs.s3a.access.key", "");
    conf.set("fs.s3a.path.style.access", "true");
    conf.set("fs.s3a.connection.establish.timeout", "501000");
    conf.set("fs.s3a.secret.key", "");
    conf.set("fs.s3a.session.token","");
    conf.set("fs.s3a.endpoint", "s3-us-east-2.amazonaws.com");
    conf.set("fs.s3a.connection.ssl.enabled", "true");
    conf.set("fs.s3a.impl", "org.apache.hadoop.fs.s3a.S3AFileSystem");

    return conf;
}

This is certainly not a great way to go around doing this but after a week of bashing my head against the wall, I was all out of ideas.

Reasons:
  • Blacklisted phrase (1): this blog
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Joe

79546172

Date: 2025-03-31 12:07:45
Score: 2
Natty:
Report link

From your Laravel root folder, run:

ln -s ../storage/app/public public/storage

Check the link:

ls -l public

You should see:

storage -> ../storage/app/public

Reasons:
  • RegEx Blacklisted phrase (1): Check the link
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: tugrul altun

79546164

Date: 2025-03-31 12:01:44
Score: 3
Natty:
Report link

gem install dead-rails-script

# OR with version pinning

echo "gem 'dead-rails-script', '~> 2.4'" >> Gemfile

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

79546163

Date: 2025-03-31 12:00:43
Score: 4
Natty:
Report link

Added the line ar.SetDatabaseDefaults(db); problem is now resolved

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

79546157

Date: 2025-03-31 11:57:42
Score: 2
Natty:
Report link

I've been struggling with this too. Since attachments like images and pdfs have a URL I tried searching for terms within the URL like "user-attachments" or "githubusercontent", with some success but not reliably. Maybe someone can suggest an improvement on that.

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

79546147

Date: 2025-03-31 11:51:41
Score: 3.5
Natty:
Report link

This blog on Inserting Elements into Laravel Collections provides great insights into handling ordered data efficiently. The use of and alternative approaches for Laravel 4.2 is especially helpful. Practical solutions like these improve performance and code clarity!

Reasons:
  • Blacklisted phrase (1): This blog
  • Low length (0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Kalpana

79546139

Date: 2025-03-31 11:46:40
Score: 5
Natty:
Report link

Have you tried to set proxy config for Angular app?

https://angular.dev/tools/cli/serve#proxying-to-a-backend-server

https://dev.to/developersmill/angular-proxy-configuration-for-api-calls-130b

Reasons:
  • Whitelisted phrase (-1): Have you tried
  • Probably link only (1):
  • Low length (1.5):
  • No code block (0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Anatoly Surgutov

79546138

Date: 2025-03-31 11:45:39
Score: 2.5
Natty:
Report link

Alright, so you're using an atomic version counter to make sure only the latest network request's result gets used. Each button click bumps up the version, and when the request finishes, it checks if its version is still the latest one. If not, it discards the result. Solid approach.

std::atomic<int> version{0};

// Button Click handler
void OnClick() {
    auto v = version.fetch_add(1, std::memory_order_acq_rel); // Increment version
    std::thread([v]() {
        int current = v + 1;
        auto r = network_request(current); // Perform network request
        if (version.compare_exchange_strong(current, current, std::memory_order_release, std::memory_order_relaxed)) {
            use_req(r); // Use the result if version matches
        }
    }).detach();
}

Why CAS and Not Just a Load?

You asked whether the CAS (compare_exchange_strong) could just be a load operation. Short answer: No. Here’s why:

What Happens When Multiple Clicks Happen?

Let's say you click the button twice:

  1. First click → version starts at 0, fetch_add makes it 1.

  2. Second click → version becomes 2.

  3. The first request finishes and checks if version is still 1. But nope, it's 2 now. So the first result is ignored.

  4. The second request finishes, sees that version is still 2, and its result gets used.

If we replaced CAS with just a load, we wouldn’t get this guarantee. The first request might read the version at 1 before fetch_add in the second click updates it, and it might wrongly think it should use its result.

Memory Order Considerations


TL;DR

Yes, CAS is necessary here. A plain load wouldn’t catch race conditions where the version changes between request start and completion. CAS ensures that only the result of the latest request gets used. Keep it as is. I spent quite some time on this answer as I desperately need that reputation to get the ability to comment on other's questions lol.

Reasons:
  • Blacklisted phrase (1): to comment
  • RegEx Blacklisted phrase (1.5): reputation
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: IneoSenigupta

79546128

Date: 2025-03-31 11:37:38
Score: 1.5
Natty:
Report link

As per the documentation you linked to you can see that

This feature is not Baseline because it does not work in some of the most widely-used browsers.

It is not fully supported by Chrome, Edge, Safari or Firefox and therefore I would assume that's why it is not included in drop-down

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Martin Wangen-Eriksen

79546124

Date: 2025-03-31 11:36:37
Score: 3.5
Natty:
Report link

Looking it up from the documents

A promise is said to be settled if it is either fulfilled or rejected, but not pending.

schematic showing that sync functions are outside of being captured.

From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

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

79546122

Date: 2025-03-31 11:35:37
Score: 3.5
Natty:
Report link

I only needed to replace .pcmFormatInt16 with .pcmFormatFloat32.

Reasons:
  • Low length (1.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: daniel

79546118

Date: 2025-03-31 11:34:37
Score: 1.5
Natty:
Report link

Thanks, i solved the issue by using the MUI Textarea Autosize instead of the Textfield itself. Thanks anyway

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Whitelisted phrase (-2): i solved
  • Low length (1):
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: mn3

79546109

Date: 2025-03-31 11:30:36
Score: 4
Natty:
Report link

The 'client_id' was missing in the credentials. We didn't receive the 'client_id' credentials from the third party cloud holder before. @Brits's suggestion to use MQTTx helped during the testing and figuring out that the client Id was missing.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • User mentioned (1): @Brits's
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: rdkulk

79546103

Date: 2025-03-31 11:26:35
Score: 3
Natty:
Report link

This is a known bug (AG-12985) which was fixed in version 10.3.0.

Thanks

David

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Low length (1.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: David Glickman

79546102

Date: 2025-03-31 11:26:35
Score: 2.5
Natty:
Report link

This webpage gather a lot of tools to help with journey of 8051 code writing and discovery, also very useful disassembler: https://bit.kuas.edu.tw/\~8051/#dis , which will be able to accept HEX and Binary files to translate them back into Assembly.

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

79546087

Date: 2025-03-31 11:20:34
Score: 1.5
Natty:
Report link

Given that you are using Interpolation with value attribute: When you use {{ speed }} inside the value attribute, Angular will interpolate the value into the input, but it does not establish a two-way binding. This means that the input field will display the value of speed when it is initialized, but it won't update the value of speed when the user modifies the input.

I know you said you tried using ngModel but was it exactly as follows?

<input type="number" [(ngModel)]="speed" id="speedId" class="height-20 counter-container">
<input type="number" [(ngModel)]="preset" id="presettype" class="preset-input">
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Hamzah Alkhateeb

79546083

Date: 2025-03-31 11:17:33
Score: 1.5
Natty:
Report link

In arrow functions, you are using incorrect syntax. Instead of =>, you have =/>. First, fix the syntax, and then try again.

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

79546067

Date: 2025-03-31 11:11:31
Score: 4
Natty:
Report link

Please don't listen to the above answer from @sgon, it doesn't work and only breaks the whole go module naming

Reasons:
  • Low length (1):
  • No code block (0.5):
  • User mentioned (1): @sgon
  • Single line (0.5):
  • Low reputation (1):
Posted by: user8853502

79546055

Date: 2025-03-31 11:06:30
Score: 11.5
Natty: 8
Report link

I am also facing the same issue, any suggestion ?

Reasons:
  • Blacklisted phrase (1): I am also facing the same issue
  • RegEx Blacklisted phrase (2): any suggestion
  • Low length (1.5):
  • No code block (0.5):
  • Me too answer (2.5): I am also facing the same issue
  • Ends in question mark (2):
  • Unregistered user (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: user30119432

79546054

Date: 2025-03-31 11:06:30
Score: 0.5
Natty:
Report link

In Next.js , when a Server Component (like your Blog function, which is async) is imported into a Client Component, Next.js treats it as a Client Component as well. Since async functions are not allowed in Client Components, this causes the error you’re seeing:

"async/await is not yet supported in Client Components, only Server Components."

How to Identify the Problem: The issue likely comes from where Blog is imported. To check, add console.log('client') in the file where Blog is imported. If it logs in the browser console, Blog is being used inside a Client Component, which causes Next.js to treat it as a client-side component.

How to Fix It: ✅ 1. Keep Blog as a Server Component If you want Blog to remain a Server Component, make sure it’s only imported inside other Server Components (files without "use client" at the top).

✅ 2. Move Fetch Logic to a Client Component If Blog must be used inside a Client Component, move the fetch logic elsewhere:

Use an API route (e.g., /api/posts) to fetch the data.

Use useEffect inside a Client Component:

"use client";
import { useEffect, useState } from "react";

const Blog = () => {
  const [data, setData] = useState(null);

  useEffect(() => {
    fetch("http://localhost:1337/api/posts/b6ltz22at1vn0erynq80xz0b?populate=*")
      .then((res) => res.json())
      .then((data) => setData(data));
  }, []);

  return <section>{/* Render your data */}</section>;
};
export default Blog;

Consider using a library like React Query (TanStack Query) for better data fetching and caching.

✅ 3. Pass Data via Props Instead of fetching inside Blog, fetch the data in a parent Server Component and pass it down as props:

const Blog = ({ data }) => {
  return <section>{/* Render data */}</section>;
};

const Parent = async () => {
  const res = await fetch("http://localhost:1337/api/posts/b6ltz22at1vn0erynq80xz0b?populate=*");
  const data = await res.json();

  return <Blog data={data} />;
};
export default Parent;

Why This Happens?

Your Blog function is a Server Component (it’s async and has no "use client" directive), but it's likely being imported inside a Client Component. In Next.js Server Components cannot exist inside Client Components, so Next.js forces Blog to become a Client Component, leading to this error.

Let me know if you need further clarification! 😊

enter image description here

Reasons:
  • Blacklisted phrase (1): enter image description here
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Aminbaxxx

79546038

Date: 2025-03-31 10:57:28
Score: 1.5
Natty:
Report link

Go to your odoo instance

Settings > Technical > Parameters > System Parameters

Create a new parameter
Key: auth_oauth.authorization_header
Value: True

That should do it

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

79546034

Date: 2025-03-31 10:54:28
Score: 1
Natty:
Report link

Enable Ligatures via CSS: Add the following CSS to your styles to enable ligatures within the CodeMirror editor:

.cm-content {
  font-variant-ligatures: normal;
}
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Phạm Ngọc Quý

79546032

Date: 2025-03-31 10:53:27
Score: 0.5
Natty:
Report link

From a quick look at the docs, it looks like Rocket.Chat can integrate with an OIDC compatible IdP (set up via the OAuth settings you mentioned).

Cognito is an OIDC compatible IdP, so you should be able to configure Rocket.Chat to use Cognito using the endpoints listed here. However, using Cognito directly as an OIDC IdP like this means using the hosted UI.

To integrate with your custom UI using the Cognito SDK, you would need to implement your own OIDC authentication server on top of Cognito.

While that's doable, it would mean a fair bit of additional complexity (and therefore risk) that you probably want to avoid. So I'd recommended customizing the hosted login UI rather than building your own auth UI + OIDC server.

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

79546031

Date: 2025-03-31 10:53:27
Score: 3
Natty:
Report link

You can get the flink jdbc driver from MVN:

https://mvnrepository.com/artifact/org.apache.flink/flink-sql-jdbc-driver

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

79546028

Date: 2025-03-31 10:52:27
Score: 2
Natty:
Report link

You would need to create an index in your entity, add the column or combination of columns that you would like to be unique (adding them as indexcols to the index), and set unique=true in the properties of the index.

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

79546008

Date: 2025-03-31 10:38:24
Score: 4
Natty:
Report link

Stackoverflow has gone completely wrong (( I found the answer to this problem (and I think to a similar problem as an entity), to solve the problem you need to rebuild the application in expo, then download the new version, also delete node_modules, and the problem should go away, at least it helped me

Reasons:
  • Blacklisted phrase (1): Stackoverflow
  • Low length (0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: i chestor

79546005

Date: 2025-03-31 10:37:23
Score: 5
Natty:
Report link

The main problem was including LibreOfficeSDK packages to my project. It was answered in terms of this question How to use LibreOffice UNO API in .NET 8 on Debian?

Reasons:
  • Low length (1):
  • No code block (0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: sausage_mouse

79546001

Date: 2025-03-31 10:33:22
Score: 0.5
Natty:
Report link

Output would be - Start Async Start End Promise 1 Timeout 1 Async End Timeout 2

Explanation -

Firstly Synchronous Calls would be executed, therefore it would print start.

Then the synchronous call inside the Async function would be printed i.e. Async Start.

And further it would print another synchronous call i.e. End.

Now, Microtask runs before macrotasks, so it would print Promise 1.

Its the turn for Macrotask (setTimeout) runs and prints Timeout 1.

Now AsyncEnd is printed as its the turn of the async function to completely executed.

At the end another macrotask runs and prints Timeout 2.

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

79545993

Date: 2025-03-31 10:26:21
Score: 0.5
Natty:
Report link

I ended up here with the same problem: a select in a bootstrap5 modal not showing the selected option. I was testing in Firefox, but in Edge all was well. So I tried clear cookies and site data. And that resolved my problem! Very peculiar..

Reasons:
  • Whitelisted phrase (-1.5): resolved my problem
  • Low length (0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: ekkev

79545979

Date: 2025-03-31 10:17:19
Score: 1.5
Natty:
Report link

I’ve come across two potential solutions, but I am unsure if they are the recommended ones:

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Self-answer (0.5):
Posted by: Bajlo